From 4592db8dfb5094eeabbea89ad027c2e7ae6e4e17 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 24 Mar 2016 10:37:15 +0100 Subject: [PATCH 001/412] added python based geometry reconstruction --- processing/post/3Dvisualize.py | 51 +++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/processing/post/3Dvisualize.py b/processing/post/3Dvisualize.py index c18fbb694..fb5465d41 100755 --- a/processing/post/3Dvisualize.py +++ b/processing/post/3Dvisualize.py @@ -9,6 +9,46 @@ import damask scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptID = ' '.join([scriptName,damask.version]) +def deformedCoordsFFT(size,F,scaling,Favg=None): + grid = np.array(np.shape(F)[:-2]) + N = grid.prod() + step = size/grid + k_s = np.zeros([3],'i') + + F_fourier = np.fft.fftpack.rfftn(F,s=grid,axes=(0,1,2)) + coords_fourier = np.zeros(F_fourier.shape[:-1],'c16') + if Favg is None: + Favg = np.real(F_fourier[0,0,0,:,:]/N) + + for i in xrange(grid[2]//2+1): + k_s[2] = i + if grid[2]%2 == 0 and i == grid[2]//2: k_s[2] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) + + for j in xrange(grid[1]): + k_s[1] = j + if grid[1]%2 == 0 and j == grid[1]//2: k_s[1] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) + elif j > grid[1]//2: k_s[1] -= grid[1] + + for k in xrange(grid[0]): + k_s[0] = k + if grid[0]%2 == 0 and k == grid[0]//2: k_s[0] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) + elif k > grid[0]//2: k_s[0] -= grid[0] + + xi = 0.0+(k_s*0.5j*size/math.pi) + for m in xrange(3): + coords_fourier[k,j,i,m] = np.sum(F_fourier[k,j,i,m,:]*xi) + + if (any(k_s != 0)): + coords_fourier[k,j,i,:]/=-np.linalg.norm(k_s)**2.0 + + coords = np.fft.fftpack.irfftn(coords_fourier,s=grid,axes=(0,1,2)) + offset_coords =np.dot(F[0,0,0,:,:],step/2.0) - scaling*coords[0,0,0,:] + + for z in xrange(grid[2]): + for y in xrange(grid[1]): + for x in xrange(grid[0]): + coords[x,y,z,:] += offset_coords + np.dot(Favg,[x,y,z]*step) + def outStdout(cmd,locals): if cmd[0:3] == '(!)': exec(cmd[3:]) @@ -314,7 +354,16 @@ for filename in args: F = np.reshape(np.transpose(values[:,column['tensor'][options.defgrad]: column['tensor'][options.defgrad]+9]), (3,3,grid[0],grid[1],grid[2])) + F2 = np.reshape(values[:,column['tensor'][options.defgrad]: + column['tensor'][options.defgrad]+9], + (grid[0],grid[1],grid[2],3,3)) + for z in xrange(grid[2]): + for y in xrange(grid[1]): + for x in xrange(grid[0]): + F2[x,y,z,:,:] = F2[x,y,z,:,:].T + centroids2 = deformedCoordsFFT(dim,F2,options.scaling,None) centroids = damask.core.mesh.deformedCoordsFFT(dim,F,Favg,options.scaling) + nodes = damask.core.mesh.nodesAroundCentres(dim,Favg,centroids) fields = {\ @@ -430,4 +479,4 @@ for filename in args: vtk = open(os.path.join(head,what+'_'+os.path.splitext(tail)[0]+'.vtk'), 'w') output(out[what],{'filepointer':vtk},'File') vtk.close() - print \ No newline at end of file + print From 022b089fa7b46b3a71e1e968bdb47c58ba4aed6a Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 24 Mar 2016 11:49:23 +0100 Subject: [PATCH 002/412] cleaned core module related stuff --- code/Makefile | 7 +- code/commercialFEM_fileList.f90 | 1 - code/libs.f90 | 12 - code/mesh.f90 | 263 +- configure | 159 +- lib/IR_Precision.f90 | 1230 ----- lib/Lib_Base64.f90 | 909 ---- lib/Lib_VTK_IO.f90 | 6070 ---------------------- lib/fftw3.f03 | 1226 ----- processing/post/marc_deformedGeometry.py | 144 - processing/post/marc_extractData.py | 421 -- 11 files changed, 9 insertions(+), 10433 deletions(-) delete mode 100644 code/libs.f90 delete mode 100644 lib/IR_Precision.f90 delete mode 100644 lib/Lib_Base64.f90 delete mode 100644 lib/Lib_VTK_IO.f90 delete mode 100644 lib/fftw3.f03 delete mode 100755 processing/post/marc_deformedGeometry.py delete mode 100755 processing/post/marc_extractData.py diff --git a/code/Makefile b/code/Makefile index a9054310d..2d5551ca9 100644 --- a/code/Makefile +++ b/code/Makefile @@ -350,7 +350,7 @@ DAMASK_spectral.o: INTERFACENAME := spectral_interface.f90 SPECTRAL_SOLVER_FILES = spectral_mech_AL.o spectral_mech_Basic.o spectral_mech_Polarisation.o \ spectral_thermal.o spectral_damage.o -SPECTRAL_FILES = prec.o DAMASK_interface.o IO.o libs.o numerics.o debug.o math.o \ +SPECTRAL_FILES = prec.o DAMASK_interface.o IO.o numerics.o debug.o math.o \ FEsolving.o mesh.o material.o lattice.o \ $(SOURCE_FILES) $(KINEMATICS_FILES) $(PLASTIC_FILES) constitutive.o \ crystallite.o \ @@ -400,7 +400,7 @@ DAMASK_FEM.exe: INCLUDE_DIRS += -I./ FEM_SOLVER_FILES = FEM_mech.o FEM_thermal.o FEM_damage.o FEM_vacancyflux.o FEM_porosity.o FEM_hydrogenflux.o -FEM_FILES = prec.o DAMASK_interface.o FEZoo.o IO.o libs.o numerics.o debug.o math.o \ +FEM_FILES = prec.o DAMASK_interface.o FEZoo.o IO.o numerics.o debug.o math.o \ FEsolving.o mesh.o material.o lattice.o \ $(SOURCE_FILES) $(KINEMATICS_FILES) $(PLASTIC_FILES) constitutive.o \ crystallite.o \ @@ -614,9 +614,6 @@ debug.o: debug.f90 \ numerics.o numerics.o: numerics.f90 \ - libs.o - -libs.o: libs.f90 \ IO.o IO.o: IO.f90 \ diff --git a/code/commercialFEM_fileList.f90 b/code/commercialFEM_fileList.f90 index 7d02eadfc..0367de1c2 100644 --- a/code/commercialFEM_fileList.f90 +++ b/code/commercialFEM_fileList.f90 @@ -4,7 +4,6 @@ !> @details List of files needed by MSC.Marc, Abaqus/Explicit, and Abaqus/Standard !-------------------------------------------------------------------------------------------------- #include "IO.f90" -#include "libs.f90" #include "numerics.f90" #include "debug.f90" #include "math.f90" diff --git a/code/libs.f90 b/code/libs.f90 deleted file mode 100644 index 71f300512..000000000 --- a/code/libs.f90 +++ /dev/null @@ -1,12 +0,0 @@ -!-------------------------------------------------------------------------------------------------- -!> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH -!> @brief dummy source for inclusion of Library files -!-------------------------------------------------------------------------------------------------- -module libs -!nothing in here -end module libs - -#include "../lib/IR_Precision.f90" -#include "../lib/Lib_Base64.f90" -#include "../lib/Lib_VTK_IO.f90" - diff --git a/code/mesh.f90 b/code/mesh.f90 index 29bb15aef..ada304d9e 100644 --- a/code/mesh.f90 +++ b/code/mesh.f90 @@ -116,12 +116,8 @@ module mesh #endif #ifdef Spectral -#ifdef PETSc #include include 'fftw3-mpi.f03' -#else - include 'fftw3.f03' -#endif #endif ! These definitions should actually reside in the FE-solver specific part (different for MARC/ABAQUS) @@ -413,18 +409,13 @@ module mesh mesh_build_ipVolumes, & mesh_build_ipCoordinates, & mesh_cellCenterCoordinates, & - mesh_init_postprocessing, & mesh_get_Ncellnodes, & mesh_get_unitlength, & mesh_get_nodeAtIP #ifdef Spectral public :: & mesh_spectral_getGrid, & - mesh_spectral_getSize, & - mesh_nodesAroundCentres, & - mesh_deformedCoordsFFT, & - mesh_volumeMismatch, & - mesh_shapeMismatch + mesh_spectral_getSize #endif private :: & @@ -436,8 +427,7 @@ module mesh mesh_spectral_build_nodes, & mesh_spectral_build_elements, & mesh_spectral_build_ipNeighborhood, & -#endif -#ifdef Marc4DAMASK +#elif defined Marc4DAMASK mesh_marc_get_tableStyles, & mesh_marc_count_nodesAndElements, & mesh_marc_count_elementSets, & @@ -448,8 +438,7 @@ module mesh mesh_marc_build_nodes, & mesh_marc_count_cpSizes, & mesh_marc_build_elements, & -#endif -#ifdef Abaqus +#elif defined Abaqus mesh_abaqus_count_nodesAndElements, & mesh_abaqus_count_elementSets, & mesh_abaqus_count_materials, & @@ -473,11 +462,7 @@ module mesh mesh_tell_statistics, & FE_mapElemtype, & mesh_faceMatch, & - mesh_build_FEdata, & - mesh_write_cellGeom, & - mesh_write_elemGeom, & - mesh_write_meshfile, & - mesh_read_meshfile + mesh_build_FEdata contains @@ -487,9 +472,7 @@ contains !! Order and routines strongly depend on type of solver !-------------------------------------------------------------------------------------------------- subroutine mesh_init(ip,el) -#ifdef Spectral use, intrinsic :: iso_c_binding -#endif use DAMASK_interface use, intrinsic :: iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment) use IO, only: & @@ -562,25 +545,18 @@ subroutine mesh_init(ip,el) myDebug = (iand(debug_level(debug_mesh),debug_levelBasic) /= 0_pInt) #ifdef Spectral -#ifdef PETSc call fftw_mpi_init() -#endif call IO_open_file(FILEUNIT,geometryFile) ! parse info from geometry file... if (myDebug) write(6,'(a)') ' Opened geometry file'; flush(6) grid = mesh_spectral_getGrid(fileUnit) geomSize = mesh_spectral_getSize(fileUnit) - -#ifdef PETSc gridMPI = int(grid,C_INTPTR_T) alloc_local = fftw_mpi_local_size_3d(gridMPI(3), gridMPI(2), gridMPI(1)/2 +1, & MPI_COMM_WORLD, local_K, local_K_offset) grid3 = int(local_K,pInt) grid3Offset = int(local_K_offset,pInt) - size3 = geomSize(3)*real(grid3,pReal) /real(grid(3),pReal) size3Offset = geomSize(3)*real(grid3Offset,pReal)/real(grid(3),pReal) -#endif - if (myDebug) write(6,'(a)') ' Grid partitioned'; flush(6) call mesh_spectral_count() if (myDebug) write(6,'(a)') ' Counted nodes/elements'; flush(6) @@ -592,8 +568,7 @@ subroutine mesh_init(ip,el) if (myDebug) write(6,'(a)') ' Built nodes'; flush(6) call mesh_spectral_build_elements(FILEUNIT) if (myDebug) write(6,'(a)') ' Built elements'; flush(6) -#endif -#ifdef Marc4DAMASK +#elif defined Marc4DAMASK call IO_open_inputFile(FILEUNIT,modelName) ! parse info from input file... if (myDebug) write(6,'(a)') ' Opened input file'; flush(6) call mesh_marc_get_tableStyles(FILEUNIT) @@ -616,8 +591,7 @@ subroutine mesh_init(ip,el) if (myDebug) write(6,'(a)') ' Counted CP sizes'; flush(6) call mesh_marc_build_elements(FILEUNIT) if (myDebug) write(6,'(a)') ' Built elements'; flush(6) -#endif -#ifdef Abaqus +#elif defined Abaqus call IO_open_inputFile(FILEUNIT,modelName) ! parse info from input file... if (myDebug) write(6,'(a)') ' Opened input file'; flush(6) noPart = IO_abaqus_hasNoPart(FILEUNIT) @@ -672,9 +646,6 @@ subroutine mesh_init(ip,el) if (worldrank == 0_pInt) then call mesh_tell_statistics - call mesh_write_meshfile - call mesh_write_cellGeom - call mesh_write_elemGeom endif if (usePingPong .and. (mesh_Nelems /= mesh_NcpElems)) & @@ -4511,228 +4482,6 @@ subroutine mesh_build_FEdata end subroutine mesh_build_FEdata -!-------------------------------------------------------------------------------------------------- -!> @brief writes out initial cell geometry -!-------------------------------------------------------------------------------------------------- -subroutine mesh_write_cellGeom - use DAMASK_interface, only: & - getSolverJobName, & - getSolverWorkingDirectoryName - use IR_Precision, only: & - I4P - use Lib_VTK_IO, only: & - VTK_ini, & - VTK_geo, & - VTK_con, & - VTK_end -#ifdef HDF - use IO, only: & - HDF5_mappingCells -#endif - implicit none - integer(I4P), dimension(1:mesh_Ncells) :: celltype - integer(I4P), dimension(mesh_Ncells*(1_pInt+FE_maxNcellnodesPerCell)) :: cellconnection -#ifdef HDF - integer(pInt), dimension(mesh_Ncells*FE_maxNcellnodesPerCell) :: cellconnectionHDF5 - integer(pInt) :: j2=0_pInt -#endif - integer(I4P):: error - integer(I4P):: g, c, e, CellID, i, j - - cellID = 0_pInt - j = 0_pInt - do e = 1_pInt, mesh_NcpElems ! loop over cpElems - g = FE_geomtype(mesh_element(2_pInt,e)) ! get geometry type - c = FE_celltype(g) ! get cell type - do i = 1_pInt,FE_Nips(g) ! loop over ips=cells in this element - cellID = cellID + 1_pInt - celltype(cellID) = MESH_VTKCELLTYPE(c) - cellconnection(j+1_pInt:j+FE_NcellnodesPerCell(c)+1_pInt) & - = [FE_NcellnodesPerCell(c),mesh_cell(1:FE_NcellnodesPerCell(c),i,e)-1_pInt] ! number of cellnodes per cell & list of global cellnode IDs belnging to this cell (cellnode counting starts at 0) - j = j + FE_NcellnodesPerCell(c) + 1_pInt -#ifdef HDF - cellconnectionHDF5(j2+1_pInt:j2+FE_NcellnodesPerCell(c)) & - = mesh_cell(1:FE_NcellnodesPerCell(c),i,e)-1_pInt - j2=j2 + FE_ncellnodesPerCell(c) -#endif - enddo - enddo -#ifdef HDF - call HDF5_mappingCells(cellconnectionHDF5(1:j2)) -#endif - - error=VTK_ini(output_format = 'ASCII', & - title=trim(getSolverJobName())//' cell mesh', & - filename = trim(getSolverWorkingDirectoryName())//trim(getSolverJobName())//'_ipbased.vtk', & - mesh_topology = 'UNSTRUCTURED_GRID') - !ToDo: check error here - error=VTK_geo(NN = int(mesh_Ncellnodes,I4P), & - X = mesh_cellnode(1,1:mesh_Ncellnodes), & - Y = mesh_cellnode(2,1:mesh_Ncellnodes), & - Z = mesh_cellnode(3,1:mesh_Ncellnodes)) - !ToDo: check error here - error=VTK_con(NC = int(mesh_Ncells,I4P), & - connect = cellconnection(1:j), & - !ToDo: check error here - cell_type = celltype) - error=VTK_end() - !ToDo: check error here - -end subroutine mesh_write_cellGeom - - -!-------------------------------------------------------------------------------------------------- -!> @brief writes out initial element geometry -!-------------------------------------------------------------------------------------------------- -subroutine mesh_write_elemGeom - use DAMASK_interface, only: & - getSolverJobName, & - getSolverWorkingDirectoryName - use IR_Precision, only: & - I4P - use Lib_VTK_IO, only: & - VTK_ini, & - VTK_geo, & - VTK_con, & - VTK_end - - implicit none - integer(I4P), dimension(1:mesh_NcpElems) :: elemtype - integer(I4P), dimension(mesh_NcpElems*(1_pInt+FE_maxNnodes)) :: elementconnection - integer(I4P):: error - integer(pInt):: e, t, n, i - - i = 0_pInt - do e = 1_pInt, mesh_NcpElems ! loop over cpElems - t = mesh_element(2,e) ! get element type - elemtype(e) = MESH_VTKELEMTYPE(t) - elementconnection(i+1_pInt) = FE_Nnodes(t) ! number of nodes per element - do n = 1_pInt,FE_Nnodes(t) - elementconnection(i+1_pInt+n) = mesh_element(4_pInt+n,e) - 1_pInt ! global node ID of node that belongs to this element (node counting starts at 0) - enddo - i = i + 1_pInt + FE_Nnodes(t) - enddo - - error=VTK_ini(output_format = 'ASCII', & - title=trim(getSolverJobName())//' element mesh', & - filename = trim(getSolverWorkingDirectoryName())//trim(getSolverJobName())//'_nodebased.vtk', & - mesh_topology = 'UNSTRUCTURED_GRID') - !ToDo: check error here - error=VTK_geo(NN = int(mesh_Nnodes,I4P), & - X = mesh_node0(1,1:mesh_Nnodes), & - Y = mesh_node0(2,1:mesh_Nnodes), & - Z = mesh_node0(3,1:mesh_Nnodes)) - !ToDo: check error here - error=VTK_con(NC = int(mesh_Nelems,I4P), & - connect = elementconnection(1:i), & - cell_type = elemtype) - !ToDo: check error here - error =VTK_end() - !ToDo: check error here - -end subroutine mesh_write_elemGeom - - -!-------------------------------------------------------------------------------------------------- -!> @brief writes description file for mesh -!-------------------------------------------------------------------------------------------------- -subroutine mesh_write_meshfile - use IO, only: & - IO_write_jobFile - - implicit none - integer(pInt), parameter :: fileUnit = 223_pInt - integer(pInt) :: e,i,t,g,c,n - - call IO_write_jobFile(fileUnit,'mesh') - write(fileUnit,'(A16,E10.3)') 'unitlength', mesh_unitlength - write(fileUnit,'(A16,I10)') 'maxNcellnodes', mesh_maxNcellnodes - write(fileUnit,'(A16,I10)') 'maxNips', mesh_maxNips - write(fileUnit,'(A16,I10)') 'maxNnodes', mesh_maxNnodes - write(fileUnit,'(A16,I10)') 'Nnodes', mesh_Nnodes - write(fileUnit,'(A16,I10)') 'NcpElems', mesh_NcpElems - do e = 1_pInt,mesh_NcpElems - t = mesh_element(2,e) - write(fileUnit,'(20(I10))') mesh_element(1_pInt:4_pInt+FE_Nnodes(t),e) - enddo - write(fileUnit,'(A16,I10)') 'Ncellnodes', mesh_Ncellnodes - do n = 1_pInt,mesh_Ncellnodes - write(fileUnit,'(2(I10))') mesh_cellnodeParent(1:2,n) - enddo - write(fileUnit,'(A16,I10)') 'Ncells', mesh_Ncells - do e = 1_pInt,mesh_NcpElems - t = mesh_element(2,e) - g = FE_geomtype(t) - c = FE_celltype(g) - do i = 1_pInt,FE_Nips(g) - write(fileUnit,'(8(I10))') & - mesh_cell(1_pInt:FE_NcellnodesPerCell(c),i,e) - enddo - enddo - close(fileUnit) - -end subroutine mesh_write_meshfile - - -!-------------------------------------------------------------------------------------------------- -!> @brief reads mesh description file -!-------------------------------------------------------------------------------------------------- -integer function mesh_read_meshfile(filepath) - - implicit none - character(len=*), intent(in) :: filepath - integer(pInt), parameter :: fileUnit = 223_pInt - integer(pInt) :: e,i,t,g,n - - open(fileUnit,status='old',err=100,iostat=mesh_read_meshfile,action='read',file=filepath) - read(fileUnit,'(TR16,E10.3)',err=100,iostat=mesh_read_meshfile) mesh_unitlength - read(fileUnit,'(TR16,I10)',err=100,iostat=mesh_read_meshfile) mesh_maxNcellnodes - read(fileUnit,'(TR16,I10)',err=100,iostat=mesh_read_meshfile) mesh_maxNips - read(fileUnit,'(TR16,I10)',err=100,iostat=mesh_read_meshfile) mesh_maxNnodes - read(fileUnit,'(TR16,I10)',err=100,iostat=mesh_read_meshfile) mesh_Nnodes - read(fileUnit,'(TR16,I10)',err=100,iostat=mesh_read_meshfile) mesh_NcpElems - if (.not. allocated(mesh_element)) allocate(mesh_element(4_pInt+mesh_maxNnodes,mesh_NcpElems)) - mesh_element = 0_pInt - do e = 1_pInt,mesh_NcpElems - read(fileUnit,'(20(I10))',err=100,iostat=mesh_read_meshfile) & - mesh_element(:,e) - enddo - read(fileUnit,'(TR16,I10)',err=100,iostat=mesh_read_meshfile) mesh_Ncellnodes - if (.not. allocated(mesh_cellnodeParent)) allocate(mesh_cellnodeParent(2_pInt,mesh_Ncellnodes)) - do n = 1_pInt,mesh_Ncellnodes - read(fileUnit,'(2(I10))',err=100,iostat=mesh_read_meshfile) mesh_cellnodeParent(1:2,n) - enddo - read(fileUnit,'(TR16,I10)',err=100,iostat=mesh_read_meshfile) mesh_Ncells - if (.not. allocated(mesh_cell)) allocate(mesh_cell(FE_maxNcellnodesPerCell,mesh_maxNips,mesh_NcpElems)) - do e = 1_pInt,mesh_NcpElems - t = mesh_element(2,e) - g = FE_geomtype(t) - do i = 1_pInt,FE_Nips(g) - read(fileUnit,'(8(I10))',err=100,iostat=mesh_read_meshfile) mesh_cell(:,i,e) - enddo - enddo - close(fileUnit) - - mesh_read_meshfile = 0 ! successfully read data - -100 continue -end function mesh_read_meshfile - - -!-------------------------------------------------------------------------------------------------- -!> @brief initializes mesh data for use in post processing -!-------------------------------------------------------------------------------------------------- -integer function mesh_init_postprocessing(filepath) - - implicit none - character(len=*), intent(in) :: filepath - - call mesh_build_FEdata - mesh_init_postprocessing = mesh_read_meshfile(filepath) - -end function mesh_init_postprocessing - - !-------------------------------------------------------------------------------------------------- !> @brief returns global variable mesh_Ncellnodes !-------------------------------------------------------------------------------------------------- diff --git a/configure b/configure index 017d28b04..4841dcf1a 100755 --- a/configure +++ b/configure @@ -22,19 +22,6 @@ class extendableOption(Option): Option.take_action(self, action, dest, opt, value, values, parser) - -# ----------------------------- -def filePresent(paths,files,warning=False): - - for path in paths: - for file in files: - if os.path.isfile(os.path.join(path,file)): return True - - if warning: print "Warning: %s not found in %s"%(','.join(files),','.join(paths)) - - return False - - ######################################################## # MAIN ######################################################## @@ -42,35 +29,15 @@ def filePresent(paths,files,warning=False): parser = OptionParser(option_class=extendableOption, usage='%prog options', description = """ Configures the compilation and installation of DAMASK -""" + string.replace('$Id$','\n','\\n') -) - -#--- determine default compiler ---------------------------------------------------------------------- -compiler = os.getenv('F90') -if compiler == None: - compiler = 'ifort' if subprocess.call(['which', 'ifort'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) == 0 \ - else 'gfortran' - -#--- default option values -------------------------------------------------------------------------- -BLAS_order = ['IMKL','ACML','LAPACK','OPENBLAS'] - +""") defaults={'DAMASK_BIN':'depending on access rights', - 'F90':compiler, 'FFTW_ROOT':'/usr', 'MSC_ROOT' :'/msc', 'DAMASK_NUM_THREADS':4, 'MARC_VERSION':'2015', - 'blasType':'LAPACK', - 'blasRoot':{'LAPACK' :'/usr', - 'ACML' :'/opt/acml6.1.0', - 'IMKL' : os.getenv('MKLROOT') if os.getenv('MKLROOT') else '/opt/intel/composerxe/mkl', - 'OPENBLAS' :'/usr', - }, 'spectralOptions':{}, } - - #--- if local config file exists, read, otherwise assume global config file ------------------------ configFile = os.path.join(os.getenv('HOME'),'.damask/damask.conf') \ if os.path.isfile(os.path.join(os.getenv('HOME'),'.damask/damask.conf')) \ @@ -91,129 +58,25 @@ try: defaults['DAMASK_NUM_THREADS'] = int(value) if key == 'DAMASK_BIN': defaults['DAMASK_BIN'] = value - if key in ['F90','FFTW_ROOT','MSC_ROOT','spectralOptions','MARC_VERSION']: - defaults[key] = value - for theKey in reversed(BLAS_order): - if key == theKey+'_ROOT' and value != None and value != '': - defaults['blasType'] = theKey - defaults['blasRoot'][theKey] = value except IOError: pass parser.add_option('--prefix', dest='prefix', metavar='string', help='location of (links to) DAMASK executables [%default]') -parser.add_option('--with-FC','--with-fc', - dest='compiler', metavar='string', - help='F90 compiler [%default]') -parser.add_option('--with-FFTW-dir','--with-fftw-dir', - dest='fftwRoot', metavar='string', - help='root directory of FFTW [%default]') -parser.add_option('--with-MSC-dir','--with-msc-dir', - dest='mscRoot', metavar='string', - help='root directory of MSC.Marc/Mentat [%default]') -parser.add_option('--with-MARC-version','--with-marc-version', - dest='marcVersion', metavar='string', - help='version of MSC.Marc/Mentat [%default]') parser.add_option('--with-OMP-threads','--with-omp-threads', dest='threads', type='int', metavar='int', help='number of openMP threads [%default]') -parser.add_option('--with-BLAS-type','--with-blas-type', - dest='blasType', metavar='string', - help='type of BLAS/LAPACK library [%default] {{{}}}'.format(','.join(BLAS_order))) -parser.add_option('--with-BLAS-dir','--with-blas-dir', - dest='blasRoot',metavar='string', - help='root directory of BLAS/LAPACK library [%default]') parser.add_option('--with-spectral-options', dest='spectraloptions', action='extend', metavar='', help='options for compilation of spectral solver') parser.set_defaults(prefix = defaults['DAMASK_BIN']) -parser.set_defaults(compiler = defaults['F90']) -parser.set_defaults(fftwRoot = defaults['FFTW_ROOT']) parser.set_defaults(mscRoot = defaults['MSC_ROOT']) parser.set_defaults(marcVersion = defaults['MARC_VERSION']) parser.set_defaults(threads = defaults['DAMASK_NUM_THREADS']) -parser.set_defaults(blasType = defaults['blasType']) - -#--- set default for blasRoot depending on current option (or default) for blasType -------------------- -blasType = defaults['blasType'].upper() -for i, arg in enumerate(sys.argv): - if arg.lower().startswith('--with-blas-type'): - if arg.lower().endswith('--with-blas-type'): - blasType = sys.argv[i+1].upper() - else: - blasType = sys.argv[i][17:].upper() -if blasType not in BLAS_order: - blasType = defaults['blasType'].upper() - -parser.set_defaults(blasRoot = defaults['blasRoot'][blasType]) parser.set_defaults(spectraloptions = []) (options,filenames) = parser.parse_args() -#--- consistency checks -------------------------------------------------------------------------------- -options.compiler = options.compiler.lower() -options.blasType = options.blasType.upper() -options.fftwRoot = os.path.normpath(options.fftwRoot) -options.mscRoot = os.path.normpath(options.mscRoot) -options.blasRoot = os.path.normpath(options.blasRoot) - -locations = { - 'FFTW' : [os.path.join(options.fftwRoot,'lib64'),os.path.join(options.fftwRoot,'lib')], - 'LAPACK' : [os.path.join(options.blasRoot,'lib64'),os.path.join(options.blasRoot,'lib')], - 'OPENBLAS': [os.path.join(options.blasRoot,'lib64'),os.path.join(options.blasRoot,'lib')], - 'ACML' : [os.path.join(options.blasRoot,'%s64/lib'%options.compiler)], - 'ACML_mp' : [os.path.join(options.blasRoot,'%s64_mp/lib'%options.compiler)], - 'IMKL' : [os.path.join(options.blasRoot,'lib/intel64')], -} - -libraries = { - 'FFTW' : [ - 'libfftw3.so','libfftw3.a', - 'libfftw3_threads.so','libfftw3_threads.a', - ], - 'LAPACK' : [ - 'liblapack.so','liblapack.a','liblapack.dylib', - ], - 'OPENBLAS' : [ - 'libopenblas.so','libopenblas.a','libopenblas.dylib', - ], - 'ACML' : [ - 'libacml.so','libacml.a', - ], - 'ACML_mp' : [ - 'libacml_mp.so','libacml_mp.a', - ], - 'IMKL' : [ - 'libmkl_core.so','libmkl_core.a', - 'libmkl_sequential.so','libmkl_sequential.a', - 'libmkl_intel_thread.so','libmkl_intel_thread.a', - 'libmkl_intel_lp64.so','libmkl_intel_lp64.a', - 'libmkl_gnu_thread.so','libmkl_gnu_thread.a', - 'libmkl_gf_lp64.so','libmkl_gf_lp64.a', - ], - - } -if options.compiler not in ['ifort','gfortran']: - print('Error: Unknown compiler option: %s'%options.compiler) - sys.exit(1) - -if not subprocess.call(['which', options.compiler], stdout=subprocess.PIPE, stderr=subprocess.PIPE) == 0: - print('Compiler Warning: executable %s not found!'%options.compiler) - -if not os.path.isdir(options.mscRoot): - print('Warning: MSC root directory %s not found!'%options.mscRoot) - - -filePresent(locations['FFTW'],libraries['FFTW'],warning=True) - -if options.blasType in ['LAPACK','OPENBLAS','IMKL']: - filePresent(locations[options.blasType],libraries[options.blasType],warning=True) -elif options.blasType == 'ACML': - filePresent(locations[options.blasType],libraries[options.blasType],warning=True) - filePresent(locations[options.blasType+'_mp'],libraries[options.blasType+'_mp'],warning=True) -else: - print('Error: Unknown BLAS/LAPACK library: %s'%options.blasType) - sys.exit(1) #--- read config file if present to keep comments and order --------------------------------------- output = [] @@ -228,12 +91,6 @@ try: if items[0] == 'DAMASK_BIN': line = '%s=%s'%(items[0],options.prefix) options.prefix ='depending on access rights' - if items[0] == 'F90': - line = '%s=%s'%(items[0],options.compiler) - options.compiler ='' - if items[0] == 'FFTW_ROOT': - line = '%s=%s'%(items[0],options.fftwRoot) - options.fftwRoot ='' if items[0] == 'MSC_ROOT': line = '%s=%s'%(items[0],options.mscRoot) options.mscRoot ='' @@ -243,14 +100,6 @@ try: if items[0] == 'DAMASK_NUM_THREADS': line = '%s=%s'%(items[0],options.threads) options.threads ='' - for blasType in defaults['blasRoot'].keys(): - if items[0] == '%s_ROOT'%blasType and items[0] == '%s_ROOT'%options.blasType: - line = '%s=%s'%(items[0],options.blasRoot) - options.blasType='' - elif items[0] == '#%s_ROOT'%blasType and items[0] == '#%s_ROOT'%options.blasType: - line = '%s=%s'%(items[0][1:],options.blasRoot) - options.blasType='' - elif items[0] == '%s_ROOT'%blasType: line = '#'+line for spectralOption in options.spectraloptions: [key,value] = re.split('[= ]',spectralOption)[0:2] if key == items[0]: @@ -264,18 +113,12 @@ except IOError: for opt, value in options.__dict__.items(): if opt == 'prefix' and value != 'depending on access rights': output.append('DAMASK_BIN=%s'%value) - if opt == 'compiler' and value != '': - output.append('F90=%s'%value) - if opt == 'fftwRoot' and value != '': - output.append('FFTW_ROOT=%s'%value) if opt == 'mscRoot' and value != '': output.append('MSC_ROOT=%s'%value) if opt == 'marcVersion' and value != '': output.append('MARC_VERSION=%s'%value) if opt == 'threads' and value != '': output.append('DAMASK_NUM_THREADS=%s'%value) - if opt == 'blasType' and value != '': - output.append('%s_ROOT=%s'%(options.blasType,options.blasRoot)) for spectralOption in options.spectraloptions: output.append(spectralOption) diff --git a/lib/IR_Precision.f90 b/lib/IR_Precision.f90 deleted file mode 100644 index d80923fee..000000000 --- a/lib/IR_Precision.f90 +++ /dev/null @@ -1,1230 +0,0 @@ -!> @addtogroup GlobalVarPar Global Variables and Parameters -!> List of global variables and parameters. -!> @addtogroup Interface Interfaces -!> List of explicitly defined interface. -!> @addtogroup Library Modules Libraries -!> List of modules containing libraries of procedures. -!> @addtogroup PublicProcedure Public Procedures -!> List of public procedures. -!> @addtogroup PrivateProcedure Private Procedures -!> List of private procedures. - -!> @ingroup Library -!> @{ -!> @defgroup IR_PrecisionLibrary IR_Precision -!> Portable kind-parameters module -!> @} - -!> @ingroup Interface -!> @{ -!> @defgroup IR_PrecisionInterface IR_Precision -!> Portable kind-parameters module -!> @} - -!> @ingroup GlobalVarPar -!> @{ -!> @defgroup IR_PrecisionGlobalVarPar IR_Precision -!> Portable kind-parameters module -!> @} - -!> @ingroup PublicProcedure -!> @{ -!> @defgroup IR_PrecisionPublicProcedure IR_Precision -!> Portable kind-parameters module -!> @} - -!> @ingroup PrivateProcedure -!> @{ -!> @defgroup IR_PrecisionPrivateProcedure IR_Precision -!> Portable kind-parameters module -!> @} - -!> @brief Module IR_Precision makes available some portable kind-parameters and some useful procedures to deal with them. -!> @details It also provides variables that contain the minimum and maximum representable values, smallest real values and -!> smallest representable differences by the running calculator. -!> -!> Finally the module provides procedures to convert a string to number and vice versa, a function to check the endianism -!> of the running calculator and a procedure to print all the aboves values. -!> @note The \em quadruple precision R16P could be activated defining \b r16p pre-processor flag (e.g. -Dr16p). Furthermore if -!> compiling with Portland Group Compiler define the pre-processor flag \b pgf95 to avoid error in computing \em Zero variables: -!> pgf compiler doesn't accept \b nearest built-in function in variables initialization. -!> @author Stefano Zaghi -!> @version 1.0 -!> @date 2012-04-24 -!> @copyright GNU Public License version 3. -!> @todo \b g95_test: Test g95 compiler -!> @ingroup IR_PrecisionLibrary -module IR_Precision -!----------------------------------------------------------------------------------------------------------------------------------- -USE, intrinsic:: ISO_FORTRAN_ENV, only: stdout => OUTPUT_UNIT, stderr => ERROR_UNIT ! Standard output/error logical units. -!----------------------------------------------------------------------------------------------------------------------------------- - -!----------------------------------------------------------------------------------------------------------------------------------- -implicit none -private -public:: endianL,endianB,endian -public:: R16P, FR16P, DR16P, MinR16P, MaxR16P, BIR16P, BYR16P, smallR16P, ZeroR16 -public:: R8P, FR8P, DR8P, MinR8P, MaxR8P, BIR8P, BYR8P, smallR8P, ZeroR8 -public:: R4P, FR4P, DR4P, MinR4P, MaxR4P, BIR4P, BYR4P, smallR4P, ZeroR4 -public:: R_P, FR_P, DR_P, MinR_P, MaxR_P, BIR_P, BYR_P, smallR_P, Zero -public:: I8P, FI8P, DI8P, MinI8P, MaxI8P, BII8P, BYI8P -public:: I4P, FI4P, DI4P, MinI4P, MaxI4P, BII4P, BYI4P -public:: I2P, FI2P, DI2P, MinI2P, MaxI2P, BII2P, BYI2P -public:: I1P, FI1P, DI1P, MinI1P, MaxI1P, BII1P, BYI1P -public:: I_P, FI_P, DI_P, MinI_P, MaxI_P, BII_P, BYI_P -public:: NRknd, RPl, FRl -public:: NIknd, RIl, FIl -public:: check_endian -public:: bit_size,byte_size -public:: str, strz, cton, bstr, bcton -public:: ir_initialized,IR_Init -public:: IR_Print -!----------------------------------------------------------------------------------------------------------------------------------- - -!----------------------------------------------------------------------------------------------------------------------------------- -!> @ingroup IR_PrecisionGlobalVarPar -!> @{ -logical:: ir_initialized = .false. !< Flag for chcecking the initialization of some variables that must be initialized by IR_Init. -! Bit ordering of the running architecture: -integer, parameter:: endianL = 1 !< Little endian parameter. -integer, parameter:: endianB = 0 !< Big endian parameter. -integer:: endian = endianL !< Bit ordering: Little endian (endianL), or Big endian (endianB). - -! The following are the portable kind parameters available. -! Real precision definitions: -#ifdef r16p -integer, parameter:: R16P = selected_real_kind(33,4931) !< 33 digits, range \f$[10^{-4931}, 10^{+4931} - 1]\f$; 128 bits. -#else -integer, parameter:: R16P = selected_real_kind(15,307) !< Defined as R8P; 64 bits. -#endif -integer, parameter:: R8P = selected_real_kind(15,307) !< 15 digits, range \f$[10^{-307} , 10^{+307} - 1]\f$; 64 bits. -integer, parameter:: R4P = selected_real_kind(6,37) !< 6 digits, range \f$[10^{-37} , 10^{+37} - 1]\f$; 32 bits. -integer, parameter:: R_P = R8P !< Default real precision. -! Integer precision definitions: -integer, parameter:: I8P = selected_int_kind(18) !< Range \f$[-2^{63},+2^{63} - 1]\f$, 19 digits plus sign; 64 bits. -integer, parameter:: I4P = selected_int_kind(9) !< Range \f$[-2^{31},+2^{31} - 1]\f$, 10 digits plus sign; 32 bits. -integer, parameter:: I2P = selected_int_kind(4) !< Range \f$[-2^{15},+2^{15} - 1]\f$, 5 digits plus sign; 16 bits. -integer, parameter:: I1P = selected_int_kind(2) !< Range \f$[-2^{7} ,+2^{7} - 1]\f$, 3 digits plus sign; 8 bits. -integer, parameter:: I_P = I4P !< Default integer precision. - -! Format parameters useful for writing in a well-ascii-format numeric variables. -! Real output formats: -character(10), parameter:: FR16P = '(E42.33E4)' !< Output format for kind=R16P variable. -character(10), parameter:: FR8P = '(E23.15E3)' !< Output format for kind=R8P variable. -character(9), parameter:: FR4P = '(E13.6E2)' !< Output format for kind=R4P variable. -character(10), parameter:: FR_P = FR8P !< Output format for kind=R_P variable. -! Real number of digits of output formats: -integer, parameter:: DR16P = 42 !< Number of digits of output format FR16P. -integer, parameter:: DR8P = 23 !< Number of digits of output format FR8P. -integer, parameter:: DR4P = 13 !< Number of digits of output format FR4P. -integer, parameter:: DR_P = DR8P !< Number of digits of output format FR_P. -! Integer output formats: -character(5), parameter:: FI8P = '(I20)' !< Output format for kind=I8P variable. -character(8), parameter:: FI8PZP = '(I20.19)' !< Output format with zero prefixing for kind=I8P variable. -character(5), parameter:: FI4P = '(I11)' !< Output format for kind=I4P variable. -character(8), parameter:: FI4PZP = '(I11.10)' !< Output format with zero prefixing for kind=I4P variable. -character(4), parameter:: FI2P = '(I6)' !< Output format for kind=I2P variable. -character(6), parameter:: FI2PZP = '(I6.5)' !< Output format with zero prefixing for kind=I2P variable. -character(4), parameter:: FI1P = '(I4)' !< Output format for kind=I1P variable. -character(6), parameter:: FI1PZP = '(I4.3)' !< Output format with zero prefixing for kind=I1P variable. -character(5), parameter:: FI_P = FI4P !< Output format for kind=I_P variable. -character(8), parameter:: FI_PZP = FI4PZP !< Output format with zero prefixing for kind=I_P variable. -! Integer number of digits of output formats: -integer, parameter:: DI8P = 20 !< Number of digits of output format I8P. -integer, parameter:: DI4P = 11 !< Number of digits of output format I4P. -integer, parameter:: DI2P = 6 !< Number of digits of output format I2P. -integer, parameter:: DI1P = 4 !< Number of digits of output format I1P. -integer, parameter:: DI_P = DI4P !< Number of digits of output format I_P. -! List of kinds -integer, parameter:: NRknd=4 !< Number of defined real kinds. -integer, parameter:: RPl(1:NRknd)=[R16P,R8P,R4P,R_P] !< List of defined real kinds. -character(10), parameter:: FRl(1:NRknd)=[FR16P,FR8P,FR4P//' ',FR_P] !< List of defined real kinds output format. -integer, parameter:: NIknd=5 !< Number of defined integer kinds. -integer, parameter:: RIl(1:NIknd)=[I8P,I4P,I2P,I1P,I_P] !< List of defined integer kinds. -character(5), parameter:: FIl(1:NIknd)=[FI8P,FI4P,FI2P//' ',FI1P//' ',FI_P] !< List of defined integer kinds output format. - -! Useful parameters for handling numbers ranges. -! Real min and max values: -real(R16P), parameter:: MinR16P = -huge(1._R16P), MaxR16P = huge(1._R16P) !< Min and max values of kind=R16P variable. -real(R8P), parameter:: MinR8P = -huge(1._R8P ), MaxR8P = huge(1._R8P ) !< Min and max values of kind=R8P variable. -real(R4P), parameter:: MinR4P = -huge(1._R4P ), MaxR4P = huge(1._R4P ) !< Min and max values of kind=R4P variable. -real(R_P), parameter:: MinR_P = MinR8P, MaxR_P = MaxR8P !< Min and max values of kind=R_P variable. -! Real number of bits/bytes -integer(I2P):: BIR16P, BYR16P !< Number of bits/bytes of kind=R16P variable. -integer(I1P):: BIR8P, BYR8P !< Number of bits/bytes of kind=R8P variable. -integer(I1P):: BIR4P, BYR4P !< Number of bits/bytes of kind=R4P variable. -integer(I1P):: BIR_P, BYR_P !< Number of bits/bytes of kind=R_P variable. -! Real smallest values: -real(R16P), parameter:: smallR16P = tiny(1._R16P) !< Smallest representable value of kind=R16P variable. -real(R8P), parameter:: smallR8P = tiny(1._R8P ) !< Smallest representable value of kind=R8P variable. -real(R4P), parameter:: smallR4P = tiny(1._R4P ) !< Smallest representable value of kind=R4P variable. -real(R_P), parameter:: smallR_P = smallR8P !< Smallest representable value of kind=R_P variable. -! Integer min and max values: -integer(I8P), parameter:: MinI8P = -huge(1_I8P), MaxI8P = huge(1_I8P) !< Min and max values of kind=I8P variable. -integer(I4P), parameter:: MinI4P = -huge(1_I4P), MaxI4P = huge(1_I4P) !< Min and max values of kind=I4P variable. -integer(I2P), parameter:: MinI2P = -huge(1_I2P), MaxI2P = huge(1_I2P) !< Min and max values of kind=I2P variable. -integer(I1P), parameter:: MinI1P = -huge(1_I1P), MaxI1P = huge(1_I1P) !< Min and max values of kind=I1P variable. -integer(I_P), parameter:: MinI_P = MinI4P, MaxI_P = MaxI4P !< Min and max values of kind=I_P variable. -! Integer number of bits/bytes: -integer(I8P), parameter:: BII8P = bit_size(MaxI8P), BYI8P = bit_size(MaxI8P)/8_I8P !< Number of bits/bytes of kind=I8P variable. -integer(I4P), parameter:: BII4P = bit_size(MaxI4P), BYI4P = bit_size(MaxI4P)/8_I4P !< Number of bits/bytes of kind=I4P variable. -integer(I2P), parameter:: BII2P = bit_size(MaxI2P), BYI2P = bit_size(MaxI2P)/8_I2P !< Number of bits/bytes of kind=I2P variable. -integer(I1P), parameter:: BII1P = bit_size(MaxI1P), BYI1P = bit_size(MaxI1P)/8_I1P !< Number of bits/bytes of kind=I1P variable. -integer(I_P), parameter:: BII_P = bit_size(MaxI_P), BYI_P = bit_size(MaxI_P)/8_I_P !< Number of bits/bytes of kind=I_P variable. -! Smallest real representable difference by the running calculator. -#ifdef pgf95 -real(R16P), parameter:: ZeroR16 = 0._R16P -real(R8P), parameter:: ZeroR8 = 0._R8P -real(R4P), parameter:: ZeroR4 = 0._R4P -#else -real(R16P), parameter:: ZeroR16 = nearest(1._R16P, 1._R16P) - & - nearest(1._R16P,-1._R16P) !< Smallest representable difference of kind=R16P variable. -real(R8P), parameter:: ZeroR8 = nearest(1._R8P, 1._R8P) - & - nearest(1._R8P,-1._R8P) !< Smallest representable difference of kind=R8P variable. -real(R4P), parameter:: ZeroR4 = nearest(1._R4P, 1._R4P) - & - nearest(1._R4P,-1._R4P) !< Smallest representable difference of kind=R4P variable. -#endif -real(R_P), parameter:: Zero = ZeroR8 !< Smallest representable difference of kind=R_P variable. -!> @} -!----------------------------------------------------------------------------------------------------------------------------------- - -!----------------------------------------------------------------------------------------------------------------------------------- -!> @brief Overloading of the intrinsic "bit_size" function for computing the number of bits of (also) real and character variables; -!> variable, intent(\b IN):: \em n input; -!> integer(I1P), intent(\b OUT):: \em bits output number of bits of input number. -!> @ingroup IR_PrecisionInterface -interface bit_size - module procedure & -#ifdef r16p - bit_size_R16p, & -#endif - bit_size_R8P, & - bit_size_R4P, & - bit_size_chr -endinterface -!> @brief Overloading of the "byte_size" function for computing the number of bytes. -!> @ingroup IR_PrecisionInterface -interface byte_size - module procedure & - byte_size_I8P, & - byte_size_I4P, & - byte_size_I2P, & - byte_size_I1P, & -#ifdef r16p - byte_size_R16p, & -#endif - byte_size_R8P, & - byte_size_R4P, & - byte_size_chr -endinterface -!> @brief Procedure for converting number, real and integer, to string (number to string type casting); -!> logical, intent(\b IN), optional:: \em no_sign flag for do not write sign; -!> number, intent(\b IN):: \em n input number; -!> string, intent(\b OUT):: \em str output string. -!> @ingroup IR_PrecisionInterface -interface str - module procedure & -#ifdef r16p - strf_R16P,str_R16P,& -#endif - strf_R8P ,str_R8P, & - strf_R4P ,str_R4P, & - strf_I8P ,str_I8P, & - strf_I4P ,str_I4P, & - strf_I2P ,str_I2P, & - strf_I1P ,str_I1P -endinterface -!> @brief Procedure for converting number, integer, to string, prefixing with the right number of zeros (number to string type -!> casting with zero padding); -!> number, intent(\b IN), optional:: \em no_zpad number of padding zeros; -!> number, intent(\b IN):: \em n input number; -!> string, intent(\b OUT):: \em str output string. -!> @ingroup IR_PrecisionInterface -interface strz - module procedure strz_I8P, & - strz_I4P, & - strz_I2P, & - strz_I1P -endinterface -!> @brief Procedure for converting string to number, real or initeger, (string to number type casting); -!> string, intent(\b IN):: \em str input string; -!> number, intent(\b OUT):: \em n output number. -!> @ingroup IR_PrecisionInterface -interface cton - module procedure & -#ifdef r16p - ctor_R16P, & -#endif - ctor_R8P, & - ctor_R4P, & - ctoi_I8P, & - ctoi_I4P, & - ctoi_I2P, & - ctoi_I1P -endinterface -!> @brief Procedure for converting number, real and integer, to bit-string (number to bit-string type casting); -!> number, intent(\b IN):: \em n input number; -!> string, intent(\b OUT):: \em bstr output bit-string. -!> @ingroup IR_PrecisionInterface -interface bstr - module procedure & -#ifdef r16p - bstr_R16P,& -#endif - bstr_R8P, & - bstr_R4P, & - bstr_I8P, & - bstr_I4P, & - bstr_I2P, & - bstr_I1P -endinterface -!> @brief Procedure for converting bit-string to number, real or initeger, (bit-string to number type casting); -!> string, intent(\b IN):: \em bstr input bit-string; -!> number, intent(\b OUT):: \em n output number. -!> @ingroup IR_PrecisionInterface -interface bcton - module procedure & -#ifdef r16p - bctor_R16P, & -#endif - bctor_R8P, & - bctor_R4P, & - bctoi_I8P, & - bctoi_I4P, & - bctoi_I2P, & - bctoi_I1P -endinterface -!----------------------------------------------------------------------------------------------------------------------------------- -contains - !> @ingroup IR_PrecisionPublicProcedure - !> @{ - !> @brief Procedure for checking if the type of the bit ordering of the running architecture is little endian. - pure function is_little_endian() result(is_little) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - logical:: is_little !< Logical output: true is the running architecture uses little endian ordering, false otherwise. - integer(I1P):: int1(1:4) !< One byte integer array for casting 4 bytes integer. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - int1 = transfer(1_I4P,int1) - is_little = (int1(1)==1_I1P) - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction is_little_endian - - !> @brief Subroutine for checking the type of bit ordering (big or little endian) of the running architecture; the result is - !> stored into the "endian" global variable. - subroutine check_endian() - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - if (is_little_endian()) then - endian = endianL - else - endian = endianB - endif - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine check_endian - !> @} - - !> @ingroup IR_PrecisionPrivateProcedure - !> @{ - !> @brief Procedure for computing the number of bits of a real variable. - elemental function bit_size_R16P(r) result(bits) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - real(R16P), intent(IN):: r !< Real variable whose number of bits must be computed. - integer(I2P):: bits !< Number of bits of r. - integer(I1P):: mold(1) !< "Molding" dummy variable for bits counting. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - bits = size(transfer(r,mold),dim=1,kind=I2P)*8_I2P - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction bit_size_R16P - - !> @brief Procedure for computing the number of bits of a real variable. - elemental function bit_size_R8P(r) result(bits) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - real(R8P), intent(IN):: r !< Real variable whose number of bits must be computed. - integer(I1P):: bits !< Number of bits of r. - integer(I1P):: mold(1) !< "Molding" dummy variable for bits counting. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - bits = size(transfer(r,mold),dim=1,kind=I1P)*8_I1P - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction bit_size_R8P - - !> @brief Procedure for computing the number of bits of a real variable. - elemental function bit_size_R4P(r) result(bits) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - real(R4P), intent(IN):: r !< Real variable whose number of bits must be computed. - integer(I1P):: bits !< Number of bits of r. - integer(I1P):: mold(1) !< "Molding" dummy variable for bits counting. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - bits = size(transfer(r,mold),dim=1,kind=I1P)*8_I1P - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction bit_size_R4P - - !> @brief Procedure for computing the number of bits of a character variable. - elemental function bit_size_chr(c) result(bits) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: c !< Character variable whose number of bits must be computed. - integer(I4P):: bits !< Number of bits of c. - integer(I1P):: mold(1) !< "Molding" dummy variable for bits counting. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - bits = size(transfer(c,mold),dim=1,kind=I4P)*8_I4P - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction bit_size_chr - - !> @brief Procedure for computing the number of bytes of an integer variable. - elemental function byte_size_I8P(i) result(bytes) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I8P), intent(IN):: i !< Integer variable whose number of bytes must be computed. - integer(I1P):: bytes !< Number of bytes of i. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - bytes = bit_size(i)/8_I1P - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction byte_size_I8P - - !> @brief Procedure for computing the number of bytes of an integer variable. - elemental function byte_size_I4P(i) result(bytes) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: i !< Integer variable whose number of bytes must be computed. - integer(I1P):: bytes !< Number of bytes of i. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - bytes = bit_size(i)/8_I1P - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction byte_size_I4P - - !> @brief Procedure for computing the number of bytes of an integer variable. - elemental function byte_size_I2P(i) result(bytes) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I2P), intent(IN):: i !< Integer variable whose number of bytes must be computed. - integer(I1P):: bytes !< Number of bytes of i. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - bytes = bit_size(i)/8_I1P - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction byte_size_I2P - - !> @brief Procedure for computing the number of bytes of an integer variable. - elemental function byte_size_I1P(i) result(bytes) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I1P), intent(IN):: i !< Integer variable whose number of bytes must be computed. - integer(I1P):: bytes !< Number of bytes of i. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - bytes = bit_size(i)/8_I1P - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction byte_size_I1P - - !> @brief Procedure for computing the number of bytes of a real variable. - elemental function byte_size_R16P(r) result(bytes) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - real(R16P), intent(IN):: r !< Real variable whose number of bytes must be computed. - integer(I1P):: bytes !< Number of bytes of r. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - bytes = bit_size(r)/8_I1P - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction byte_size_R16P - - !> @brief Procedure for computing the number of bytes of a real variable. - elemental function byte_size_R8P(r) result(bytes) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - real(R8P), intent(IN):: r !< Real variable whose number of bytes must be computed. - integer(I1P):: bytes !< Number of bytes of r. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - bytes = bit_size(r)/8_I1P - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction byte_size_R8P - - !> @brief Procedure for computing the number of bytes of a real variable. - elemental function byte_size_R4P(r) result(bytes) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - real(R4P), intent(IN):: r !< Real variable whose number of bytes must be computed. - integer(I1P):: bytes !< Number of bytes of r. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - bytes = bit_size(r)/8_I1P - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction byte_size_R4P - - !> @brief Procedure for computing the number of bytes of a character variable. - elemental function byte_size_chr(c) result(bytes) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: c !< Character variable whose number of bytes must be computed. - integer(I4P):: bytes !< Number of bytes of c. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - bytes = bit_size(c)/8_I4P - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction byte_size_chr - - !> @brief Procedure for converting real to string. This function achieves casting of real to string. - elemental function strf_R16P(fm,n) result(str) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: fm !< Format different from the standard for the kind. - real(R16P), intent(IN):: n !< Real to be converted. - character(DR16P):: str !< Returned string containing input number. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - write(str,trim(fm)) n ! Casting of n to string. - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction strf_R16P - - !> @brief Procedure for converting real to string. This function achieves casting of real to string. - elemental function strf_R8P(fm,n) result(str) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: fm !< Format different from the standard for the kind. - real(R8P), intent(IN):: n !< Real to be converted. - character(DR8P):: str !< Returned string containing input number. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - write(str,trim(fm)) n ! Casting of n to string. - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction strf_R8P - - !> @brief Procedure for converting real to string. This function achieves casting of real to string. - elemental function strf_R4P(fm,n) result(str) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: fm !< Format different from the standard for the kind. - real(R4P), intent(IN):: n !< Real to be converted. - character(DR4P):: str !< Returned string containing input number. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - write(str,trim(fm)) n ! Casting of n to string. - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction strf_R4P - - !> @brief Procedure for converting integer to string. This function achieves casting of integer to string. - elemental function strf_I8P(fm,n) result(str) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: fm !< Format different from the standard for the kind. - integer(I8P), intent(IN):: n !< Integer to be converted. - character(DI8P):: str !< Returned string containing input number. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - write(str,trim(fm)) n ! Casting of n to string. - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction strf_I8P - - !> @brief Procedure for converting integer to string. This function achieves casting of integer to string. - elemental function strf_I4P(fm,n) result(str) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: fm !< Format different from the standard for the kind. - integer(I4P), intent(IN):: n !< Integer to be converted. - character(DI4P):: str !< Returned string containing input number. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - write(str,trim(fm)) n ! Casting of n to string. - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction strf_I4P - - !> @brief Procedure for converting integer to string. This function achieves casting of integer to string. - elemental function strf_I2P(fm,n) result(str) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: fm !< Format different from the standard for the kind. - integer(I2P), intent(IN):: n !< Integer to be converted. - character(DI2P):: str !< Returned string containing input number. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - write(str,trim(fm)) n ! Casting of n to string. - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction strf_I2P - - !> @brief Procedure for converting integer to string. This function achieves casting of integer to string. - elemental function strf_I1P(fm,n) result(str) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: fm !< Format different from the standard for the kind. - integer(I1P), intent(IN):: n !< Integer to be converted. - character(DI1P):: str !< Returned string containing input number. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - write(str,trim(fm)) n ! Casting of n to string. - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction strf_I1P - - !> @brief Procedure for converting real to string. This function achieves casting of real to string. - elemental function str_R16P(no_sign,n) result(str) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - logical, intent(IN), optional:: no_sign !< Flag for leaving out the sign. - real(R16P), intent(IN):: n !< Real to be converted. - character(DR16P):: str !< Returned string containing input number. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - write(str,FR16P) n ! Casting of n to string. - if (n>0._R16P) str(1:1)='+' ! Prefixing plus if n>0. - if (present(no_sign)) str=str(2:) ! Leaving out the sign. - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction str_R16P - - !> @brief Procedure for converting real to string. This function achieves casting of real to string. - elemental function str_R8P(no_sign,n) result(str) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - logical, intent(IN), optional:: no_sign !< Flag for leaving out the sign. - real(R8P), intent(IN):: n !< Real to be converted. - character(DR8P):: str !< Returned string containing input number. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - write(str,FR8P) n ! Casting of n to string. - if (n>0._R8P) str(1:1)='+' ! Prefixing plus if n>0. - if (present(no_sign)) str=str(2:) ! Leaving out the sign. - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction str_R8P - - !> @brief Procedure for converting real to string. This function achieves casting of real to string. - elemental function str_R4P(no_sign,n) result(str) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - logical, intent(IN), optional:: no_sign !< Flag for leaving out the sign. - real(R4P), intent(IN):: n !< Real to be converted. - character(DR4P):: str !< Returned string containing input number. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - write(str,FR4P) n ! Casting of n to string. - if (n>0._R4P) str(1:1)='+' ! Prefixing plus if n>0. - if (present(no_sign)) str=str(2:) ! Leaving out the sign. - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction str_R4P - - !> @brief Procedure for converting integer to string. This function achieves casting of integer to string. - elemental function str_I8P(no_sign,n) result(str) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - logical, intent(IN), optional:: no_sign !< Flag for leaving out the sign. - integer(I8P), intent(IN):: n !< Integer to be converted. - character(DI8P):: str !< Returned string containing input number plus padding zeros. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - write(str,FI8P) n ! Casting of n to string. - str = adjustl(trim(str)) ! Removing white spaces. - if (n>=0_I8P) str='+'//trim(str) ! Prefixing plus if n>0. - if (present(no_sign)) str=str(2:) ! Leaving out the sign. - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction str_I8P - - !> @brief Procedure for converting integer to string. This function achieves casting of integer to string. - elemental function str_I4P(no_sign,n) result(str) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - logical, intent(IN), optional:: no_sign !< Flag for leaving out the sign. - integer(I4P), intent(IN):: n !< Integer to be converted. - character(DI4P):: str !< Returned string containing input number plus padding zeros. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - write(str,FI4P) n ! Casting of n to string. - str = adjustl(trim(str)) ! Removing white spaces. - if (n>=0_I4P) str='+'//trim(str) ! Prefixing plus if n>0. - if (present(no_sign)) str=str(2:) ! Leaving out the sign. - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction str_I4P - - !> @brief Procedure for converting integer to string. This function achieves casting of integer to string. - elemental function str_I2P(no_sign,n) result(str) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - logical, intent(IN), optional:: no_sign !< Flag for leaving out the sign. - integer(I2P), intent(IN):: n !< Integer to be converted. - character(DI2P):: str !< Returned string containing input number plus padding zeros. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - write(str,FI2P) n ! Casting of n to string. - str = adjustl(trim(str)) ! Removing white spaces. - if (n>=0_I2P) str='+'//trim(str) ! Prefixing plus if n>0. - if (present(no_sign)) str=str(2:) ! Leaving out the sign. - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction str_I2P - - !> @brief Procedure for converting integer to string. This function achieves casting of integer to string. - elemental function str_I1P(no_sign,n) result(str) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - logical, intent(IN), optional:: no_sign !< Flag for leaving out the sign. - integer(I1P), intent(IN):: n !< Integer to be converted. - character(DI1P):: str !< Returned string containing input number plus padding zeros. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - write(str,FI1P) n ! Casting of n to string. - str = adjustl(trim(str)) ! Removing white spaces. - if (n>=0_I1P) str='+'//trim(str) ! Prefixing plus if n>0. - if (present(no_sign)) str=str(2:) ! Leaving out the sign. - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction str_I1P - - !> @brief Procedure for converting integer to string, prefixing with the right number of zeros. This function achieves casting of - !> integer to string. - elemental function strz_I8P(nz_pad,n) result(str) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN), optional:: nz_pad !< Number of zeros padding. - integer(I8P), intent(IN):: n !< Integer to be converted. - character(DI8P):: str !< Returned string containing input number plus padding zeros. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - write(str,FI8PZP) n ! Casting of n to string. - str=str(2:) ! Leaving out the sign. - if (present(nz_pad)) str=str(DI8P-nz_pad:DI8P-1) ! Leaving out the extra zeros padding - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction strz_I8P - - !> @brief Procedure for converting integer to string, prefixing with the right number of zeros. This function achieves casting of - !> integer to string. - elemental function strz_I4P(nz_pad,n) result(str) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN), optional:: nz_pad !< Number of zeros padding. - integer(I4P), intent(IN):: n !< Integer to be converted. - character(DI4P):: str !< Returned string containing input number plus padding zeros. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - write(str,FI4PZP) n ! Casting of n to string. - str=str(2:) ! Leaving out the sign. - if (present(nz_pad)) str=str(DI4P-nz_pad:DI4P-1) ! Leaving out the extra zeros padding - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction strz_I4P - - !> @brief Procedure for converting integer to string, prefixing with the right number of zeros. This function achieves casting of - !> integer to string. - elemental function strz_I2P(nz_pad,n) result(str) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN), optional:: nz_pad !< Number of zeros padding. - integer(I2P), intent(IN):: n !< Integer to be converted. - character(DI2P):: str !< Returned string containing input number plus padding zeros. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - write(str,FI2PZP) n ! Casting of n to string. - str=str(2:) ! Leaving out the sign. - if (present(nz_pad)) str=str(DI2P-nz_pad:DI2P-1) ! Leaving out the extra zeros padding - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction strz_I2P - - !> @brief Procedure for converting integer to string, prefixing with the right number of zeros. This function achieves casting of - !> integer to string. - elemental function strz_I1P(nz_pad,n) result(str) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN), optional:: nz_pad !< Number of zeros padding. - integer(I1P), intent(IN):: n !< Integer to be converted. - character(DI1P):: str !< Returned string containing input number plus padding zeros. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - write(str,FI1PZP) n ! Casting of n to string. - str=str(2:) ! Leaving out the sign. - if (present(nz_pad)) str=str(DI1P-nz_pad:DI1P-1) ! Leaving out the extra zeros padding - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction strz_I1P - - !> @brief Procedure for converting string to real. This function achieves casting of string to real. - function ctor_R16P(str,knd) result(n) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: str !< String containing input number. - real(R16P), intent(IN):: knd !< Number kind. - real(R16P):: n !< Number returned. - integer(I4P):: err !< Error trapping flag: 0 no errors, >0 error occurs. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - read(str,*,iostat=err) n ! Casting of str to n. - if (err/=0) then - write(stderr,'(A)') 'Conversion of string "'//str//'" to real failed' - write(stderr,'(A,'//FR16P//')') 'Kind parameter ',knd - write(stderr,'(A)') 'Function used "ctor_R16P"' - endif - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction ctor_R16P - - !> @brief Procedure for converting string to real. This function achieves casting of string to real. - function ctor_R8P(str,knd) result(n) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: str !< String containing input number. - real(R8P), intent(IN):: knd !< Number kind. - real(R8P):: n !< Number returned. - integer(I4P):: err !< Error trapping flag: 0 no errors, >0 error occurs. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - read(str,*,iostat=err) n ! Casting of str to n. - if (err/=0) then - write(stderr,'(A)') 'Conversion of string "'//str//'" to real failed' - write(stderr,'(A,'//FR8P//')') 'Kind parameter ',knd - write(stderr,'(A)') 'Function used "ctor_R8P"' - endif - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction ctor_R8P - - !> @brief Procedure for converting string to real. This function achieves casting of string to real. - function ctor_R4P(str,knd) result(n) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: str !< String containing input number. - real(R4P), intent(IN):: knd !< Number kind. - real(R4P):: n !< Number returned. - integer(I4P):: err !< Error trapping flag: 0 no errors, >0 error occurs. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - read(str,*,iostat=err) n ! Casting of str to n. - if (err/=0) then - write(stderr,'(A)') 'Conversion of string "'//str//'" to real failed' - write(stderr,'(A,'//FR4P//')') 'Kind parameter ',knd - write(stderr,'(A)') 'Function used "ctor_R4P"' - endif - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction ctor_R4P - - !> @brief Procedure for converting string to integer. This function achieves casting of string to integer. - function ctoi_I8P(str,knd) result(n) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: str !< String containing input number. - integer(I8P), intent(IN):: knd !< Number kind. - integer(I8P):: n !< Number returned. - integer(I4P):: err !< Error trapping flag: 0 no errors, >0 error occurs. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - read(str,*,iostat=err) n ! Casting of str to n. - if (err/=0) then - write(stderr,'(A)') 'Conversion of string "'//str//'" to integer failed' - write(stderr,'(A,'//FI8P//')') 'Kind parameter ',knd - write(stderr,'(A)') 'Function used "ctoi_I8P"' - endif - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction ctoi_I8P - - !> @brief Procedure for converting string to integer. This function achieves casting of string to integer. - function ctoi_I4P(str,knd) result(n) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: str !< String containing input number. - integer(I4P), intent(IN):: knd !< Number kind. - integer(I4P):: n !< Number returned. - integer(I4P):: err !< Error trapping flag: 0 no errors, >0 error occurs. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - read(str,*,iostat=err) n ! Casting of str to n. - if (err/=0) then - write(stderr,'(A)') 'Conversion of string "'//str//'" to integer failed' - write(stderr,'(A,'//FI4P//')') 'Kind parameter ',knd - write(stderr,'(A)') 'Function used "ctoi_I4P"' - endif - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction ctoi_I4P - - !> @brief Procedure for converting string to integer. This function achieves casting of string to integer. - function ctoi_I2P(str,knd) result(n) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: str !< String containing input number. - integer(I2P), intent(IN):: knd !< Number kind. - integer(I2P):: n !< Number returned. - integer(I4P):: err !< Error trapping flag: 0 no errors, >0 error occurs. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - read(str,*,iostat=err) n ! Casting of str to n. - if (err/=0) then - write(stderr,'(A)') 'Conversion of string "'//str//'" to integer failed' - write(stderr,'(A,'//FI2P//')') 'Kind parameter ',knd - write(stderr,'(A)') 'Function used "ctoi_I2P"' - endif - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction ctoi_I2P - - !> @brief Procedure for converting string to integer. This function achieves casting of string to integer. - function ctoi_I1P(str,knd) result(n) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: str !< String containing input number. - integer(I1P), intent(IN):: knd !< Number kind. - integer(I1P):: n !< Number returned. - integer(I4P):: err !< Error trapping flag: 0 no errors, >0 error occurs. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - read(str,*,iostat=err) n ! Casting of str to n. - if (err/=0) then - write(stderr,'(A)') 'Conversion of string "'//str//'" to integer failed' - write(stderr,'(A,'//FI1P//')') 'Kind parameter ',knd - write(stderr,'(A)') 'Function used "ctoi_I1P"' - endif - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction ctoi_I1P - - !> @brief Procedure for converting real to string of bits. This function achieves casting of real to bit-string. - !> @note It is assumed that R16P is represented by means of 128 bits, but this is not ensured in all architectures. - elemental function bstr_R16P(n) result(bstr) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - real(R8P), intent(IN):: n !< Real to be converted. - character(128):: bstr !< Returned bit-string containing input number. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - write(bstr,'(B128.128)')n ! Casting of n to bit-string. - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction bstr_R16P - - !> @brief Procedure for converting real to string of bits. This function achieves casting of real to bit-string. - !> @note It is assumed that R8P is represented by means of 64 bits, but this is not ensured in all architectures. - elemental function bstr_R8P(n) result(bstr) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - real(R8P), intent(IN):: n !< Real to be converted. - character(64):: bstr !< Returned bit-string containing input number. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - write(bstr,'(B64.64)')n ! Casting of n to bit-string. - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction bstr_R8P - - !> @brief Procedure for converting real to string of bits. This function achieves casting of real to bit-string. - !> @note It is assumed that R4P is represented by means of 32 bits, but this is not ensured in all architectures. - elemental function bstr_R4P(n) result(bstr) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - real(R4P), intent(IN):: n !< Real to be converted. - character(32):: bstr !< Returned bit-string containing input number. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - write(bstr,'(B32.32)')n ! Casting of n to bit-string. - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction bstr_R4P - - !> @brief Procedure for converting integer to string of bits. This function achieves casting of integer to bit-string. - !> @note It is assumed that I8P is represented by means of 64 bits, but this is not ensured in all architectures. - elemental function bstr_I8P(n) result(bstr) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I8P), intent(IN):: n !< Real to be converted. - character(64):: bstr !< Returned bit-string containing input number. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - write(bstr,'(B64.64)')n ! Casting of n to bit-string. - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction bstr_I8P - - !> @brief Procedure for converting integer to string of bits. This function achieves casting of integer to bit-string. - !> @note It is assumed that I4P is represented by means of 32 bits, but this is not ensured in all architectures. - elemental function bstr_I4P(n) result(bstr) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: n !< Real to be converted. - character(32):: bstr !< Returned bit-string containing input number. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - write(bstr,'(B32.32)')n ! Casting of n to bit-string. - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction bstr_I4P - - !> @brief Procedure for converting integer to string of bits. This function achieves casting of integer to bit-string. - !> @note It is assumed that I2P is represented by means of 16 bits, but this is not ensured in all architectures. - elemental function bstr_I2P(n) result(bstr) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I2P), intent(IN):: n !< Real to be converted. - character(16):: bstr !< Returned bit-string containing input number. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - write(bstr,'(B16.16)')n ! Casting of n to bit-string. - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction bstr_I2P - - !> @brief Procedure for converting integer to string of bits. This function achieves casting of integer to bit-string. - !> @note It is assumed that I1P is represented by means of 8 bits, but this is not ensured in all architectures. - elemental function bstr_I1P(n) result(bstr) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I1P), intent(IN):: n !< Real to be converted. - character(8):: bstr !< Returned bit-string containing input number. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - write(bstr,'(B8.8)')n ! Casting of n to bit-string. - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction bstr_I1P - - !> @brief Procedure for converting bit-string to real. This function achieves casting of bit-string to real. - elemental function bctor_R8P(bstr,knd) result(n) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: bstr !< String containing input number. - real(R8P), intent(IN):: knd !< Number kind. - real(R8P):: n !< Number returned. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - read(bstr,'(B'//trim(str(.true.,bit_size(knd)))//'.'//trim(str(.true.,bit_size(knd)))//')')n ! Casting of bstr to n. - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction bctor_R8P - - !> @brief Procedure for converting bit-string to real. This function achieves casting of bit-string to real. - elemental function bctor_R4P(bstr,knd) result(n) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: bstr !< String containing input number. - real(R4P), intent(IN):: knd !< Number kind. - real(R4P):: n !< Number returned. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - read(bstr,'(B'//trim(str(.true.,bit_size(knd)))//'.'//trim(str(.true.,bit_size(knd)))//')')n ! Casting of bstr to n. - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction bctor_R4P - - !> @brief Procedure for converting bit-string to integer. This function achieves casting of bit-string to integer. - elemental function bctoi_I8P(bstr,knd) result(n) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: bstr !< String containing input number. - integer(I8P), intent(IN):: knd !< Number kind. - integer(I8P):: n !< Number returned. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - read(bstr,'(B'//trim(str(.true.,bit_size(knd)))//'.'//trim(str(.true.,bit_size(knd)))//')')n ! Casting of bstr to n. - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction bctoi_I8P - - !> @brief Procedure for converting bit-string to integer. This function achieves casting of bit-string to integer. - elemental function bctoi_I4P(bstr,knd) result(n) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: bstr !< String containing input number. - integer(I4P), intent(IN):: knd !< Number kind. - integer(I4P):: n !< Number returned. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - read(bstr,'(B'//trim(str(.true.,bit_size(knd)))//'.'//trim(str(.true.,bit_size(knd)))//')')n ! Casting of bstr to n. - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction bctoi_I4P - - !> @brief Procedure for converting bit-string to integer. This function achieves casting of bit-string to integer. - elemental function bctoi_I2P(bstr,knd) result(n) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: bstr !< String containing input number. - integer(I2P), intent(IN):: knd !< Number kind. - integer(I2P):: n !< Number returned. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - read(bstr,'(B'//trim(str(.true.,bit_size(knd)))//'.'//trim(str(.true.,bit_size(knd)))//')')n ! Casting of bstr to n. - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction bctoi_I2P - - !> @brief Procedure for converting bit-string to integer. This function achieves casting of bit-string to integer. - elemental function bctoi_I1P(bstr,knd) result(n) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: bstr !< String containing input number. - integer(I1P), intent(IN):: knd !< Number kind. - integer(I1P):: n !< Number returned. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - read(bstr,'(B'//trim(str(.true.,bit_size(knd)))//'.'//trim(str(.true.,bit_size(knd)))//')')n ! Casting of bstr to n. - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction bctoi_I1P - !> @} - - !> Subroutine for initilizing module's variables that are not initialized into the definition specification. - !> @ingroup IR_PrecisionPublicProcedure - subroutine IR_init() - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - ! checking the bit ordering architecture - call check_endian - ! computing the bits/bytes sizes of real variables - BIR8P = bit_size(r=MaxR8P) ; BYR8P = BIR8P/8_I1P - BIR4P = bit_size(r=MaxR4P) ; BYR4P = BIR4P/8_I1P - BIR_P = bit_size(r=MaxR_P) ; BYR_P = BIR_P/8_I1P -#ifdef r16p - BIR16P = bit_size(r=MaxR16P) ; BYR16P = BIR16P/8_I2P -#else - BIR16P = int(BIR8P,kind=I2P) ; BYR16P = BIR16P/8_I2P -#endif - ir_initialized = .true. - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine IR_init - - !>Subroutine for printing to the standard output the kind definition of reals and integers and the utility variables. - !> @ingroup IR_PrecisionPublicProcedure - subroutine IR_Print(myrank,Nproc) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN), optional:: myrank !< Actual rank process necessary for concurrent multi-processes calls. - integer(I4P), intent(IN), optional:: Nproc !< Number of MPI processes used. - character(DI4P):: rks !< String containing myrank. - integer(I4P):: rank,Np !< Dummy temporary variables. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - if (.not.ir_initialized) call IR_init - rank = 0 ; if (present(myrank)) rank = myrank ; Np = 1 ; if (present(Nproc)) Np = Nproc ; rks = 'rank'//trim(strz(Np,rank)) - ! printing informations - if (endian==endianL) then - write(stdout,'(A)') trim(rks)//' This architecture has LITTLE Endian bit ordering' - else - write(stdout,'(A)') trim(rks)//' This architecture has BIG Endian bit ordering' - endif - write(stdout,'(A)') trim(rks)//' Reals kind precision definition' - write(stdout,'(A,I2,A,I2,A)')trim(rks)//' R16P Kind "',R16P,'" | FR16P format "'//FR16P//'" | DR16P chars "',DR16P,'"' - write(stdout,'(A,I2,A,I2,A)')trim(rks)//' R8P Kind "',R8P, '" | FR8P format "'//FR8P// '" | DR8P chars "',DR8P ,'"' - write(stdout,'(A,I2,A,I2,A)')trim(rks)//' R4P Kind "',R4P, '" | FR4P format "'//FR4P//'" | DR4P chars "',DR4P ,'"' - write(stdout,'(A)') trim(rks)//' Integers kind precision definition' - write(stdout,'(A,I2,A,I2,A)')trim(rks)//' I8P Kind "',I8P,'" | FI8P format "'//FI8P// '" | DI8P chars "',DI8P,'"' - write(stdout,'(A,I2,A,I2,A)')trim(rks)//' I4P Kind "',I4P,'" | FI4P format "'//FI4P// '" | DI4P chars "',DI4P,'"' - write(stdout,'(A,I2,A,I2,A)')trim(rks)//' I2P Kind "',I2P,'" | FI2P format "'//FI2P//'" | DI2P chars "',DI2P,'"' - write(stdout,'(A,I2,A,I2,A)')trim(rks)//' I1P Kind "',I1P,'" | FI1P format "'//FI1P//'" | DI1P chars "',DI1P,'"' - write(stdout,'(A)') trim(rks)//' Reals minimum and maximum values' - write(stdout,'(A)') trim(rks)//' MinR16P "'//trim(str(n=MinR16P))//'" | MaxR16P "'//trim(str(n=MaxR16P))//'"' - write(stdout,'(A)') trim(rks)//' MinR8P "'//trim(str(n=MinR8P))// '" | MaxR8P "'//trim(str(n=MaxR8P))// '"' - write(stdout,'(A)') trim(rks)//' MinR4P "'//trim(str(n=MinR4P))// '" | MaxR4P "'//trim(str(n=MaxR4P))// '"' - write(stdout,'(A)') trim(rks)//' Reals bits/bytes sizes' - write(stdout,'(A,I2,A,I2,A)')trim(rks)//' R16P bits "',BIR16P,'", bytes "',BYR16P,'"' - write(stdout,'(A,I2,A,I2,A)')trim(rks)//' R8P bits "', BIR8P, '", bytes "',BYR8P, '"' - write(stdout,'(A,I2,A,I2,A)')trim(rks)//' R4P bits "', BIR4P, '", bytes "',BYR4P, '"' - write(stdout,'(A,I2,A,I2,A)')trim(rks)//' R_P bits "', BIR_P, '", bytes "',BYR_P, '"' - write(stdout,'(A)') trim(rks)//' Integers minimum and maximum values' - write(stdout,'(A)') trim(rks)//' MinI8P "'//trim(str(n=MinI8P))//'" | MaxI8P "'//trim(str(n=MaxI8P))//'"' - write(stdout,'(A)') trim(rks)//' MinI4P "'//trim(str(n=MinI4P))//'" | MaxI4P "'//trim(str(n=MaxI4P))//'"' - write(stdout,'(A)') trim(rks)//' MinI2P "'//trim(str(n=MinI2P))//'" | MaxI2P "'//trim(str(n=MaxI2P))//'"' - write(stdout,'(A)') trim(rks)//' MinI1P "'//trim(str(n=MinI1P))//'" | MaxI1P "'//trim(str(n=MaxI1P))//'"' - write(stdout,'(A)') trim(rks)//' Integers bits/bytes sizes' - write(stdout,'(A,I2,A,I2,A)')trim(rks)//' I8P bits "',BII8P,'", bytes "',BYI8P,'"' - write(stdout,'(A,I2,A,I2,A)')trim(rks)//' I4P bits "',BII4P,'", bytes "',BYI4P,'"' - write(stdout,'(A,I2,A,I2,A)')trim(rks)//' I2P bits "',BII2P,'", bytes "',BYI2P,'"' - write(stdout,'(A,I2,A,I2,A)')trim(rks)//' I1P bits "',BII1P,'", bytes "',BYI1P,'"' - write(stdout,'(A,I2,A,I2,A)')trim(rks)//' I_P bits "',BII_P,'", bytes "',BYI_P,'"' - write(stdout,'(A)') trim(rks)//' Machine precisions' - write(stdout,'(A)') trim(rks)//' ZeroR16 "'//trim(str(.true.,ZeroR16))//'"' - write(stdout,'(A)') trim(rks)//' ZeroR8 "'//trim(str(.true.,ZeroR8 ))//'"' - write(stdout,'(A)') trim(rks)//' ZeroR4 "'//trim(str(.true.,ZeroR4 ))//'"' - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine IR_Print -endmodule IR_Precision diff --git a/lib/Lib_Base64.f90 b/lib/Lib_Base64.f90 deleted file mode 100644 index f1a5754eb..000000000 --- a/lib/Lib_Base64.f90 +++ /dev/null @@ -1,909 +0,0 @@ -!> @ingroup Library -!> @{ -!> @defgroup Lib_Base64Library Lib_Base64 -!> base64 encoding/decoding library -!> @} - -!> @ingroup Interface -!> @{ -!> @defgroup Lib_Base64Interface Lib_Base64 -!> base64 encoding/decoding library -!> @} - -!> @ingroup PublicProcedure -!> @{ -!> @defgroup Lib_Base64PublicProcedure Lib_Base64 -!> base64 encoding/decoding library -!> @} - -!> @ingroup PrivateProcedure -!> @{ -!> @defgroup Lib_Base64PrivateProcedure Lib_Base64 -!> base64 encoding/decoding library -!> @} - -!> @ingroup GlobalVarPar -!> @{ -!> @defgroup Lib_Base64GlobalVarPar Lib_Base64 -!> base64 encoding/decoding library -!> @} - -!> @ingroup PrivateVarPar -!> @{ -!> @defgroup Lib_Base64PrivateVarPar Lib_Base64 -!> base64 encoding/decoding library -!> @} - -!> This module contains base64 encoding/decoding procedures. -!> @todo \b Decoding: Implement decoding functions. -!> @todo \b DocComplete: Complete the documentation. -!> @ingroup Lib_Base64Library -module Lib_Base64 -!----------------------------------------------------------------------------------------------------------------------------------- -USE IR_Precision ! Integers and reals precision definition. -!----------------------------------------------------------------------------------------------------------------------------------- - -!----------------------------------------------------------------------------------------------------------------------------------- -implicit none -private -public:: b64_encode -!public:: b64_decode -public:: pack_data -!----------------------------------------------------------------------------------------------------------------------------------- - -!----------------------------------------------------------------------------------------------------------------------------------- -!> @ingroup Lib_Base64GlobalVarPar -!> @{ -!> @} -!> @ingroup Lib_Base64PrivateVarPar -!> @{ -character(64):: base64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" !< Base64 alphabet. -!> @} -!----------------------------------------------------------------------------------------------------------------------------------- - -!----------------------------------------------------------------------------------------------------------------------------------- -!> @brief Subroutine for encoding numbers (integer and real) to base64. -!> @ingroup Lib_Base64Interface -interface b64_encode - module procedure b64_encode_R8_a, & - b64_encode_R4_a, & - b64_encode_I8_a, & - b64_encode_I4_a, & - b64_encode_I2_a, & - b64_encode_I1_a -endinterface -!!> @brief Subroutine for decoding numbers (integer and real) from base64. -!!> @ingroup Lib_Base64Interface -!interface b64_decode -! module procedure b64_decode_R8_a, & -! b64_decode_R4_a, & -! b64_decode_I8_a, & -! b64_decode_I4_a, & -! b64_decode_I2_a, & -! b64_decode_I1_a -!endinterface -!> @brief Subroutine for packing different kinds of data into single I1P array. This is useful for encoding different kinds -!> variables into a single stream of bits. -!> @ingroup Lib_Base64Interface -interface pack_data - module procedure pack_data_R8_R4,pack_data_R8_I8,pack_data_R8_I4,pack_data_R8_I2,pack_data_R8_I1, & - pack_data_R4_R8,pack_data_R4_I8,pack_data_R4_I4,pack_data_R4_I2,pack_data_R4_I1, & - pack_data_I8_R8,pack_data_I8_R4,pack_data_I8_I4,pack_data_I8_I2,pack_data_I8_I1, & - pack_data_I4_R8,pack_data_I4_R4,pack_data_I4_I8,pack_data_I4_I2,pack_data_I4_I1, & - pack_data_I2_R8,pack_data_I2_R4,pack_data_I2_I8,pack_data_I2_I4,pack_data_I2_I1, & - pack_data_I1_R8,pack_data_I1_R4,pack_data_I1_I8,pack_data_I1_I4,pack_data_I1_I2 -endinterface -!----------------------------------------------------------------------------------------------------------------------------------- -contains - !> @ingroup Lib_Base64PrivateProcedure - !> @{ - !> @brief Subroutine for packing different kinds of data into single I1P array. - pure subroutine pack_data_R8_R4(a1,a2,packed) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - real(R8P), intent(IN):: a1(1:) !< Firs data stream. - real(R4P), intent(IN):: a2(1:) !< Second data stream. - integer(I1P), allocatable, intent(INOUT):: packed(:) !< Packed data into I1P array. - integer(I1P), allocatable:: p1(:) !< Temporary packed data of first stream. - integer(I1P), allocatable:: p2(:) !< Temporary packed data of second stream. - integer(I4P):: np !< Size of temporary packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - np = size(transfer(a1,p1)) ; allocate(p1(1:np)) ; p1 = transfer(a1,p1) - np = size(transfer(a2,p2)) ; allocate(p2(1:np)) ; p2 = transfer(a2,p2) - if (allocated(packed)) deallocate(packed) ; allocate(packed(1:size(p1,dim=1)+size(p2,dim=1))) ; packed = [p1,p2] - deallocate(p1,p2) - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine pack_data_R8_R4 - - !> @brief Subroutine for packing different kinds of data into single I1P array. - pure subroutine pack_data_R8_I8(a1,a2,packed) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - real(R8P), intent(IN):: a1(1:) !< First data stream. - integer(I8P), intent(IN):: a2(1:) !< Second data stream. - integer(I1P), allocatable, intent(INOUT):: packed(:) !< Packed data into I1P array. - integer(I1P), allocatable:: p1(:) !< Temporary packed data of first stream. - integer(I1P), allocatable:: p2(:) !< Temporary packed data of second stream. - integer(I4P):: np !< Size of temporary packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - np = size(transfer(a1,p1)) ; allocate(p1(1:np)) ; p1 = transfer(a1,p1) - np = size(transfer(a2,p2)) ; allocate(p2(1:np)) ; p2 = transfer(a2,p2) - if (allocated(packed)) deallocate(packed) ; allocate(packed(1:size(p1,dim=1)+size(p2,dim=1))) ; packed = [p1,p2] - deallocate(p1,p2) - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine pack_data_R8_I8 - - !> @brief Subroutine for packing different kinds of data into single I1P array. - pure subroutine pack_data_R8_I4(a1,a2,packed) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - real(R8P), intent(IN):: a1(1:) !< First data stream. - integer(I4P), intent(IN):: a2(1:) !< Second data stream. - integer(I1P), allocatable, intent(INOUT):: packed(:) !< Packed data into I1P array. - integer(I1P), allocatable:: p1(:) !< Temporary packed data of first stream. - integer(I1P), allocatable:: p2(:) !< Temporary packed data of second stream. - integer(I4P):: np !< Size of temporary packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - np = size(transfer(a1,p1)) ; allocate(p1(1:np)) ; p1 = transfer(a1,p1) - np = size(transfer(a2,p2)) ; allocate(p2(1:np)) ; p2 = transfer(a2,p2) - if (allocated(packed)) deallocate(packed) ; allocate(packed(1:size(p1,dim=1)+size(p2,dim=1))) ; packed = [p1,p2] - deallocate(p1,p2) - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine pack_data_R8_I4 - - !> @brief Subroutine for packing different kinds of data into single I1P array. - pure subroutine pack_data_R8_I2(a1,a2,packed) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - real(R8P), intent(IN):: a1(1:) !< First data stream. - integer(I2P), intent(IN):: a2(1:) !< Second data stream. - integer(I1P), allocatable, intent(INOUT):: packed(:) !< Packed data into I1P array. - integer(I1P), allocatable:: p1(:) !< Temporary packed data of first stream. - integer(I1P), allocatable:: p2(:) !< Temporary packed data of second stream. - integer(I4P):: np !< Size of temporary packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - np = size(transfer(a1,p1)) ; allocate(p1(1:np)) ; p1 = transfer(a1,p1) - np = size(transfer(a2,p2)) ; allocate(p2(1:np)) ; p2 = transfer(a2,p2) - if (allocated(packed)) deallocate(packed) ; allocate(packed(1:size(p1,dim=1)+size(p2,dim=1))) ; packed = [p1,p2] - deallocate(p1,p2) - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine pack_data_R8_I2 - - !> @brief Subroutine for packing different kinds of data into single I1P array. - pure subroutine pack_data_R8_I1(a1,a2,packed) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - real(R8P), intent(IN):: a1(1:) !< First data stream. - integer(I1P), intent(IN):: a2(1:) !< Second data stream. - integer(I1P), allocatable, intent(INOUT):: packed(:) !< Packed data into I1P array. - integer(I1P), allocatable:: p1(:) !< Temporary packed data of first stream. - integer(I1P), allocatable:: p2(:) !< Temporary packed data of second stream. - integer(I4P):: np !< Size of temporary packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - np = size(transfer(a1,p1)) ; allocate(p1(1:np)) ; p1 = transfer(a1,p1) - np = size(transfer(a2,p2)) ; allocate(p2(1:np)) ; p2 = transfer(a2,p2) - if (allocated(packed)) deallocate(packed) ; allocate(packed(1:size(p1,dim=1)+size(p2,dim=1))) ; packed = [p1,p2] - deallocate(p1,p2) - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine pack_data_R8_I1 - - !> @brief Subroutine for packing different kinds of data into single I1P array. - pure subroutine pack_data_R4_R8(a1,a2,packed) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - real(R4P), intent(IN):: a1(1:) !< Firs data stream. - real(R8P), intent(IN):: a2(1:) !< Second data stream. - integer(I1P), allocatable, intent(INOUT):: packed(:) !< Packed data into I1P array. - integer(I1P), allocatable:: p1(:) !< Temporary packed data of first stream. - integer(I1P), allocatable:: p2(:) !< Temporary packed data of second stream. - integer(I4P):: np !< Size of temporary packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - np = size(transfer(a1,p1)) ; allocate(p1(1:np)) ; p1 = transfer(a1,p1) - np = size(transfer(a2,p2)) ; allocate(p2(1:np)) ; p2 = transfer(a2,p2) - if (allocated(packed)) deallocate(packed) ; allocate(packed(1:size(p1,dim=1)+size(p2,dim=1))) ; packed = [p1,p2] - deallocate(p1,p2) - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine pack_data_R4_R8 - - !> @brief Subroutine for packing different kinds of data into single I1P array. - pure subroutine pack_data_R4_I8(a1,a2,packed) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - real(R4P), intent(IN):: a1(1:) !< First data stream. - integer(I8P), intent(IN):: a2(1:) !< Second data stream. - integer(I1P), allocatable, intent(INOUT):: packed(:) !< Packed data into I1P array. - integer(I1P), allocatable:: p1(:) !< Temporary packed data of first stream. - integer(I1P), allocatable:: p2(:) !< Temporary packed data of second stream. - integer(I4P):: np !< Size of temporary packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - np = size(transfer(a1,p1)) ; allocate(p1(1:np)) ; p1 = transfer(a1,p1) - np = size(transfer(a2,p2)) ; allocate(p2(1:np)) ; p2 = transfer(a2,p2) - if (allocated(packed)) deallocate(packed) ; allocate(packed(1:size(p1,dim=1)+size(p2,dim=1))) ; packed = [p1,p2] - deallocate(p1,p2) - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine pack_data_R4_I8 - - !> @brief Subroutine for packing different kinds of data into single I1P array. - pure subroutine pack_data_R4_I4(a1,a2,packed) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - real(R4P), intent(IN):: a1(1:) !< First data stream. - integer(I4P), intent(IN):: a2(1:) !< Second data stream. - integer(I1P), allocatable, intent(INOUT):: packed(:) !< Packed data into I1P array. - integer(I1P), allocatable:: p1(:) !< Temporary packed data of first stream. - integer(I1P), allocatable:: p2(:) !< Temporary packed data of second stream. - integer(I4P):: np !< Size of temporary packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - np = size(transfer(a1,p1)) ; allocate(p1(1:np)) ; p1 = transfer(a1,p1) - np = size(transfer(a2,p2)) ; allocate(p2(1:np)) ; p2 = transfer(a2,p2) - if (allocated(packed)) deallocate(packed) ; allocate(packed(1:size(p1,dim=1)+size(p2,dim=1))) ; packed = [p1,p2] - deallocate(p1,p2) - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine pack_data_R4_I4 - - !> @brief Subroutine for packing different kinds of data into single I1P array. - pure subroutine pack_data_R4_I2(a1,a2,packed) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - real(R4P), intent(IN):: a1(1:) !< First data stream. - integer(I2P), intent(IN):: a2(1:) !< Second data stream. - integer(I1P), allocatable, intent(INOUT):: packed(:) !< Packed data into I1P array. - integer(I1P), allocatable:: p1(:) !< Temporary packed data of first stream. - integer(I1P), allocatable:: p2(:) !< Temporary packed data of second stream. - integer(I4P):: np !< Size of temporary packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - np = size(transfer(a1,p1)) ; allocate(p1(1:np)) ; p1 = transfer(a1,p1) - np = size(transfer(a2,p2)) ; allocate(p2(1:np)) ; p2 = transfer(a2,p2) - if (allocated(packed)) deallocate(packed) ; allocate(packed(1:size(p1,dim=1)+size(p2,dim=1))) ; packed = [p1,p2] - deallocate(p1,p2) - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine pack_data_R4_I2 - - !> @brief Subroutine for packing different kinds of data into single I1P array. - pure subroutine pack_data_R4_I1(a1,a2,packed) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - real(R4P), intent(IN):: a1(1:) !< First data stream. - integer(I1P), intent(IN):: a2(1:) !< Second data stream. - integer(I1P), allocatable, intent(INOUT):: packed(:) !< Packed data into I1P array. - integer(I1P), allocatable:: p1(:) !< Temporary packed data of first stream. - integer(I1P), allocatable:: p2(:) !< Temporary packed data of second stream. - integer(I4P):: np !< Size of temporary packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - np = size(transfer(a1,p1)) ; allocate(p1(1:np)) ; p1 = transfer(a1,p1) - np = size(transfer(a2,p2)) ; allocate(p2(1:np)) ; p2 = transfer(a2,p2) - if (allocated(packed)) deallocate(packed) ; allocate(packed(1:size(p1,dim=1)+size(p2,dim=1))) ; packed = [p1,p2] - deallocate(p1,p2) - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine pack_data_R4_I1 - - !> @brief Subroutine for packing different kinds of data into single I1P array. - pure subroutine pack_data_I8_R8(a1,a2,packed) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I8P), intent(IN):: a1(1:) !< First data stream. - real(R8P), intent(IN):: a2(1:) !< Second data stream. - integer(I1P), allocatable, intent(INOUT):: packed(:) !< Packed data into I1P array. - integer(I1P), allocatable:: p1(:) !< Temporary packed data of first stream. - integer(I1P), allocatable:: p2(:) !< Temporary packed data of second stream. - integer(I4P):: np !< Size of temporary packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - np = size(transfer(a1,p1)) ; allocate(p1(1:np)) ; p1 = transfer(a1,p1) - np = size(transfer(a2,p2)) ; allocate(p2(1:np)) ; p2 = transfer(a2,p2) - if (allocated(packed)) deallocate(packed) ; allocate(packed(1:size(p1,dim=1)+size(p2,dim=1))) ; packed = [p1,p2] - deallocate(p1,p2) - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine pack_data_I8_R8 - - !> @brief Subroutine for packing different kinds of data into single I1P array. - pure subroutine pack_data_I8_R4(a1,a2,packed) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I8P), intent(IN):: a1(1:) !< First data stream. - real(R4P), intent(IN):: a2(1:) !< Second data stream. - integer(I1P), allocatable, intent(INOUT):: packed(:) !< Packed data into I1P array. - integer(I1P), allocatable:: p1(:) !< Temporary packed data of first stream. - integer(I1P), allocatable:: p2(:) !< Temporary packed data of second stream. - integer(I4P):: np !< Size of temporary packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - np = size(transfer(a1,p1)) ; allocate(p1(1:np)) ; p1 = transfer(a1,p1) - np = size(transfer(a2,p2)) ; allocate(p2(1:np)) ; p2 = transfer(a2,p2) - if (allocated(packed)) deallocate(packed) ; allocate(packed(1:size(p1,dim=1)+size(p2,dim=1))) ; packed = [p1,p2] - deallocate(p1,p2) - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine pack_data_I8_R4 - - !> @brief Subroutine for packing different kinds of data into single I1P array. - pure subroutine pack_data_I8_I4(a1,a2,packed) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I8P), intent(IN):: a1(1:) !< First data stream. - integer(I4P), intent(IN):: a2(1:) !< Second data stream. - integer(I1P), allocatable, intent(INOUT):: packed(:) !< Packed data into I1P array. - integer(I1P), allocatable:: p1(:) !< Temporary packed data of first stream. - integer(I1P), allocatable:: p2(:) !< Temporary packed data of second stream. - integer(I4P):: np !< Size of temporary packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - np = size(transfer(a1,p1)) ; allocate(p1(1:np)) ; p1 = transfer(a1,p1) - np = size(transfer(a2,p2)) ; allocate(p2(1:np)) ; p2 = transfer(a2,p2) - if (allocated(packed)) deallocate(packed) ; allocate(packed(1:size(p1,dim=1)+size(p2,dim=1))) ; packed = [p1,p2] - deallocate(p1,p2) - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine pack_data_I8_I4 - - !> @brief Subroutine for packing different kinds of data into single I1P array. - pure subroutine pack_data_I8_I2(a1,a2,packed) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I8P), intent(IN):: a1(1:) !< First data stream. - integer(I2P), intent(IN):: a2(1:) !< Second data stream. - integer(I1P), allocatable, intent(INOUT):: packed(:) !< Packed data into I1P array. - integer(I1P), allocatable:: p1(:) !< Temporary packed data of first stream. - integer(I1P), allocatable:: p2(:) !< Temporary packed data of second stream. - integer(I4P):: np !< Size of temporary packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - np = size(transfer(a1,p1)) ; allocate(p1(1:np)) ; p1 = transfer(a1,p1) - np = size(transfer(a2,p2)) ; allocate(p2(1:np)) ; p2 = transfer(a2,p2) - if (allocated(packed)) deallocate(packed) ; allocate(packed(1:size(p1,dim=1)+size(p2,dim=1))) ; packed = [p1,p2] - deallocate(p1,p2) - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine pack_data_I8_I2 - - !> @brief Subroutine for packing different kinds of data into single I1P array. - pure subroutine pack_data_I8_I1(a1,a2,packed) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I8P), intent(IN):: a1(1:) !< First data stream. - integer(I1P), intent(IN):: a2(1:) !< Second data stream. - integer(I1P), allocatable, intent(INOUT):: packed(:) !< Packed data into I1P array. - integer(I1P), allocatable:: p1(:) !< Temporary packed data of first stream. - integer(I1P), allocatable:: p2(:) !< Temporary packed data of second stream. - integer(I4P):: np !< Size of temporary packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - np = size(transfer(a1,p1)) ; allocate(p1(1:np)) ; p1 = transfer(a1,p1) - np = size(transfer(a2,p2)) ; allocate(p2(1:np)) ; p2 = transfer(a2,p2) - if (allocated(packed)) deallocate(packed) ; allocate(packed(1:size(p1,dim=1)+size(p2,dim=1))) ; packed = [p1,p2] - deallocate(p1,p2) - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine pack_data_I8_I1 - - !> @brief Subroutine for packing different kinds of data into single I1P array. - pure subroutine pack_data_I4_R8(a1,a2,packed) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: a1(1:) !< First data stream. - real(R8P), intent(IN):: a2(1:) !< Second data stream. - integer(I1P), allocatable, intent(INOUT):: packed(:) !< Packed data into I1P array. - integer(I1P), allocatable:: p1(:) !< Temporary packed data of first stream. - integer(I1P), allocatable:: p2(:) !< Temporary packed data of second stream. - integer(I4P):: np !< Size of temporary packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - np = size(transfer(a1,p1)) ; allocate(p1(1:np)) ; p1 = transfer(a1,p1) - np = size(transfer(a2,p2)) ; allocate(p2(1:np)) ; p2 = transfer(a2,p2) - if (allocated(packed)) deallocate(packed) ; allocate(packed(1:size(p1,dim=1)+size(p2,dim=1))) ; packed = [p1,p2] - deallocate(p1,p2) - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine pack_data_I4_R8 - - !> @brief Subroutine for packing different kinds of data into single I1P array. - pure subroutine pack_data_I4_R4(a1,a2,packed) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: a1(1:) !< First data stream. - real(R4P), intent(IN):: a2(1:) !< Second data stream. - integer(I1P), allocatable, intent(INOUT):: packed(:) !< Packed data into I1P array. - integer(I1P), allocatable:: p1(:) !< Temporary packed data of first stream. - integer(I1P), allocatable:: p2(:) !< Temporary packed data of second stream. - integer(I4P):: np !< Size of temporary packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - np = size(transfer(a1,p1)) ; allocate(p1(1:np)) ; p1 = transfer(a1,p1) - np = size(transfer(a2,p2)) ; allocate(p2(1:np)) ; p2 = transfer(a2,p2) - if (allocated(packed)) deallocate(packed) ; allocate(packed(1:size(p1,dim=1)+size(p2,dim=1))) ; packed = [p1,p2] - deallocate(p1,p2) - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine pack_data_I4_R4 - - !> @brief Subroutine for packing different kinds of data into single I1P array. - pure subroutine pack_data_I4_I8(a1,a2,packed) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: a1(1:) !< First data stream. - integer(I8P), intent(IN):: a2(1:) !< Second data stream. - integer(I1P), allocatable, intent(INOUT):: packed(:) !< Packed data into I1P array. - integer(I1P), allocatable:: p1(:) !< Temporary packed data of first stream. - integer(I1P), allocatable:: p2(:) !< Temporary packed data of second stream. - integer(I4P):: np !< Size of temporary packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - np = size(transfer(a1,p1)) ; allocate(p1(1:np)) ; p1 = transfer(a1,p1) - np = size(transfer(a2,p2)) ; allocate(p2(1:np)) ; p2 = transfer(a2,p2) - if (allocated(packed)) deallocate(packed) ; allocate(packed(1:size(p1,dim=1)+size(p2,dim=1))) ; packed = [p1,p2] - deallocate(p1,p2) - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine pack_data_I4_I8 - - !> @brief Subroutine for packing different kinds of data into single I1P array. - pure subroutine pack_data_I4_I2(a1,a2,packed) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: a1(1:) !< First data stream. - integer(I2P), intent(IN):: a2(1:) !< Second data stream. - integer(I1P), allocatable, intent(INOUT):: packed(:) !< Packed data into I1P array. - integer(I1P), allocatable:: p1(:) !< Temporary packed data of first stream. - integer(I1P), allocatable:: p2(:) !< Temporary packed data of second stream. - integer(I4P):: np !< Size of temporary packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - np = size(transfer(a1,p1)) ; allocate(p1(1:np)) ; p1 = transfer(a1,p1) - np = size(transfer(a2,p2)) ; allocate(p2(1:np)) ; p2 = transfer(a2,p2) - if (allocated(packed)) deallocate(packed) ; allocate(packed(1:size(p1,dim=1)+size(p2,dim=1))) ; packed = [p1,p2] - deallocate(p1,p2) - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine pack_data_I4_I2 - - !> @brief Subroutine for packing different kinds of data into single I1P array. - pure subroutine pack_data_I4_I1(a1,a2,packed) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: a1(1:) !< First data stream. - integer(I1P), intent(IN):: a2(1:) !< Second data stream. - integer(I1P), allocatable, intent(INOUT):: packed(:) !< Packed data into I1P array. - integer(I1P), allocatable:: p1(:) !< Temporary packed data of first stream. - integer(I1P), allocatable:: p2(:) !< Temporary packed data of second stream. - integer(I4P):: np !< Size of temporary packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - np = size(transfer(a1,p1)) ; allocate(p1(1:np)) ; p1 = transfer(a1,p1) - np = size(transfer(a2,p2)) ; allocate(p2(1:np)) ; p2 = transfer(a2,p2) - if (allocated(packed)) deallocate(packed) ; allocate(packed(1:size(p1,dim=1)+size(p2,dim=1))) ; packed = [p1,p2] - deallocate(p1,p2) - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine pack_data_I4_I1 - - !> @brief Subroutine for packing different kinds of data into single I1P array. - pure subroutine pack_data_I2_R8(a1,a2,packed) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I2P), intent(IN):: a1(1:) !< First data stream. - real(R8P), intent(IN):: a2(1:) !< Second data stream. - integer(I1P), allocatable, intent(INOUT):: packed(:) !< Packed data into I1P array. - integer(I1P), allocatable:: p1(:) !< Temporary packed data of first stream. - integer(I1P), allocatable:: p2(:) !< Temporary packed data of second stream. - integer(I4P):: np !< Size of temporary packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - np = size(transfer(a1,p1)) ; allocate(p1(1:np)) ; p1 = transfer(a1,p1) - np = size(transfer(a2,p2)) ; allocate(p2(1:np)) ; p2 = transfer(a2,p2) - if (allocated(packed)) deallocate(packed) ; allocate(packed(1:size(p1,dim=1)+size(p2,dim=1))) ; packed = [p1,p2] - deallocate(p1,p2) - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine pack_data_I2_R8 - - !> @brief Subroutine for packing different kinds of data into single I1P array. - pure subroutine pack_data_I2_R4(a1,a2,packed) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I2P), intent(IN):: a1(1:) !< First data stream. - real(R4P), intent(IN):: a2(1:) !< Second data stream. - integer(I1P), allocatable, intent(INOUT):: packed(:) !< Packed data into I1P array. - integer(I1P), allocatable:: p1(:) !< Temporary packed data of first stream. - integer(I1P), allocatable:: p2(:) !< Temporary packed data of second stream. - integer(I4P):: np !< Size of temporary packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - np = size(transfer(a1,p1)) ; allocate(p1(1:np)) ; p1 = transfer(a1,p1) - np = size(transfer(a2,p2)) ; allocate(p2(1:np)) ; p2 = transfer(a2,p2) - if (allocated(packed)) deallocate(packed) ; allocate(packed(1:size(p1,dim=1)+size(p2,dim=1))) ; packed = [p1,p2] - deallocate(p1,p2) - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine pack_data_I2_R4 - - !> @brief Subroutine for packing different kinds of data into single I1P array. - pure subroutine pack_data_I2_I8(a1,a2,packed) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I2P), intent(IN):: a1(1:) !< First data stream. - integer(I8P), intent(IN):: a2(1:) !< Second data stream. - integer(I1P), allocatable, intent(INOUT):: packed(:) !< Packed data into I1P array. - integer(I1P), allocatable:: p1(:) !< Temporary packed data of first stream. - integer(I1P), allocatable:: p2(:) !< Temporary packed data of second stream. - integer(I4P):: np !< Size of temporary packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - np = size(transfer(a1,p1)) ; allocate(p1(1:np)) ; p1 = transfer(a1,p1) - np = size(transfer(a2,p2)) ; allocate(p2(1:np)) ; p2 = transfer(a2,p2) - if (allocated(packed)) deallocate(packed) ; allocate(packed(1:size(p1,dim=1)+size(p2,dim=1))) ; packed = [p1,p2] - deallocate(p1,p2) - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine pack_data_I2_I8 - - !> @brief Subroutine for packing different kinds of data into single I1P array. - pure subroutine pack_data_I2_I4(a1,a2,packed) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I2P), intent(IN):: a1(1:) !< First data stream. - integer(I4P), intent(IN):: a2(1:) !< Second data stream. - integer(I1P), allocatable, intent(INOUT):: packed(:) !< Packed data into I1P array. - integer(I1P), allocatable:: p1(:) !< Temporary packed data of first stream. - integer(I1P), allocatable:: p2(:) !< Temporary packed data of second stream. - integer(I4P):: np !< Size of temporary packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - np = size(transfer(a1,p1)) ; allocate(p1(1:np)) ; p1 = transfer(a1,p1) - np = size(transfer(a2,p2)) ; allocate(p2(1:np)) ; p2 = transfer(a2,p2) - if (allocated(packed)) deallocate(packed) ; allocate(packed(1:size(p1,dim=1)+size(p2,dim=1))) ; packed = [p1,p2] - deallocate(p1,p2) - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine pack_data_I2_I4 - - !> @brief Subroutine for packing different kinds of data into single I1P array. - pure subroutine pack_data_I2_I1(a1,a2,packed) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I2P), intent(IN):: a1(1:) !< First data stream. - integer(I1P), intent(IN):: a2(1:) !< Second data stream. - integer(I1P), allocatable, intent(INOUT):: packed(:) !< Packed data into I1P array. - integer(I1P), allocatable:: p1(:) !< Temporary packed data of first stream. - integer(I1P), allocatable:: p2(:) !< Temporary packed data of second stream. - integer(I4P):: np !< Size of temporary packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - np = size(transfer(a1,p1)) ; allocate(p1(1:np)) ; p1 = transfer(a1,p1) - np = size(transfer(a2,p2)) ; allocate(p2(1:np)) ; p2 = transfer(a2,p2) - if (allocated(packed)) deallocate(packed) ; allocate(packed(1:size(p1,dim=1)+size(p2,dim=1))) ; packed = [p1,p2] - deallocate(p1,p2) - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine pack_data_I2_I1 - - !> @brief Subroutine for packing different kinds of data into single I1P array. - pure subroutine pack_data_I1_R8(a1,a2,packed) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I1P), intent(IN):: a1(1:) !< First data stream. - real(R8P), intent(IN):: a2(1:) !< Second data stream. - integer(I1P), allocatable, intent(INOUT):: packed(:) !< Packed data into I1P array. - integer(I1P), allocatable:: p1(:) !< Temporary packed data of first stream. - integer(I1P), allocatable:: p2(:) !< Temporary packed data of second stream. - integer(I4P):: np !< Size of temporary packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - np = size(transfer(a1,p1)) ; allocate(p1(1:np)) ; p1 = transfer(a1,p1) - np = size(transfer(a2,p2)) ; allocate(p2(1:np)) ; p2 = transfer(a2,p2) - if (allocated(packed)) deallocate(packed) ; allocate(packed(1:size(p1,dim=1)+size(p2,dim=1))) ; packed = [p1,p2] - deallocate(p1,p2) - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine pack_data_I1_R8 - - !> @brief Subroutine for packing different kinds of data into single I1P array. - pure subroutine pack_data_I1_R4(a1,a2,packed) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I1P), intent(IN):: a1(1:) !< First data stream. - real(R4P), intent(IN):: a2(1:) !< Second data stream. - integer(I1P), allocatable, intent(INOUT):: packed(:) !< Packed data into I1P array. - integer(I1P), allocatable:: p1(:) !< Temporary packed data of first stream. - integer(I1P), allocatable:: p2(:) !< Temporary packed data of second stream. - integer(I4P):: np !< Size of temporary packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - np = size(transfer(a1,p1)) ; allocate(p1(1:np)) ; p1 = transfer(a1,p1) - np = size(transfer(a2,p2)) ; allocate(p2(1:np)) ; p2 = transfer(a2,p2) - if (allocated(packed)) deallocate(packed) ; allocate(packed(1:size(p1,dim=1)+size(p2,dim=1))) ; packed = [p1,p2] - deallocate(p1,p2) - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine pack_data_I1_R4 - - !> @brief Subroutine for packing different kinds of data into single I1P array. - pure subroutine pack_data_I1_I8(a1,a2,packed) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I1P), intent(IN):: a1(1:) !< First data stream. - integer(I8P), intent(IN):: a2(1:) !< Second data stream. - integer(I1P), allocatable, intent(INOUT):: packed(:) !< Packed data into I1P array. - integer(I1P), allocatable:: p1(:) !< Temporary packed data of first stream. - integer(I1P), allocatable:: p2(:) !< Temporary packed data of second stream. - integer(I4P):: np !< Size of temporary packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - np = size(transfer(a1,p1)) ; allocate(p1(1:np)) ; p1 = transfer(a1,p1) - np = size(transfer(a2,p2)) ; allocate(p2(1:np)) ; p2 = transfer(a2,p2) - if (allocated(packed)) deallocate(packed) ; allocate(packed(1:size(p1,dim=1)+size(p2,dim=1))) ; packed = [p1,p2] - deallocate(p1,p2) - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine pack_data_I1_I8 - - !> @brief Subroutine for packing different kinds of data into single I1P array. - pure subroutine pack_data_I1_I4(a1,a2,packed) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I1P), intent(IN):: a1(1:) !< First data stream. - integer(I4P), intent(IN):: a2(1:) !< Second data stream. - integer(I1P), allocatable, intent(INOUT):: packed(:) !< Packed data into I1P array. - integer(I1P), allocatable:: p1(:) !< Temporary packed data of first stream. - integer(I1P), allocatable:: p2(:) !< Temporary packed data of second stream. - integer(I4P):: np !< Size of temporary packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - np = size(transfer(a1,p1)) ; allocate(p1(1:np)) ; p1 = transfer(a1,p1) - np = size(transfer(a2,p2)) ; allocate(p2(1:np)) ; p2 = transfer(a2,p2) - if (allocated(packed)) deallocate(packed) ; allocate(packed(1:size(p1,dim=1)+size(p2,dim=1))) ; packed = [p1,p2] - deallocate(p1,p2) - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine pack_data_I1_I4 - - !> @brief Subroutine for packing different kinds of data into single I1P array. - pure subroutine pack_data_I1_I2(a1,a2,packed) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I1P), intent(IN):: a1(1:) !< First data stream. - integer(I2P), intent(IN):: a2(1:) !< Second data stream. - integer(I1P), allocatable, intent(INOUT):: packed(:) !< Packed data into I1P array. - integer(I1P), allocatable:: p1(:) !< Temporary packed data of first stream. - integer(I1P), allocatable:: p2(:) !< Temporary packed data of second stream. - integer(I4P):: np !< Size of temporary packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - np = size(transfer(a1,p1)) ; allocate(p1(1:np)) ; p1 = transfer(a1,p1) - np = size(transfer(a2,p2)) ; allocate(p2(1:np)) ; p2 = transfer(a2,p2) - if (allocated(packed)) deallocate(packed) ; allocate(packed(1:size(p1,dim=1)+size(p2,dim=1))) ; packed = [p1,p2] - deallocate(p1,p2) - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine pack_data_I1_I2 - - !> @brief Subroutine for encoding bits (must be multiple of 24 bits) into base64 charcaters code (of length multiple of 4). - !> @note The bits stream are encoded in chunks of 24 bits as the following example (in little endian order): - !> @code - !> +--first octet--+-second octet--+--third octet--+ - !> |7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0|7 6 5 4 3 2 1 0| - !> +-----------+---+-------+-------+---+-----------+ - !> |5 4 3 2 1 0|5 4 3 2 1 0|5 4 3 2 1 0|5 4 3 2 1 0| - !> +--1.index--+--2.index--+--3.index--+--4.index--+ - !> @endcode - !> The 4 indexes are stored into 4 elements 8 bits array, thus 2 bits of each array element are not used. - pure subroutine encode_bits(bits,padd,code) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I1P), intent(IN):: bits(1:) !< Bits to be encoded. - integer(I4P), intent(IN):: padd !< Number of padding characters ('='). - character(1), intent(OUT):: code(1:) !< Characters code. - integer(I1P):: sixb(1:4) !< 6 bits slices (stored into 8 bits integer) of 24 bits input. - integer(I8P):: c,e !< Counters. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - c = 1_I8P - do e=1_I8P,size(bits,dim=1,kind=I8P),3_I8P ! loop over array elements: 3 bytes (24 bits) scanning - sixb = 0_I1P - call mvbits(bits(e ),2,6,sixb(1),0) - call mvbits(bits(e ),0,2,sixb(2),4) ; call mvbits(bits(e+1),4,4,sixb(2),0) - call mvbits(bits(e+1),0,4,sixb(3),2) ; call mvbits(bits(e+2),6,2,sixb(3),0) - call mvbits(bits(e+2),0,6,sixb(4),0) - sixb = sixb + 1_I1P - code(c :c )(1:1) = base64(sixb(1):sixb(1)) - code(c+1:c+1)(1:1) = base64(sixb(2):sixb(2)) - code(c+2:c+2)(1:1) = base64(sixb(3):sixb(3)) - code(c+3:c+3)(1:1) = base64(sixb(4):sixb(4)) - c = c + 4_I8P - enddo - if (padd>0) code(size(code,dim=1)-padd+1:)(1:1)='=' - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine encode_bits - - !> @brief Subroutine for encoding array numbers to base64 (R8P). - pure subroutine b64_encode_R8_a(nB,n,code) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: nB !< Number of bytes of single element of n. - real(R8P), intent(IN):: n(1:) !< Array of numbers to be encoded. - character(1), allocatable, intent(OUT):: code(:) !< Encoded array. - integer(I1P):: nI1P(1:((size(n,dim=1)*nB+2)/3)*3) !< One byte integer array containing n. - integer(I4P):: padd !< Number of padding characters ('='). - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - if (allocated(code)) deallocate(code) ; allocate(code(1:((size(n,dim=1)*nB+2)/3)*4)) ! allocating code chars - nI1P = transfer(n,nI1P) ! casting n to integer array of 1 byte elem - padd = mod((size(n,dim=1)*nB),3_I4P) ; if (padd>0_I4P) padd = 3_I4P - padd ! computing the number of padding characters - call encode_bits(bits=nI1P,padd=padd,code=code) ! encoding bits - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine b64_encode_R8_a - - !> @brief Subroutine for encoding array numbers to base64 (R4P). - pure subroutine b64_encode_R4_a(nB,n,code) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: nB !< Number of bytes of single element of n. - real(R4P), intent(IN):: n(1:) !< Array of numbers to be encoded. - character(1), allocatable, intent(OUT):: code(:) !< Encoded array. - integer(I1P):: nI1P(1:((size(n,dim=1)*nB+2)/3)*3) !< One byte integer array containing n. - integer(I4P):: padd !< Number of padding characters ('='). - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - if (allocated(code)) deallocate(code) ; allocate(code(1:((size(n,dim=1)*nB+2)/3)*4)) ! allocating code chars - nI1P = transfer(n,nI1P) ! casting n to integer array of 1 byte elem - padd = mod((size(n,dim=1)*nB),3_I4P) ; if (padd>0_I4P) padd = 3_I4P - padd ! computing the number of padding characters - call encode_bits(bits=nI1P,padd=padd,code=code) ! encoding bits - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine b64_encode_R4_a - - !> @brief Subroutine for encoding array numbers to base64 (I8P). - pure subroutine b64_encode_I8_a(nB,n,code) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: nB !< Number of bytes of single element of n. - integer(I8P), intent(IN):: n(1:) !< Array of numbers to be encoded. - character(1), allocatable, intent(OUT):: code(:) !< Encoded array. - integer(I1P):: nI1P(1:((size(n,dim=1)*nB+2)/3)*3) !< One byte integer array containing n. - integer(I4P):: padd !< Number of padding characters ('='). - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - if (allocated(code)) deallocate(code) ; allocate(code(1:((size(n,dim=1)*nB+2)/3)*4)) ! allocating code chars - nI1P = transfer(n,nI1P) ! casting n to integer array of 1 byte elem - padd = mod((size(n,dim=1)*nB),3_I4P) ; if (padd>0_I4P) padd = 3_I4P - padd ! computing the number of padding characters - call encode_bits(bits=nI1P,padd=padd,code=code) ! encoding bits - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine b64_encode_I8_a - - !> @brief Subroutine for encoding array numbers to base64 (I4P). - pure subroutine b64_encode_I4_a(nB,n,code) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: nB !< Number of bytes of single element of n. - integer(I4P), intent(IN):: n(1:) !< Array of numbers to be encoded. - character(1), allocatable, intent(OUT):: code(:) !< Encoded array. - integer(I1P):: nI1P(1:((size(n,dim=1)*nB+2)/3)*3) !< One byte integer array containing n. - integer(I4P):: padd !< Number of padding characters ('='). - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - if (allocated(code)) deallocate(code) ; allocate(code(1:((size(n,dim=1)*nB+2)/3)*4)) ! allocating code chars - nI1P = transfer(n,nI1P) ! casting n to integer array of 1 byte elem - padd = mod((size(n,dim=1)*nB),3_I4P) ; if (padd>0_I4P) padd = 3_I4P - padd ! computing the number of padding characters - call encode_bits(bits=nI1P,padd=padd,code=code) ! encoding bits - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine b64_encode_I4_a - - !> @brief Subroutine for encoding array numbers to base64 (I2P). - pure subroutine b64_encode_I2_a(nB,n,code) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: nB !< Number of bytes of single element of n. - integer(I2P), intent(IN):: n(1:) !< Array of numbers to be encoded. - character(1), allocatable, intent(OUT):: code(:) !< Encoded array. - integer(I1P):: nI1P(1:((size(n,dim=1)*nB+2)/3)*3) !< One byte integer array containing n. - integer(I4P):: padd !< Number of padding characters ('='). - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - if (allocated(code)) deallocate(code) ; allocate(code(1:((size(n,dim=1)*nB+2)/3)*4)) ! allocating code chars - nI1P = transfer(n,nI1P) ! casting n to integer array of 1 byte elem - padd = mod((size(n,dim=1)*nB),3_I4P) ; if (padd>0_I4P) padd = 3_I4P - padd ! computing the number of padding characters - call encode_bits(bits=nI1P,padd=padd,code=code) ! encoding bits - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine b64_encode_I2_a - - !> @brief Subroutine for encoding array numbers to base64 (I1P). - pure subroutine b64_encode_I1_a(nB,n,code) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: nB !< Number of bytes of single element of n. - integer(I1P), intent(IN):: n(1:) !< Array of numbers to be encoded. - character(1), allocatable, intent(OUT):: code(:) !< Encoded array. - integer(I1P):: nI1P(1:((size(n,dim=1)*nB+2)/3)*3) !< One byte integer array containing n. - integer(I4P):: padd !< Number of padding characters ('='). - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - if (allocated(code)) deallocate(code) ; allocate(code(1:((size(n,dim=1)*nB+2)/3)*4)) ! allocating code chars - nI1P = transfer(n,nI1P) ! casting n to integer array of 1 byte elem - padd = mod((size(n,dim=1)*nB),3_I4P) ; if (padd>0_I4P) padd = 3_I4P - padd ! computing the number of padding characters - call encode_bits(bits=nI1P,padd=padd,code=code) ! encoding bits - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine b64_encode_I1_a - - !!> @brief Subroutine for decoding array numbers from base64 (R8P). - !pure subroutine b64_decode_R8_a(code,n) - !!-------------------------------------------------------------------------------------------------------------------------------- - !implicit none - !real(R8P), intent(OUT):: n(1:) !< Number to be decoded. - !character(ncR8P*size(n,dim=1)), intent(IN):: code !< Encoded number. - !integer(I4P):: c,d !< Counters. - !!-------------------------------------------------------------------------------------------------------------------------------- - - !!-------------------------------------------------------------------------------------------------------------------------------- - !d = 1_I4P - !do c=1,len(code),ncR8P - ! call b64_decode_R8_s(code=code(c:c+ncR8P-1),n=n(d)) - ! d = d + 1_I4P - !enddo - !return - !!-------------------------------------------------------------------------------------------------------------------------------- - !endsubroutine b64_decode_R8_a - !> @} -endmodule Lib_Base64 diff --git a/lib/Lib_VTK_IO.f90 b/lib/Lib_VTK_IO.f90 deleted file mode 100644 index 62a838189..000000000 --- a/lib/Lib_VTK_IO.f90 +++ /dev/null @@ -1,6070 +0,0 @@ -!> @addtogroup PrivateVarPar Private Variables and Parameters -!> List of private variables and parameters. -!> @addtogroup Interface Interfaces -!> List of explicitly defined interface. -!> @addtogroup Library Modules Libraries -!> List of modules containing libraries of procedures. -!> @addtogroup PublicProcedure Public Procedures -!> List of public procedures. -!> @addtogroup PrivateProcedure Private Procedures -!> List of private procedures. - -!> @ingroup Library -!> @{ -!> @defgroup Lib_VTK_IOLibrary Lib_VTK_IO -!> @} - -!> @ingroup Interface -!> @{ -!> @defgroup Lib_VTK_IOInterface Lib_VTK_IO -!> @} - -!> @ingroup PrivateVarPar -!> @{ -!> @defgroup Lib_VTK_IOPrivateVarPar Lib_VTK_IO -!> @} - -!> @ingroup PublicProcedure -!> @{ -!> @defgroup Lib_VTK_IOPublicProcedure Lib_VTK_IO -!> @} - -!> @ingroup PrivateProcedure -!> @{ -!> @defgroup Lib_VTK_IOPrivateProcedure Lib_VTK_IO -!> @} - -!> @brief This is a library of functions for Input and Output pure Fortran data in VTK format. -!> @details It is useful for Paraview visualization tool. Even though there are many wrappers/porting of the VTK source -!> code (C++ code), there is not a Fortran one. This library is not a porting or a wrapper of the VTK code, -!> but it only an exporter/importer of the VTK data format written in pure Fortran language (standard Fortran 2003 or -!> higher) that can be used by Fortran coders (yes, there are still a lot of these brave coders...) without mixing Fortran -!> with C++ language. Fortran is still the best language for high performance computing for scientific purpose, like CFD -!> computing. It is necessary a tool to deal with VTK standard directly by Fortran code. The library was made to fill -!> this empty: it is a simple Fortran module able to export native Fortran data into VTK data format and to import VTK -!> data into a Fortran code, both in ascii and binary file format. -!> -!> The library provides an automatic way to deal with VTK data format: all the formatting processes is nested into the -!> library and users communicate with it by a simple API passing only native Fortran data (Fortran scalars and arrays). -!> -!> The library is still in developing and testing, this is first usable release, but there are not all the features of -!> the stable release (the importer is totally absent and the exporter is not complete). Surely there are a lot of bugs -!> and the programming style is not the best, but the exporters are far-complete. -!> -!> The supported VTK features are: -!> - Exporters: -!> - Legacy standard: -!> - Structured Points; -!> - Structured Grid; -!> - Unstructured Grid; -!> - Polydata (\b missing); -!> - Rectilinear Grid; -!> - Field (\b missing); -!> - XML standard: -!> - serial dataset: -!> - Image Data (\b missing); -!> - Polydata (\b missing); -!> - Rectilinear Grid; -!> - Structured Grid; -!> - Unstructured Grid; -!> - parallel (partitioned) dataset: -!> - Image Data (\b missing); -!> - Polydata (\b missing); -!> - Rectilinear Grid; -!> - Structured Grid; -!> - Unstructured Grid; -!> - composite dataset: -!> - vtkMultiBlockDataSet; -!> - Importers are \b missing. -!> -!> @libvtk can handle multiple concurrent files and it is \b thread/processor-safe (meaning that can be safely used into -!> parallel frameworks as OpenMP or MPI, see \ref SpeedUP "Parallel Frameworks Benchmarks"). -!> -!> The library is an open source project, it is distributed under the GPL v3. Anyone is interest to use, to develop or -!> to contribute to @libvtk is welcome. -!> -!> It can be found at: https://github.com/szaghi/Lib_VTK_IO -!> -!> @par VTK_Standard -!> VTK, Visualization Toolkit, is an open source software that provides a powerful framework for the computer graphic, for -!> the images processing and for 3D rendering. It is widely used in the world and so it has a very large community of users, -!> besides the Kitware (The Kitware homepage can be found here: http://public.kitware.com) company provides professional -!> support. The toolkit is written in C++ and a lot of porting/wrappers for Tcl/Tk, Java and Python are provided, unlucky -!> there aren't wrappers for Fortran. -!> -!> Because of its good features the VTK toolkit has been used to develop a large set of open source programs. For my work -!> the most important family of programs is the scientific visualization programs. A lot of high-quality scientific -!> visualization tool are available on the web but for me the best is ParaView: I think that it is one of the best -!> scientific visualization program in the world and it is open source! Paraview is based on VTK. -!> @par Paraview -!> ParaView (The ParaView homepage can be found here: http://www.paraview.org) is an open source software voted to scientific -!> visualization and able to use the power of parallel architectures. It has an architecture client-server in order to make -!> easy the remote visualization of very large set of data. Because it is based on VTK it inherits all VTK features. ParaView -!> is very useful for Computational Fluid Dynamics visualizations because it provides powerful post-processing tools, it -!> provides a very large set of importers for the most used format like Plot3D and HDF (the list is very large). It is easy to -!> extend ParaView because it supports all the scripting language supported by VTK. -!> @note All the @libvtk functions are I4P integer functions: the returned integer output is 0 if the function calling has -!> been completed right while it is >0 if some errors occur (the error handling is only at its embryonic phase). Therefore the -!> functions calling must be done in the following way: \n -!> @code -!> ... -!> integer(I4P):: E_IO -!> ... -!> E_IO = VTK_INI(.... -!> ... @endcode -!> @libvtk programming style is based on two main principles: portable kind-precision of reals and integers -!> variables and dynamic dispatching. Using dynamic dispatching @libvtk has a simple API. The user calls -!> a generic procedure (VTK_INI, VTK_GEO,...) and the library, depending on the type and number of the inputs passed, calls the -!> correct internal function (i.e. VTK_GEO for R8P real type if the input passed is R8P real type). By this interface only few -!> functions are used without the necessity of calling a different function for each different input type. -!> Dynamic dispatching is based on the internal kind-precision/rank selecting convention: Fortran 90/95 standard has introduced some -!> useful functions to achieve the portability of reals and integers precision and @libvtk uses these functions to define portable -!> kind-precision; to this aim @libvtk uses IR_Precision module. -!> @author Stefano Zaghi -!> @version 1.1 -!> @date 2013-05-23 -!> @par News -!> - Added packed API and 3D(or higher) arrays for VTK_VAR_XML function: this avoids the necessity of explicit reshape of -!> multi-dimensional arrays containing saved variables in VAR callings; the following inputs are now available: -!> - scalar input: -!> - input is 1D-rank array: var[1:NC_NN]; -!> - input is 3D-rank array: var[nx1:nx2,ny1:ny2,nz1:nz2]; -!> - vectorial inputs: -!> - inputs are 1D-rank arrays: varX[1:NC_NN],varY[1:NC_NN],varZ[1:NC_NN]; -!> - inputs are 3D-rank arrays: varX[nx1:nx2,ny1:ny2,nz1:nz2],varY[nx1:nx2,ny1:ny2,nz1:nz2],varX[nx1:nx2,ny1:ny2,nz1:nz2]; -!> - 3D(or higher) vectorial inputs: -!> - input is 1D-rank (packed API): var[1:N_COL,1:NC_NN]; -!> - input is 3D-rank (packed API): var[1:N_COL,nx1:nx2,ny1:ny2,nz1:nz2]. -!> - Added packed API and 3D arrays for VTK_GEO and VTK_GEO_XML function: this avoids the necessity of explicit reshape of -!> multi-dimensional arrays containing X, Y and Z coordinates in GEO callings; the following inputs are now available: -!> - StructuredGrid (NN is the number of grid points, n\#1-n\#2, \#x,y,z are the domain extents): -!> - 1D arrays of size NN: X[1:NN],Y[1:NN],Z[1:NN]; -!> - 3D arrays of size NN: X[nx1:nx2,ny1:ny2,nz1:nz2],Y[nx1:nx2,ny1:ny2,nz1:nz2],Z[nx1:nx2,ny1:ny2,nz1:nz2]; -!> - 1D array of size 3*NN (packed API): XYZ[1:3,1:NN]; -!> - 3D array of size 3*NN (packed API): XYZ[1:3,nx1:nx2,ny1:ny2,nz1:nz2]. -!> - UnStructuredGrid (NN is the number of grid points): -!> - 1D arrays of size NN: X[1:NN],Y[1:NN],Z[1:NN]; -!> - 1D array of size 3*NN (packed API): XYZ[1:3,1:NN]. -!> - Added base64 encoding format: the output format specifier of VTK_INI_XML has been changed: -!> - output_format = 'ascii' means \b ascii data, the same as the previous version; -!> - output_format = 'binary' means \b base64 encoded data, different from the previous version where it meant appended -!> raw-binary data; base64 encoding was missing in the previous version; -!> - output_format = 'raw' means \b appended \b raw-binary data, as 'binary' of the previous version; -!> - Added support for OpenMP multi-threads framework; -!> - Correct bug affecting binary output; -!> - implement concurrent multiple files IO capability; -!> - implement FieldData tag for XML files, useful for tagging dataset with global auxiliary data, e.g. time, time step, ecc; -!> - implement Parallel (Partitioned) XML files support (.pvtu,.pvts,.pvtr); -!> - implement Driver testing program for providing practical examples of @libvtk usage; -!> - added support for parallel framework, namely OpenMP (thread-safe) and MPI (process-safe). -!> @copyright GNU Public License version 3. -!> @note The supported compilers are GNU gfortran 4.7.x (or higher) and Intel Fortran 12.x (or higher). @libvtk needs a modern -!> compiler providing support for some Fortran standard 2003 features. -!> @todo \b CompleteExporter: Complete the exporters -!> @todo \b CompleteImporter: Complete the importers -!> @todo \b DocExamples: Complete the documentation of examples -!> @todo \b g95_test: Test g95 compiler -!> @bug XML-Efficiency: \n This is not properly a bug. There is an inefficiency when saving XML raw (binary) file. To write -!> raw data into XML file @libvtk uses a temporary scratch file to save binary data while saving all -!> formatting data to the final XML file. Only when all XML formatting data have been written the -!> scratch file is rewind and the binary data is saved in the final tag of XML file as \b raw -!> \b appended data. This approach is not efficient. -!> @ingroup Lib_VTK_IOLibrary -module Lib_VTK_IO -!----------------------------------------------------------------------------------------------------------------------------------- -USE IR_Precision ! Integers and reals precision definition. -USE Lib_Base64 ! Base64 encoding/decoding procedures. -USE, intrinsic:: ISO_FORTRAN_ENV, only: stdout=>OUTPUT_UNIT, stderr=>ERROR_UNIT ! Standard output/error logical units. -!----------------------------------------------------------------------------------------------------------------------------------- - -!----------------------------------------------------------------------------------------------------------------------------------- -implicit none -private -save -! functions for VTK XML -public:: VTK_INI_XML -public:: VTK_FLD_XML -public:: VTK_GEO_XML -public:: VTK_CON_XML -public:: VTK_DAT_XML -public:: VTK_VAR_XML -public:: VTK_END_XML -! functions for VTM XML -public:: VTM_INI_XML -public:: VTM_BLK_XML -public:: VTM_WRF_XML -public:: VTM_END_XML -! functions for PVTK XML -public:: PVTK_INI_XML -public:: PVTK_GEO_XML -public:: PVTK_DAT_XML -public:: PVTK_VAR_XML -public:: PVTK_END_XML -! functions for VTK LEGACY -public:: VTK_INI -public:: VTK_GEO -public:: VTK_CON -public:: VTK_DAT -public:: VTK_VAR -public:: VTK_END -!----------------------------------------------------------------------------------------------------------------------------------- - -!----------------------------------------------------------------------------------------------------------------------------------- -!> @brief Function for saving field data (global auxiliary data, eg time, step number, dataset name, etc). -!> VTK_FLD_XML is an interface to 7 different functions, there are 2 functions for real field data, 4 functions for integer one -!> and one function for open and close field data tag. -!> @remark VTK_FLD_XML must be called after VTK_INI_XML and befor VTK_GEO_XML. It must always called three times at least: 1) for -!> opening the FieldData tag, 2) for saving at least one FieldData entry and 3) for closing the FieldData tag. -!> Examples of usage are: \n -!> \b saving the time and step cicle counter of current dataset: \n -!> @code ... -!> real(R8P):: time -!> integer(I4P):: step -!> ... -!> E_IO=VTK_FLD_XML(fld_action='open') -!> E_IO=VTK_FLD_XML(fld=time,fname='TIME') -!> E_IO=VTK_FLD_XML(fld=step,fname='CYCLE') -!> E_IO=VTK_FLD_XML(fld_action='close') -!> ... @endcode -!> @ingroup Lib_VTK_IOInterface -interface VTK_FLD_XML - module procedure VTK_FLD_XML_OC, & ! open/close field data tag - VTK_FLD_XML_R8, & ! real(R8P) scalar - VTK_FLD_XML_R4, & ! real(R4P) scalar - VTK_FLD_XML_I8, & ! integer(I8P) scalar - VTK_FLD_XML_I4, & ! integer(I4P) scalar - VTK_FLD_XML_I2, & ! integer(I2P) scalar - VTK_FLD_XML_I1 ! integer(I1P) scalar -endinterface -!> @brief Function for saving mesh with different topologies in VTK-XML standard. -!> VTK_GEO_XML is an interface to 15 different functions; there are 2 functions for each of 3 topologies supported and a function -!> for closing XML pieces: one function for mesh coordinates with R8P precision and one for mesh coordinates with R4P precision. -!> @remark 1D/3D-rank arrays and packed API for any kinds \n -!> - For StructuredGrid there are 4 functions for each real kinds: -!> - inputs are 1D-rank arrays: X[1:NN],Y[1:NN],Z[1:NN]; -!> - inputs are 3D-rank arrays: X[nx1:nx2,ny1:ny2,nz1:nz2],Y[nx1:nx2,ny1:ny2,nz1:nz2],Z[nx1:nx2,ny1:ny2,nz1:nz2]; -!> - input is 1D-rank array (packed API): XYZ[1:3,1:NN]; -!> - input is 3D-rank array (packed API): XYZ[1:3,nx1:nx2,ny1:ny2,nz1:nz2]. -!> - For UnStructuredGrid there are 2 functions for each real kinds: -!> - inputs are 1D arrays: X[1:NN],Y[1:NN],Z[1:NN]; -!> - input is 1D array (packed API): XYZ[1:3,1:NN]. -!> -!> @remark VTK_GEO_XML must be called after VTK_INI_XML. It saves the mesh geometry. The inputs that must be passed -!> change depending on the topologies chosen. Not all VTK topologies have been implemented (\em polydata topologies are absent). -!> @note The XML standard is more powerful than legacy. XML file can contain more than 1 mesh with its -!> associated variables. Thus there is the necessity to close each \em pieces that compose the data-set saved in the -!> XML file. The VTK_GEO_XML called in the close piece format is used just to close the -!> current piece before saving another piece or closing the file. \n -!> Examples of usage are: \n -!> \b Structured grid calling: \n -!> @code ... -!> integer(I4P):: nx1,nx2,ny1,ny2,nz1,nz2,NN -!> real(R8P):: X(1:NN),Y(1:NN),Z(1:NN) -!> ... -!> E_IO=VTK_GEO_XML(nx1,nx2,ny1,ny2,nz1,nz2,Nn,X,Y,Z) -!> ... @endcode -!> \b Rectilinear grid calling: \n -!> @code ... -!> integer(I4P):: nx1,nx2,ny1,ny2,nz1,nz2 -!> real(R8P):: X(nx1:nx2),Y(ny1:ny2),Z(nz1:nz2) -!> ... -!> E_IO=VTK_GEO_XML(nx1,nx2,ny1,ny2,nz1,nz2,X,Y,Z) -!> ... @endcode -!> \b Unstructured grid calling: \n -!> @code ... -!> integer(I4P):: Nn,Nc -!> real(R8P):: X(1:Nn),Y(1:Nn),Z(1:Nn) -!> ... -!> E_IO=VTK_GEO_XML(Nn,Nc,X,Y,Z) -!> ... @endcode -!> \b Closing piece calling: 1n -!> @code ... -!> E_IO=VTK_GEO_XML() -!> ... @endcode -!> @ingroup Lib_VTK_IOInterface -interface VTK_GEO_XML - module procedure VTK_GEO_XML_STRG_1DA_R8, VTK_GEO_XML_STRG_3DA_R8, & ! real(R8P) StructuredGrid, 1D/3D Arrays - VTK_GEO_XML_STRG_1DAP_R8,VTK_GEO_XML_STRG_3DAP_R8, & ! real(R8P) StructuredGrid, 1D/3D Arrays packed API - VTK_GEO_XML_STRG_1DA_R4, VTK_GEO_XML_STRG_3DA_R4, & ! real(R4P) StructuredGrid, 1D/3D Arrays - VTK_GEO_XML_STRG_1DAP_R4,VTK_GEO_XML_STRG_3DAP_R4, & ! real(R4P) StructuredGrid, 1D/3D Arrays packed API - VTK_GEO_XML_RECT_R8, & ! real(R8P) RectilinearGrid - VTK_GEO_XML_RECT_R4, & ! real(R4P) RectilinearGrid - VTK_GEO_XML_UNST_R8,VTK_GEO_XML_UNST_PACK_R4, & ! real(R8P) UnstructuredGrid, standard and packed API - VTK_GEO_XML_UNST_R4,VTK_GEO_XML_UNST_PACK_R8, & ! real(R4P) UnstructuredGrid, standard and packed API - VTK_GEO_XML_CLOSEP ! closing tag "Piece" function -endinterface -!> @brief Function for saving data variable(s) in VTK-XML standard. -!> VTK_VAR_XML is an interface to 36 different functions, there are 6 functions for scalar variables, 6 functions for vectorial -!> variables and 6 functions for 3D(or higher) vectorial variables: for all of types the precision can be R8P, R4P, I8P, I4P, I2P -!> and I1P. This function saves the data variables related (cell-centered or node-centered) to geometric mesh. -!> @remark 1D/3D-rank arrays and packed API for any kinds \n -!> The inputs arrays can be passed as 1D-rank or 3D-rank and the vectorial variables can be component-separated (one for each of -!> the 3 components) or packed into one multidimensional array: -!> - scalar input: -!> - input is 1D-rank array: var[1:NC_NN]; -!> - input is 3D-rank array: var[nx1:nx2,ny1:ny2,nz1:nz2]; -!> - vectorial inputs: -!> - inputs are 1D-rank arrays: varX[1:NC_NN],varY[1:NC_NN],varZ[1:NC_NN]; -!> - inputs are 3D-rank arrays: varX[nx1:nx2,ny1:ny2,nz1:nz2],varY[nx1:nx2,ny1:ny2,nz1:nz2],varX[nx1:nx2,ny1:ny2,nz1:nz2]; -!> - 3D(or higher) vectorial inputs: -!> - input is 1D-rank (packed API): var[1:N_COL,1:NC_NN]; -!> - input is 3D-rank (packed API): var[1:N_COL,nx1:nx2,ny1:ny2,nz1:nz2]. -!> -!> @remark Note that the inputs that must be passed change depending on the data variables type. -!> -!> @note Examples of usage are: \n -!> \b Scalar data calling: \n -!> @code ... -!> integer(I4P):: NN -!> real(R8P):: var(1:NN) -!> ... -!> E_IO=VTK_VAR_XML(NN,'Sca',var) -!> ... @endcode -!> \b Vectorial data calling: \n -!> @code ... -!> integer(I4P):: NN -!> real(R8P):: varX(1:NN),varY(1:NN),varZ(1:NN), -!> ... -!> E_IO=VTK_VAR_XML(NN,'Vec',varX,varY,varZ) -!> ... @endcode -!> @ingroup Lib_VTK_IOInterface -interface VTK_VAR_XML - module procedure VTK_VAR_XML_SCAL_1DA_R8,VTK_VAR_XML_SCAL_3DA_R8, & ! real(R8P) scalar 1D/3D array - VTK_VAR_XML_SCAL_1DA_R4,VTK_VAR_XML_SCAL_3DA_R4, & ! real(R4P) scalar 1D/3D array - VTK_VAR_XML_SCAL_1DA_I8,VTK_VAR_XML_SCAL_3DA_I8, & ! integer(I8P) scalar 1D/3D array - VTK_VAR_XML_SCAL_1DA_I4,VTK_VAR_XML_SCAL_3DA_I4, & ! integer(I4P) scalar 1D/3D array - VTK_VAR_XML_SCAL_1DA_I2,VTK_VAR_XML_SCAL_3DA_I2, & ! integer(I2P) scalar 1D/3D array - VTK_VAR_XML_SCAL_1DA_I1,VTK_VAR_XML_SCAL_3DA_I1, & ! integer(I1P) scalar 1D/3D array - VTK_VAR_XML_VECT_1DA_R8,VTK_VAR_XML_VECT_3DA_R8, & ! real(R8P) vectorial 1D/3D arrays - VTK_VAR_XML_VECT_1DA_R4,VTK_VAR_XML_VECT_3DA_R4, & ! real(R4P) vectorial 1D/3D arrays - VTK_VAR_XML_VECT_1DA_I8,VTK_VAR_XML_VECT_3DA_I8, & ! integer(I8P) vectorial 1D/3D arrays - VTK_VAR_XML_VECT_1DA_I4,VTK_VAR_XML_VECT_3DA_I4, & ! integer(I4P) vectorial 1D/3D arrays - VTK_VAR_XML_VECT_1DA_I2,VTK_VAR_XML_VECT_3DA_I2, & ! integer(I2P) vectorial 1D/3D arrays - VTK_VAR_XML_VECT_1DA_I1,VTK_VAR_XML_VECT_3DA_I1, & ! integer(I1P) vectorial 1D/3D arrays - VTK_VAR_XML_LIST_1DA_R8,VTK_VAR_XML_LIST_3DA_R8, & ! real(R8P) list 1D/3D array - VTK_VAR_XML_LIST_1DA_R4,VTK_VAR_XML_LIST_3DA_R4, & ! real(R4P) list 1D/3D array - VTK_VAR_XML_LIST_1DA_I8,VTK_VAR_XML_LIST_3DA_I8, & ! integer(I4P) list 1D/3D array - VTK_VAR_XML_LIST_1DA_I4,VTK_VAR_XML_LIST_3DA_I4, & ! integer(I4P) list 1D/3D array - VTK_VAR_XML_LIST_1DA_I2,VTK_VAR_XML_LIST_3DA_I2, & ! integer(I2P) list 1D/3D array - VTK_VAR_XML_LIST_1DA_I1,VTK_VAR_XML_LIST_3DA_I1 ! integer(I1P) list 1D/3D array -endinterface -!> @brief Function for saving mesh with different topologies in VTK-legacy standard. -!> VTK_GEO is an interface to 16 different functions, there are 2 functions for each of 4 different topologies actually supported: -!> one function for mesh coordinates with R8P precision and one for mesh coordinates with R4P precision. -!> @remark This function must be called after VTK_INI. It saves the mesh geometry. The inputs that must be passed change depending -!> on the topologies chosen. Not all VTK topologies have been implemented (\em polydata topologies are absent). -!> @note Examples of usage are: \n -!> \b Structured points calling: \n -!> @code ... -!> integer(I4P):: Nx,Ny,Nz -!> real(I8P):: X0,Y0,Z0,Dx,Dy,Dz -!> ... -!> E_IO=VTK_GEO(Nx,Ny,Nz,X0,Y0,Z0,Dx,Dy,Dz) -!> ... @endcode -!> \b Structured grid calling: \n -!> @code ... -!> integer(I4P):: Nx,Ny,Nz,Nnodes -!> real(R8P):: X(1:Nnodes),Y(1:Nnodes),Z(1:Nnodes) -!> ... -!> E_IO=VTK_GEO(Nx,Ny,Nz,Nnodes,X,Y,Z) -!> ... @endcode -!> \b Rectilinear grid calling: \n -!> @code ... -!> integer(I4P):: Nx,Ny,Nz -!> real(R8P):: X(1:Nx),Y(1:Ny),Z(1:Nz) -!> ... -!> E_IO=VTK_GEO(Nx,Ny,Nz,X,Y,Z) -!> ... @endcode -!> \b Unstructured grid calling: \n -!> @code ... -!> integer(I4P):: NN -!> real(R4P):: X(1:NN),Y(1:NN),Z(1:NN) -!> ... -!> E_IO=VTK_GEO(NN,X,Y,Z) -!> ... @endcode -!> @ingroup Lib_VTK_IOInterface -interface VTK_GEO - module procedure VTK_GEO_UNST_R8,VTK_GEO_UNST_P_R8, & ! real(R8P) UNSTRUCTURED_GRID, standard and packed API - VTK_GEO_UNST_R4,VTK_GEO_UNST_P_R4, & ! real(R4P) UNSTRUCTURED_GRID, standard and packed API - VTK_GEO_STRP_R8, & ! real(R8P) STRUCTURED_POINTS - VTK_GEO_STRP_R4, & ! real(R4P) STRUCTURED_POINTS - VTK_GEO_STRG_1DA_R8, VTK_GEO_STRG_3DA_R8, & ! real(R8P) STRUCTURED_GRID 1D/3D arrays - VTK_GEO_STRG_1DAP_R8,VTK_GEO_STRG_3DAP_R8, & ! real(R8P) STRUCTURED_GRID 1D/3D arrays, packed API - VTK_GEO_STRG_1DA_R4, VTK_GEO_STRG_3DA_R4, & ! real(R4P) STRUCTURED_GRID 1D/3D arrays - VTK_GEO_STRG_1DAP_R4,VTK_GEO_STRG_3DAP_R4, & ! real(R4P) STRUCTURED_GRID 1D/3D arrays, packed API - VTK_GEO_RECT_R8, & ! real(R8P) RECTILINEAR_GRID - VTK_GEO_RECT_R4 ! real(R4P) RECTILINEAR_GRID -endinterface -!> @brief Function for saving data variable(s) in VTK-legacy standard. -!> VTK_VAR is an interface to 8 different functions, there are 3 functions for scalar variables, 3 functions for vectorial -!> variables and 2 functions texture variables: scalar and vectorial data can be R8P, R4P and I4P data while texture variables can -!> be only R8P or R4P. -!> This function saves the data variables related to geometric mesh. -!> @remark The inputs that must be passed change depending on the data -!> variables type. -!> @note Examples of usage are: \n -!> \b Scalar data calling: \n -!> @code ... -!> integer(I4P):: NN -!> real(R4P):: var(1:NN) -!> ... -!> E_IO=VTK_VAR(NN,'Sca',var) -!> ... @endcode -!> \b Vectorial data calling: \n -!> @code ... -!> integer(I4P):: NN -!> real(R4P):: varX(1:NN),varY(1:NN),varZ(1:NN) -!> ... -!> E_IO=VTK_VAR('vect',NN,'Vec',varX,varY,varZ) -!> ... @endcode -!> @ingroup Lib_VTK_IOInterface -interface VTK_VAR - module procedure VTK_VAR_SCAL_R8, & ! real(R8P) scalar - VTK_VAR_SCAL_R4, & ! real(R4P) scalar - VTK_VAR_SCAL_I4, & ! integer(I4P) scalar - VTK_VAR_VECT_R8, & ! real(R8P) vectorial - VTK_VAR_VECT_R4, & ! real(R4P) vectorial - VTK_VAR_VECT_I4, & ! integer(I4P) vectorial - VTK_VAR_TEXT_R8, & ! real(R8P) vectorial (texture) - VTK_VAR_TEXT_R4 ! real(R4P) vectorial (texture) -endinterface -!----------------------------------------------------------------------------------------------------------------------------------- - -!----------------------------------------------------------------------------------------------------------------------------------- -!> @ingroup Lib_VTK_IOPrivateVarPar -!> @{ -! The library uses a small set of internal variables that are private (not accessible from the outside). The following are -! private variables. -! Parameters: -integer(I4P), parameter:: maxlen = 500 !< Max number of characters of static string. -character(1), parameter:: end_rec = char(10) !< End-character for binary-record finalize. -integer(I4P), parameter:: ascii = 0 !< Ascii-output-format parameter identifier. -integer(I4P), parameter:: binary = 1 !< Base64-output-format parameter identifier. -integer(I4P), parameter:: raw = 2 !< Raw-appended-binary-output-format parameter identifier. -integer(I4P), parameter:: bin_app = 3 !< Base64-appended-output-format parameter identifier. -! VTK file data: -type:: Type_VTK_File - integer(I4P):: f = ascii !< Current output-format (initialized to ascii format). - character(len=maxlen):: topology = '' !< Mesh topology. - integer(I4P):: u = 0_I4P !< Logical unit. - integer(I4P):: ua = 0_I4P !< Logical unit for raw binary XML append file. -#ifdef HUGE - integer(I8P):: N_Byte = 0_I8P !< Number of byte to be written/read. -#else - integer(I4P):: N_Byte = 0_I4P !< Number of byte to be written/read. -#endif - integer(I8P):: ioffset = 0_I8P !< Offset pointer. - integer(I4P):: indent = 0_I4P !< Indent pointer. - contains - procedure:: byte_update ! Procedure for updating N_Byte and ioffset pointer. -endtype Type_VTK_File -type(Type_VTK_File), allocatable:: vtk(:) !< Global data of VTK files [1:Nvtk]. -integer(I4P):: Nvtk = 0_I4P !< Number of (concurrent) VTK files. -integer(I4P):: f = 0_I4P !< Current VTK file index. -! VTM file data: -type:: Type_VTM_File - integer(I4P):: u = 0_I4P !< Logical unit. - integer(I4P):: blk = 0_I4P !< Block index. - integer(I4P):: indent = 0_I4P !< Indent pointer. -endtype Type_VTM_File -type(Type_VTM_File):: vtm !< Global data of VTM files. -!> @} -!----------------------------------------------------------------------------------------------------------------------------------- -contains - ! The library uses five auxiliary procedures that are private thus they cannot be called outside the library. - !> @ingroup Lib_VTK_IOPrivateProcedure - !> @{ - !> @brief Function for getting a free logic unit. The users of @libvtk does not know which is the logical - !> unit: @libvtk uses this information without boring the users. The logical unit used is safe-free: if the program - !> calling @libvtk has others logical units used @libvtk will never use these units, but will choice one that is free. - !>@return Free_Unit - integer function Get_Unit(Free_Unit) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(OUT), optional:: Free_Unit !< Free logic unit. - integer:: n1 !< Counter. - integer:: ios !< Inquiring flag. - logical:: lopen !< Inquiring flag. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - Get_Unit = -1 - n1=1 - do - if ((n1/=stdout).AND.(n1/=stderr)) then - inquire(unit=n1,opened=lopen,iostat=ios) - if (ios==0) then - if (.NOT.lopen) then - Get_Unit = n1 ; if (present(Free_Unit)) Free_Unit = Get_Unit - return - endif - endif - endif - n1=n1+1 - enddo - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction Get_Unit - - !> @brief Function for converting lower case characters of a string to upper case ones. @libvtk uses this function in - !> order to achieve case-insensitive: all character variables used within @libvtk functions are pre-processed by - !> Uppper_Case function before these variables are used. So the users can call @libvtk functions without pay attention of - !> the case of the keywords passed to the functions: calling the function VTK_INI with the string - !> E_IO = VTK_INI('Ascii',...) is equivalent to E_IO = VTK_INI('ASCII',...). - !>@return Upper_Case - elemental function Upper_Case(string) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(len=*), intent(IN):: string !< String to be converted. - character(len=len(string)):: Upper_Case !< Converted string. - integer:: n1 !< Characters counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - Upper_Case = string - do n1=1,len(string) - select case(ichar(string(n1:n1))) - case(97:122) - Upper_Case(n1:n1)=char(ichar(string(n1:n1))-32) ! Upper case conversion - endselect - enddo - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction Upper_Case - - !> @brief Subroutine for updating N_Byte and ioffset pointer. - elemental subroutine byte_update(vtk,N_Byte) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - class(Type_VTK_File), intent(INOUT):: vtk !< Global data of VTK file. -#ifdef HUGE - integer(I8P), intent(IN):: N_Byte !< Number of bytes saved. -#else - integer(I4P), intent(IN):: N_Byte !< Number of bytes saved. -#endif - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - vtk%N_Byte = N_Byte - if (vtk%f==raw) then -#ifdef HUGE - vtk%ioffset = vtk%ioffset + BYI8P + N_Byte -#else - vtk%ioffset = vtk%ioffset + BYI4P + N_Byte -#endif - else -#ifdef HUGE - vtk%ioffset = vtk%ioffset + ((N_Byte + BYI8P + 2_I8P)/3_I8P)*4_I8P -#else - vtk%ioffset = vtk%ioffset + ((N_Byte + BYI4P + 2_I4P)/3_I4P)*4_I4P -#endif - endif - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine byte_update - - !> @brief Subroutine for updating (adding and removing elements into) vtk array. - pure subroutine vtk_update(act,cf,Nvtk,vtk) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: act !< Action: 'ADD' one more element, 'REMOVE' current element file. - integer(I4P), intent(INOUT):: cf !< Current file index (for concurrent files IO). - integer(I4P), intent(INOUT):: Nvtk !< Number of (concurrent) VTK files. - type(Type_VTK_File), allocatable, intent(INOUT):: vtk(:) !< VTK files data. - type(Type_VTK_File), allocatable:: vtk_tmp(:) !< Temporary array of VTK files data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - select case(Upper_Case(trim(act))) - case('ADD') - if (Nvtk>0_I4P) then - allocate(vtk_tmp(1:Nvtk)) - vtk_tmp = vtk - deallocate(vtk) - Nvtk = Nvtk + 1 - allocate(vtk(1:Nvtk)) - vtk(1:Nvtk-1) = vtk_tmp - deallocate(vtk_tmp) - cf = Nvtk - else - Nvtk = 1_I4P - allocate(vtk(1:Nvtk)) - cf = Nvtk - endif - case default - if (Nvtk>1_I4P) then - allocate(vtk_tmp(1:Nvtk-1)) - if (cf==Nvtk) then - vtk_tmp = vtk(1:Nvtk-1) - else - vtk_tmp(1 :cf-1) = vtk(1 :cf-1) - vtk_tmp(cf: ) = vtk(cf+1: ) - endif - deallocate(vtk) - Nvtk = Nvtk - 1 - allocate(vtk(1:Nvtk)) - vtk = vtk_tmp - deallocate(vtk_tmp) - cf = 1_I4P - else - Nvtk = 0_I4P - if (allocated(vtk)) deallocate(vtk) - cf = Nvtk - endif - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endsubroutine vtk_update - - !> @brief Function for converting array of 1 character to a string of characters. It is used for writing the stream of base64 - !> encoded data. - pure function tochar(string) result (char_string) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(1), intent(IN):: string(1:) !< Array of 1 character. - character(size(string,dim=1)):: char_string !< String of characters. - integer(I4P):: i !< Counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - forall(i = 1:size(string,dim=1)) - char_string(i:i) = string(i) - endforall - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction tochar - !> @} - - !> @brief Function for initializing VTK-XML file. - !> The XML standard is more powerful than legacy one. It is flexible but on the other hand is (but not so more using a library - !> like @libvtk...) complex than legacy standard. The output of XML functions is a well-formated valid XML file, at least for the - !> ascii, binary and binary appended formats (in the raw-binary format @libvtk uses raw-binary-appended format that is not a valid - !> XML file). - !> Note that the XML functions have the same name of legacy functions with the suffix \em XML. - !> @remark This function must be the first to be called. - !> @note Supported output formats are (the passed specifier value is case insensitive): - !> - ASCII: data are saved in ASCII format; - !> - BINARY: data are saved in base64 encoded format; - !> - RAW: data are saved in raw-binary format in the appended tag of the XML file; - !> - BINARY-APPENDED: data are saved in base64 encoded format in the appended tag of the XML file. - !> @note Supported topologies are: - !> - RectilinearGrid; - !> - StructuredGrid; - !> - UnstructuredGrid. - !> @note An example of usage is: \n - !> @code ... - !> integer(I4P):: nx1,nx2,ny1,ny2,nz1,nz2 - !> ... - !> E_IO = VTK_INI_XML('BINARY','XML_RECT_BINARY.vtr','RectilinearGrid',nx1=nx1,nx2=nx2,ny1=ny1,ny2=ny2,nz1=nz1,nz2=nz2) - !> ... @endcode - !> Note that the file extension is necessary in the file name. The XML standard has different extensions for each - !> different topologies (e.g. \em vtr for rectilinear topology). See the VTK-standard file for more information. - !> @return E_IO: integer(I4P) error flag - function VTK_INI_XML(output_format,filename,mesh_topology,cf,nx1,nx2,ny1,ny2,nz1,nz2) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: output_format !< Output format: ASCII, BINARY, RAW or BINARY-APPENDED. - character(*), intent(IN):: filename !< File name. - character(*), intent(IN):: mesh_topology !< Mesh topology. - integer(I4P), intent(OUT), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P), intent(IN), optional:: nx1 !< Initial node of x axis. - integer(I4P), intent(IN), optional:: nx2 !< Final node of x axis. - integer(I4P), intent(IN), optional:: ny1 !< Initial node of y axis. - integer(I4P), intent(IN), optional:: ny2 !< Final node of y axis. - integer(I4P), intent(IN), optional:: nz1 !< Initial node of z axis. - integer(I4P), intent(IN), optional:: nz2 !< Final node of z axis. - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I4P):: rf !< Real file index. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - if (.not.ir_initialized) call IR_Init - call vtk_update(act='add',cf=rf,Nvtk=Nvtk,vtk=vtk) - f = rf - if (present(cf)) cf = rf - vtk(rf)%topology = trim(mesh_topology) - select case(trim(Upper_Case(output_format))) - case('ASCII') - vtk(rf)%f = ascii - open(unit=Get_Unit(vtk(rf)%u),file=trim(filename),form='FORMATTED',& - access='SEQUENTIAL',action='WRITE',status='REPLACE',iostat=E_IO) - ! writing header of file - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)'' - if (endian==endianL) then - s_buffer = '' - else - s_buffer = '' - endif - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) ; vtk(rf)%indent = 2 - select case(trim(vtk(rf)%topology)) - case('RectilinearGrid','StructuredGrid') - s_buffer = repeat(' ',vtk(rf)%indent)//'<'//trim(vtk(rf)%topology)//' WholeExtent="'//& - trim(str(n=nx1))//' '//trim(str(n=nx2))//' '// & - trim(str(n=ny1))//' '//trim(str(n=ny2))//' '// & - trim(str(n=nz1))//' '//trim(str(n=nz2))//'">' - case('UnstructuredGrid') - s_buffer = repeat(' ',vtk(rf)%indent)//'<'//trim(vtk(rf)%topology)//'>' - endselect - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) ; vtk(rf)%indent = vtk(rf)%indent + 2 - case('RAW','BINARY-APPENDED') - vtk(rf)%f = raw - if (trim(Upper_Case(output_format))=='BINARY-APPENDED') vtk(rf)%f = bin_app - open(unit=Get_Unit(vtk(rf)%u),file=trim(filename),& - form='UNFORMATTED',access='STREAM',action='WRITE',status='REPLACE',iostat=E_IO) - ! writing header of file - write(unit=vtk(rf)%u,iostat=E_IO)''//end_rec - if (endian==endianL) then - s_buffer = '' - else - s_buffer = '' - endif - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = 2 - select case(trim(vtk(rf)%topology)) - case('RectilinearGrid','StructuredGrid') - s_buffer = repeat(' ',vtk(rf)%indent)//'<'//trim(vtk(rf)%topology)//' WholeExtent="'//& - trim(str(n=nx1))//' '//trim(str(n=nx2))//' '// & - trim(str(n=ny1))//' '//trim(str(n=ny2))//' '// & - trim(str(n=nz1))//' '//trim(str(n=nz2))//'">' - case('UnstructuredGrid') - s_buffer = repeat(' ',vtk(rf)%indent)//'<'//trim(vtk(rf)%topology)//'>' - endselect - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - ! opening the SCRATCH file used for appending raw binary data - open(unit=Get_Unit(vtk(rf)%ua), form='UNFORMATTED', access='STREAM', action='READWRITE', status='SCRATCH', iostat=E_IO) - vtk(rf)%ioffset = 0 ! initializing offset pointer - case('BINARY') - vtk(rf)%f = binary - open(unit=Get_Unit(vtk(rf)%u),file=trim(filename),& - form='UNFORMATTED',access='STREAM',action='WRITE',status='REPLACE',iostat=E_IO) - ! writing header of file - write(unit=vtk(rf)%u,iostat=E_IO)''//end_rec - if (endian==endianL) then - s_buffer = '' - else - s_buffer = '' - endif - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = 2 - select case(trim(vtk(rf)%topology)) - case('RectilinearGrid','StructuredGrid') - s_buffer = repeat(' ',vtk(rf)%indent)//'<'//trim(vtk(rf)%topology)//' WholeExtent="'//& - trim(str(n=nx1))//' '//trim(str(n=nx2))//' '// & - trim(str(n=ny1))//' '//trim(str(n=ny2))//' '// & - trim(str(n=nz1))//' '//trim(str(n=nz2))//'">' - case('UnstructuredGrid') - s_buffer = repeat(' ',vtk(rf)%indent)//'<'//trim(vtk(rf)%topology)//'>' - endselect - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_INI_XML - - !> @ingroup Lib_VTK_IOPrivateProcedure - !> @{ - !> Function for open/close field data tag. - !> @return E_IO: integer(I4P) error flag - function VTK_FLD_XML_OC(fld_action,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: fld_action !< Field data tag action: OPEN or CLOSE tag. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - integer(I4P):: rf !< Real file index. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(trim(Upper_Case(fld_action))) - case('OPEN') - select case(vtk(rf)%f) - case(ascii) - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent + 2 - case(raw,binary,bin_app) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - endselect - case('CLOSE') - select case(vtk(rf)%f) - case(ascii) - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,binary,bin_app) - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_FLD_XML_OC - - !> Function for saving field data (global auxiliary data, e.g. time, step number, data set name...) (R8P). - !> @return E_IO: integer(I4P) error flag - function VTK_FLD_XML_R8(fld,fname,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - real(R8P), intent(IN):: fld !< Field data value. - character(*), intent(IN):: fname !< Field data name. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: fldp(:) !< Packed field data. - character(1), allocatable:: fld64(:) !< Field data encoded in base64. - integer(I4P):: rf !< Real file index. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer=repeat(' ',vtk(rf)%indent)//''//& - trim(str(n=fld))//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) - case(raw,bin_app) - s_buffer=repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = int(BYR8P,I4P)) - write(unit=vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'R8',1_I4P - write(unit=vtk(rf)%ua,iostat=E_IO)fld - case(binary) - s_buffer=repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int(BYR8P,I4P)],a2=[fld],packed=fldp) - call b64_encode(nB=int(BYI1P,I4P),n=fldp,code=fld64) ; deallocate(fldp) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(fld64)//end_rec ; deallocate(fld64) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_FLD_XML_R8 - - !> Function for saving field data (global auxiliary data, e.g. time, step number, data set name...) (R4P). - !> @return E_IO: integer(I4P) error flag - function VTK_FLD_XML_R4(fld,fname,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - real(R4P), intent(IN):: fld !< Field data value. - character(*), intent(IN):: fname !< Field data name. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: fldp(:) !< Packed field data. - character(1), allocatable:: fld64(:) !< Field data encoded in base64. - integer(I4P):: rf !< Real file index. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer=repeat(' ',vtk(rf)%indent)//''//& - trim(str(n=fld))//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) - case(raw,bin_app) - s_buffer=repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = int(BYR4P,I4P)) - write(unit=vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'R4',1_I4P - write(unit=vtk(rf)%ua,iostat=E_IO)fld - case(binary) - s_buffer=repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int(BYR4P,I4P)],a2=[fld],packed=fldp) - call b64_encode(nB=int(BYI1P,I4P),n=fldp,code=fld64) ; deallocate(fldp) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(fld64)//end_rec ; deallocate(fld64) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_FLD_XML_R4 - - !> Function for saving field data (global auxiliary data, e.g. time, step number, data set name...) (I8P). - !> @return E_IO: integer(I4P) error flag - function VTK_FLD_XML_I8(fld,fname,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I8P), intent(IN):: fld !< Field data value. - character(*), intent(IN):: fname !< Field data name. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: fldp(:) !< Packed field data. - character(1), allocatable:: fld64(:) !< Field data encoded in base64. - integer(I4P):: rf !< Real file index. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//''// & - trim(str(n=fld))//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = int(BYI8P,I4P)) - write(unit=vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'I8',1_I4P - write(unit=vtk(rf)%ua,iostat=E_IO)fld - case(binary) - s_buffer=repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int(BYI8P,I4P)],a2=[fld],packed=fldp) - call b64_encode(nB=int(BYI1P,I4P),n=fldp,code=fld64) ; deallocate(fldp) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(fld64)//end_rec ; deallocate(fld64) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_FLD_XML_I8 - - !> Function for saving field data (global auxiliary data, e.g. time, step number, data set name...) (I4P). - !> @return E_IO: integer(I4P) error flag - function VTK_FLD_XML_I4(fld,fname,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: fld !< Field data value. - character(*), intent(IN):: fname !< Field data name. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: fldp(:) !< Packed field data. - character(1), allocatable:: fld64(:) !< Field data encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I8P):: Nfldp !< Dimension of fldp, packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//''// & - trim(str(n=fld))//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = int(BYI4P,I4P)) - write(unit=vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'I4',1_I4P - write(unit=vtk(rf)%ua,iostat=E_IO)fld - case(binary) - s_buffer=repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - Nfldp=size(transfer([int(BYI4P,I4P),fld],fldp),kind=I8P) ; if (allocated(fldp)) deallocate(fldp) ; allocate(fldp(1:Nfldp)) - fldp = transfer([int(BYI4P,I4P),fld],fldp) - call b64_encode(nB=int(BYI1P,I4P),n=fldp,code=fld64) ; deallocate(fldp) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(fld64)//end_rec ; deallocate(fld64) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_FLD_XML_I4 - - !> Function for saving field data (global auxiliary data, e.g. time, step number, data set name...) (I2P). - !> @return E_IO: integer(I4P) error flag - function VTK_FLD_XML_I2(fld,fname,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I2P), intent(IN):: fld !< Field data value. - character(*), intent(IN):: fname !< Field data name. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: fldp(:) !< Packed field data. - character(1), allocatable:: fld64(:) !< Field data encoded in base64. - integer(I4P):: rf !< Real file index. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//''// & - trim(str(n=fld))//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = int(BYI2P,I4P)) - write(unit=vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'I2',1_I4P - write(unit=vtk(rf)%ua,iostat=E_IO)fld - case(binary) - s_buffer=repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int(BYI2P,I4P)],a2=[fld],packed=fldp) - call b64_encode(nB=int(BYI1P,I4P),n=fldp,code=fld64) ; deallocate(fldp) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(fld64)//end_rec ; deallocate(fld64) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_FLD_XML_I2 - - !> Function for saving field data (global auxiliary data, e.g. time, step number, data set name...) (I1P). - !> @return E_IO: integer(I4P) error flag - function VTK_FLD_XML_I1(fld,fname,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I1P), intent(IN):: fld !< Field data value. - character(*), intent(IN):: fname !< Field data name. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: fldp(:) !< Packed field data. - character(1), allocatable:: fld64(:) !< Field data encoded in base64. - integer(I4P):: rf !< Real file index. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//''// & - trim(str(n=fld))//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = int(BYI1P,I4P)) - write(unit=vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'I1',1_I4P - write(unit=vtk(rf)%ua,iostat=E_IO)fld - case(binary) - s_buffer=repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int(BYI1P,I4P)],a2=[fld],packed=fldp) - call b64_encode(nB=int(BYI1P,I4P),n=fldp,code=fld64) ; deallocate(fldp) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(fld64)//end_rec ; deallocate(fld64) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_FLD_XML_I1 - - !> Function for saving mesh with \b StructuredGrid topology (R8P, 1D Arrays). - !> @return E_IO: integer(I4P) error flag - function VTK_GEO_XML_STRG_1DA_R8(nx1,nx2,ny1,ny2,nz1,nz2,NN,X,Y,Z,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: nx1 !< Initial node of x axis. - integer(I4P), intent(IN):: nx2 !< Final node of x axis. - integer(I4P), intent(IN):: ny1 !< Initial node of y axis. - integer(I4P), intent(IN):: ny2 !< Final node of y axis. - integer(I4P), intent(IN):: nz1 !< Initial node of z axis. - integer(I4P), intent(IN):: nz2 !< Final node of z axis. - integer(I4P), intent(IN):: NN !< Number of all nodes. - real(R8P), intent(IN):: X(1:) !< X coordinates [1:NN]. - real(R8P), intent(IN):: Y(1:) !< Y coordinates [1:NN]. - real(R8P), intent(IN):: Z(1:) !< Z coordinates [1:NN]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - integer(I1P), allocatable:: XYZp(:) !< Packed coordinates data. - character(1), allocatable:: XYZ64(:) !< X, Y, Z coordinates encoded in base64. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) - do n1=1,NN - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//str(n=X(n1))//' '//str(n=Y(n1))//' '//str(n=Z(n1)) - enddo - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent - 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)// & - '' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = 3*NN*BYR8P) - write(unit=vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'R8',3*NN - write(unit=vtk(rf)%ua,iostat=E_IO)(X(n1),Y(n1),Z(n1),n1=1,NN) - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int(3*NN*BYR8P,I4P)],a2=[(X(n1),Y(n1),Z(n1),n1=1,NN)],packed=XYZp) - call b64_encode(nB=int(BYI1P,I4P),n=XYZp,code=XYZ64) ; deallocate(XYZp) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(XYZ64)//end_rec ; deallocate(XYZ64) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_GEO_XML_STRG_1DA_R8 - - !> Function for saving mesh with \b StructuredGrid topology (R8P, 3D Arrays). - !> @return E_IO: integer(I4P) error flag - function VTK_GEO_XML_STRG_3DA_R8(nx1,nx2,ny1,ny2,nz1,nz2,NN,X,Y,Z,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: nx1 !< Initial node of x axis. - integer(I4P), intent(IN):: nx2 !< Final node of x axis. - integer(I4P), intent(IN):: ny1 !< Initial node of y axis. - integer(I4P), intent(IN):: ny2 !< Final node of y axis. - integer(I4P), intent(IN):: nz1 !< Initial node of z axis. - integer(I4P), intent(IN):: nz2 !< Final node of z axis. - integer(I4P), intent(IN):: NN !< Number of all nodes. - real(R8P), intent(IN):: X(nx1:,ny1:,nz1:) !< X coordinates [nx1:nx2,ny1:ny2,nz1:nz2]. - real(R8P), intent(IN):: Y(nx1:,ny1:,nz1:) !< Y coordinates [nx1:nx2,ny1:ny2,nz1:nz2]. - real(R8P), intent(IN):: Z(nx1:,ny1:,nz1:) !< Z coordinates [nx1:nx2,ny1:ny2,nz1:nz2]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - integer(I1P), allocatable:: XYZp(:) !< Packed coordinates data. - character(1), allocatable:: XYZ64(:) !< X, Y, Z coordinates encoded in base64. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I4P):: rf !< Real file index. - integer(I4P):: nx,ny,nz !< Counters. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) - do nz=nz1,nz2 - do ny=ny1,ny2 - do nx=nx1,nx2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//& - str(n=X(nx,ny,nz))//' '//str(n=Y(nx,ny,nz))//' '//str(n=Z(nx,ny,nz)) - enddo - enddo - enddo - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent - 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)// & - '' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = 3*NN*BYR8P) - write(unit=vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'R8',3*NN - write(unit=vtk(rf)%ua,iostat=E_IO)(((X(nx,ny,nz),Y(nx,ny,nz),Z(nx,ny,nz),nx=nx1,nx2),ny=ny1,ny2),nz=nz1,nz2) - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int(3*NN*BYR8P,I4P)],a2=[(((X(nx,ny,nz),Y(nx,ny,nz),Z(nx,ny,nz),nx=nx1,nx2),ny=ny1,ny2),nz=nz1,nz2)],& - packed=XYZp) - call b64_encode(nB=int(BYI1P,I4P),n=XYZp,code=XYZ64) ; deallocate(XYZp) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(XYZ64)//end_rec ; deallocate(XYZ64) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_GEO_XML_STRG_3DA_R8 - - !> Function for saving mesh with \b StructuredGrid topology (R8P, 1D Arrays, packed API). - !> @return E_IO: integer(I4P) error flag - function VTK_GEO_XML_STRG_1DAP_R8(nx1,nx2,ny1,ny2,nz1,nz2,NN,XYZ,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: nx1 !< Initial node of x axis. - integer(I4P), intent(IN):: nx2 !< Final node of x axis. - integer(I4P), intent(IN):: ny1 !< Initial node of y axis. - integer(I4P), intent(IN):: ny2 !< Final node of y axis. - integer(I4P), intent(IN):: nz1 !< Initial node of z axis. - integer(I4P), intent(IN):: nz2 !< Final node of z axis. - integer(I4P), intent(IN):: NN !< Number of all nodes. - real(R8P), intent(IN):: XYZ(1:,1:) !< X, Y, Z coordinates (packed API) [1:3,1:NN]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - integer(I1P), allocatable:: XYZp(:) !< Packed coordinates data. - character(1), allocatable:: XYZ64(:) !< X, Y, Z coordinates encoded in base64. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) - do n1=1,NN - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//& - str(n=XYZ(1,n1))//' '//str(n=XYZ(2,n1))//' '//str(n=XYZ(3,n1)) - enddo - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent - 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)// & - '' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = 3*NN*BYR8P) - write(unit=vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'R8',3*NN - write(unit=vtk(rf)%ua,iostat=E_IO)XYZ - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int(3*NN*BYR8P,I4P)],a2=reshape(XYZ,[3*NN]),packed=XYZp) - call b64_encode(nB=int(BYI1P,I4P),n=XYZp,code=XYZ64) ; deallocate(XYZp) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(XYZ64)//end_rec ; deallocate(XYZ64) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_GEO_XML_STRG_1DAP_R8 - - !> Function for saving mesh with \b StructuredGrid topology (R8P, 3D Arrays, packed API). - !> @return E_IO: integer(I4P) error flag - function VTK_GEO_XML_STRG_3DAP_R8(nx1,nx2,ny1,ny2,nz1,nz2,NN,XYZ,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: nx1 !< Initial node of x axis. - integer(I4P), intent(IN):: nx2 !< Final node of x axis. - integer(I4P), intent(IN):: ny1 !< Initial node of y axis. - integer(I4P), intent(IN):: ny2 !< Final node of y axis. - integer(I4P), intent(IN):: nz1 !< Initial node of z axis. - integer(I4P), intent(IN):: nz2 !< Final node of z axis. - integer(I4P), intent(IN):: NN !< Number of all nodes. - real(R8P), intent(IN):: XYZ(1:,nx1:,ny1:,nz1:) !< X, Y, Z coordinates (packed API). - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - integer(I1P), allocatable:: XYZp(:) !< Packed coordinates data. - character(1), allocatable:: XYZ64(:) !< X, Y, Z coordinates encoded in base64. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I4P):: rf !< Real file index. - integer(I4P):: nx,ny,nz !< Counters. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) - do nz=nz1,nz2 - do ny=ny1,ny2 - do nx=nx1,nx2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//& - str(n=XYZ(1,nx,ny,nz))//' '//str(n=XYZ(2,nx,ny,nz))//' '//str(n=XYZ(3,nx,ny,nz)) - enddo - enddo - enddo - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent - 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)// & - '' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = 3*NN*BYR8P) - write(unit=vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'R8',3*NN - write(unit=vtk(rf)%ua,iostat=E_IO)XYZ - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int(3*NN*BYR8P,I4P)],a2=reshape(XYZ,[3*NN]),packed=XYZp) - call b64_encode(nB=int(BYI1P,I4P),n=XYZp,code=XYZ64) ; deallocate(XYZp) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(XYZ64)//end_rec ; deallocate(XYZ64) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_GEO_XML_STRG_3DAP_R8 - - !> Function for saving mesh with \b StructuredGrid topology (R4P, 1D Arrays). - !> @return E_IO: integer(I4P) error flag - function VTK_GEO_XML_STRG_1DA_R4(nx1,nx2,ny1,ny2,nz1,nz2,NN,X,Y,Z,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: nx1 !< Initial node of x axis. - integer(I4P), intent(IN):: nx2 !< Final node of x axis. - integer(I4P), intent(IN):: ny1 !< Initial node of y axis. - integer(I4P), intent(IN):: ny2 !< Final node of y axis. - integer(I4P), intent(IN):: nz1 !< Initial node of z axis. - integer(I4P), intent(IN):: nz2 !< Final node of z axis. - integer(I4P), intent(IN):: NN !< Number of all nodes. - real(R4P), intent(IN):: X(1:) !< X coordinates [1:NN]. - real(R4P), intent(IN):: Y(1:) !< Y coordinates [1:NN]. - real(R4P), intent(IN):: Z(1:) !< Z coordinates [1:NN]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: XYZp(:) !< Packed data. - character(1), allocatable:: XYZ64(:) !< X, Y, Z coordinates encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) - do n1=1,NN - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//str(n=X(n1))//' '//str(n=Y(n1))//' '//str(n=Z(n1)) - enddo - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent - 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)// & - '' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = 3*NN*BYR4P) - write(unit=vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'R4',3*NN - write(unit=vtk(rf)%ua,iostat=E_IO)(X(n1),Y(n1),Z(n1),n1=1,NN) - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int(3*NN*BYR4P,I4P)],a2=[(X(n1),Y(n1),Z(n1),n1=1,NN)],packed=XYZp) - call b64_encode(nB=int(BYI1P,I4P),n=XYZp,code=XYZ64) ; deallocate(XYZp) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(XYZ64)//end_rec ; deallocate(XYZ64) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_GEO_XML_STRG_1DA_R4 - - !> Function for saving mesh with \b StructuredGrid topology (R4P, 3D Arrays). - !> @return E_IO: integer(I4P) error flag - function VTK_GEO_XML_STRG_3DA_R4(nx1,nx2,ny1,ny2,nz1,nz2,NN,X,Y,Z,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: nx1 !< Initial node of x axis. - integer(I4P), intent(IN):: nx2 !< Final node of x axis. - integer(I4P), intent(IN):: ny1 !< Initial node of y axis. - integer(I4P), intent(IN):: ny2 !< Final node of y axis. - integer(I4P), intent(IN):: nz1 !< Initial node of z axis. - integer(I4P), intent(IN):: nz2 !< Final node of z axis. - integer(I4P), intent(IN):: NN !< Number of all nodes. - real(R4P), intent(IN):: X(nx1:,ny1:,nz1:) !< X coordinates [nx1:nx2,ny1:ny2,nz1:nz2]. - real(R4P), intent(IN):: Y(nx1:,ny1:,nz1:) !< Y coordinates [nx1:nx2,ny1:ny2,nz1:nz2]. - real(R4P), intent(IN):: Z(nx1:,ny1:,nz1:) !< Z coordinates [nx1:nx2,ny1:ny2,nz1:nz2]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: XYZp(:) !< Packed data. - character(1), allocatable:: XYZ64(:) !< X, Y, Z coordinates encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: nx,ny,nz !< Counters. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) - do nz=nz1,nz2 - do ny=ny1,ny2 - do nx=nx1,nx2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//& - str(n=X(nx,ny,nz))//' '//str(n=Y(nx,ny,nz))//' '//str(n=Z(nx,ny,nz)) - enddo - enddo - enddo - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent - 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)// & - '' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = 3*NN*BYR4P) - write(unit=vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'R4',3*NN - write(unit=vtk(rf)%ua,iostat=E_IO)(((X(nx,ny,nz),Y(nx,ny,nz),Z(nx,ny,nz),nx=nx1,nx2),ny=ny1,ny2),nz=nz1,nz2) - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int(3*NN*BYR4P,I4P)],a2=[(((X(nx,ny,nz),Y(nx,ny,nz),Z(nx,ny,nz),nx=nx1,nx2),ny=ny1,ny2),nz=nz1,nz2)], & - packed=XYZp) - call b64_encode(nB=int(BYI1P,I4P),n=XYZp,code=XYZ64) ; deallocate(XYZp) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(XYZ64)//end_rec ; deallocate(XYZ64) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_GEO_XML_STRG_3DA_R4 - - !> Function for saving mesh with \b StructuredGrid topology (R4P, 1D Arrays, packed API). - !> @return E_IO: integer(I4P) error flag - function VTK_GEO_XML_STRG_1DAP_R4(nx1,nx2,ny1,ny2,nz1,nz2,NN,XYZ,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: nx1 !< Initial node of x axis. - integer(I4P), intent(IN):: nx2 !< Final node of x axis. - integer(I4P), intent(IN):: ny1 !< Initial node of y axis. - integer(I4P), intent(IN):: ny2 !< Final node of y axis. - integer(I4P), intent(IN):: nz1 !< Initial node of z axis. - integer(I4P), intent(IN):: nz2 !< Final node of z axis. - integer(I4P), intent(IN):: NN !< Number of all nodes. - real(R4P), intent(IN):: XYZ(1:,1:) !< X, Y, Z coordinates (packed API) [1:3,1:NN]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: XYZp(:) !< Packed data. - character(1), allocatable:: XYZ64(:) !< X, Y, Z coordinates encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) - do n1=1,NN - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//& - str(n=XYZ(1,n1))//' '//str(n=XYZ(2,n1))//' '//str(n=XYZ(3,n1)) - enddo - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent - 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)// & - '' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = 3*NN*BYR4P) - write(unit=vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'R4',3*NN - write(unit=vtk(rf)%ua,iostat=E_IO)XYZ - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int(3*NN*BYR4P,I4P)],a2=reshape(XYZ,[3*NN]),packed=XYZp) - call b64_encode(nB=int(BYI1P,I4P),n=XYZp,code=XYZ64) ; deallocate(XYZp) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(XYZ64)//end_rec ; deallocate(XYZ64) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_GEO_XML_STRG_1DAP_R4 - - !> Function for saving mesh with \b StructuredGrid topology (R4P, 3D Arrays, packed API). - !> @return E_IO: integer(I4P) error flag - function VTK_GEO_XML_STRG_3DAP_R4(nx1,nx2,ny1,ny2,nz1,nz2,NN,XYZ,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: nx1 !< Initial node of x axis. - integer(I4P), intent(IN):: nx2 !< Final node of x axis. - integer(I4P), intent(IN):: ny1 !< Initial node of y axis. - integer(I4P), intent(IN):: ny2 !< Final node of y axis. - integer(I4P), intent(IN):: nz1 !< Initial node of z axis. - integer(I4P), intent(IN):: nz2 !< Final node of z axis. - integer(I4P), intent(IN):: NN !< Number of all nodes. - real(R4P), intent(IN):: XYZ(1:,nx1:,ny1:,nz1:) !< X, Y, Z coordinates (packed API) [1:3,nx1:nx2,ny1:ny2,nz1:nz2]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: XYZp(:) !< Packed data. - character(1), allocatable:: XYZ64(:) !< X, Y, Z coordinates encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: nx,ny,nz !< Counters. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) - do nz=nz1,nz2 - do ny=ny1,ny2 - do nx=nx1,nx2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//& - str(n=XYZ(1,nx,ny,nz))//' '//str(n=XYZ(2,nx,ny,nz))//' '//str(n=XYZ(3,nx,ny,nz)) - enddo - enddo - enddo - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent - 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)// & - '' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = 3*NN*BYR4P) - write(unit=vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'R4',3*NN - write(unit=vtk(rf)%ua,iostat=E_IO)XYZ - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int(3*NN*BYR4P,I4P)],a2=reshape(XYZ,[3*NN]),packed=XYZp) - call b64_encode(nB=int(BYI1P,I4P),n=XYZp,code=XYZ64) ; deallocate(XYZp) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(XYZ64)//end_rec ; deallocate(XYZ64) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_GEO_XML_STRG_3DAP_R4 - - !> Function for saving mesh with \b RectilinearGrid topology (R8P). - !> @return E_IO: integer(I4P) error flag - function VTK_GEO_XML_RECT_R8(nx1,nx2,ny1,ny2,nz1,nz2,X,Y,Z,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: nx1 !< Initial node of x axis. - integer(I4P), intent(IN):: nx2 !< Final node of x axis. - integer(I4P), intent(IN):: ny1 !< Initial node of y axis. - integer(I4P), intent(IN):: ny2 !< Final node of y axis. - integer(I4P), intent(IN):: nz1 !< Initial node of z axis. - integer(I4P), intent(IN):: nz2 !< Final node of z axis. - real(R8P), intent(IN):: X(nx1:nx2) !< X coordinates. - real(R8P), intent(IN):: Y(ny1:ny2) !< Y coordinates. - real(R8P), intent(IN):: Z(nz1:nz2) !< Z coordinates. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: XYZp(:) !< Packed data. - character(1), allocatable:: XYZ64(:) !< X, Y, Z coordinates encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt=FR8P, iostat=E_IO)(X(n1),n1=nx1,nx2) - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt=FR8P, iostat=E_IO)(Y(n1),n1=ny1,ny2) - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt=FR8P, iostat=E_IO)(Z(n1),n1=nz1,nz2) - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent - 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = (nx2-nx1+1)*BYR8P) - write(unit=vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'R8',(nx2-nx1+1) - write(unit=vtk(rf)%ua,iostat=E_IO)(X(n1),n1=nx1,nx2) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = (ny2-ny1+1)*BYR8P) - write(unit=vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'R8',(ny2-ny1+1) - write(unit=vtk(rf)%ua,iostat=E_IO)(Y(n1),n1=ny1,ny2) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = (nz2-nz1+1)*BYR8P) - write(unit=vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'R8',(nz2-nz1+1) - write(unit=vtk(rf)%ua,iostat=E_IO)(Z(n1),n1=nz1,nz2) - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int((nx2-nx1+1)*BYR8P,I4P)],a2=X,packed=XYZp) - call b64_encode(nB=int(BYI1P,I4P),n=XYZp,code=XYZ64) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(XYZ64)//end_rec - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int((ny2-ny1+1)*BYR8P,I4P)],a2=Y,packed=XYZp) - call b64_encode(nB=int(BYI1P,I4P),n=XYZp,code=XYZ64) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(XYZ64)//end_rec - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int((nz2-nz1+1)*BYR8P,I4P)],a2=Z,packed=XYZp) - call b64_encode(nB=int(BYI1P,I4P),n=XYZp,code=XYZ64) ; deallocate(XYZp) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(XYZ64)//end_rec ; deallocate(XYZ64) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - vtk(rf)%indent = vtk(rf)%indent - 2 - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_GEO_XML_RECT_R8 - - !> Function for saving mesh with \b RectilinearGrid topology (R4P). - !> @return E_IO: integer(I4P) error flag - function VTK_GEO_XML_RECT_R4(nx1,nx2,ny1,ny2,nz1,nz2,X,Y,Z,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: nx1 !< Initial node of x axis. - integer(I4P), intent(IN):: nx2 !< Final node of x axis. - integer(I4P), intent(IN):: ny1 !< Initial node of y axis. - integer(I4P), intent(IN):: ny2 !< Final node of y axis. - integer(I4P), intent(IN):: nz1 !< Initial node of z axis. - integer(I4P), intent(IN):: nz2 !< Final node of z axis. - real(R4P), intent(IN):: X(nx1:nx2) !< X coordinates. - real(R4P), intent(IN):: Y(ny1:ny2) !< Y coordinates. - real(R4P), intent(IN):: Z(nz1:nz2) !< Z coordinates. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: XYZp(:) !< Packed data. - character(1), allocatable:: XYZ64(:) !< X, Y, Z coordinates encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt=FR4P, iostat=E_IO)(X(n1),n1=nx1,nx2) - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt=FR4P, iostat=E_IO)(Y(n1),n1=ny1,ny2) - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt=FR4P, iostat=E_IO)(Z(n1),n1=nz1,nz2) - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent - 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = (nx2-nx1+1)*BYR4P) - write(unit=vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'R4',(nx2-nx1+1) - write(unit=vtk(rf)%ua,iostat=E_IO)(X(n1),n1=nx1,nx2) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = (ny2-ny1+1)*BYR4P) - write(unit=vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'R4',(ny2-ny1+1) - write(unit=vtk(rf)%ua,iostat=E_IO)(Y(n1),n1=ny1,ny2) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = (nz2-nz1+1)*BYR4P) - write(unit=vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'R4',(nz2-nz1+1) - write(unit=vtk(rf)%ua,iostat=E_IO)(Z(n1),n1=nz1,nz2) - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int((nx2-nx1+1)*BYR4P,I4P)],a2=X,packed=XYZp) - call b64_encode(nB=int(BYI1P,I4P),n=XYZp,code=XYZ64) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(XYZ64)//end_rec - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int((ny2-ny1+1)*BYR4P,I4P)],a2=Y,packed=XYZp) - call b64_encode(nB=int(BYI1P,I4P),n=XYZp,code=XYZ64) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(XYZ64)//end_rec - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int((nz2-nz1+1)*BYR4P,I4P)],a2=Z,packed=XYZp) - call b64_encode(nB=int(BYI1P,I4P),n=XYZp,code=XYZ64) ; deallocate(XYZp) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(XYZ64)//end_rec ; deallocate(XYZ64) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - vtk(rf)%indent = vtk(rf)%indent - 2 - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_GEO_XML_RECT_R4 - - !> Function for saving mesh with \b UnstructuredGrid topology (R8P). - !> @return E_IO: integer(I4P) error flag - function VTK_GEO_XML_UNST_R8(NN,NC,X,Y,Z,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NN !< Number of nodes. - integer(I4P), intent(IN):: NC !< Number of cells. - real(R8P), intent(IN):: X(1:NN) !< X coordinates. - real(R8P), intent(IN):: Y(1:NN) !< Y coordinates. - real(R8P), intent(IN):: Z(1:NN) !< Z coordinates. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - real(R8P), allocatable:: XYZa(:) !< X, Y, Z coordinates. - integer(I1P), allocatable:: XYZp(:) !< Packed data. - character(1), allocatable:: XYZ64(:) !< X, Y, Z coordinates encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) - do n1=1,NN - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//str(n=X(n1))//' '//str(n=Y(n1))//' '//str(n=Z(n1)) - enddo - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent - 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)// & - '' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = 3*NN*BYR8P) - write(unit=vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'R8',3*NN - write(unit=vtk(rf)%ua,iostat=E_IO)(X(n1),Y(n1),Z(n1),n1=1,NN) - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - allocate(XYZa(1:3*NN)) - do n1 = 1,NN - XYZa(1+(n1-1)*3:1+(n1-1)*3+2)=[X(n1),Y(n1),Z(n1)] - enddo - call pack_data(a1=[int(3*NN*BYR8P,I4P)],a2=XYZa,packed=XYZp) ; deallocate(XYZa) - call b64_encode(nB=int(BYI1P,I4P),n=XYZp,code=XYZ64) ; deallocate(XYZp) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(XYZ64)//end_rec ; deallocate(XYZ64) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_GEO_XML_UNST_R8 - - !> Function for saving mesh with \b UnstructuredGrid topology (R8P, packed API). - !> @return E_IO: integer(I4P) error flag - function VTK_GEO_XML_UNST_PACK_R8(NN,NC,XYZ,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NN !< Number of nodes. - integer(I4P), intent(IN):: NC !< Number of cells. - real(R8P), intent(IN):: XYZ(1:3,1:NN) !< X, Y, Z coordinates (packed API). - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - real(R8P), allocatable:: XYZa(:) !< X, Y, Z coordinates. - integer(I1P), allocatable:: XYZp(:) !< Packed data. - character(1), allocatable:: XYZ64(:) !< X, Y, Z coordinates encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) - do n1=1,NN - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//& - str(n=XYZ(1,n1))//' '//str(n=XYZ(2,n1))//' '//str(n=XYZ(3,n1)) - enddo - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent - 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)// & - '' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = 3*NN*BYR8P) - write(unit=vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'R8',3*NN - write(unit=vtk(rf)%ua,iostat=E_IO)XYZ - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - allocate(XYZa(1:3*NN)) - do n1 = 1,NN - XYZa(1+(n1-1)*3:1+(n1-1)*3+2)=XYZ(1:3,n1) - enddo - call pack_data(a1=[int(3*NN*BYR8P,I4P)],a2=XYZa,packed=XYZp) ; deallocate(XYZa) - call b64_encode(nB=int(BYI1P,I4P),n=XYZp,code=XYZ64) ; deallocate(XYZp) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(XYZ64)//end_rec ; deallocate(XYZ64) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_GEO_XML_UNST_PACK_R8 - - !> Function for saving mesh with \b UnstructuredGrid topology (R4P). - !> @return E_IO: integer(I4P) error flag - function VTK_GEO_XML_UNST_R4(NN,NC,X,Y,Z,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NN !< Number of nodes. - integer(I4P), intent(IN):: NC !< Number of cells. - real(R4P), intent(IN):: X(1:NN) !< X coordinates. - real(R4P), intent(IN):: Y(1:NN) !< Y coordinates. - real(R4P), intent(IN):: Z(1:NN) !< Z coordinates. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - real(R4P), allocatable:: XYZa(:) !< X, Y, Z coordinates. - integer(I1P), allocatable:: XYZp(:) !< Packed data. - character(1), allocatable:: XYZ64(:) !< X, Y, Z coordinates encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) - do n1=1,NN - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//str(n=X(n1))//' '//str(n=Y(n1))//' '//str(n=Z(n1)) - enddo - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent - 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)// & - '' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = 3*NN*BYR4P) - write(unit=vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'R4',3*NN - write(unit=vtk(rf)%ua,iostat=E_IO)(X(n1),Y(n1),Z(n1),n1=1,NN) - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - allocate(XYZa(1:3*NN)) - do n1 = 1,NN - XYZa(1+(n1-1)*3:1+(n1-1)*3+2)=[X(n1),Y(n1),Z(n1)] - enddo - call pack_data(a1=[int(3*NN*BYR4P,I4P)],a2=XYZa,packed=XYZp) ; deallocate(XYZa) - call b64_encode(nB=int(BYI1P,I4P),n=XYZp,code=XYZ64) ; deallocate(XYZp) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(XYZ64)//end_rec ; deallocate(XYZ64) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_GEO_XML_UNST_R4 - - !> Function for saving mesh with \b UnstructuredGrid topology (R4P, packed API). - !> @return E_IO: integer(I4P) error flag - function VTK_GEO_XML_UNST_PACK_R4(NN,NC,XYZ,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NN !< Number of nodes. - integer(I4P), intent(IN):: NC !< Number of cells. - real(R4P), intent(IN):: XYZ(1:3,1:NN) !< X, Y, Z coordinates (packed API). - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - real(R4P), allocatable:: XYZa(:) !< X, Y, Z coordinates. - integer(I1P), allocatable:: XYZp(:) !< Packed data. - character(1), allocatable:: XYZ64(:) !< X, Y, Z coordinates encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) - do n1=1,NN - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//& - str(n=XYZ(1,n1))//' '//str(n=XYZ(2,n1))//' '//str(n=XYZ(3,n1)) - enddo - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent - 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)// & - '' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = 3*NN*BYR4P) - write(unit=vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'R4',3*NN - write(unit=vtk(rf)%ua,iostat=E_IO)XYZ - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - allocate(XYZa(1:3*NN)) - do n1 = 1,NN - XYZa(1+(n1-1)*3:1+(n1-1)*3+2)=XYZ(1:3,n1) - enddo - call pack_data(a1=[int(3*NN*BYR4P,I4P)],a2=XYZa,packed=XYZp) ; deallocate(XYZa) - call b64_encode(nB=int(BYI1P,I4P),n=XYZp,code=XYZ64) ; deallocate(XYZp) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(XYZ64)//end_rec ; deallocate(XYZ64) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_GEO_XML_UNST_PACK_R4 - - !> @brief Function for closing mesh block data. - !> @return E_IO: integer(I4P) error flag - function VTK_GEO_XML_CLOSEP(cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - integer(I4P):: rf !< Real file index. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - vtk(rf)%indent = vtk(rf)%indent - 2 - select case(vtk(rf)%f) - case(ascii) - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,binary,bin_app) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_GEO_XML_CLOSEP - !> @} - - !> Function that \b must be used when unstructured grid is used, it saves the connectivity of the unstructured gird. - !> @note The vector \b connect must follow the VTK-legacy standard. It is passed as \em assumed-shape array - !> because its dimensions is related to the mesh dimensions in a complex way. Its dimensions can be calculated by the following - !> equation: \f$dc = dc = \sum\limits_{i = 1}^{NC} {nvertex_i }\f$. - !> Note that this equation is different from the legacy one. The XML connectivity convention is quite different from the - !> legacy standard. As an example suppose we have a mesh composed by 2 cells, one hexahedron (8 vertices) and one pyramid with - !> square basis (5 vertices) and suppose that the basis of pyramid is constitute by a face of the hexahedron and so the two cells - !> share 4 vertices. The above equation gives \f$dc=8+5=13\f$. The connectivity vector for this mesh can be: \n - !> first cell \n - !> connect(1) = 0 identification flag of \f$1^\circ\f$ vertex of 1° cell \n - !> connect(2) = 1 identification flag of \f$2^\circ\f$ vertex of 1° cell \n - !> connect(3) = 2 identification flag of \f$3^\circ\f$ vertex of 1° cell \n - !> connect(4) = 3 identification flag of \f$4^\circ\f$ vertex of 1° cell \n - !> connect(5) = 4 identification flag of \f$5^\circ\f$ vertex of 1° cell \n - !> connect(6) = 5 identification flag of \f$6^\circ\f$ vertex of 1° cell \n - !> connect(7) = 6 identification flag of \f$7^\circ\f$ vertex of 1° cell \n - !> connect(8) = 7 identification flag of \f$8^\circ\f$ vertex of 1° cell \n - !> second cell \n - !> connect(9 ) = 0 identification flag of \f$1^\circ\f$ vertex of 2° cell \n - !> connect(10) = 1 identification flag of \f$2^\circ\f$ vertex of 2° cell \n - !> connect(11) = 2 identification flag of \f$3^\circ\f$ vertex of 2° cell \n - !> connect(12) = 3 identification flag of \f$4^\circ\f$ vertex of 2° cell \n - !> connect(13) = 8 identification flag of \f$5^\circ\f$ vertex of 2° cell \n - !> Therefore this connectivity vector convention is more simple than the legacy convention, now we must create also the - !> \em offset vector that contains the data now missing in the \em connect vector. The offset - !> vector for this mesh can be: \n - !> first cell \n - !> offset(1) = 8 => summ of nodes of \f$1^\circ\f$ cell \n - !> second cell \n - !> offset(2) = 13 => summ of nodes of \f$1^\circ\f$ and \f$2^\circ\f$ cells \n - !> The value of every cell-offset can be calculated by the following equation: \f$offset_c=\sum\limits_{i=1}^{c}{nvertex_i}\f$ - !> where \f$offset_c\f$ is the value of \f$c^{th}\f$ cell and \f$nvertex_i\f$ is the number of vertices of \f$i^{th}\f$ cell. - !> The function VTK_CON_XML does not calculate the connectivity and offset vectors: it writes the connectivity and offset - !> vectors conforming the VTK-XML standard, but does not calculate them. - !> The vector variable \em cell_type must conform the VTK-XML standard (see the file VTK-Standard at the - !> Kitware homepage) that is the same of the legacy standard. It contains the - !> \em type of each cells. For the above example this vector is: \n - !> first cell \n - !> cell_type(1) = 12 hexahedron type of \f$1^\circ\f$ cell \n - !> second cell \n - !> cell_type(2) = 14 pyramid type of \f$2^\circ\f$ cell \n - !> @return E_IO: integer(I4P) error flag - function VTK_CON_XML(NC,connect,offset,cell_type,idx,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC !< Number of cells. - integer(I4P), intent(IN):: connect(1:) !< Mesh connectivity. - integer(I4P), intent(IN):: offset(1:NC) !< Cell offset. - integer(I1P), intent(IN):: cell_type(1:) !< VTK cell type. - integer(I1P), intent(IN), optional:: idx !< Id offset to convert Fortran (first id 1) to C (first id 0) standards. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: cocp(:) !< Packed data. - character(1), allocatable:: coc64(:) !< Data encoded in base64. - integer(I1P):: incr !< Actual id offset increment. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - integer(I8P):: Ncocp !< Dimension of cocp, packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - incr = 0_I1P - if (present(idx)) then - incr = idx - endif - select case(vtk(rf)%f) - case(ascii) - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//& - '' - write(unit=vtk(rf)%u,fmt=FI4P, iostat=E_IO)(connect(n1)+incr,n1=1,offset(NC)) - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt=FI4P, iostat=E_IO)(offset(n1),n1=1,NC) - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - if (lbound(cell_type,dim=1)==ubound(cell_type,dim=1)) then - write(unit=vtk(rf)%u,fmt=FI1P, iostat=E_IO)(cell_type(1),n1=1,NC) - else - write(unit=vtk(rf)%u,fmt=FI1P, iostat=E_IO)(cell_type(n1),n1=1,NC) - endif - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent - 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = offset(NC)*BYI4P) - write(unit=vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'I4',offset(NC) - write(unit=vtk(rf)%ua,iostat=E_IO)(connect(n1)+incr,n1=1,offset(NC)) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = NC*BYI4P) - write(unit=vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'I4',NC - write(unit=vtk(rf)%ua,iostat=E_IO)(offset(n1),n1=1,NC) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = NC*BYI1P) - write(unit=vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'I1',NC - if (lbound(cell_type,dim=1)==ubound(cell_type,dim=1)) then - write(unit=vtk(rf)%ua,iostat=E_IO)(cell_type(1),n1=1,NC) - else - write(unit=vtk(rf)%ua,iostat=E_IO)(cell_type(n1),n1=1,NC) - endif - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - case(binary) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//& - ''//end_rec - Ncocp=size(transfer([int(offset(NC)*BYI4P,I4P),connect],cocp),kind=I8P) - if (allocated(cocp)) deallocate(cocp) ; allocate(cocp(1:Ncocp)) - cocp = transfer([int(offset(NC)*BYI4P,I4P),connect],cocp) - call b64_encode(nB=int(BYI1P,I4P),n=cocp,code=coc64) - deallocate(cocp) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(coc64)//end_rec - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - Ncocp=size(transfer([int(NC*BYI4P,I4P),offset],cocp),kind=I8P) ; if (allocated(cocp)) deallocate(cocp) ; allocate(cocp(1:Ncocp)) - cocp = transfer([int(NC*BYI4P,I4P),offset],cocp) - call b64_encode(nB=int(BYI1P,I4P),n=cocp,code=coc64) - deallocate(cocp) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(coc64)//end_rec - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - if (lbound(cell_type,dim=1)==ubound(cell_type,dim=1)) then - call pack_data(a1=[int(NC*BYI1P,I4P)],a2=[(cell_type(1),n1=1,NC)],packed=cocp) - else - call pack_data(a1=[int(NC*BYI1P,I4P)],a2=cell_type,packed=cocp) - endif - call b64_encode(nB=int(BYI1P,I4P),n=cocp,code=coc64) ; deallocate(cocp) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(coc64)//end_rec ; deallocate(coc64) - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec ; vtk(rf)%indent = vtk(rf)%indent - 2 - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_CON_XML - - !> Function that \b must be called before saving the data related to geometric mesh, this function initializes the - !> saving of data variables indicating the \em type (node or cell centered) of variables that will be saved. - !> @note A single file can contain both cell and node centered variables. In this case the VTK_DAT_XML function must be - !> called two times, before saving cell-centered variables and before saving node-centered variables. - !> Examples of usage are: \n - !> \b Opening node piece: \n - !> @code ... - !> E_IO=VTK_DAT_XML('node','OPEN') - !> ... @endcode - !> \b Closing node piece: \n - !> @code ... - !> E_IO=VTK_DAT_XML('node','CLOSE') - !> ... @endcode - !> @return E_IO: integer(I4P) error flag - !> @ingroup Lib_VTK_IOPublicProcedure - function VTK_DAT_XML(var_location,var_block_action,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: var_location !< Location of saving variables: CELL or NODE centered. - character(*), intent(IN):: var_block_action !< Variables block action: OPEN or CLOSE block. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - integer(I4P):: rf !< Real file index. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - select case(trim(Upper_Case(var_location))) - case('CELL') - select case(trim(Upper_Case(var_block_action))) - case('OPEN') - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent + 2 - case('CLOSE') - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - endselect - case('NODE') - select case(trim(Upper_Case(var_block_action))) - case('OPEN') - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent + 2 - case('CLOSE') - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - endselect - endselect - case(raw,binary,bin_app) - select case(trim(Upper_Case(var_location))) - case('CELL') - select case(trim(Upper_Case(var_block_action))) - case('OPEN') - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - case('CLOSE') - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - case('NODE') - select case(trim(Upper_Case(var_block_action))) - case('OPEN') - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec ; vtk(rf)%indent = vtk(rf)%indent + 2 - case('CLOSE') - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - endselect - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_DAT_XML - - !> @ingroup Lib_VTK_IOPrivateProcedure - !> @{ - - !> Function for saving field of scalar variable (R8P, 1D array). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_SCAL_1DA_R8(NC_NN,varname,var,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - character(*), intent(IN):: varname !< Variable name. - real(R8P), intent(IN):: var(1:) !< Variable to be saved [1:NC_NN]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)',iostat=E_IO)trim(s_buffer) - write(vtk(rf)%u,'('//trim(str(.true.,NC_NN+1))//'A)',iostat=E_IO)repeat(' ',vtk(rf)%indent),(' '//str(n=var(n1)),n1=1,NC_NN) - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = NC_NN*BYR8P) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'R8',NC_NN - write(vtk(rf)%ua,iostat=E_IO)var - case(binary) - s_buffer=repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int(NC_NN*BYR8P,I4P)],a2=var,packed=varp) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_SCAL_1DA_R8 - - !> Function for saving field of scalar variable (R8P, 3D array). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_SCAL_3DA_R8(NC_NN,varname,var,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - character(*), intent(IN):: varname !< Variable name. - real(R8P), intent(IN):: var(1:,1:,1:) !< Variable to be saved [1:Nx,1:Ny,1:Nz]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: nx,ny,nz !< Counters. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)', iostat=E_IO)trim(s_buffer) - write(vtk(rf)%u,'('//trim(str(.true.,NC_NN+1))//'A)',iostat=E_IO)repeat(' ',vtk(rf)%indent),& - (((' '//str(n=var(nx,ny,nz)),nx=1,size(var,dim=1)),ny=1,size(var,dim=2)),nz=1,size(var,dim=3)) - write(vtk(rf)%u,'(A)', iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = NC_NN*BYR8P) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'R8',NC_NN - write(vtk(rf)%ua,iostat=E_IO)var - case(binary) - s_buffer=repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int(NC_NN*BYR8P,I4P)],a2=reshape(var,[NC_NN]),packed=varp) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_SCAL_3DA_R8 - - !> Function for saving field of scalar variable (R4P, 1D array). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_SCAL_1DA_R4(NC_NN,varname,var,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - character(*), intent(IN):: varname !< Variable name. - real(R4P), intent(IN):: var(1:) !< Variable to be saved [1:NC_NN]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)', iostat=E_IO)trim(s_buffer) - write(vtk(rf)%u,'('//trim(str(.true.,NC_NN+1))//'A)',iostat=E_IO)repeat(' ',vtk(rf)%indent),(' '//str(n=var(n1)),n1=1,NC_NN) - write(vtk(rf)%u,'(A)', iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = NC_NN*BYR4P) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'R4',NC_NN - write(vtk(rf)%ua,iostat=E_IO)var - case(binary) - s_buffer=repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int(NC_NN*BYR4P,I4P)],a2=var,packed=varp) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_SCAL_1DA_R4 - - !> Function for saving field of scalar variable (R4P, 3D array). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_SCAL_3DA_R4(NC_NN,varname,var,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - character(*), intent(IN):: varname !< Variable name. - real(R4P), intent(IN):: var(1:,1:,1:) !< Variable to be saved [1:Nx,1:Ny,1:Nz]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: nx,ny,nz !< Counters. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)', iostat=E_IO)trim(s_buffer) - write(vtk(rf)%u,'('//trim(str(.true.,NC_NN+1))//'A)',iostat=E_IO)repeat(' ',vtk(rf)%indent),& - (((' '//str(n=var(nx,ny,nz)),nx=1,size(var,dim=1)),ny=1,size(var,dim=2)),nz=1,size(var,dim=3)) - write(vtk(rf)%u,'(A)', iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = NC_NN*BYR4P) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'R4',NC_NN - write(vtk(rf)%ua,iostat=E_IO)var - case(binary) - s_buffer=repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int(NC_NN*BYR4P,I4P)],a2=reshape(var,[NC_NN]),packed=varp) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_SCAL_3DA_R4 - - !> Function for saving field of scalar variable (I8P, 1D array). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_SCAL_1DA_I8(NC_NN,varname,var,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - character(*), intent(IN):: varname !< Variable name. - integer(I8P), intent(IN):: var(1:) !< Variable to be saved [1:NC_NN]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)',iostat=E_IO)trim(s_buffer) - write(vtk(rf)%u,'('//trim(str(.true.,NC_NN+1))//'A)',iostat=E_IO)repeat(' ',vtk(rf)%indent),(' '//str(n=var(n1)),n1=1,NC_NN) - write(vtk(rf)%u,'(A)',iostat=E_IO)'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = int(NC_NN*BYI8P,I4P)) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'I8',NC_NN - write(vtk(rf)%ua,iostat=E_IO)var - case(binary) - s_buffer=repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int(NC_NN*BYI8P,I4P)],a2=var,packed=varp) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_SCAL_1DA_I8 - - !> Function for saving field of scalar variable (I8P, 3D array). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_SCAL_3DA_I8(NC_NN,varname,var,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - character(*), intent(IN):: varname !< Variable name. - integer(I8P), intent(IN):: var(1:,1:,1:) !< Variable to be saved [1:Nx,1:Ny,1:Nz]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: nx,ny,nz !< Counters. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)',iostat=E_IO)trim(s_buffer) - write(vtk(rf)%u,'('//trim(str(.true.,NC_NN+1))//'A)',iostat=E_IO)repeat(' ',vtk(rf)%indent),& - (((' '//str(n=var(nx,ny,nz)),nx=1,size(var,dim=1)),ny=1,size(var,dim=2)),nz=1,size(var,dim=3)) - write(vtk(rf)%u,'(A)',iostat=E_IO)'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = int(NC_NN*BYI8P,I4P)) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'I8',NC_NN - write(vtk(rf)%ua,iostat=E_IO)var - case(binary) - s_buffer=repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int(NC_NN*BYI8P,I4P)],a2=reshape(var,[NC_NN]),packed=varp) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_SCAL_3DA_I8 - - !> Function for saving field of scalar variable (I4P, 1D array). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_SCAL_1DA_I4(NC_NN,varname,var,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - character(*), intent(IN):: varname !< Variable name. - integer(I4P), intent(IN):: var(1:) !< Variable to be saved [1:NC_NN]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - integer(I8P):: Nvarp !< Dimension of varp, packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)',iostat=E_IO)trim(s_buffer) - write(vtk(rf)%u,'('//trim(str(.true.,NC_NN+1))//'A)',iostat=E_IO)repeat(' ',vtk(rf)%indent),(' '//str(n=var(n1)),n1=1,NC_NN) - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = NC_NN*BYI4P) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'I4',NC_NN - write(vtk(rf)%ua,iostat=E_IO)var - case(binary) - s_buffer=repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - Nvarp=size(transfer([int(NC_NN*BYI4P,I4P),var],varp),kind=I8P) ; if (allocated(varp)) deallocate(varp) ; allocate(varp(1:Nvarp)) - varp = transfer([int(NC_NN*BYI4P,I4P),var],varp) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_SCAL_1DA_I4 - - !> Function for saving field of scalar variable (I4P, 3D array). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_SCAL_3DA_I4(NC_NN,varname,var,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - character(*), intent(IN):: varname !< Variable name. - integer(I4P), intent(IN):: var(1:,1:,1:) !< Variable to be saved [1:Nx,1:Ny,1:Nz]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: nx,ny,nz !< Counters. - integer(I8P):: Nvarp !< Dimension of varp, packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)',iostat=E_IO)trim(s_buffer) - write(vtk(rf)%u,'('//trim(str(.true.,NC_NN+1))//'A)',iostat=E_IO)repeat(' ',vtk(rf)%indent),& - (((' '//str(n=var(nx,ny,nz)),nx=1,size(var,dim=1)),ny=1,size(var,dim=2)),nz=1,size(var,dim=3)) - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = NC_NN*BYI4P) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'I4',NC_NN - write(vtk(rf)%ua,iostat=E_IO)var - case(binary) - s_buffer=repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - Nvarp=size(transfer([int(NC_NN*BYI4P,I4P),reshape(var,[NC_NN])],varp),kind=I8P) - if (allocated(varp)) deallocate(varp); allocate(varp(1:Nvarp)) - varp = transfer([int(NC_NN*BYI4P,I4P),reshape(var,[NC_NN])],varp) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_SCAL_3DA_I4 - - !> Function for saving field of scalar variable (I2P, 1D array). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_SCAL_1DA_I2(NC_NN,varname,var,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - character(*), intent(IN):: varname !< Variable name. - integer(I2P), intent(IN):: var(1:) !< Variable to be saved [1:NC_NN]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)',iostat=E_IO)trim(s_buffer) - write(vtk(rf)%u,'('//trim(str(.true.,NC_NN+1))//'A)',iostat=E_IO)repeat(' ',vtk(rf)%indent),(' '//str(n=var(n1)),n1=1,NC_NN) - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = NC_NN*BYI2P) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'I2',NC_NN - write(vtk(rf)%ua,iostat=E_IO)var - case(binary) - s_buffer=repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int(NC_NN*BYI2P,I4P)],a2=var,packed=varp) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_SCAL_1DA_I2 - - !> Function for saving field of scalar variable (I2P, 3D array). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_SCAL_3DA_I2(NC_NN,varname,var,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - character(*), intent(IN):: varname !< Variable name. - integer(I2P), intent(IN):: var(1:,1:,1:) !< Variable to be saved [1:Nx,1:Ny,1:Nz]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: nx,ny,nz !< Counters. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)',iostat=E_IO)trim(s_buffer) - write(vtk(rf)%u,'('//trim(str(.true.,NC_NN+1))//'A)',iostat=E_IO)repeat(' ',vtk(rf)%indent),& - (((' '//str(n=var(nx,ny,nz)),nx=1,size(var,dim=1)),ny=1,size(var,dim=2)),nz=1,size(var,dim=3)) - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = NC_NN*BYI2P) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'I2',NC_NN - write(vtk(rf)%ua,iostat=E_IO)var - case(binary) - s_buffer=repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int(NC_NN*BYI2P,I4P)],a2=reshape(var,[NC_NN]),packed=varp) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_SCAL_3DA_I2 - - !> Function for saving field of scalar variable (I1P, 1D array). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_SCAL_1DA_I1(NC_NN,varname,var,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - character(*), intent(IN):: varname !< Variable name. - integer(I1P), intent(IN):: var(1:) !< Variable to be saved [1:NC_NN]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer=repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)',iostat=E_IO)trim(s_buffer) - write(vtk(rf)%u,'('//trim(str(.true.,NC_NN+1))//'A)',iostat=E_IO)repeat(' ',vtk(rf)%indent),(' '//str(n=var(n1)),n1=1,NC_NN) - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer=repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = NC_NN*BYI1P) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'I1',NC_NN - write(vtk(rf)%ua,iostat=E_IO)var - case(binary) - s_buffer=repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int(NC_NN*BYI1P,I4P)],a2=var,packed=varp) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_SCAL_1DA_I1 - - !> Function for saving field of scalar variable (I1P, 3D array). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_SCAL_3DA_I1(NC_NN,varname,var,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - character(*), intent(IN):: varname !< Variable name. - integer(I1P), intent(IN):: var(1:,1:,1:) !< Variable to be saved [1:Nx,1:ny,1:Nz]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: nx,ny,nz !< Counters. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer=repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)',iostat=E_IO)trim(s_buffer) - write(vtk(rf)%u,'('//trim(str(.true.,NC_NN+1))//'A)',iostat=E_IO)repeat(' ',vtk(rf)%indent),& - (((' '//str(n=var(nx,ny,nz)),nx=1,size(var,dim=1)),ny=1,size(var,dim=2)),nz=1,size(var,dim=3)) - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer=repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = NC_NN*BYI1P) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'I1',NC_NN - write(vtk(rf)%ua,iostat=E_IO)var - case(binary) - s_buffer=repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int(NC_NN*BYI1P,I4P)],a2=reshape(var,[NC_NN]),packed=varp) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_SCAL_3DA_I1 - - !> Function for saving field of vectorial variable (R8P, 1D arrays). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_VECT_1DA_R8(NC_NN,varname,varX,varY,varZ,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - character(*), intent(IN):: varname !< Variable name. - real(R8P), intent(IN):: varX(1:) !< X component [1:NC_NN]. - real(R8P), intent(IN):: varY(1:) !< Y component [1:NC_NN]. - real(R8P), intent(IN):: varZ(1:) !< Z component [1:NC_NN]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - real(R8P), allocatable:: var(:) !< X, Y, Z component. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)',iostat=E_IO)trim(s_buffer) - do n1=1,NC_NN - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//str(n=varX(n1))//' '//str(n=varY(n1))//' '//str(n=varZ(n1)) - enddo - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = 3*NC_NN*BYR8P) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'R8',3*NC_NN - write(vtk(rf)%ua,iostat=E_IO)(varX(n1),varY(n1),varZ(n1),n1=1,NC_NN) - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - allocate(var(1:3*NC_NN)) - do n1=1,NC_NN - var(1+(n1-1)*3:1+(n1-1)*3+2)=[varX(n1),varY(n1),varZ(n1)] - enddo - call pack_data(a1=[int(3*NC_NN*BYR8P,I4P)],a2=var,packed=varp) ; deallocate(var) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_VECT_1DA_R8 - - !> Function for saving field of vectorial variable (R8P, 3D arrays). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_VECT_3DA_R8(NC_NN,varname,varX,varY,varZ,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - character(*), intent(IN):: varname !< Variable name. - real(R8P), intent(IN):: varX(1:,1:,1:) !< X component [1:Nx,1:Ny,1:Nz]. - real(R8P), intent(IN):: varY(1:,1:,1:) !< Y component [1:Nx,1:Ny,1:Nz]. - real(R8P), intent(IN):: varZ(1:,1:,1:) !< Z component [1:Nx,1:Ny,1:Nz]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - real(R8P), allocatable:: var(:) !< X, Y, Z component. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: nx,ny,nz,n1 !< Counters. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)',iostat=E_IO)trim(s_buffer) - do nz=1,size(varX,dim=3) ; do ny=1,size(varX,dim=2) ; do nx=1,size(varX,dim=1) - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//& - str(n=varX(nx,ny,nz))//' '//str(n=varY(nx,ny,nz))//' '//str(n=varZ(nx,ny,nz)) - enddo ; enddo ; enddo - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = 3*NC_NN*BYR8P) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'R8',3*NC_NN - write(vtk(rf)%ua,iostat=E_IO)(((varX(nx,ny,nz),varY(nx,ny,nz),varZ(nx,ny,nz),& - nx=1,size(varX,dim=1)),ny=1,size(varX,dim=2)),nz=1,size(varX,dim=3)) - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - allocate(var(1:3*NC_NN)) - n1 = 0_I4P - do nz=1,size(varX,dim=3) ; do ny=1,size(varX,dim=2) ; do nx=1,size(varX,dim=1) - n1 = n1 + 1_I4P ; var(1+(n1-1)*3:1+(n1-1)*3+2)=[varX(nx,ny,nz),varY(nx,ny,nz),varZ(nx,ny,nz)] - enddo ; enddo ; enddo - call pack_data(a1=[int(3*NC_NN*BYR8P,I4P)],a2=var,packed=varp) ; deallocate(var) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_VECT_3DA_R8 - - !> Function for saving field of vectorial variable (R4P, 1D arrays). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_VECT_1DA_R4(NC_NN,varname,varX,varY,varZ,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - character(*), intent(IN):: varname !< Variable name. - real(R4P), intent(IN):: varX(1:) !< X component [1:NC_NN]. - real(R4P), intent(IN):: varY(1:) !< Y component [1:NC_NN]. - real(R4P), intent(IN):: varZ(1:) !< Z component [1:NC_NN]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - real(R4P), allocatable:: var(:) !< X, Y, Z component. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)',iostat=E_IO)trim(s_buffer) - do n1=1,NC_NN - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//str(n=varX(n1))//' '//str(n=varY(n1))//' '//str(n=varZ(n1)) - enddo - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = 3*NC_NN*BYR4P) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'R4',3*NC_NN - write(vtk(rf)%ua,iostat=E_IO)(varX(n1),varY(n1),varZ(n1),n1=1,NC_NN) - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - allocate(var(1:3*NC_NN)) - do n1=1,NC_NN - var(1+(n1-1)*3:1+(n1-1)*3+2)=[varX(n1),varY(n1),varZ(n1)] - enddo - call pack_data(a1=[int(3*NC_NN*BYR4P,I4P)],a2=var,packed=varp) ; deallocate(var) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_VECT_1DA_R4 - - !> Function for saving field of vectorial variable (R4P, 3D arrays). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_VECT_3DA_R4(NC_NN,varname,varX,varY,varZ,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - character(*), intent(IN):: varname !< Variable name. - real(R4P), intent(IN):: varX(1:,1:,1:) !< X component [1:Nx,1:Ny,1:Nz]. - real(R4P), intent(IN):: varY(1:,1:,1:) !< Y component [1:Nx,1:Ny,1:Nz]. - real(R4P), intent(IN):: varZ(1:,1:,1:) !< Z component [1:Nx,1:Ny,1:Nz]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - real(R4P), allocatable:: var(:) !< X, Y, Z component. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: nx,ny,nz,n1 !< Counters. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)',iostat=E_IO)trim(s_buffer) - do nz=1,size(varX,dim=3) ; do ny=1,size(varX,dim=2) ; do nx=1,size(varX,dim=1) - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//& - str(n=varX(nx,ny,nz))//' '//str(n=varY(nx,ny,nz))//' '//str(n=varZ(nx,ny,nz)) - enddo ; enddo ; enddo - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = 3*NC_NN*BYR4P) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'R4',3*NC_NN - write(vtk(rf)%ua,iostat=E_IO)(((varX(nx,ny,nz),varY(nx,ny,nz),varZ(nx,ny,nz),& - nx=1,size(varX,dim=1)),ny=1,size(varX,dim=2)),nz=1,size(varX,dim=3)) - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - allocate(var(1:3*NC_NN)) - n1 = 0_I4P - do nz=1,size(varX,dim=3) ; do ny=1,size(varX,dim=2) ; do nx=1,size(varX,dim=1) - n1 = n1 + 1_I4P ; var(1+(n1-1)*3:1+(n1-1)*3+2)=[varX(nx,ny,nz),varY(nx,ny,nz),varZ(nx,ny,nz)] - enddo ; enddo ; enddo - call pack_data(a1=[int(3*NC_NN*BYR4P,I4P)],a2=var,packed=varp) ; deallocate(var) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_VECT_3DA_R4 - - !> Function for saving field of vectorial variable (I8P, 1D arrays). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_VECT_1DA_I8(NC_NN,varname,varX,varY,varZ,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - character(*), intent(IN):: varname !< Variable name. - integer(I8P), intent(IN):: varX(1:) !< X component [1:NC_NN]. - integer(I8P), intent(IN):: varY(1:) !< Y component [1:NC_NN]. - integer(I8P), intent(IN):: varZ(1:) !< Z component [1:NC_NN]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I8P), allocatable:: var(:) !< X, Y, Z component. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)',iostat=E_IO)trim(s_buffer) - do n1=1,NC_NN - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//str(n=varX(n1))//' '//str(n=varY(n1))//' '//str(n=varZ(n1)) - enddo - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = int(3*NC_NN*BYI8P,I4P)) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'I8',3*NC_NN - write(vtk(rf)%ua,iostat=E_IO)(varX(n1),varY(n1),varZ(n1),n1=1,NC_NN) - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - allocate(var(1:3*NC_NN)) - do n1=1,NC_NN - var(1+(n1-1)*3:1+(n1-1)*3+2)=[varX(n1),varY(n1),varZ(n1)] - enddo - call pack_data(a1=[int(3*NC_NN*BYI8P,I4P)],a2=var,packed=varp) ; deallocate(var) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_VECT_1DA_I8 - - !> Function for saving field of vectorial variable (I8P, 3D arrays). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_VECT_3DA_I8(NC_NN,varname,varX,varY,varZ,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - character(*), intent(IN):: varname !< Variable name. - integer(I8P), intent(IN):: varX(1:,1:,1:) !< X component [1:Nx,1:Ny,1:Nz]. - integer(I8P), intent(IN):: varY(1:,1:,1:) !< Y component [1:Nx,1:Ny,1:Nz]. - integer(I8P), intent(IN):: varZ(1:,1:,1:) !< Z component [1:Nx,1:Ny,1:Nz]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I8P), allocatable:: var(:) !< X, Y, Z component. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: nx,ny,nz,n1 !< Counters. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)',iostat=E_IO)trim(s_buffer) - do nz=1,size(varX,dim=3) ; do ny=1,size(varX,dim=2) ; do nx=1,size(varX,dim=1) - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//& - str(n=varX(nx,ny,nz))//' '//str(n=varY(nx,ny,nz))//' '//str(n=varZ(nx,ny,nz)) - enddo ; enddo ; enddo - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = int(3*NC_NN*BYI8P,I4P)) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'I8',3*NC_NN - write(vtk(rf)%ua,iostat=E_IO)(((varX(nx,ny,nz),varY(nx,ny,nz),varZ(nx,ny,nz),& - nx=1,size(varX,dim=1)),ny=1,size(varX,dim=2)),nz=1,size(varX,dim=3)) - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - allocate(var(1:3*NC_NN)) - n1 = 0_I4P - do nz=1,size(varX,dim=3) ; do ny=1,size(varX,dim=2) ; do nx=1,size(varX,dim=1) - n1 = n1 + 1_I4P ; var(1+(n1-1)*3:1+(n1-1)*3+2)=[varX(nx,ny,nz),varY(nx,ny,nz),varZ(nx,ny,nz)] - enddo ; enddo ; enddo - call pack_data(a1=[int(3*NC_NN*BYI8P,I4P)],a2=var,packed=varp) ; deallocate(var) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_VECT_3DA_I8 - - !> Function for saving field of vectorial variable (I4P, 1D arrays). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_VECT_1DA_I4(NC_NN,varname,varX,varY,varZ,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - character(*), intent(IN):: varname !< Variable name. - integer(I4P), intent(IN):: varX(1:) !< X component [1:NC_NN]. - integer(I4P), intent(IN):: varY(1:) !< Y component [1:NC_NN]. - integer(I4P), intent(IN):: varZ(1:) !< Z component [1:NC_NN]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I4P), allocatable:: var(:) !< X, Y, Z component. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - integer(I8P):: Nvarp !< Dimension of varp, packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)',iostat=E_IO)trim(s_buffer) - do n1=1,NC_NN - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//str(n=varX(n1))//' '//str(n=varY(n1))//' '//str(n=varZ(n1)) - enddo - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = 3*NC_NN*BYI4P) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'I4',3*NC_NN - write(vtk(rf)%ua,iostat=E_IO)(varX(n1),varY(n1),varZ(n1),n1=1,NC_NN) - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - allocate(var(1:3*NC_NN)) - do n1=1,NC_NN - var(1+(n1-1)*3:1+(n1-1)*3+2)=[varX(n1),varY(n1),varZ(n1)] - enddo - Nvarp=size(transfer([int(3*NC_NN*BYI4P,I4P),var],varp),kind=I8P) - if (allocated(varp)) deallocate(varp); allocate(varp(1:Nvarp)) - varp = transfer([int(3*NC_NN*BYI4P,I4P),var],varp) ; deallocate(var) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_VECT_1DA_I4 - - !> Function for saving field of vectorial variable (I4P, 3D arrays). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_VECT_3DA_I4(NC_NN,varname,varX,varY,varZ,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - character(*), intent(IN):: varname !< Variable name. - integer(I4P), intent(IN):: varX(1:,1:,1:) !< X component [1:Nx,1:Ny,1:Nz]. - integer(I4P), intent(IN):: varY(1:,1:,1:) !< Y component [1:Nx,1:Ny,1:Nz]. - integer(I4P), intent(IN):: varZ(1:,1:,1:) !< Z component [1:Nx,1:Ny,1:Nz]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I4P), allocatable:: var(:) !< X, Y, Z component. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: nx,ny,nz,n1 !< Counters. - integer(I8P):: Nvarp !< Dimension of varp, packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)',iostat=E_IO)trim(s_buffer) - do nz=1,size(varX,dim=3) ; do ny=1,size(varX,dim=2) ; do nx=1,size(varX,dim=1) - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//& - str(n=varX(nx,ny,nz))//' '//str(n=varY(nx,ny,nz))//' '//str(n=varZ(nx,ny,nz)) - enddo ; enddo ; enddo - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = 3*NC_NN*BYI4P) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'I4',3*NC_NN - write(vtk(rf)%ua,iostat=E_IO)(((varX(nx,ny,nz),varY(nx,ny,nz),varZ(nx,ny,nz),& - nx=1,size(varX,dim=1)),ny=1,size(varX,dim=2)),nz=1,size(varX,dim=3)) - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - allocate(var(1:3*NC_NN)) - n1 = 0_I4P - do nz=1,size(varX,dim=3) ; do ny=1,size(varX,dim=2) ; do nx=1,size(varX,dim=1) - n1 = n1 + 1_I4P ; var(1+(n1-1)*3:1+(n1-1)*3+2)=[varX(nx,ny,nz),varY(nx,ny,nz),varZ(nx,ny,nz)] - enddo ; enddo ; enddo - Nvarp=size(transfer([int(3*NC_NN*BYI4P,I4P),var],varp),kind=I8P) - if (allocated(varp)) deallocate(varp); allocate(varp(1:Nvarp)) - varp = transfer([int(3*NC_NN*BYI4P,I4P),var],varp) ; deallocate(var) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_VECT_3DA_I4 - - !> Function for saving field of vectorial variable (I2P, 1D arrays). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_VECT_1DA_I2(NC_NN,varname,varX,varY,varZ,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - character(*), intent(IN):: varname !< Variable name. - integer(I2P), intent(IN):: varX(1:) !< X component [1:NC_NN]. - integer(I2P), intent(IN):: varY(1:) !< Y component [1:NC_NN]. - integer(I2P), intent(IN):: varZ(1:) !< Z component [1:NC_NN]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I2P), allocatable:: var(:) !< X, Y, Z component. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)',iostat=E_IO)trim(s_buffer) - do n1=1,NC_NN - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//str(n=varX(n1))//' '//str(n=varY(n1))//' '//str(n=varZ(n1)) - enddo - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = 3*NC_NN*BYI2P) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'I2',3*NC_NN - write(vtk(rf)%ua,iostat=E_IO)(varX(n1),varY(n1),varZ(n1),n1=1,NC_NN) - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - allocate(var(1:3*NC_NN)) - do n1=1,NC_NN - var(1+(n1-1)*3:1+(n1-1)*3+2)=[varX(n1),varY(n1),varZ(n1)] - enddo - call pack_data(a1=[int(3*NC_NN*BYI2P,I4P)],a2=var,packed=varp) ; deallocate(var) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_VECT_1DA_I2 - - !> Function for saving field of vectorial variable (I2P, 3D arrays). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_VECT_3DA_I2(NC_NN,varname,varX,varY,varZ,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - character(*), intent(IN):: varname !< Variable name. - integer(I2P), intent(IN):: varX(1:,1:,1:) !< X component [1:Nx,1:Ny,1:Nz]. - integer(I2P), intent(IN):: varY(1:,1:,1:) !< Y component [1:Nx,1:Ny,1:Nz]. - integer(I2P), intent(IN):: varZ(1:,1:,1:) !< Z component [1:Nx,1:Ny,1:Nz]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I2P), allocatable:: var(:) !< X, Y, Z component. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: nx,ny,nz,n1 !< Counters. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)',iostat=E_IO)trim(s_buffer) - do nz=1,size(varX,dim=3) ; do ny=1,size(varX,dim=2) ; do nx=1,size(varX,dim=1) - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//& - str(n=varX(nx,ny,nz))//' '//str(n=varY(nx,ny,nz))//' '//str(n=varZ(nx,ny,nz)) - enddo ; enddo ; enddo - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = 3*NC_NN*BYI2P) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'I2',3*NC_NN - write(vtk(rf)%ua,iostat=E_IO)(((varX(nx,ny,nz),varY(nx,ny,nz),varZ(nx,ny,nz),& - nx=1,size(varX,dim=1)),ny=1,size(varX,dim=2)),nz=1,size(varX,dim=3)) - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - allocate(var(1:3*NC_NN)) - n1 = 0_I4P - do nz=1,size(varX,dim=3) ; do ny=1,size(varX,dim=2) ; do nx=1,size(varX,dim=1) - n1 = n1 + 1_I4P ; var(1+(n1-1)*3:1+(n1-1)*3+2)=[varX(nx,ny,nz),varY(nx,ny,nz),varZ(nx,ny,nz)] - enddo ; enddo ; enddo - call pack_data(a1=[int(3*NC_NN*BYI2P,I4P)],a2=var,packed=varp) ; deallocate(var) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_VECT_3DA_I2 - - !> Function for saving field of vectorial variable (I1P, 1D arrays). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_VECT_1DA_I1(NC_NN,varname,varX,varY,varZ,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - character(*), intent(IN):: varname !< Variable name. - integer(I1P), intent(IN):: varX(1:) !< X component [1:NC_NN]. - integer(I1P), intent(IN):: varY(1:) !< Y component [1:NC_NN]. - integer(I1P), intent(IN):: varZ(1:) !< Z component [1:NC_NN]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: var(:) !< X, Y, Z component. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer=repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)',iostat=E_IO)trim(s_buffer) - do n1=1,NC_NN - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//str(n=varX(n1))//' '//str(n=varY(n1))//' '//str(n=varZ(n1)) - enddo - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer=repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - vtk(rf)%N_Byte = 3*NC_NN*BYI1P - call vtk(rf)%byte_update(N_Byte = 3*NC_NN*BYI1P) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'I1',3*NC_NN - write(vtk(rf)%ua,iostat=E_IO)(varX(n1),varY(n1),varZ(n1),n1=1,NC_NN) - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - allocate(var(1:3*NC_NN)) - do n1=1,NC_NN - var(1+(n1-1)*3:1+(n1-1)*3+2)=[varX(n1),varY(n1),varZ(n1)] - enddo - call pack_data(a1=[int(3*NC_NN*BYI1P,I4P)],a2=var,packed=varp) ; deallocate(var) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_VECT_1DA_I1 - - !> Function for saving field of vectorial variable (I1P, 3D arrays). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_VECT_3DA_I1(NC_NN,varname,varX,varY,varZ,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - character(*), intent(IN):: varname !< Variable name. - integer(I1P), intent(IN):: varX(1:,1:,1:) !< X component [1:Nx,1:Ny,1:Nz]. - integer(I1P), intent(IN):: varY(1:,1:,1:) !< Y component [1:Nx,1:Ny,1:Nz]. - integer(I1P), intent(IN):: varZ(1:,1:,1:) !< Z component [1:Nx,1:Ny,1:Nz]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: var(:) !< X, Y, Z component. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: nx,ny,nz,n1 !< Counters. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer=repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)',iostat=E_IO)trim(s_buffer) - do nz=1,size(varX,dim=3) ; do ny=1,size(varX,dim=2) ; do nx=1,size(varX,dim=1) - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//& - str(n=varX(nx,ny,nz))//' '//str(n=varY(nx,ny,nz))//' '//str(n=varZ(nx,ny,nz)) - enddo ; enddo ; enddo - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer=repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - vtk(rf)%N_Byte = 3*NC_NN*BYI1P - call vtk(rf)%byte_update(N_Byte = 3*NC_NN*BYI1P) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'I1',3*NC_NN - write(vtk(rf)%ua,iostat=E_IO)(((varX(nx,ny,nz),varY(nx,ny,nz),varZ(nx,ny,nz),& - nx=1,size(varX,dim=1)),ny=1,size(varX,dim=2)),nz=1,size(varX,dim=3)) - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - allocate(var(1:3*NC_NN)) - n1 = 0_I4P - do nz=1,size(varX,dim=3) ; do ny=1,size(varX,dim=2) ; do nx=1,size(varX,dim=1) - n1 = n1 + 1_I4P ; var(1+(n1-1)*3:1+(n1-1)*3+2)=[varX(nx,ny,nz),varY(nx,ny,nz),varZ(nx,ny,nz)] - enddo ; enddo ; enddo - call pack_data(a1=[int(3*NC_NN*BYI1P,I4P)],a2=var,packed=varp) ; deallocate(var) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_VECT_3DA_I1 - - !> Function for saving field of list variable (R8P, 1D array). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_LIST_1DA_R8(NC_NN,N_COL,varname,var,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - integer(I4P), intent(IN):: N_COL !< Number of columns. - character(*), intent(IN):: varname !< Variable name. - real(R8P), intent(IN):: var(1:,1:) !< Components [1:N_COL,1:NC_NN]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1,n2 !< Counters. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)',iostat=E_IO)trim(s_buffer) - do n2=1,NC_NN - write(vtk(rf)%u,'('//trim(str(.true.,N_COL+1))//'A)',iostat=E_IO)repeat(' ',vtk(rf)%indent),& - (' '//str(n=var(n1,n2)),n1=1,N_COL) - enddo - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = N_COL*NC_NN*BYR8P) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'R8',N_COL*NC_NN - write(vtk(rf)%ua,iostat=E_IO)var - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int(N_COL*NC_NN*BYR8P,I4P)],a2=reshape(var,[N_COL*NC_NN]),packed=varp) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_LIST_1DA_R8 - - !> Function for saving field of list variable (R8P, 3D array). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_LIST_3DA_R8(NC_NN,N_COL,varname,var,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - integer(I4P), intent(IN):: N_COL !< Number of columns. - character(*), intent(IN):: varname !< Variable name. - real(R8P), intent(IN):: var(1:,1:,1:,1:) !< Components [1:N_COL,1:Nx,1:Ny,1:Nz]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: nx,ny,nz,n1 !< Counters. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)',iostat=E_IO)trim(s_buffer) - do nz=1,size(var,dim=4) ; do ny=1,size(var,dim=3) ; do nx=1,size(var,dim=2) - write(vtk(rf)%u,'('//trim(str(.true.,N_COL+1))//'A)',iostat=E_IO)repeat(' ',vtk(rf)%indent),& - (' '//str(n=var(n1,nx,ny,nz)),n1=1,N_COL) - enddo ; enddo ; enddo - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = N_COL*NC_NN*BYR8P) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'R8',N_COL*NC_NN - write(vtk(rf)%ua,iostat=E_IO)var - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int(N_COL*NC_NN*BYR8P,I4P)],a2=reshape(var,[N_COL*NC_NN]),packed=varp) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_LIST_3DA_R8 - - !> Function for saving field of list variable (R4P, 1D array). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_LIST_1DA_R4(NC_NN,N_COL,varname,var,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - integer(I4P), intent(IN):: N_COL !< Number of columns. - character(*), intent(IN):: varname !< Variable name. - real(R4P), intent(IN):: var(1:,1:) !< Components [1:N_COL,1:NC_NN]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1,n2 !< Counters. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)',iostat=E_IO)trim(s_buffer) - do n2=1,NC_NN - write(vtk(rf)%u,'('//trim(str(.true.,N_COL+1))//'A)',iostat=E_IO)repeat(' ',vtk(rf)%indent),& - (' '//str(n=var(n1,n2)),n1=1,N_COL) - enddo - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = N_COL*NC_NN*BYR4P) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'R4',N_COL*NC_NN - write(vtk(rf)%ua,iostat=E_IO)var - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int(N_COL*NC_NN*BYR4P,I4P)],a2=reshape(var,[N_COL*NC_NN]),packed=varp) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_LIST_1DA_R4 - - !> Function for saving field of list variable (R4P, 3D array). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_LIST_3DA_R4(NC_NN,N_COL,varname,var,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - integer(I4P), intent(IN):: N_COL !< Number of columns. - character(*), intent(IN):: varname !< Variable name. - real(R4P), intent(IN):: var(1:,1:,1:,1:) !< Components [1:N_COL,1:Nx,1:Ny,1:Nz]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: nx,ny,nz,n1 !< Counters. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)',iostat=E_IO)trim(s_buffer) - do nz=1,size(var,dim=4) ; do ny=1,size(var,dim=3) ; do nx=1,size(var,dim=2) - write(vtk(rf)%u,'('//trim(str(.true.,N_COL+1))//'A)',iostat=E_IO)repeat(' ',vtk(rf)%indent),& - (' '//str(n=var(n1,nx,ny,nz)),n1=1,N_COL) - enddo ; enddo ; enddo - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = N_COL*NC_NN*BYR4P) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'R4',N_COL*NC_NN - write(vtk(rf)%ua,iostat=E_IO)var - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int(N_COL*NC_NN*BYR4P,I4P)],a2=reshape(var,[N_COL*NC_NN]),packed=varp) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_LIST_3DA_R4 - - !> Function for saving field of list variable (I8P, 1D array). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_LIST_1DA_I8(NC_NN,N_COL,varname,var,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - integer(I4P), intent(IN):: N_COL !< Number of columns. - character(*), intent(IN):: varname !< Variable name. - integer(I8P), intent(IN):: var(1:,1:) !< Components [1:N_COL,1:NC_NN]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1,n2 !< Counters. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)',iostat=E_IO)trim(s_buffer) - do n2=1,NC_NN - write(vtk(rf)%u,'('//trim(str(.true.,N_COL+1))//'A)',iostat=E_IO)repeat(' ',vtk(rf)%indent),& - (' '//str(n=var(n1,n2)),n1=1,N_COL) - enddo - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = int(N_COL*NC_NN*BYI8P,I4P)) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'I8',N_COL*NC_NN - write(vtk(rf)%ua,iostat=E_IO)var - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int(N_COL*NC_NN*BYI8P,I4P)],a2=reshape(var,[N_COL*NC_NN]),packed=varp) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_LIST_1DA_I8 - - !> Function for saving field of list variable (I8P, 3D array). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_LIST_3DA_I8(NC_NN,N_COL,varname,var,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - integer(I4P), intent(IN):: N_COL !< Number of columns. - character(*), intent(IN):: varname !< Variable name. - integer(I8P), intent(IN):: var(1:,1:,1:,1:) !< Components [1:N_COL,1:Nx,1:Ny,1:Nz]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: nx,ny,nz,n1 !< Counters. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)',iostat=E_IO)trim(s_buffer) - do nz=1,size(var,dim=4) ; do ny=1,size(var,dim=3) ; do nx=1,size(var,dim=2) - write(vtk(rf)%u,'('//trim(str(.true.,N_COL+1))//'A)',iostat=E_IO)repeat(' ',vtk(rf)%indent),& - (' '//str(n=var(n1,nx,ny,nz)),n1=1,N_COL) - enddo ; enddo ; enddo - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = int(N_COL*NC_NN*BYI8P,I4P)) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'I8',N_COL*NC_NN - write(vtk(rf)%ua,iostat=E_IO)var - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int(N_COL*NC_NN*BYI8P,I4P)],a2=reshape(var,[N_COL*NC_NN]),packed=varp) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_LIST_3DA_I8 - - !> Function for saving field of list variable (I4P, 1D array). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_LIST_1DA_I4(NC_NN,N_COL,varname,var,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - integer(I4P), intent(IN):: N_COL !< Number of columns. - character(*), intent(IN):: varname !< Variable name. - integer(I4P), intent(IN):: var(1:,1:) !< Components [1:N_COL,1:NC_NN]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1,n2 !< Counters. - integer(I8P):: Nvarp !< Dimension of varp, packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)',iostat=E_IO)trim(s_buffer) - do n2=1,NC_NN - write(vtk(rf)%u,'('//trim(str(.true.,N_COL+1))//'A)',iostat=E_IO)repeat(' ',vtk(rf)%indent),& - (' '//str(n=var(n1,n2)),n1=1,N_COL) - enddo - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = N_COL*NC_NN*BYI4P) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'I4',N_COL*NC_NN - write(vtk(rf)%ua,iostat=E_IO)var - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - Nvarp=size(transfer([int(N_COL*NC_NN*BYI4P,I4P),reshape(var,[N_COL*NC_NN])],varp),kind=I8P) - if (allocated(varp)) deallocate(varp); allocate(varp(1:Nvarp)) - varp = transfer([int(N_COL*NC_NN*BYI4P,I4P),reshape(var,[N_COL*NC_NN])],varp) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_LIST_1DA_I4 - - !> Function for saving field of list variable (I4P, 3D array). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_LIST_3DA_I4(NC_NN,N_COL,varname,var,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - integer(I4P), intent(IN):: N_COL !< Number of columns. - character(*), intent(IN):: varname !< Variable name. - integer(I4P), intent(IN):: var(1:,1:,1:,1:) !< Components [1:N_COL,1:Nx,1:Ny,1:Nz]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: nx,ny,nz,n1 !< Counters. - integer(I8P):: Nvarp !< Dimension of varp, packed data. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)',iostat=E_IO)trim(s_buffer) - do nz=1,size(var,dim=4) ; do ny=1,size(var,dim=3) ; do nx=1,size(var,dim=2) - write(vtk(rf)%u,'('//trim(str(.true.,N_COL+1))//'A)',iostat=E_IO)repeat(' ',vtk(rf)%indent),& - (' '//str(n=var(n1,nx,ny,nz)),n1=1,N_COL) - enddo ; enddo ; enddo - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = N_COL*NC_NN*BYI4P) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'I4',N_COL*NC_NN - write(vtk(rf)%ua,iostat=E_IO)var - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - Nvarp=size(transfer([int(N_COL*NC_NN*BYI4P,I4P),reshape(var,[N_COL*NC_NN])],varp),kind=I8P) - if (allocated(varp)) deallocate(varp); allocate(varp(1:Nvarp)) - varp = transfer([int(N_COL*NC_NN*BYI4P,I4P),reshape(var,[N_COL*NC_NN])],varp) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_LIST_3DA_I4 - - !> Function for saving field of list variable (I2P, 1D array). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_LIST_1DA_I2(NC_NN,N_COL,varname,var,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - integer(I4P), intent(IN):: N_COL !< Number of columns. - character(*), intent(IN):: varname !< Variable name. - integer(I2P), intent(IN):: var(1:,1:) !< Components [1:N_COL,1:NC_NN]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1,n2 !< Counters. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)',iostat=E_IO)trim(s_buffer) - do n2=1,NC_NN - write(vtk(rf)%u,'('//trim(str(.true.,N_COL+1))//'A)',iostat=E_IO)repeat(' ',vtk(rf)%indent),& - (' '//str(n=var(n1,n2)),n1=1,N_COL) - enddo - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = N_COL*NC_NN*BYI2P) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'I2',N_COL*NC_NN - write(vtk(rf)%ua,iostat=E_IO)var - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int(N_COL*NC_NN*BYI2P,I4P)],a2=reshape(var,[N_COL*NC_NN]),packed=varp) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_LIST_1DA_I2 - - !> Function for saving field of list variable (I2P, 3D array). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_LIST_3DA_I2(NC_NN,N_COL,varname,var,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - integer(I4P), intent(IN):: N_COL !< Number of columns. - character(*), intent(IN):: varname !< Variable name. - integer(I2P), intent(IN):: var(1:,1:,1:,1:) !< Components [1:N_COL,1:Nx,1:Ny,1:Nz]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: nx,ny,nz,n1 !< Counters. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)',iostat=E_IO)trim(s_buffer) - do nz=1,size(var,dim=4) ; do ny=1,size(var,dim=3) ; do nx=1,size(var,dim=2) - write(vtk(rf)%u,'('//trim(str(.true.,N_COL+1))//'A)',iostat=E_IO)repeat(' ',vtk(rf)%indent),& - (' '//str(n=var(n1,nx,ny,nz)),n1=1,N_COL) - enddo ; enddo ; enddo - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = N_COL*NC_NN*BYI2P) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'I2',N_COL*NC_NN - write(vtk(rf)%ua,iostat=E_IO)var - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int(N_COL*NC_NN*BYI2P,I4P)],a2=reshape(var,[N_COL*NC_NN]),packed=varp) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_LIST_3DA_I2 - - !> Function for saving field of list variable (I1P, 1D array). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_LIST_1DA_I1(NC_NN,N_COL,varname,var,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - integer(I4P), intent(IN):: N_COL !< Number of columns. - character(*), intent(IN):: varname !< Variable name. - integer(I1P), intent(IN):: var(1:,1:) !< Components [1:N_COL,1:NC_NN]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1,n2 !< Counters. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)',iostat=E_IO)trim(s_buffer) - do n2=1,NC_NN - write(vtk(rf)%u,'('//trim(str(.true.,N_COL+1))//'A)',iostat=E_IO)repeat(' ',vtk(rf)%indent),& - (' '//str(n=var(n1,n2)),n1=1,N_COL) - enddo - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = N_COL*NC_NN*BYI1P) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'I1',N_COL*NC_NN - write(vtk(rf)%ua,iostat=E_IO)var - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int(N_COL*NC_NN*BYI1P,I4P)],a2=reshape(var,[N_COL*NC_NN]),packed=varp) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_LIST_1DA_I1 - - !> Function for saving field of list variable (I1P, 3D array). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_XML_LIST_3DA_I1(NC_NN,N_COL,varname,var,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes. - integer(I4P), intent(IN):: N_COL !< Number of columns. - character(*), intent(IN):: varname !< Variable name. - integer(I1P), intent(IN):: var(1:,1:,1:,1:) !< Components [1:N_COL,1:Nx,1:Ny,1:Nz]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I4P):: nx,ny,nz,n1 !< Counters. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,'(A)',iostat=E_IO)trim(s_buffer) - do nz=1,size(var,dim=4) ; do ny=1,size(var,dim=3) ; do nx=1,size(var,dim=2) - write(vtk(rf)%u,'('//trim(str(.true.,N_COL+1))//'A)',iostat=E_IO)repeat(' ',vtk(rf)%indent),& - (' '//str(n=var(n1,nx,ny,nz)),n1=1,N_COL) - enddo ; enddo ; enddo - write(vtk(rf)%u,'(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case(raw,bin_app) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call vtk(rf)%byte_update(N_Byte = N_COL*NC_NN*BYI1P) - write(vtk(rf)%ua,iostat=E_IO)vtk(rf)%N_Byte,'I1',N_COL*NC_NN - write(vtk(rf)%ua,iostat=E_IO)var - case(binary) - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - call pack_data(a1=[int(N_COL*NC_NN*BYI1P,I4P)],a2=reshape(var,[N_COL*NC_NN]),packed=varp) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent+2)//tochar(var64)//end_rec ; deallocate(var64) - write(vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_XML_LIST_3DA_I1 - !> @} - - !> @brief Function for finalizing the VTK-XML file. - !> @note An example of usage is: \n - !> @code ... - !> E_IO = VTK_END_XML() - !> ... @endcode - !> @return E_IO: integer(I4P) error flag - !> @ingroup Lib_VTK_IOPublicProcedure - function VTK_END_XML(cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(INOUT), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(2):: var_type !< Varable type = R8,R4,I8,I4,I2,I1. - real(R8P), allocatable:: v_R8(:) !< R8 vector for IO in AppendData. - real(R4P), allocatable:: v_R4(:) !< R4 vector for IO in AppendData. - integer(I8P), allocatable:: v_I8(:) !< I8 vector for IO in AppendData. - integer(I4P), allocatable:: v_I4(:) !< I4 vector for IO in AppendData. - integer(I2P), allocatable:: v_I2(:) !< I2 vector for IO in AppendData. - integer(I1P), allocatable:: v_I1(:) !< I1 vector for IO in AppendData. - integer(I1P), allocatable:: varp(:) !< Packed data. - character(1), allocatable:: var64(:) !< Variable encoded in base64. - integer(I4P):: rf !< Real file index. - integer(I8P):: Nvarp !< Dimension of varp, packed data. -#ifdef HUGE - integer(I8P):: N_v !< Vector dimension. - integer(I8P):: n1 !< Counter. -#else - integer(I4P):: N_v !< Vector dimension. - integer(I4P):: n1 !< Counter. -#endif - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - vtk(rf)%indent = vtk(rf)%indent - 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)'' - case(raw,bin_app) - vtk(rf)%indent = vtk(rf)%indent - 2 - write(unit =vtk(rf)%u, iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - if (vtk(rf)%f==raw) then - write(unit =vtk(rf)%u, iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - else - write(unit =vtk(rf)%u, iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - endif - write(unit =vtk(rf)%u, iostat=E_IO)'_' - endfile(unit=vtk(rf)%ua,iostat=E_IO) - rewind(unit =vtk(rf)%ua,iostat=E_IO) - do - read(unit=vtk(rf)%ua,iostat=E_IO,end=100)vtk(rf)%N_Byte,var_type,N_v - select case(var_type) - case('R8') - allocate(v_R8(1:N_v)) - read(unit =vtk(rf)%ua,iostat=E_IO)(v_R8(n1),n1=1,N_v) - if (vtk(rf)%f==raw) then - write(unit=vtk(rf)%u,iostat=E_IO)int(vtk(rf)%N_Byte,I4P),(v_R8(n1),n1=1,N_v) - else - call pack_data(a1=[int(vtk(rf)%N_Byte,I4P)],a2=v_R8,packed=varp) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(unit=vtk(rf)%u,iostat=E_IO)tochar(var64) ; deallocate(var64) - endif - deallocate(v_R8) - case('R4') - allocate(v_R4(1:N_v)) - read(unit =vtk(rf)%ua,iostat=E_IO)(v_R4(n1),n1=1,N_v) - if (vtk(rf)%f==raw) then - write(unit=vtk(rf)%u,iostat=E_IO)int(vtk(rf)%N_Byte,I4P),(v_R4(n1),n1=1,N_v) - else - call pack_data(a1=[int(vtk(rf)%N_Byte,I4P)],a2=v_R4,packed=varp) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(unit=vtk(rf)%u,iostat=E_IO)tochar(var64) ; deallocate(var64) - endif - deallocate(v_R4) - case('I8') - allocate(v_I8(1:N_v)) - read(unit =vtk(rf)%ua,iostat=E_IO)(v_I8(n1),n1=1,N_v) - if (vtk(rf)%f==raw) then - write(unit=vtk(rf)%u,iostat=E_IO)int(vtk(rf)%N_Byte,I4P),(v_I8(n1),n1=1,N_v) - else - call pack_data(a1=[int(vtk(rf)%N_Byte,I4P)],a2=v_I8,packed=varp) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(unit=vtk(rf)%u,iostat=E_IO)tochar(var64) ; deallocate(var64) - endif - deallocate(v_I8) - case('I4') - allocate(v_I4(1:N_v)) - read(unit =vtk(rf)%ua,iostat=E_IO)(v_I4(n1),n1=1,N_v) - if (vtk(rf)%f==raw) then - write(unit=vtk(rf)%u,iostat=E_IO)int(vtk(rf)%N_Byte,I4P),(v_I4(n1),n1=1,N_v) - else - Nvarp=size(transfer([int(vtk(rf)%N_Byte,I4P),v_I4],varp),kind=I8P) - if (allocated(varp)) deallocate(varp); allocate(varp(1:Nvarp)) - varp = transfer([int(vtk(rf)%N_Byte,I4P),v_I4],varp) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(unit=vtk(rf)%u,iostat=E_IO)tochar(var64) ; deallocate(var64) - endif - deallocate(v_I4) - case('I2') - allocate(v_I2(1:N_v)) - read(unit =vtk(rf)%ua,iostat=E_IO)(v_I2(n1),n1=1,N_v) - if (vtk(rf)%f==raw) then - write(unit=vtk(rf)%u,iostat=E_IO)int(vtk(rf)%N_Byte,I4P),(v_I2(n1),n1=1,N_v) - else - call pack_data(a1=[int(vtk(rf)%N_Byte,I4P)],a2=v_I2,packed=varp) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(unit=vtk(rf)%u,iostat=E_IO)tochar(var64) ; deallocate(var64) - endif - deallocate(v_I2) - case('I1') - allocate(v_I1(1:N_v)) - read(unit =vtk(rf)%ua,iostat=E_IO)(v_I1(n1),n1=1,N_v) - if (vtk(rf)%f==raw) then - write(unit=vtk(rf)%u,iostat=E_IO)int(vtk(rf)%N_Byte,I4P),(v_I1(n1),n1=1,N_v) - else - call pack_data(a1=[int(vtk(rf)%N_Byte,I4P)],a2=v_I1,packed=varp) - call b64_encode(nB=int(BYI1P,I4P),n=varp,code=var64) ; deallocate(varp) - write(unit=vtk(rf)%u,iostat=E_IO)tochar(var64) ; deallocate(var64) - endif - deallocate(v_I1) - case default - E_IO = 1 - write (stderr,'(A)')' bad var_type = '//var_type - write (stderr,'(A)')' N_Byte = '//trim(str(n=vtk(rf)%N_Byte))//' N_v = '//trim(str(n=N_v)) - return - endselect - enddo - 100 continue - write(unit=vtk(rf)%u,iostat=E_IO)end_rec - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - write(unit=vtk(rf)%u,iostat=E_IO)''//end_rec - close(unit=vtk(rf)%ua,iostat=E_IO) - case(binary) - vtk(rf)%indent = vtk(rf)%indent - 2 - write(unit=vtk(rf)%u,iostat=E_IO)repeat(' ',vtk(rf)%indent)//''//end_rec - write(unit=vtk(rf)%u,iostat=E_IO)''//end_rec - endselect - close(unit=vtk(rf)%u,iostat=E_IO) - call vtk_update(act='remove',cf=rf,Nvtk=Nvtk,vtk=vtk) - f = rf - if (present(cf)) cf = rf - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_END_XML - - !> The VTK_VTM_XML function is used for initializing a VTM (VTK Multiblocks) XML file that is a wrapper to a set of VTK-XML files. - !> @return E_IO: integer(I4P) error flag - !> @ingroup Lib_VTK_IOPublicProcedure - function VTM_INI_XML(filename) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: filename !< File name of output VTM file. - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - if (.not.ir_initialized) call IR_Init - if (endian==endianL) then - s_buffer='' - else - s_buffer='' - endif - open(unit=Get_Unit(vtm%u),file=trim(filename),form='FORMATTED',access='SEQUENTIAL',action='WRITE',status='REPLACE',iostat=E_IO) - write(unit=vtm%u,fmt='(A)',iostat=E_IO)'' - write(unit=vtm%u,fmt='(A)',iostat=E_IO)trim(s_buffer) ; vtm%indent = 2 - write(unit=vtm%u,fmt='(A)',iostat=E_IO)repeat(' ',vtm%indent)//'' ; vtm%indent = vtm%indent + 2 - vtm%blk = -1 - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTM_INI_XML - - !> The VTM_BLK_XML function is used for opening or closing a block level of a VTM file. - !> @return E_IO: integer(I4P) error flag - !> @ingroup Lib_VTK_IOPublicProcedure - function VTM_BLK_XML(block_action) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: block_action !< Block action: OPEN or CLOSE block. - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - select case(trim(Upper_Case(block_action))) - case('OPEN') - vtm%blk = vtm%blk + 1 - write(unit=vtm%u,fmt='(A)',iostat=E_IO)repeat(' ',vtm%indent)//'' - vtm%indent = vtm%indent + 2 - case('CLOSE') - vtm%indent = vtm%indent - 2 ; write(unit=vtm%u,fmt='(A)',iostat=E_IO)repeat(' ',vtm%indent)//'' - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTM_BLK_XML - - !> The VTM_WRF_XML function is used for saving the list of VTK-XML wrapped files by the actual block of the mutliblock VTM file. - !> @return E_IO: integer(I4P) error flag - !> @ingroup Lib_VTK_IOPublicProcedure - function VTM_WRF_XML(flist) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: flist(:) !< List of VTK-XML wrapped files. - integer(I4P):: E_IO !< Input/Output inquiring flag: 0 if IO is done, > 0 if IO is not done. - integer(I4P):: f !< File counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - do f=1,size(flist) - write(unit=vtm%u,fmt='(A)',iostat=E_IO)repeat(' ',vtm%indent)//'' - enddo - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTM_WRF_XML - - !> Function for finalizing open file, it has not inputs, @libvtk manages the file unit without the - !> user's action. - !> @return E_IO: integer(I4P) error flag - !> @ingroup Lib_VTK_IOPublicProcedure - function VTM_END_XML() result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - vtm%indent = vtm%indent - 2 - write(unit=vtm%u,fmt='(A)',iostat=E_IO)repeat(' ',vtm%indent)//'' - write(unit=vtm%u,fmt='(A)',iostat=E_IO)'' - close(unit=vtm%u) - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTM_END_XML - - !> @brief Function for initializing parallel (partitioned) VTK-XML file. - !> @return E_IO: integer(I4P) error flag - !> @ingroup Lib_VTK_IOPublicProcedure - function PVTK_INI_XML(filename,mesh_topology,tp,cf,nx1,nx2,ny1,ny2,nz1,nz2) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: filename !< File name. - character(*), intent(IN):: mesh_topology !< Mesh topology. - character(*), intent(IN):: tp !< Type of geometry representation (Float32, Float64, ecc). - integer(I4P), intent(OUT), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P), intent(IN), optional:: nx1 !< Initial node of x axis. - integer(I4P), intent(IN), optional:: nx2 !< Final node of x axis. - integer(I4P), intent(IN), optional:: ny1 !< Initial node of y axis. - integer(I4P), intent(IN), optional:: ny2 !< Final node of y axis. - integer(I4P), intent(IN), optional:: nz1 !< Initial node of z axis. - integer(I4P), intent(IN), optional:: nz2 !< Final node of z axis. - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I4P):: rf !< Real file index. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - if (.not.ir_initialized) call IR_Init - call vtk_update(act='add',cf=rf,Nvtk=Nvtk,vtk=vtk) - f = rf - if (present(cf)) cf = rf - vtk(rf)%topology = trim(mesh_topology) - open(unit=Get_Unit(vtk(rf)%u),file=trim(filename),& - form='FORMATTED',access='SEQUENTIAL',action='WRITE',status='REPLACE',iostat=E_IO) - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)'' - if (endian==endianL) then - s_buffer = '' - else - s_buffer = '' - endif - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) ; vtk(rf)%indent = 2 - select case(trim(vtk(rf)%topology)) - case('PRectilinearGrid') - s_buffer = repeat(' ',vtk(rf)%indent)//'<'//trim(vtk(rf)%topology)//' WholeExtent="'//& - trim(str(n=nx1))//' '//trim(str(n=nx2))//' '// & - trim(str(n=ny1))//' '//trim(str(n=ny2))//' '// & - trim(str(n=nz1))//' '//trim(str(n=nz2))//'" GhostLevel="#">' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case('PStructuredGrid') - s_buffer = repeat(' ',vtk(rf)%indent)//'<'//trim(vtk(rf)%topology)//' WholeExtent="'//& - trim(str(n=nx1))//' '//trim(str(n=nx2))//' '// & - trim(str(n=ny1))//' '//trim(str(n=ny2))//' '// & - trim(str(n=nz1))//' '//trim(str(n=nz2))//'" GhostLevel="#">' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - case('PUnstructuredGrid') - s_buffer = repeat(' ',vtk(rf)%indent)//'<'//trim(vtk(rf)%topology)//' GhostLevel="0">' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) ; vtk(rf)%indent = vtk(rf)%indent + 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent + 2 - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction PVTK_INI_XML - - !> Function for saving piece geometry source for parallel (partitioned) VTK-XML file. - !> @return E_IO: integer(I4P) error flag - !> @ingroup Lib_VTK_IOPublicProcedure - function PVTK_GEO_XML(source,cf,nx1,nx2,ny1,ny2,nz1,nz2) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: source !< Source file name containing the piece data. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P), intent(IN), optional:: nx1 !< Initial node of x axis. - integer(I4P), intent(IN), optional:: nx2 !< Final node of x axis. - integer(I4P), intent(IN), optional:: ny1 !< Initial node of y axis. - integer(I4P), intent(IN), optional:: ny2 !< Final node of y axis. - integer(I4P), intent(IN), optional:: nz1 !< Initial node of z axis. - integer(I4P), intent(IN), optional:: nz2 !< Final node of z axis. - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I4P):: rf !< Real file index. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case (vtk(rf)%topology) - case('PRectilinearGrid','PStructuredGrid') - s_buffer = repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) - case('PUnstructuredGrid') - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction PVTK_GEO_XML - - !> Function that \b must be called before saving the data related to geometric mesh, this function initializes the - !> saving of data variables indicating the \em type (node or cell centered) of variables that will be saved. - !> @ingroup Lib_VTK_IOPublicProcedure - function PVTK_DAT_XML(var_location,var_block_action,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: var_location !< Location of saving variables: CELL or NODE centered. - character(*), intent(IN):: var_block_action !< Variables block action: OPEN or CLOSE block. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - integer(I4P):: rf !< Real file index. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(trim(Upper_Case(var_location))) - case('CELL') - select case(trim(Upper_Case(var_block_action))) - case('OPEN') - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent + 2 - case('CLOSE') - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - endselect - case('NODE') - select case(trim(Upper_Case(var_block_action))) - case('OPEN') - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' ; vtk(rf)%indent = vtk(rf)%indent + 2 - case('CLOSE') - vtk(rf)%indent = vtk(rf)%indent - 2 ; write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - endselect - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction PVTK_DAT_XML - - !> Function for saving variable associated to nodes or cells geometry. - !> @return E_IO: integer(I4P) error flag - !> @ingroup Lib_VTK_IOPublicProcedure - function PVTK_VAR_XML(varname,tp,cf,Nc) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: varname !< Variable name. - character(*), intent(IN):: tp !< Type of data representation (Float32, Float64, ecc). - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P), intent(IN), optional:: Nc !< Number of components of variable. - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I4P):: rf !< Real file index. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - if (present(Nc)) then - s_buffer = repeat(' ',vtk(rf)%indent)//'' - else - s_buffer = repeat(' ',vtk(rf)%indent)//'' - endif - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(s_buffer) - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction PVTK_VAR_XML - - !> @brief Function for finalizing the parallel (partitioned) VTK-XML file. - !> @return E_IO: integer(I4P) error flag - !> @ingroup Lib_VTK_IOPublicProcedure - function PVTK_END_XML(cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(INOUT), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - integer(I4P):: rf !< Real file index. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - vtk(rf)%indent = vtk(rf)%indent - 2 - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)repeat(' ',vtk(rf)%indent)//'' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)'' - close(unit=vtk(rf)%u,iostat=E_IO) - call vtk_update(act='remove',cf=rf,Nvtk=Nvtk,vtk=vtk) - f = rf - if (present(cf)) cf = rf - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction PVTK_END_XML - - !> @brief Function for initializing VTK-legacy file. - !> @remark This function must be the first to be called. - !> @note An example of usage is: \n - !> @code ... - !> E_IO=VTK_INI('Binary','example.vtk','VTK legacy file','UNSTRUCTURED_GRID') - !> ... @endcode - !> @return E_IO: integer(I4P) error flag - !> @ingroup Lib_VTK_IOPublicProcedure - function VTK_INI(output_format,filename,title,mesh_topology,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: output_format !< Output format: ASCII or RAW. - character(*), intent(IN):: filename !< Name of file. - character(*), intent(IN):: title !< Title. - character(*), intent(IN):: mesh_topology !< Mesh topology. - integer(I4P), intent(OUT), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - integer(I4P):: rf !< Real file index. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - if (.not.ir_initialized) call IR_Init - call vtk_update(act='add',cf=rf,Nvtk=Nvtk,vtk=vtk) - f = rf - if (present(cf)) cf = rf - vtk(rf)%topology = trim(mesh_topology) - select case(trim(Upper_Case(output_format))) - case('ASCII') - vtk(rf)%f = ascii - open(unit=Get_Unit(vtk(rf)%u),file=trim(filename),form='FORMATTED',& - access='SEQUENTIAL',action='WRITE',status='REPLACE',iostat=E_IO) - ! writing header of file - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)'# vtk DataFile Version 3.0' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(title) - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)trim(Upper_Case(output_format)) - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)'DATASET '//trim(vtk(rf)%topology) - case('RAW') - vtk(rf)%f = raw - open(unit=Get_Unit(vtk(rf)%u),file=trim(filename),& - form='UNFORMATTED',access='STREAM',action='WRITE',status='REPLACE',iostat=E_IO) - ! writing header of file - write(unit=vtk(rf)%u,iostat=E_IO)'# vtk DataFile Version 3.0'//end_rec - write(unit=vtk(rf)%u,iostat=E_IO)trim(title)//end_rec - write(unit=vtk(rf)%u,iostat=E_IO)trim(Upper_Case(output_format))//end_rec - write(unit=vtk(rf)%u,iostat=E_IO)'DATASET '//trim(vtk(rf)%topology)//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_INI - - !> @ingroup Lib_VTK_IOPrivateProcedure - !> @{ - !> Function for saving mesh with \b STRUCTURED_POINTS topology (R8P). - !> @return E_IO: integer(I4P) error flag - function VTK_GEO_STRP_R8(Nx,Ny,Nz,X0,Y0,Z0,Dx,Dy,Dz,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: Nx !< Number of nodes in x direction. - integer(I4P), intent(IN):: Ny !< Number of nodes in y direction. - integer(I4P), intent(IN):: Nz !< Number of nodes in z direction. - real(R8P), intent(IN):: X0 !< X coordinate of origin. - real(R8P), intent(IN):: Y0 !< Y coordinate of origin. - real(R8P), intent(IN):: Z0 !< Z coordinate of origin. - real(R8P), intent(IN):: Dx !< Space step in x direction. - real(R8P), intent(IN):: Dy !< Space step in y direction. - real(R8P), intent(IN):: Dz !< Space step in z direction. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - integer(I4P):: rf !< Real file index. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - write(vtk(rf)%u,'(A)',iostat=E_IO)'DIMENSIONS '//trim(str(.true.,Nx))//' '//trim(str(.true.,Ny))//' '//trim(str(.true.,Nz)) - write(vtk(rf)%u,'(A)',iostat=E_IO)'ORIGIN '//trim(str(n=X0))//' '//trim(str(n=Y0))//' '//trim(str(n=Z0)) - write(vtk(rf)%u,'(A)',iostat=E_IO)'SPACING '//trim(str(n=Dx))//' '//trim(str(n=Dy))//' '//trim(str(n=Dz)) - case(raw) - write(vtk(rf)%u,iostat=E_IO)'DIMENSIONS '//trim(str(.true.,Nx))//' '//trim(str(.true.,Ny))//' '//trim(str(.true.,Nz))//end_rec - write(vtk(rf)%u,iostat=E_IO)'ORIGIN '//trim(str(n=X0))//' '//trim(str(n=Y0))//' '//trim(str(n=Z0))//end_rec - write(vtk(rf)%u,iostat=E_IO)'SPACING '//trim(str(n=Dx))//' '//trim(str(n=Dy))//' '//trim(str(n=Dz))//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_GEO_STRP_R8 - - !> Function for saving mesh with \b STRUCTURED_POINTS topology (R4P). - !> @return E_IO: integer(I4P) error flag - function VTK_GEO_STRP_R4(Nx,Ny,Nz,X0,Y0,Z0,Dx,Dy,Dz,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: Nx !< Number of nodes in x direction. - integer(I4P), intent(IN):: Ny !< Number of nodes in y direction. - integer(I4P), intent(IN):: Nz !< Number of nodes in z direction. - real(R4P), intent(IN):: X0 !< X coordinate of origin. - real(R4P), intent(IN):: Y0 !< Y coordinate of origin. - real(R4P), intent(IN):: Z0 !< Z coordinate of origin. - real(R4P), intent(IN):: Dx !< Space step in x direction. - real(R4P), intent(IN):: Dy !< Space step in y direction. - real(R4P), intent(IN):: Dz !< Space step in z direction. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - integer(I4P):: rf !< Real file index. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - write(vtk(rf)%u,'(A)',iostat=E_IO)'DIMENSIONS '//trim(str(.true.,Nx))//' '//trim(str(.true.,Ny))//' '//trim(str(.true.,Nz)) - write(vtk(rf)%u,'(A)',iostat=E_IO)'ORIGIN '//trim(str(n=X0))//' '//trim(str(n=Y0))//' '//trim(str(n=Z0)) - write(vtk(rf)%u,'(A)',iostat=E_IO)'SPACING '//trim(str(n=Dx))//' '//trim(str(n=Dy))//' '//trim(str(n=Dz)) - case(raw) - write(vtk(rf)%u,iostat=E_IO)'DIMENSIONS '//trim(str(.true.,Nx))//' '//trim(str(.true.,Ny))//' '//trim(str(.true.,Nz))//end_rec - write(vtk(rf)%u,iostat=E_IO)'ORIGIN '//trim(str(n=X0))//' '//trim(str(n=Y0))//' '//trim(str(n=Z0))//end_rec - write(vtk(rf)%u,iostat=E_IO)'SPACING '//trim(str(n=Dx))//' '//trim(str(n=Dy))//' '//trim(str(n=Dz))//end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_GEO_STRP_R4 - - !> Function for saving mesh with \b STRUCTURED_GRID topology (R8P, 1D arrays). - !> @return E_IO: integer(I4P) error flag - function VTK_GEO_STRG_1DA_R8(Nx,Ny,Nz,NN,X,Y,Z,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: Nx !< Number of nodes in x direction. - integer(I4P), intent(IN):: Ny !< Number of nodes in y direction. - integer(I4P), intent(IN):: Nz !< Number of nodes in z direction. - integer(I4P), intent(IN):: NN !< Number of all nodes. - real(R8P), intent(IN):: X(1:) !< X coordinates [1:NN]. - real(R8P), intent(IN):: Y(1:) !< Y coordinates [1:NN]. - real(R8P), intent(IN):: Z(1:) !< Z coordinates [1:NN]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - write(vtk(rf)%u,'(A)',iostat=E_IO)'DIMENSIONS '//trim(str(.true.,Nx))//' '//trim(str(.true.,Ny))//' '//trim(str(.true.,Nz)) - write(vtk(rf)%u,'(A)',iostat=E_IO)'POINTS '//trim(str(.true.,NN))//' double' - do n1=1,NN - write(vtk(rf)%u,'(A)',iostat=E_IO)str(n=X(n1))//' '//str(n=Y(n1))//' '//str(n=Z(n1)) - enddo - case(raw) - write(vtk(rf)%u,iostat=E_IO)'DIMENSIONS '//trim(str(.true.,Nx))//' '//trim(str(.true.,Ny))//' '//trim(str(.true.,Nz))//end_rec - write(vtk(rf)%u,iostat=E_IO)'POINTS '//trim(str(.true.,NN))//' double'//end_rec - write(vtk(rf)%u,iostat=E_IO)(X(n1),Y(n1),Z(n1),n1=1,NN) - write(vtk(rf)%u,iostat=E_IO)end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_GEO_STRG_1DA_R8 - - !> Function for saving mesh with \b STRUCTURED_GRID topology (R8P, 1D arrays, packed API). - !> @return E_IO: integer(I4P) error flag - function VTK_GEO_STRG_1DAP_R8(Nx,Ny,Nz,NN,XYZ,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: Nx !< Number of nodes in x direction. - integer(I4P), intent(IN):: Ny !< Number of nodes in y direction. - integer(I4P), intent(IN):: Nz !< Number of nodes in z direction. - integer(I4P), intent(IN):: NN !< Number of all nodes. - real(R8P), intent(IN):: XYZ(1:,1:) !< X, Y and Z coordinates [1:3,1:NN]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - write(vtk(rf)%u,'(A)',iostat=E_IO)'DIMENSIONS '//trim(str(.true.,Nx))//' '//trim(str(.true.,Ny))//' '//trim(str(.true.,Nz)) - write(vtk(rf)%u,'(A)',iostat=E_IO)'POINTS '//trim(str(.true.,NN))//' double' - do n1=1,NN - write(vtk(rf)%u,'(A)',iostat=E_IO)str(n=XYZ(1,n1))//' '//str(n=XYZ(2,n1))//' '//str(n=XYZ(3,n1)) - enddo - case(raw) - write(vtk(rf)%u,iostat=E_IO)'DIMENSIONS '//trim(str(.true.,Nx))//' '//trim(str(.true.,Ny))//' '//trim(str(.true.,Nz))//end_rec - write(vtk(rf)%u,iostat=E_IO)'POINTS '//trim(str(.true.,NN))//' double'//end_rec - write(vtk(rf)%u,iostat=E_IO)XYZ - write(vtk(rf)%u,iostat=E_IO)end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_GEO_STRG_1DAP_R8 - - !> Function for saving mesh with \b STRUCTURED_GRID topology (R8P, 3D arrays). - !> @return E_IO: integer(I4P) error flag - function VTK_GEO_STRG_3DA_R8(Nx,Ny,Nz,NN,X,Y,Z,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: Nx !< Number of nodes in x direction. - integer(I4P), intent(IN):: Ny !< Number of nodes in y direction. - integer(I4P), intent(IN):: Nz !< Number of nodes in z direction. - integer(I4P), intent(IN):: NN !< Number of all nodes. - real(R8P), intent(IN):: X(1:,1:,1:) !< X coordinates [1:Nx,1:Ny,1:Nz]. - real(R8P), intent(IN):: Y(1:,1:,1:) !< Y coordinates [1:Nx,1:Ny,1:Nz]. - real(R8P), intent(IN):: Z(1:,1:,1:) !< Z coordinates [1:Nx,1:Ny,1:Nz]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1,n2,n3 !< Counters. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - write(vtk(rf)%u,'(A)',iostat=E_IO)'DIMENSIONS '//trim(str(.true.,Nx))//' '//trim(str(.true.,Ny))//' '//trim(str(.true.,Nz)) - write(vtk(rf)%u,'(A)',iostat=E_IO)'POINTS '//trim(str(.true.,NN))//' double' - do n3=1,Nz - do n2=1,Ny - do n1=1,Nx - write(vtk(rf)%u,'(A)',iostat=E_IO)str(n=X(n1,n2,n3))//' '//str(n=Y(n1,n2,n3))//' '//str(n=Z(n1,n2,n3)) - enddo - enddo - enddo - case(raw) - write(vtk(rf)%u,iostat=E_IO)'DIMENSIONS '//trim(str(.true.,Nx))//' '//trim(str(.true.,Ny))//' '//trim(str(.true.,Nz))//end_rec - write(vtk(rf)%u,iostat=E_IO)'POINTS '//trim(str(.true.,NN))//' double'//end_rec - write(vtk(rf)%u,iostat=E_IO)(((X(n1,n2,n3),Y(n1,n2,n3),Z(n1,n2,n3),n1=1,Nx),n2=1,Ny),n3=1,Nz) - write(vtk(rf)%u,iostat=E_IO)end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_GEO_STRG_3DA_R8 - - !> Function for saving mesh with \b STRUCTURED_GRID topology (R8P, 3D arrays, packed API). - !> @return E_IO: integer(I4P) error flag - function VTK_GEO_STRG_3DAP_R8(Nx,Ny,Nz,NN,XYZ,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: Nx !< Number of nodes in x direction. - integer(I4P), intent(IN):: Ny !< Number of nodes in y direction. - integer(I4P), intent(IN):: Nz !< Number of nodes in z direction. - integer(I4P), intent(IN):: NN !< Number of all nodes. - real(R8P), intent(IN):: XYZ(1:,1:,1:,1:) !< X, Y and Z coordinates [1:3,1:Nx,1:Ny,1:Nz]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1,n2,n3 !< Counters. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - write(vtk(rf)%u,'(A)',iostat=E_IO)'DIMENSIONS '//trim(str(.true.,Nx))//' '//trim(str(.true.,Ny))//' '//trim(str(.true.,Nz)) - write(vtk(rf)%u,'(A)',iostat=E_IO)'POINTS '//trim(str(.true.,NN))//' double' - do n3=1,Nz - do n2=1,Ny - do n1=1,Nx - write(vtk(rf)%u,'(A)',iostat=E_IO)str(n=XYZ(1,n1,n2,n3))//' '//str(n=XYZ(2,n1,n2,n3))//' '//str(n=XYZ(3,n1,n2,n3)) - enddo - enddo - enddo - case(raw) - write(vtk(rf)%u,iostat=E_IO)'DIMENSIONS '//trim(str(.true.,Nx))//' '//trim(str(.true.,Ny))//' '//trim(str(.true.,Nz))//end_rec - write(vtk(rf)%u,iostat=E_IO)'POINTS '//trim(str(.true.,NN))//' double'//end_rec - write(vtk(rf)%u,iostat=E_IO)XYZ - write(vtk(rf)%u,iostat=E_IO)end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_GEO_STRG_3DAP_R8 - - !> Function for saving mesh with \b STRUCTURED_GRID topology (R4P, 1D arrays). - !> @return E_IO: integer(I4P) error flag - function VTK_GEO_STRG_1DA_R4(Nx,Ny,Nz,NN,X,Y,Z,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: Nx !< Number of nodes in x direction. - integer(I4P), intent(IN):: Ny !< Number of nodes in y direction. - integer(I4P), intent(IN):: Nz !< Number of nodes in z direction. - integer(I4P), intent(IN):: NN !< Number of all nodes. - real(R4P), intent(IN):: X(1:) !< X coordinates [1:NN]. - real(R4P), intent(IN):: Y(1:) !< Y coordinates [1:NN]. - real(R4P), intent(IN):: Z(1:) !< Z coordinates [1:NN]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - write(vtk(rf)%u,'(A)',iostat=E_IO)'DIMENSIONS '//trim(str(.true.,Nx))//' '//trim(str(.true.,Ny))//' '//trim(str(.true.,Nz)) - write(vtk(rf)%u,'(A)',iostat=E_IO)'POINTS '//trim(str(.true.,NN))//' float' - do n1=1,NN - write(vtk(rf)%u,'(A)',iostat=E_IO)str(n=X(n1))//' '//str(n=Y(n1))//' '//str(n=Z(n1)) - enddo - case(raw) - write(vtk(rf)%u,iostat=E_IO)'DIMENSIONS '//trim(str(.true.,Nx))//' '//trim(str(.true.,Ny))//' '//trim(str(.true.,Nz))//end_rec - write(vtk(rf)%u,iostat=E_IO)'POINTS '//trim(str(.true.,NN))//' float'//end_rec - write(vtk(rf)%u,iostat=E_IO)(X(n1),Y(n1),Z(n1),n1=1,NN) - write(vtk(rf)%u,iostat=E_IO)end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_GEO_STRG_1DA_R4 - - !> Function for saving mesh with \b STRUCTURED_GRID topology (R4P, 1D arrays, packed API). - !> @return E_IO: integer(I4P) error flag - function VTK_GEO_STRG_1DAP_R4(Nx,Ny,Nz,NN,XYZ,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: Nx !< Number of nodes in x direction. - integer(I4P), intent(IN):: Ny !< Number of nodes in y direction. - integer(I4P), intent(IN):: Nz !< Number of nodes in z direction. - integer(I4P), intent(IN):: NN !< Number of all nodes. - real(R4P), intent(IN):: XYZ(1:,1:) !< X, Y and Z coordinates [1:3,1:NN]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - write(vtk(rf)%u,'(A)',iostat=E_IO)'DIMENSIONS '//trim(str(.true.,Nx))//' '//trim(str(.true.,Ny))//' '//trim(str(.true.,Nz)) - write(vtk(rf)%u,'(A)',iostat=E_IO)'POINTS '//trim(str(.true.,NN))//' float' - do n1=1,NN - write(vtk(rf)%u,'(A)',iostat=E_IO)str(n=XYZ(1,n1))//' '//str(n=XYZ(2,n1))//' '//str(n=XYZ(3,n1)) - enddo - case(raw) - write(vtk(rf)%u,iostat=E_IO)'DIMENSIONS '//trim(str(.true.,Nx))//' '//trim(str(.true.,Ny))//' '//trim(str(.true.,Nz))//end_rec - write(vtk(rf)%u,iostat=E_IO)'POINTS '//trim(str(.true.,NN))//' float'//end_rec - write(vtk(rf)%u,iostat=E_IO)XYZ - write(vtk(rf)%u,iostat=E_IO)end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_GEO_STRG_1DAP_R4 - - !> Function for saving mesh with \b STRUCTURED_GRID topology (R4P, 3D arrays). - !> @return E_IO: integer(I4P) error flag - function VTK_GEO_STRG_3DA_R4(Nx,Ny,Nz,NN,X,Y,Z,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: Nx !< Number of nodes in x direction. - integer(I4P), intent(IN):: Ny !< Number of nodes in y direction. - integer(I4P), intent(IN):: Nz !< Number of nodes in z direction. - integer(I4P), intent(IN):: NN !< Number of all nodes. - real(R4P), intent(IN):: X(1:,1:,1:) !< X coordinates [1:Nx,1:Ny,1:Nz]. - real(R4P), intent(IN):: Y(1:,1:,1:) !< Y coordinates [1:Nx,1:Ny,1:Nz]. - real(R4P), intent(IN):: Z(1:,1:,1:) !< Z coordinates [1:Nx,1:Ny,1:Nz]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1,n2,n3 !< Counters. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - write(vtk(rf)%u,'(A)',iostat=E_IO)'DIMENSIONS '//trim(str(.true.,Nx))//' '//trim(str(.true.,Ny))//' '//trim(str(.true.,Nz)) - write(vtk(rf)%u,'(A)',iostat=E_IO)'POINTS '//trim(str(.true.,NN))//' float' - do n3=1,Nz - do n2=1,Ny - do n1=1,Nx - write(vtk(rf)%u,'(A)',iostat=E_IO)str(n=X(n1,n2,n3))//' '//str(n=Y(n1,n2,n3))//' '//str(n=Z(n1,n2,n3)) - enddo - enddo - enddo - case(raw) - write(vtk(rf)%u,iostat=E_IO)'DIMENSIONS '//trim(str(.true.,Nx))//' '//trim(str(.true.,Ny))//' '//trim(str(.true.,Nz))//end_rec - write(vtk(rf)%u,iostat=E_IO)'POINTS '//trim(str(.true.,NN))//' float'//end_rec - write(vtk(rf)%u,iostat=E_IO)(((X(n1,n2,n3),Y(n1,n2,n3),Z(n1,n2,n3),n1=1,Nx),n2=1,Ny),n3=1,Nz) - write(vtk(rf)%u,iostat=E_IO)end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_GEO_STRG_3DA_R4 - - !> Function for saving mesh with \b STRUCTURED_GRID topology (R4P, 3D arrays, packed API). - !> @return E_IO: integer(I4P) error flag - function VTK_GEO_STRG_3DAP_R4(Nx,Ny,Nz,NN,XYZ,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: Nx !< Number of nodes in x direction. - integer(I4P), intent(IN):: Ny !< Number of nodes in y direction. - integer(I4P), intent(IN):: Nz !< Number of nodes in z direction. - integer(I4P), intent(IN):: NN !< Number of all nodes. - real(R4P), intent(IN):: XYZ(1:,1:,1:,1:) !< X, Y and Z coordinates [1:3,1:Nx,1:Ny,1:Nz]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1,n2,n3 !< Counters. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - write(vtk(rf)%u,'(A)',iostat=E_IO)'DIMENSIONS '//trim(str(.true.,Nx))//' '//trim(str(.true.,Ny))//' '//trim(str(.true.,Nz)) - write(vtk(rf)%u,'(A)',iostat=E_IO)'POINTS '//trim(str(.true.,NN))//' float' - do n3=1,Nz - do n2=1,Ny - do n1=1,Nx - write(vtk(rf)%u,'(A)',iostat=E_IO)str(n=XYZ(1,n1,n2,n3))//' '//str(n=XYZ(2,n1,n2,n3))//' '//str(n=XYZ(3,n1,n2,n3)) - enddo - enddo - enddo - case(raw) - write(vtk(rf)%u,iostat=E_IO)'DIMENSIONS '//trim(str(.true.,Nx))//' '//trim(str(.true.,Ny))//' '//trim(str(.true.,Nz))//end_rec - write(vtk(rf)%u,iostat=E_IO)'POINTS '//trim(str(.true.,NN))//' float'//end_rec - write(vtk(rf)%u,iostat=E_IO)XYZ - write(vtk(rf)%u,iostat=E_IO)end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_GEO_STRG_3DAP_R4 - - !> Function for saving mesh with \b RECTILINEAR_GRID topology (R8P). - !> @return E_IO: integer(I4P) error flag - function VTK_GEO_RECT_R8(Nx,Ny,Nz,X,Y,Z,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: Nx !< Number of nodes in x direction. - integer(I4P), intent(IN):: Ny !< Number of nodes in y direction. - integer(I4P), intent(IN):: Nz !< Number of nodes in z direction. - real(R8P), intent(IN):: X(1:Nx) !< X coordinates. - real(R8P), intent(IN):: Y(1:Ny) !< Y coordinates. - real(R8P), intent(IN):: Z(1:Nz) !< Z coordinates. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - write(vtk(rf)%u,'(A)',iostat=E_IO)'DIMENSIONS '//trim(str(.true.,Nx))//' '//trim(str(.true.,Ny))//' '//trim(str(.true.,Nz)) - write(vtk(rf)%u,'(A)',iostat=E_IO)'X_COORDINATES '//trim(str(.true.,Nx))//' double' - do n1=1,Nx - write(vtk(rf)%u,'(A)',iostat=E_IO)str(n=X(n1)) - enddo - write(vtk(rf)%u,'(A)',iostat=E_IO)'Y_COORDINATES '//trim(str(.true.,Ny))//' double' - do n1=1,Ny - write(vtk(rf)%u,'(A)',iostat=E_IO)str(n=Y(n1)) - enddo - write(vtk(rf)%u,'(A)',iostat=E_IO)'Z_COORDINATES '//trim(str(.true.,Nz))//' double' - do n1=1,Nz - write(vtk(rf)%u,'(A)',iostat=E_IO)str(n=Z(n1)) - enddo - case(raw) - write(vtk(rf)%u,iostat=E_IO)'DIMENSIONS '//trim(str(.true.,Nx))//' '//trim(str(.true.,Ny))//' '//trim(str(.true.,Nz))//end_rec - write(vtk(rf)%u,iostat=E_IO)'X_COORDINATES '//trim(str(.true.,Nx))//' double'//end_rec - write(vtk(rf)%u,iostat=E_IO)X - write(vtk(rf)%u,iostat=E_IO)end_rec - write(vtk(rf)%u,iostat=E_IO)'Y_COORDINATES '//trim(str(.true.,Ny))//' double'//end_rec - write(vtk(rf)%u,iostat=E_IO)Y - write(vtk(rf)%u,iostat=E_IO)end_rec - write(vtk(rf)%u,iostat=E_IO)'Z_COORDINATES '//trim(str(.true.,Nz))//' double'//end_rec - write(vtk(rf)%u,iostat=E_IO)Z - write(vtk(rf)%u,iostat=E_IO)end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_GEO_RECT_R8 - - !> Function for saving mesh with \b RECTILINEAR_GRID topology (R4P). - !> @return E_IO: integer(I4P) error flag - function VTK_GEO_RECT_R4(Nx,Ny,Nz,X,Y,Z,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: Nx !< Number of nodes in x direction. - integer(I4P), intent(IN):: Ny !< Number of nodes in y direction. - integer(I4P), intent(IN):: Nz !< Number of nodes in z direction. - real(R4P), intent(IN):: X(1:Nx) !< X coordinates. - real(R4P), intent(IN):: Y(1:Ny) !< Y coordinates. - real(R4P), intent(IN):: Z(1:Nz) !< Z coordinates. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - write(vtk(rf)%u,'(A)',iostat=E_IO)'DIMENSIONS '//trim(str(.true.,Nx))//' '//trim(str(.true.,Ny))//' '//trim(str(.true.,Nz)) - write(vtk(rf)%u,'(A)',iostat=E_IO)'X_COORDINATES '//trim(str(.true.,Nx))//' float' - do n1=1,Nx - write(vtk(rf)%u,'(A)',iostat=E_IO)str(n=X(n1)) - enddo - write(vtk(rf)%u,'(A)',iostat=E_IO)'Y_COORDINATES '//trim(str(.true.,Ny))//' float' - do n1=1,Ny - write(vtk(rf)%u,'(A)',iostat=E_IO)str(n=Y(n1)) - enddo - write(vtk(rf)%u,'(A)',iostat=E_IO)'Z_COORDINATES '//trim(str(.true.,Nz))//' float' - do n1=1,Nz - write(vtk(rf)%u,'(A)',iostat=E_IO)str(n=Z(n1)) - enddo - case(raw) - write(vtk(rf)%u,iostat=E_IO)'DIMENSIONS '//trim(str(.true.,Nx))//' '//trim(str(.true.,Ny))//' '//trim(str(.true.,Nz))//end_rec - write(vtk(rf)%u,iostat=E_IO)'X_COORDINATES '//trim(str(.true.,Nx))//' float'//end_rec - write(vtk(rf)%u,iostat=E_IO)X - write(vtk(rf)%u,iostat=E_IO)end_rec - write(vtk(rf)%u,iostat=E_IO)'Y_COORDINATES '//trim(str(.true.,Ny))//' float'//end_rec - write(vtk(rf)%u,iostat=E_IO)Y - write(vtk(rf)%u,iostat=E_IO)end_rec - write(vtk(rf)%u,iostat=E_IO)'Z_COORDINATES '//trim(str(.true.,Nz))//' float'//end_rec - write(vtk(rf)%u,iostat=E_IO)Z - write(vtk(rf)%u,iostat=E_IO)end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_GEO_RECT_R4 - - !> Function for saving mesh with \b UNSTRUCTURED_GRID topology (R8P). - !> @return E_IO: integer(I4P) error flag - function VTK_GEO_UNST_R8(NN,X,Y,Z,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NN !< Number of nodes. - real(R8P), intent(IN):: X(1:) !< X coordinates of all nodes [1:NN]. - real(R8P), intent(IN):: Y(1:) !< Y coordinates of all nodes [1:NN]. - real(R8P), intent(IN):: Z(1:) !< Z coordinates of all nodes [1:NN]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)'POINTS '//str(.true.,NN)//' double' - do n1=1,NN - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)str(n=X(n1))//' '//str(n=Y(n1))//' '//str(n=Z(n1)) - enddo - case(raw) - write(unit=vtk(rf)%u,iostat=E_IO)'POINTS '//str(.true.,NN)//' double'//end_rec - write(unit=vtk(rf)%u,iostat=E_IO)(X(n1),Y(n1),Z(n1),n1=1,NN) - write(unit=vtk(rf)%u,iostat=E_IO)end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_GEO_UNST_R8 - - !> Function for saving mesh with \b UNSTRUCTURED_GRID topology (R8P, packed API). - !> @return E_IO: integer(I4P) error flag - function VTK_GEO_UNST_P_R8(NN,XYZ,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NN !< Number of nodes. - real(R8P), intent(IN):: XYZ(1:,1:) !< X, Y and Z coordinates of all nodes [1:3,1:NN]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)'POINTS '//str(.true.,NN)//' double' - do n1=1,NN - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)str(n=XYZ(1,n1))//' '//str(n=XYZ(2,n1))//' '//str(n=XYZ(3,n1)) - enddo - case(raw) - write(unit=vtk(rf)%u,iostat=E_IO)'POINTS '//str(.true.,NN)//' double'//end_rec - write(unit=vtk(rf)%u,iostat=E_IO)XYZ - write(unit=vtk(rf)%u,iostat=E_IO)end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_GEO_UNST_P_R8 - - !> Function for saving mesh with \b UNSTRUCTURED_GRID topology (R4P). - !> @return E_IO: integer(I4P) error flag - function VTK_GEO_UNST_R4(NN,X,Y,Z,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NN !< number of nodes. - real(R4P), intent(IN):: X(1:) !< X coordinates of all nodes [1:NN]. - real(R4P), intent(IN):: Y(1:) !< Y coordinates of all nodes [1:NN]. - real(R4P), intent(IN):: Z(1:) !< Z coordinates of all nodes [1:NN]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)'POINTS '//str(.true.,NN)//' float' - do n1=1,NN - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)str(n=X(n1))//' '//str(n=Y(n1))//' '//str(n=Z(n1)) - enddo - case(raw) - write(unit=vtk(rf)%u,iostat=E_IO)'POINTS '//str(.true.,NN)//' float'//end_rec - write(unit=vtk(rf)%u,iostat=E_IO)(X(n1),Y(n1),Z(n1),n1=1,NN) - write(unit=vtk(rf)%u,iostat=E_IO)end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_GEO_UNST_R4 - - !> Function for saving mesh with \b UNSTRUCTURED_GRID topology (R4P, packed API). - !> @return E_IO: integer(I4P) error flag - function VTK_GEO_UNST_P_R4(NN,XYZ,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NN !< number of nodes. - real(R4P), intent(IN):: XYZ(1:,1:) !< X, Y and Z coordinates of all nodes [1:3,1:NN]. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)'POINTS '//str(.true.,NN)//' float' - do n1=1,NN - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)str(n=XYZ(1,n1))//' '//str(n=XYZ(2,n1))//' '//str(n=XYZ(3,n1)) - enddo - case(raw) - write(unit=vtk(rf)%u,iostat=E_IO)'POINTS '//str(.true.,NN)//' float'//end_rec - write(unit=vtk(rf)%u,iostat=E_IO)XYZ - write(unit=vtk(rf)%u,iostat=E_IO)end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_GEO_UNST_P_R4 - !> @} - - !> Function that \b must be used when unstructured grid is used, it saves the connectivity of the unstructured gird. - !> @note The vector \b connect must follow the VTK-legacy standard. It is passed as \em assumed-shape array - !> because its dimensions is related to the mesh dimensions in a complex way. Its dimensions can be calculated by the following - !> equation: \f$dc = NC + \sum\limits_{i = 1}^{NC} {nvertex_i }\f$ - !> where \f$dc\f$ is connectivity vector dimension and \f$nvertex_i\f$ is the number of vertices of \f$i^{th}\f$ cell. The VTK- - !> legacy standard for the mesh connectivity is quite obscure at least at first sight. It is more simple analyzing an example. - !> Suppose we have a mesh composed by 2 cells, one hexahedron (8 vertices) and one pyramid with square basis (5 vertices) and - !> suppose that the basis of pyramid is constitute by a face of the hexahedron and so the two cells share 4 vertices. - !> The above equation !> gives \f$dc=2+8+5=15\f$. The connectivity vector for this mesh can be: \n - !> first cell \n - !> connect(1) = 8 number of vertices of \f$1^\circ\f$ cell \n - !> connect(2) = 0 identification flag of \f$1^\circ\f$ vertex of 1° cell \n - !> connect(3) = 1 identification flag of \f$2^\circ\f$ vertex of 1° cell \n - !> connect(4) = 2 identification flag of \f$3^\circ\f$ vertex of 1° cell \n - !> connect(5) = 3 identification flag of \f$4^\circ\f$ vertex of 1° cell \n - !> connect(6) = 4 identification flag of \f$5^\circ\f$ vertex of 1° cell \n - !> connect(7) = 5 identification flag of \f$6^\circ\f$ vertex of 1° cell \n - !> connect(8) = 6 identification flag of \f$7^\circ\f$ vertex of 1° cell \n - !> connect(9) = 7 identification flag of \f$8^\circ\f$ vertex of 1° cell \n - !> second cell \n - !> connect(10) = 5 number of vertices of \f$2^\circ \f$cell \n - !> connect(11) = 0 identification flag of \f$1^\circ\f$ vertex of 2° cell \n - !> connect(12) = 1 identification flag of \f$2^\circ\f$ vertex of 2° cell \n - !> connect(13) = 2 identification flag of \f$3^\circ\f$ vertex of 2° cell \n - !> connect(14) = 3 identification flag of \f$4^\circ\f$ vertex of 2° cell \n - !> connect(15) = 8 identification flag of \f$5^\circ\f$ vertex of 2° cell \n - !> Note that the first 4 identification flags of pyramid vertices as the same of the first 4 identification flags of - !> the hexahedron because the two cells share this face. It is also important to note that the identification flags start - !> form $0$ value: this is impose to the VTK standard. The function VTK_CON does not calculate the connectivity vector: it - !> writes the connectivity vector conforming the VTK standard, but does not calculate it. - !> The vector variable \em cell_type must conform the VTK-legacy standard (see the file VTK-Standard at the - !> Kitware homepage). It contains the - !> \em type of each cells. For the above example this vector is: \n - !> first cell \n - !> cell_type(1) = 12 hexahedron type of \f$1^\circ\f$ cell \n - !> second cell \n - !> cell_type(2) = 14 pyramid type of \f$2^\circ\f$ cell \n - !> @return E_IO: integer(I4P) error flag - !> @ingroup Lib_VTK_IOPublicProcedure - function VTK_CON(NC,connect,cell_type,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC !< Number of cells. - integer(I4P), intent(IN):: connect(:) !< Mesh connectivity. - integer(I4P), intent(IN):: cell_type(1:NC) !< VTK cell type. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I4P):: ncon !< Dimension of connectivity vector. - integer(I4P):: rf !< Real file index. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - ncon = size(connect,1) - select case(vtk(rf)%f) - case(ascii) - write(unit=vtk(rf)%u,fmt='(A,2'//FI4P//')',iostat=E_IO)'CELLS ',NC,ncon - write(unit=vtk(rf)%u,fmt=FI4P, iostat=E_IO)connect - write(unit=vtk(rf)%u,fmt='(A,'//FI4P//')', iostat=E_IO)'CELL_TYPES ',NC - write(unit=vtk(rf)%u,fmt=FI4P, iostat=E_IO)cell_type - case(raw) - write(s_buffer, fmt='(A,2'//FI4P//')',iostat=E_IO)'CELLS ',NC,ncon - write(unit=vtk(rf)%u, iostat=E_IO)trim(s_buffer)//end_rec - write(unit=vtk(rf)%u, iostat=E_IO)connect - write(unit=vtk(rf)%u, iostat=E_IO)end_rec - write(s_buffer, fmt='(A,'//FI4P//')', iostat=E_IO)'CELL_TYPES ',NC - write(unit=vtk(rf)%u, iostat=E_IO)trim(s_buffer)//end_rec - write(unit=vtk(rf)%u, iostat=E_IO)cell_type - write(unit=vtk(rf)%u, iostat=E_IO)end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_CON - - !> Function that \b must be called before saving the data related to geometric mesh, this function initializes the - !> saving of data variables indicating the \em type (node or cell centered) of variables that will be saved. - !> @note A single file can contain both cell and node centered variables. In this case the VTK_DAT function must be - !> called two times, before saving cell-centered variables and before saving node-centered variables. - !> Examples of usage are: \n - !> \b Node piece: \n - !> @code ... - !> E_IO=VTK_DAT(50,'node') - !> ... @endcode - !> \b Cell piece: \n - !> @code ... - !> E_IO=VTK_DAT(50,'cell') - !> ... @endcode - !> @return E_IO: integer(I4P) error flag - !> @ingroup Lib_VTK_IOPublicProcedure - function VTK_DAT(NC_NN,var_location,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of cells or nodes of field. - character(*), intent(IN):: var_location !< Location of saving variables: cell for cell-centered, node for node-centered. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I4P):: rf !< Real file index. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - select case(trim(Upper_Case(var_location))) - case('CELL') - write(unit=vtk(rf)%u,fmt='(A,'//FI4P//')',iostat=E_IO)'CELL_DATA ',NC_NN - case('NODE') - write(unit=vtk(rf)%u,fmt='(A,'//FI4P//')',iostat=E_IO)'POINT_DATA ',NC_NN - endselect - case(raw) - select case(trim(Upper_Case(var_location))) - case('CELL') - write(s_buffer,fmt='(A,'//FI4P//')',iostat=E_IO)'CELL_DATA ',NC_NN - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - case('NODE') - write(s_buffer,fmt='(A,'//FI4P//')',iostat=E_IO)'POINT_DATA ',NC_NN - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - endselect - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_DAT - - !> @ingroup Lib_VTK_IOPrivateProcedure - !> @{ - !> Function for saving field of scalar variable (R8P). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_SCAL_R8(NC_NN,varname,var,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of nodes or cells. - character(*), intent(IN):: varname !< Variable name. - real(R8P), intent(IN):: var(1:NC_NN) !< Variable to be saved. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - integer(I4P):: rf !< Real file index. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)'SCALARS '//trim(varname)//' double 1' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)'LOOKUP_TABLE default' - write(unit=vtk(rf)%u,fmt=FR8P, iostat=E_IO)var - case(raw) - write(unit=vtk(rf)%u,iostat=E_IO)'SCALARS '//trim(varname)//' double 1'//end_rec - write(unit=vtk(rf)%u,iostat=E_IO)'LOOKUP_TABLE default'//end_rec - write(unit=vtk(rf)%u,iostat=E_IO)var - write(unit=vtk(rf)%u,iostat=E_IO)end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_SCAL_R8 - - !> Function for saving field of scalar variable (R4P). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_SCAL_R4(NC_NN,varname,var,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of nodes or cells. - character(*), intent(IN):: varname !< Variable name. - real(R4P), intent(IN):: var(1:NC_NN) !< Variable to be saved. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - integer(I4P):: rf !< Real file index. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)'SCALARS '//trim(varname)//' float 1' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)'LOOKUP_TABLE default' - write(unit=vtk(rf)%u,fmt=FR4P, iostat=E_IO)var - case(raw) - write(unit=vtk(rf)%u,iostat=E_IO)'SCALARS '//trim(varname)//' float 1'//end_rec - write(unit=vtk(rf)%u,iostat=E_IO)'LOOKUP_TABLE default'//end_rec - write(unit=vtk(rf)%u,iostat=E_IO)var - write(unit=vtk(rf)%u,iostat=E_IO)end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_SCAL_R4 - - !> Function for saving field of scalar variable (I4P). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_SCAL_I4(NC_NN,varname,var,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of nodes or cells. - character(*), intent(IN):: varname !< Variable name. - integer(I4P), intent(IN):: var(1:NC_NN) !< Variable to be saved. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - integer(I4P):: rf !< Real file index. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)'SCALARS '//trim(varname)//' int 1' - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)'LOOKUP_TABLE default' - write(unit=vtk(rf)%u,fmt=FI4P, iostat=E_IO)var - case(raw) - write(unit=vtk(rf)%u,iostat=E_IO)'SCALARS '//trim(varname)//' int 1'//end_rec - write(unit=vtk(rf)%u,iostat=E_IO)'LOOKUP_TABLE default'//end_rec - write(unit=vtk(rf)%u,iostat=E_IO)var - write(unit=vtk(rf)%u,iostat=E_IO)end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_SCAL_I4 - - !> Function for saving field of vectorial variable (R8P). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_VECT_R8(vec_type,NC_NN,varname,varX,varY,varZ,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: vec_type !< Vector type: vect = generic vector , norm = normal vector. - integer(I4P), intent(IN):: NC_NN !< Number of nodes or cells. - character(*), intent(IN):: varname !< Variable name. - real(R8P), intent(IN):: varX(1:NC_NN) !< X component of vector. - real(R8P), intent(IN):: varY(1:NC_NN) !< Y component of vector. - real(R8P), intent(IN):: varZ(1:NC_NN) !< Z component of vector. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - select case(Upper_Case(trim(vec_type))) - case('VECT') - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)'VECTORS '//trim(varname)//' double' - case('NORM') - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)'NORMALS '//trim(varname)//' double' - endselect - write(unit=vtk(rf)%u,fmt='(3'//FR8P//')',iostat=E_IO)(varX(n1),varY(n1),varZ(n1),n1=1,NC_NN) - case(raw) - select case(Upper_Case(trim(vec_type))) - case('VECT') - write(unit=vtk(rf)%u,iostat=E_IO)'VECTORS '//trim(varname)//' double'//end_rec - case('NORM') - write(unit=vtk(rf)%u,iostat=E_IO)'NORMALS '//trim(varname)//' double'//end_rec - endselect - write(unit=vtk(rf)%u,iostat=E_IO)(varX(n1),varY(n1),varZ(n1),n1=1,NC_NN) - write(unit=vtk(rf)%u,iostat=E_IO)end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_VECT_R8 - - !> Function for saving field of vectorial variable (R4P). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_VECT_R4(vec_type,NC_NN,varname,varX,varY,varZ,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - character(*), intent(IN):: vec_type !< Vector type: vect = generic vector , norm = normal vector. - integer(I4P), intent(IN):: NC_NN !< Number of nodes or cells. - character(*), intent(IN):: varname !< Variable name. - real(R4P), intent(IN):: varX(1:NC_NN) !< X component of vector. - real(R4P), intent(IN):: varY(1:NC_NN) !< Y component of vector. - real(R4P), intent(IN):: varZ(1:NC_NN) !< Z component of vector. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - select case(Upper_Case(trim(vec_type))) - case('vect') - write(unit=vtk(rf)%u,fmt='(A)', iostat=E_IO)'VECTORS '//trim(varname)//' float' - case('norm') - write(unit=vtk(rf)%u,fmt='(A)', iostat=E_IO)'NORMALS '//trim(varname)//' float' - endselect - write(unit=vtk(rf)%u,fmt='(3'//FR4P//')',iostat=E_IO)(varX(n1),varY(n1),varZ(n1),n1=1,NC_NN) - case(raw) - select case(Upper_Case(trim(vec_type))) - case('vect') - write(unit=vtk(rf)%u,iostat=E_IO)'VECTORS '//trim(varname)//' float'//end_rec - case('norm') - write(unit=vtk(rf)%u,iostat=E_IO)'NORMALS '//trim(varname)//' float'//end_rec - endselect - write(unit=vtk(rf)%u,iostat=E_IO)(varX(n1),varY(n1),varZ(n1),n1=1,NC_NN) - write(unit=vtk(rf)%u,iostat=E_IO)end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_VECT_R4 - - !> Function for saving field of vectorial variable (I4P). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_VECT_I4(NC_NN,varname,varX,varY,varZ,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of nodes or cells. - character(*), intent(IN):: varname !< Variable name. - integer(I4P), intent(IN):: varX(1:NC_NN) !< X component of vector. - integer(I4P), intent(IN):: varY(1:NC_NN) !< Y component of vector. - integer(I4P), intent(IN):: varZ(1:NC_NN) !< Z component of vector. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1 !< Counter. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - write(unit=vtk(rf)%u,fmt='(A)',iostat=E_IO)'VECTORS '//trim(varname)//' int' - write(unit=vtk(rf)%u,fmt='(3'//FI4P//')',iostat=E_IO)(varX(n1),varY(n1),varZ(n1),n1=1,NC_NN) - case(raw) - write(unit=vtk(rf)%u,iostat=E_IO)'VECTORS '//trim(varname)//' int'//end_rec - write(unit=vtk(rf)%u,iostat=E_IO)(varX(n1),varY(n1),varZ(n1),n1=1,NC_NN) - write(unit=vtk(rf)%u,iostat=E_IO)end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_VECT_I4 - - !> Function for saving texture variable (R8P). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_TEXT_R8(NC_NN,dimm,varname,textCoo,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of nodes or cells. - integer(I4P), intent(IN):: dimm !< Texture dimensions. - character(*), intent(IN):: varname !< Variable name. - real(R8P), intent(IN):: textCoo(1:NC_NN,1:dimm) !< Texture. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1,n2 !< Counters. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - write(unit=vtk(rf)%u,fmt='(A,1X,'//FI4P//',1X,A)',iostat=E_IO)'TEXTURE_COORDINATES '//trim(varname),dimm,' double' - write(s_buffer,fmt='(I1)',iostat=E_IO)dimm - s_buffer='('//trim(s_buffer)//FR4P//')' - write(unit=vtk(rf)%u,fmt=trim(s_buffer),iostat=E_IO)((textCoo(n1,n2),n2=1,dimm),n1=1,NC_NN) - case(raw) - write(s_buffer,fmt='(A,1X,'//FI4P//',1X,A)',iostat=E_IO)'TEXTURE_COORDINATES '//trim(varname),dimm,' double' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - write(unit=vtk(rf)%u,iostat=E_IO)((textCoo(n1,n2),n2=1,dimm),n1=1,NC_NN) - write(unit=vtk(rf)%u,iostat=E_IO)end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_TEXT_R8 - - !> Function for saving texture variable (R4P). - !> @return E_IO: integer(I4P) error flag - function VTK_VAR_TEXT_R4(NC_NN,dimm,varname,textCoo,cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - !! Function for saving texture variable (R4P). - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(IN):: NC_NN !< Number of nodes or cells. - integer(I4P), intent(IN):: dimm !< Texture dimensions. - character(*), intent(IN):: varname !< Variable name. - real(R4P), intent(IN):: textCoo(1:NC_NN,1:dimm) !< Texture. - integer(I4P), intent(IN), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - character(len=maxlen):: s_buffer !< Buffer string. - integer(I4P):: rf !< Real file index. - integer(I4P):: n1,n2 !< Counters. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - select case(vtk(rf)%f) - case(ascii) - write(unit=vtk(rf)%u,fmt='(A,1X,'//FI4P//',1X,A)',iostat=E_IO)'TEXTURE_COORDINATES '//trim(varname),dimm,' float' - write(s_buffer,fmt='(I1)',iostat=E_IO)dimm - s_buffer='('//trim(s_buffer)//FR4P//')' - write(unit=vtk(rf)%u,fmt=trim(s_buffer),iostat=E_IO)((textCoo(n1,n2),n2=1,dimm),n1=1,NC_NN) - case(raw) - write(s_buffer,fmt='(A,1X,'//FI4P//',1X,A)',iostat=E_IO)'TEXTURE_COORDINATES '//trim(varname),dimm,' float' - write(unit=vtk(rf)%u,iostat=E_IO)trim(s_buffer)//end_rec - write(unit=vtk(rf)%u,iostat=E_IO)((textCoo(n1,n2),n2=1,dimm),n1=1,NC_NN) - write(unit=vtk(rf)%u,iostat=E_IO)end_rec - endselect - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_VAR_TEXT_R4 - !> @} - - !>Function for finalizing open file, it has not inputs, @libvtk manages the file unit without the - !>user's action. - !> @note An example of usage is: \n - !> @code ... - !> E_IO=VTK_END() - !> ... @endcode - !> @return E_IO: integer(I4P) error flag - !> @ingroup Lib_VTK_IOPublicProcedure - function VTK_END(cf) result(E_IO) - !--------------------------------------------------------------------------------------------------------------------------------- - implicit none - integer(I4P), intent(INOUT), optional:: cf !< Current file index (for concurrent files IO). - integer(I4P):: E_IO !< Input/Output inquiring flag: $0$ if IO is done, $> 0$ if IO is not done. - integer(I4P):: rf !< Real file index. - !--------------------------------------------------------------------------------------------------------------------------------- - - !--------------------------------------------------------------------------------------------------------------------------------- - E_IO = -1_I4P - rf = f - if (present(cf)) then - rf = cf ; f = cf - endif - close(unit=vtk(rf)%u,iostat=E_IO) - call vtk_update(act='remove',cf=rf,Nvtk=Nvtk,vtk=vtk) - f = rf - if (present(cf)) cf = rf - return - !--------------------------------------------------------------------------------------------------------------------------------- - endfunction VTK_END -endmodule Lib_VTK_IO diff --git a/lib/fftw3.f03 b/lib/fftw3.f03 deleted file mode 100644 index 75def88cc..000000000 --- a/lib/fftw3.f03 +++ /dev/null @@ -1,1226 +0,0 @@ -! Generated automatically. DO NOT EDIT! - - integer, parameter :: C_FFTW_R2R_KIND = C_INT32_T - - integer(C_INT), parameter :: FFTW_R2HC = 0_C_INT - integer(C_INT), parameter :: FFTW_HC2R = 1_C_INT - integer(C_INT), parameter :: FFTW_DHT = 2_C_INT - integer(C_INT), parameter :: FFTW_REDFT00 = 3_C_INT - integer(C_INT), parameter :: FFTW_REDFT01 = 4_C_INT - integer(C_INT), parameter :: FFTW_REDFT10 = 5_C_INT - integer(C_INT), parameter :: FFTW_REDFT11 = 6_C_INT - integer(C_INT), parameter :: FFTW_RODFT00 = 7_C_INT - integer(C_INT), parameter :: FFTW_RODFT01 = 8_C_INT - integer(C_INT), parameter :: FFTW_RODFT10 = 9_C_INT - integer(C_INT), parameter :: FFTW_RODFT11 = 10_C_INT - integer(C_INT), parameter :: FFTW_FORWARD = -1_C_INT - integer(C_INT), parameter :: FFTW_BACKWARD = +1_C_INT - integer(C_INT), parameter :: FFTW_MEASURE = 0_C_INT - integer(C_INT), parameter :: FFTW_DESTROY_INPUT = 1_C_INT - integer(C_INT), parameter :: FFTW_UNALIGNED = 2_C_INT - integer(C_INT), parameter :: FFTW_CONSERVE_MEMORY = 4_C_INT - integer(C_INT), parameter :: FFTW_EXHAUSTIVE = 8_C_INT - integer(C_INT), parameter :: FFTW_PRESERVE_INPUT = 16_C_INT - integer(C_INT), parameter :: FFTW_PATIENT = 32_C_INT - integer(C_INT), parameter :: FFTW_ESTIMATE = 64_C_INT - integer(C_INT), parameter :: FFTW_ESTIMATE_PATIENT = 128_C_INT - integer(C_INT), parameter :: FFTW_BELIEVE_PCOST = 256_C_INT - integer(C_INT), parameter :: FFTW_NO_DFT_R2HC = 512_C_INT - integer(C_INT), parameter :: FFTW_NO_NONTHREADED = 1024_C_INT - integer(C_INT), parameter :: FFTW_NO_BUFFERING = 2048_C_INT - integer(C_INT), parameter :: FFTW_NO_INDIRECT_OP = 4096_C_INT - integer(C_INT), parameter :: FFTW_ALLOW_LARGE_GENERIC = 8192_C_INT - integer(C_INT), parameter :: FFTW_NO_RANK_SPLITS = 16384_C_INT - integer(C_INT), parameter :: FFTW_NO_VRANK_SPLITS = 32768_C_INT - integer(C_INT), parameter :: FFTW_NO_VRECURSE = 65536_C_INT - integer(C_INT), parameter :: FFTW_NO_SIMD = 131072_C_INT - integer(C_INT), parameter :: FFTW_NO_SLOW = 262144_C_INT - integer(C_INT), parameter :: FFTW_NO_FIXED_RADIX_LARGE_N = 524288_C_INT - integer(C_INT), parameter :: FFTW_ALLOW_PRUNING = 1048576_C_INT - integer(C_INT), parameter :: FFTW_WISDOM_ONLY = 2097152_C_INT - - type, bind(C) :: fftw_iodim - integer(C_INT) n, is, os - end type fftw_iodim - type, bind(C) :: fftw_iodim64 - integer(C_INTPTR_T) n, is, os - end type fftw_iodim64 - - interface - type(C_PTR) function fftw_plan_dft(rank,n,in,out,sign,flags) bind(C, name='fftw_plan_dft') - import - integer(C_INT), value :: rank - integer(C_INT), dimension(*), intent(in) :: n - complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: in - complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: out - integer(C_INT), value :: sign - integer(C_INT), value :: flags - end function fftw_plan_dft - - type(C_PTR) function fftw_plan_dft_1d(n,in,out,sign,flags) bind(C, name='fftw_plan_dft_1d') - import - integer(C_INT), value :: n - complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: in - complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: out - integer(C_INT), value :: sign - integer(C_INT), value :: flags - end function fftw_plan_dft_1d - - type(C_PTR) function fftw_plan_dft_2d(n0,n1,in,out,sign,flags) bind(C, name='fftw_plan_dft_2d') - import - integer(C_INT), value :: n0 - integer(C_INT), value :: n1 - complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: in - complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: out - integer(C_INT), value :: sign - integer(C_INT), value :: flags - end function fftw_plan_dft_2d - - type(C_PTR) function fftw_plan_dft_3d(n0,n1,n2,in,out,sign,flags) bind(C, name='fftw_plan_dft_3d') - import - integer(C_INT), value :: n0 - integer(C_INT), value :: n1 - integer(C_INT), value :: n2 - complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: in - complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: out - integer(C_INT), value :: sign - integer(C_INT), value :: flags - end function fftw_plan_dft_3d - - type(C_PTR) function fftw_plan_many_dft(rank,n,howmany,in,inembed,istride,idist,out,onembed,ostride,odist,sign,flags) & - bind(C, name='fftw_plan_many_dft') - import - integer(C_INT), value :: rank - integer(C_INT), dimension(*), intent(in) :: n - integer(C_INT), value :: howmany - complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: in - integer(C_INT), dimension(*), intent(in) :: inembed - integer(C_INT), value :: istride - integer(C_INT), value :: idist - complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: out - integer(C_INT), dimension(*), intent(in) :: onembed - integer(C_INT), value :: ostride - integer(C_INT), value :: odist - integer(C_INT), value :: sign - integer(C_INT), value :: flags - end function fftw_plan_many_dft - - type(C_PTR) function fftw_plan_guru_dft(rank,dims,howmany_rank,howmany_dims,in,out,sign,flags) & - bind(C, name='fftw_plan_guru_dft') - import - integer(C_INT), value :: rank - type(fftw_iodim), dimension(*), intent(in) :: dims - integer(C_INT), value :: howmany_rank - type(fftw_iodim), dimension(*), intent(in) :: howmany_dims - complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: in - complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: out - integer(C_INT), value :: sign - integer(C_INT), value :: flags - end function fftw_plan_guru_dft - - type(C_PTR) function fftw_plan_guru_split_dft(rank,dims,howmany_rank,howmany_dims,ri,ii,ro,io,flags) & - bind(C, name='fftw_plan_guru_split_dft') - import - integer(C_INT), value :: rank - type(fftw_iodim), dimension(*), intent(in) :: dims - integer(C_INT), value :: howmany_rank - type(fftw_iodim), dimension(*), intent(in) :: howmany_dims - real(C_DOUBLE), dimension(*), intent(out) :: ri - real(C_DOUBLE), dimension(*), intent(out) :: ii - real(C_DOUBLE), dimension(*), intent(out) :: ro - real(C_DOUBLE), dimension(*), intent(out) :: io - integer(C_INT), value :: flags - end function fftw_plan_guru_split_dft - - type(C_PTR) function fftw_plan_guru64_dft(rank,dims,howmany_rank,howmany_dims,in,out,sign,flags) & - bind(C, name='fftw_plan_guru64_dft') - import - integer(C_INT), value :: rank - type(fftw_iodim64), dimension(*), intent(in) :: dims - integer(C_INT), value :: howmany_rank - type(fftw_iodim64), dimension(*), intent(in) :: howmany_dims - complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: in - complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: out - integer(C_INT), value :: sign - integer(C_INT), value :: flags - end function fftw_plan_guru64_dft - - type(C_PTR) function fftw_plan_guru64_split_dft(rank,dims,howmany_rank,howmany_dims,ri,ii,ro,io,flags) & - bind(C, name='fftw_plan_guru64_split_dft') - import - integer(C_INT), value :: rank - type(fftw_iodim64), dimension(*), intent(in) :: dims - integer(C_INT), value :: howmany_rank - type(fftw_iodim64), dimension(*), intent(in) :: howmany_dims - real(C_DOUBLE), dimension(*), intent(out) :: ri - real(C_DOUBLE), dimension(*), intent(out) :: ii - real(C_DOUBLE), dimension(*), intent(out) :: ro - real(C_DOUBLE), dimension(*), intent(out) :: io - integer(C_INT), value :: flags - end function fftw_plan_guru64_split_dft - - subroutine fftw_execute_dft(p,in,out) bind(C, name='fftw_execute_dft') - import - type(C_PTR), value :: p - complex(C_DOUBLE_COMPLEX), dimension(*), intent(inout) :: in - complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: out - end subroutine fftw_execute_dft - - subroutine fftw_execute_split_dft(p,ri,ii,ro,io) bind(C, name='fftw_execute_split_dft') - import - type(C_PTR), value :: p - real(C_DOUBLE), dimension(*), intent(inout) :: ri - real(C_DOUBLE), dimension(*), intent(inout) :: ii - real(C_DOUBLE), dimension(*), intent(out) :: ro - real(C_DOUBLE), dimension(*), intent(out) :: io - end subroutine fftw_execute_split_dft - - type(C_PTR) function fftw_plan_many_dft_r2c(rank,n,howmany,in,inembed,istride,idist,out,onembed,ostride,odist,flags) & - bind(C, name='fftw_plan_many_dft_r2c') - import - integer(C_INT), value :: rank - integer(C_INT), dimension(*), intent(in) :: n - integer(C_INT), value :: howmany - real(C_DOUBLE), dimension(*), intent(out) :: in - integer(C_INT), dimension(*), intent(in) :: inembed - integer(C_INT), value :: istride - integer(C_INT), value :: idist - complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: out - integer(C_INT), dimension(*), intent(in) :: onembed - integer(C_INT), value :: ostride - integer(C_INT), value :: odist - integer(C_INT), value :: flags - end function fftw_plan_many_dft_r2c - - type(C_PTR) function fftw_plan_dft_r2c(rank,n,in,out,flags) bind(C, name='fftw_plan_dft_r2c') - import - integer(C_INT), value :: rank - integer(C_INT), dimension(*), intent(in) :: n - real(C_DOUBLE), dimension(*), intent(out) :: in - complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: out - integer(C_INT), value :: flags - end function fftw_plan_dft_r2c - - type(C_PTR) function fftw_plan_dft_r2c_1d(n,in,out,flags) bind(C, name='fftw_plan_dft_r2c_1d') - import - integer(C_INT), value :: n - real(C_DOUBLE), dimension(*), intent(out) :: in - complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: out - integer(C_INT), value :: flags - end function fftw_plan_dft_r2c_1d - - type(C_PTR) function fftw_plan_dft_r2c_2d(n0,n1,in,out,flags) bind(C, name='fftw_plan_dft_r2c_2d') - import - integer(C_INT), value :: n0 - integer(C_INT), value :: n1 - real(C_DOUBLE), dimension(*), intent(out) :: in - complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: out - integer(C_INT), value :: flags - end function fftw_plan_dft_r2c_2d - - type(C_PTR) function fftw_plan_dft_r2c_3d(n0,n1,n2,in,out,flags) bind(C, name='fftw_plan_dft_r2c_3d') - import - integer(C_INT), value :: n0 - integer(C_INT), value :: n1 - integer(C_INT), value :: n2 - real(C_DOUBLE), dimension(*), intent(out) :: in - complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: out - integer(C_INT), value :: flags - end function fftw_plan_dft_r2c_3d - - type(C_PTR) function fftw_plan_many_dft_c2r(rank,n,howmany,in,inembed,istride,idist,out,onembed,ostride,odist,flags) & - bind(C, name='fftw_plan_many_dft_c2r') - import - integer(C_INT), value :: rank - integer(C_INT), dimension(*), intent(in) :: n - integer(C_INT), value :: howmany - complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: in - integer(C_INT), dimension(*), intent(in) :: inembed - integer(C_INT), value :: istride - integer(C_INT), value :: idist - real(C_DOUBLE), dimension(*), intent(out) :: out - integer(C_INT), dimension(*), intent(in) :: onembed - integer(C_INT), value :: ostride - integer(C_INT), value :: odist - integer(C_INT), value :: flags - end function fftw_plan_many_dft_c2r - - type(C_PTR) function fftw_plan_dft_c2r(rank,n,in,out,flags) bind(C, name='fftw_plan_dft_c2r') - import - integer(C_INT), value :: rank - integer(C_INT), dimension(*), intent(in) :: n - complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: in - real(C_DOUBLE), dimension(*), intent(out) :: out - integer(C_INT), value :: flags - end function fftw_plan_dft_c2r - - type(C_PTR) function fftw_plan_dft_c2r_1d(n,in,out,flags) bind(C, name='fftw_plan_dft_c2r_1d') - import - integer(C_INT), value :: n - complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: in - real(C_DOUBLE), dimension(*), intent(out) :: out - integer(C_INT), value :: flags - end function fftw_plan_dft_c2r_1d - - type(C_PTR) function fftw_plan_dft_c2r_2d(n0,n1,in,out,flags) bind(C, name='fftw_plan_dft_c2r_2d') - import - integer(C_INT), value :: n0 - integer(C_INT), value :: n1 - complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: in - real(C_DOUBLE), dimension(*), intent(out) :: out - integer(C_INT), value :: flags - end function fftw_plan_dft_c2r_2d - - type(C_PTR) function fftw_plan_dft_c2r_3d(n0,n1,n2,in,out,flags) bind(C, name='fftw_plan_dft_c2r_3d') - import - integer(C_INT), value :: n0 - integer(C_INT), value :: n1 - integer(C_INT), value :: n2 - complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: in - real(C_DOUBLE), dimension(*), intent(out) :: out - integer(C_INT), value :: flags - end function fftw_plan_dft_c2r_3d - - type(C_PTR) function fftw_plan_guru_dft_r2c(rank,dims,howmany_rank,howmany_dims,in,out,flags) & - bind(C, name='fftw_plan_guru_dft_r2c') - import - integer(C_INT), value :: rank - type(fftw_iodim), dimension(*), intent(in) :: dims - integer(C_INT), value :: howmany_rank - type(fftw_iodim), dimension(*), intent(in) :: howmany_dims - real(C_DOUBLE), dimension(*), intent(out) :: in - complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: out - integer(C_INT), value :: flags - end function fftw_plan_guru_dft_r2c - - type(C_PTR) function fftw_plan_guru_dft_c2r(rank,dims,howmany_rank,howmany_dims,in,out,flags) & - bind(C, name='fftw_plan_guru_dft_c2r') - import - integer(C_INT), value :: rank - type(fftw_iodim), dimension(*), intent(in) :: dims - integer(C_INT), value :: howmany_rank - type(fftw_iodim), dimension(*), intent(in) :: howmany_dims - complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: in - real(C_DOUBLE), dimension(*), intent(out) :: out - integer(C_INT), value :: flags - end function fftw_plan_guru_dft_c2r - - type(C_PTR) function fftw_plan_guru_split_dft_r2c(rank,dims,howmany_rank,howmany_dims,in,ro,io,flags) & - bind(C, name='fftw_plan_guru_split_dft_r2c') - import - integer(C_INT), value :: rank - type(fftw_iodim), dimension(*), intent(in) :: dims - integer(C_INT), value :: howmany_rank - type(fftw_iodim), dimension(*), intent(in) :: howmany_dims - real(C_DOUBLE), dimension(*), intent(out) :: in - real(C_DOUBLE), dimension(*), intent(out) :: ro - real(C_DOUBLE), dimension(*), intent(out) :: io - integer(C_INT), value :: flags - end function fftw_plan_guru_split_dft_r2c - - type(C_PTR) function fftw_plan_guru_split_dft_c2r(rank,dims,howmany_rank,howmany_dims,ri,ii,out,flags) & - bind(C, name='fftw_plan_guru_split_dft_c2r') - import - integer(C_INT), value :: rank - type(fftw_iodim), dimension(*), intent(in) :: dims - integer(C_INT), value :: howmany_rank - type(fftw_iodim), dimension(*), intent(in) :: howmany_dims - real(C_DOUBLE), dimension(*), intent(out) :: ri - real(C_DOUBLE), dimension(*), intent(out) :: ii - real(C_DOUBLE), dimension(*), intent(out) :: out - integer(C_INT), value :: flags - end function fftw_plan_guru_split_dft_c2r - - type(C_PTR) function fftw_plan_guru64_dft_r2c(rank,dims,howmany_rank,howmany_dims,in,out,flags) & - bind(C, name='fftw_plan_guru64_dft_r2c') - import - integer(C_INT), value :: rank - type(fftw_iodim64), dimension(*), intent(in) :: dims - integer(C_INT), value :: howmany_rank - type(fftw_iodim64), dimension(*), intent(in) :: howmany_dims - real(C_DOUBLE), dimension(*), intent(out) :: in - complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: out - integer(C_INT), value :: flags - end function fftw_plan_guru64_dft_r2c - - type(C_PTR) function fftw_plan_guru64_dft_c2r(rank,dims,howmany_rank,howmany_dims,in,out,flags) & - bind(C, name='fftw_plan_guru64_dft_c2r') - import - integer(C_INT), value :: rank - type(fftw_iodim64), dimension(*), intent(in) :: dims - integer(C_INT), value :: howmany_rank - type(fftw_iodim64), dimension(*), intent(in) :: howmany_dims - complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: in - real(C_DOUBLE), dimension(*), intent(out) :: out - integer(C_INT), value :: flags - end function fftw_plan_guru64_dft_c2r - - type(C_PTR) function fftw_plan_guru64_split_dft_r2c(rank,dims,howmany_rank,howmany_dims,in,ro,io,flags) & - bind(C, name='fftw_plan_guru64_split_dft_r2c') - import - integer(C_INT), value :: rank - type(fftw_iodim64), dimension(*), intent(in) :: dims - integer(C_INT), value :: howmany_rank - type(fftw_iodim64), dimension(*), intent(in) :: howmany_dims - real(C_DOUBLE), dimension(*), intent(out) :: in - real(C_DOUBLE), dimension(*), intent(out) :: ro - real(C_DOUBLE), dimension(*), intent(out) :: io - integer(C_INT), value :: flags - end function fftw_plan_guru64_split_dft_r2c - - type(C_PTR) function fftw_plan_guru64_split_dft_c2r(rank,dims,howmany_rank,howmany_dims,ri,ii,out,flags) & - bind(C, name='fftw_plan_guru64_split_dft_c2r') - import - integer(C_INT), value :: rank - type(fftw_iodim64), dimension(*), intent(in) :: dims - integer(C_INT), value :: howmany_rank - type(fftw_iodim64), dimension(*), intent(in) :: howmany_dims - real(C_DOUBLE), dimension(*), intent(out) :: ri - real(C_DOUBLE), dimension(*), intent(out) :: ii - real(C_DOUBLE), dimension(*), intent(out) :: out - integer(C_INT), value :: flags - end function fftw_plan_guru64_split_dft_c2r - - subroutine fftw_execute_dft_r2c(p,in,out) bind(C, name='fftw_execute_dft_r2c') - import - type(C_PTR), value :: p - real(C_DOUBLE), dimension(*), intent(inout) :: in - complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: out - end subroutine fftw_execute_dft_r2c - - subroutine fftw_execute_dft_c2r(p,in,out) bind(C, name='fftw_execute_dft_c2r') - import - type(C_PTR), value :: p - complex(C_DOUBLE_COMPLEX), dimension(*), intent(inout) :: in - real(C_DOUBLE), dimension(*), intent(out) :: out - end subroutine fftw_execute_dft_c2r - - subroutine fftw_execute_split_dft_r2c(p,in,ro,io) bind(C, name='fftw_execute_split_dft_r2c') - import - type(C_PTR), value :: p - real(C_DOUBLE), dimension(*), intent(inout) :: in - real(C_DOUBLE), dimension(*), intent(out) :: ro - real(C_DOUBLE), dimension(*), intent(out) :: io - end subroutine fftw_execute_split_dft_r2c - - subroutine fftw_execute_split_dft_c2r(p,ri,ii,out) bind(C, name='fftw_execute_split_dft_c2r') - import - type(C_PTR), value :: p - real(C_DOUBLE), dimension(*), intent(inout) :: ri - real(C_DOUBLE), dimension(*), intent(inout) :: ii - real(C_DOUBLE), dimension(*), intent(out) :: out - end subroutine fftw_execute_split_dft_c2r - - type(C_PTR) function fftw_plan_many_r2r(rank,n,howmany,in,inembed,istride,idist,out,onembed,ostride,odist,kind,flags) & - bind(C, name='fftw_plan_many_r2r') - import - integer(C_INT), value :: rank - integer(C_INT), dimension(*), intent(in) :: n - integer(C_INT), value :: howmany - real(C_DOUBLE), dimension(*), intent(out) :: in - integer(C_INT), dimension(*), intent(in) :: inembed - integer(C_INT), value :: istride - integer(C_INT), value :: idist - real(C_DOUBLE), dimension(*), intent(out) :: out - integer(C_INT), dimension(*), intent(in) :: onembed - integer(C_INT), value :: ostride - integer(C_INT), value :: odist - integer(C_FFTW_R2R_KIND), dimension(*), intent(in) :: kind - integer(C_INT), value :: flags - end function fftw_plan_many_r2r - - type(C_PTR) function fftw_plan_r2r(rank,n,in,out,kind,flags) bind(C, name='fftw_plan_r2r') - import - integer(C_INT), value :: rank - integer(C_INT), dimension(*), intent(in) :: n - real(C_DOUBLE), dimension(*), intent(out) :: in - real(C_DOUBLE), dimension(*), intent(out) :: out - integer(C_FFTW_R2R_KIND), dimension(*), intent(in) :: kind - integer(C_INT), value :: flags - end function fftw_plan_r2r - - type(C_PTR) function fftw_plan_r2r_1d(n,in,out,kind,flags) bind(C, name='fftw_plan_r2r_1d') - import - integer(C_INT), value :: n - real(C_DOUBLE), dimension(*), intent(out) :: in - real(C_DOUBLE), dimension(*), intent(out) :: out - integer(C_FFTW_R2R_KIND), value :: kind - integer(C_INT), value :: flags - end function fftw_plan_r2r_1d - - type(C_PTR) function fftw_plan_r2r_2d(n0,n1,in,out,kind0,kind1,flags) bind(C, name='fftw_plan_r2r_2d') - import - integer(C_INT), value :: n0 - integer(C_INT), value :: n1 - real(C_DOUBLE), dimension(*), intent(out) :: in - real(C_DOUBLE), dimension(*), intent(out) :: out - integer(C_FFTW_R2R_KIND), value :: kind0 - integer(C_FFTW_R2R_KIND), value :: kind1 - integer(C_INT), value :: flags - end function fftw_plan_r2r_2d - - type(C_PTR) function fftw_plan_r2r_3d(n0,n1,n2,in,out,kind0,kind1,kind2,flags) bind(C, name='fftw_plan_r2r_3d') - import - integer(C_INT), value :: n0 - integer(C_INT), value :: n1 - integer(C_INT), value :: n2 - real(C_DOUBLE), dimension(*), intent(out) :: in - real(C_DOUBLE), dimension(*), intent(out) :: out - integer(C_FFTW_R2R_KIND), value :: kind0 - integer(C_FFTW_R2R_KIND), value :: kind1 - integer(C_FFTW_R2R_KIND), value :: kind2 - integer(C_INT), value :: flags - end function fftw_plan_r2r_3d - - type(C_PTR) function fftw_plan_guru_r2r(rank,dims,howmany_rank,howmany_dims,in,out,kind,flags) & - bind(C, name='fftw_plan_guru_r2r') - import - integer(C_INT), value :: rank - type(fftw_iodim), dimension(*), intent(in) :: dims - integer(C_INT), value :: howmany_rank - type(fftw_iodim), dimension(*), intent(in) :: howmany_dims - real(C_DOUBLE), dimension(*), intent(out) :: in - real(C_DOUBLE), dimension(*), intent(out) :: out - integer(C_FFTW_R2R_KIND), dimension(*), intent(in) :: kind - integer(C_INT), value :: flags - end function fftw_plan_guru_r2r - - type(C_PTR) function fftw_plan_guru64_r2r(rank,dims,howmany_rank,howmany_dims,in,out,kind,flags) & - bind(C, name='fftw_plan_guru64_r2r') - import - integer(C_INT), value :: rank - type(fftw_iodim64), dimension(*), intent(in) :: dims - integer(C_INT), value :: howmany_rank - type(fftw_iodim64), dimension(*), intent(in) :: howmany_dims - real(C_DOUBLE), dimension(*), intent(out) :: in - real(C_DOUBLE), dimension(*), intent(out) :: out - integer(C_FFTW_R2R_KIND), dimension(*), intent(in) :: kind - integer(C_INT), value :: flags - end function fftw_plan_guru64_r2r - - subroutine fftw_execute_r2r(p,in,out) bind(C, name='fftw_execute_r2r') - import - type(C_PTR), value :: p - real(C_DOUBLE), dimension(*), intent(inout) :: in - real(C_DOUBLE), dimension(*), intent(out) :: out - end subroutine fftw_execute_r2r - - subroutine fftw_destroy_plan(p) bind(C, name='fftw_destroy_plan') - import - type(C_PTR), value :: p - end subroutine fftw_destroy_plan - - subroutine fftw_forget_wisdom() bind(C, name='fftw_forget_wisdom') - import - end subroutine fftw_forget_wisdom - - subroutine fftw_cleanup() bind(C, name='fftw_cleanup') - import - end subroutine fftw_cleanup - - subroutine fftw_set_timelimit(t) bind(C, name='fftw_set_timelimit') - import - real(C_DOUBLE), value :: t - end subroutine fftw_set_timelimit - - subroutine fftw_plan_with_nthreads(nthreads) bind(C, name='fftw_plan_with_nthreads') - import - integer(C_INT), value :: nthreads - end subroutine fftw_plan_with_nthreads - - integer(C_INT) function fftw_init_threads() bind(C, name='fftw_init_threads') - import - end function fftw_init_threads - - subroutine fftw_cleanup_threads() bind(C, name='fftw_cleanup_threads') - import - end subroutine fftw_cleanup_threads - - integer(C_INT) function fftw_export_wisdom_to_filename(filename) bind(C, name='fftw_export_wisdom_to_filename') - import - character(C_CHAR), dimension(*), intent(in) :: filename - end function fftw_export_wisdom_to_filename - - subroutine fftw_export_wisdom_to_file(output_file) bind(C, name='fftw_export_wisdom_to_file') - import - type(C_PTR), value :: output_file - end subroutine fftw_export_wisdom_to_file - - type(C_PTR) function fftw_export_wisdom_to_string() bind(C, name='fftw_export_wisdom_to_string') - import - end function fftw_export_wisdom_to_string - - subroutine fftw_export_wisdom(write_char,data) bind(C, name='fftw_export_wisdom') - import - type(C_FUNPTR), value :: write_char - type(C_PTR), value :: data - end subroutine fftw_export_wisdom - - integer(C_INT) function fftw_import_system_wisdom() bind(C, name='fftw_import_system_wisdom') - import - end function fftw_import_system_wisdom - - integer(C_INT) function fftw_import_wisdom_from_filename(filename) bind(C, name='fftw_import_wisdom_from_filename') - import - character(C_CHAR), dimension(*), intent(in) :: filename - end function fftw_import_wisdom_from_filename - - integer(C_INT) function fftw_import_wisdom_from_file(input_file) bind(C, name='fftw_import_wisdom_from_file') - import - type(C_PTR), value :: input_file - end function fftw_import_wisdom_from_file - - integer(C_INT) function fftw_import_wisdom_from_string(input_string) bind(C, name='fftw_import_wisdom_from_string') - import - character(C_CHAR), dimension(*), intent(in) :: input_string - end function fftw_import_wisdom_from_string - - integer(C_INT) function fftw_import_wisdom(read_char,data) bind(C, name='fftw_import_wisdom') - import - type(C_FUNPTR), value :: read_char - type(C_PTR), value :: data - end function fftw_import_wisdom - - subroutine fftw_fprint_plan(p,output_file) bind(C, name='fftw_fprint_plan') - import - type(C_PTR), value :: p - type(C_PTR), value :: output_file - end subroutine fftw_fprint_plan - - subroutine fftw_print_plan(p) bind(C, name='fftw_print_plan') - import - type(C_PTR), value :: p - end subroutine fftw_print_plan - - type(C_PTR) function fftw_malloc(n) bind(C, name='fftw_malloc') - import - integer(C_SIZE_T), value :: n - end function fftw_malloc - - type(C_PTR) function fftw_alloc_real(n) bind(C, name='fftw_alloc_real') - import - integer(C_SIZE_T), value :: n - end function fftw_alloc_real - - type(C_PTR) function fftw_alloc_complex(n) bind(C, name='fftw_alloc_complex') - import - integer(C_SIZE_T), value :: n - end function fftw_alloc_complex - - subroutine fftw_free(p) bind(C, name='fftw_free') - import - type(C_PTR), value :: p - end subroutine fftw_free - - subroutine fftw_flops(p,add,mul,fmas) bind(C, name='fftw_flops') - import - type(C_PTR), value :: p - real(C_DOUBLE), intent(out) :: add - real(C_DOUBLE), intent(out) :: mul - real(C_DOUBLE), intent(out) :: fmas - end subroutine fftw_flops - - real(C_DOUBLE) function fftw_estimate_cost(p) bind(C, name='fftw_estimate_cost') - import - type(C_PTR), value :: p - end function fftw_estimate_cost - - real(C_DOUBLE) function fftw_cost(p) bind(C, name='fftw_cost') - import - type(C_PTR), value :: p - end function fftw_cost - - end interface - - type, bind(C) :: fftwf_iodim - integer(C_INT) n, is, os - end type fftwf_iodim - type, bind(C) :: fftwf_iodim64 - integer(C_INTPTR_T) n, is, os - end type fftwf_iodim64 - - interface - type(C_PTR) function fftwf_plan_dft(rank,n,in,out,sign,flags) bind(C, name='fftwf_plan_dft') - import - integer(C_INT), value :: rank - integer(C_INT), dimension(*), intent(in) :: n - complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: in - complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: out - integer(C_INT), value :: sign - integer(C_INT), value :: flags - end function fftwf_plan_dft - - type(C_PTR) function fftwf_plan_dft_1d(n,in,out,sign,flags) bind(C, name='fftwf_plan_dft_1d') - import - integer(C_INT), value :: n - complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: in - complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: out - integer(C_INT), value :: sign - integer(C_INT), value :: flags - end function fftwf_plan_dft_1d - - type(C_PTR) function fftwf_plan_dft_2d(n0,n1,in,out,sign,flags) bind(C, name='fftwf_plan_dft_2d') - import - integer(C_INT), value :: n0 - integer(C_INT), value :: n1 - complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: in - complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: out - integer(C_INT), value :: sign - integer(C_INT), value :: flags - end function fftwf_plan_dft_2d - - type(C_PTR) function fftwf_plan_dft_3d(n0,n1,n2,in,out,sign,flags) bind(C, name='fftwf_plan_dft_3d') - import - integer(C_INT), value :: n0 - integer(C_INT), value :: n1 - integer(C_INT), value :: n2 - complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: in - complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: out - integer(C_INT), value :: sign - integer(C_INT), value :: flags - end function fftwf_plan_dft_3d - - type(C_PTR) function fftwf_plan_many_dft(rank,n,howmany,in,inembed,istride,idist,out,onembed,ostride,odist,sign,flags) & - bind(C, name='fftwf_plan_many_dft') - import - integer(C_INT), value :: rank - integer(C_INT), dimension(*), intent(in) :: n - integer(C_INT), value :: howmany - complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: in - integer(C_INT), dimension(*), intent(in) :: inembed - integer(C_INT), value :: istride - integer(C_INT), value :: idist - complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: out - integer(C_INT), dimension(*), intent(in) :: onembed - integer(C_INT), value :: ostride - integer(C_INT), value :: odist - integer(C_INT), value :: sign - integer(C_INT), value :: flags - end function fftwf_plan_many_dft - - type(C_PTR) function fftwf_plan_guru_dft(rank,dims,howmany_rank,howmany_dims,in,out,sign,flags) & - bind(C, name='fftwf_plan_guru_dft') - import - integer(C_INT), value :: rank - type(fftwf_iodim), dimension(*), intent(in) :: dims - integer(C_INT), value :: howmany_rank - type(fftwf_iodim), dimension(*), intent(in) :: howmany_dims - complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: in - complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: out - integer(C_INT), value :: sign - integer(C_INT), value :: flags - end function fftwf_plan_guru_dft - - type(C_PTR) function fftwf_plan_guru_split_dft(rank,dims,howmany_rank,howmany_dims,ri,ii,ro,io,flags) & - bind(C, name='fftwf_plan_guru_split_dft') - import - integer(C_INT), value :: rank - type(fftwf_iodim), dimension(*), intent(in) :: dims - integer(C_INT), value :: howmany_rank - type(fftwf_iodim), dimension(*), intent(in) :: howmany_dims - real(C_FLOAT), dimension(*), intent(out) :: ri - real(C_FLOAT), dimension(*), intent(out) :: ii - real(C_FLOAT), dimension(*), intent(out) :: ro - real(C_FLOAT), dimension(*), intent(out) :: io - integer(C_INT), value :: flags - end function fftwf_plan_guru_split_dft - - type(C_PTR) function fftwf_plan_guru64_dft(rank,dims,howmany_rank,howmany_dims,in,out,sign,flags) & - bind(C, name='fftwf_plan_guru64_dft') - import - integer(C_INT), value :: rank - type(fftwf_iodim64), dimension(*), intent(in) :: dims - integer(C_INT), value :: howmany_rank - type(fftwf_iodim64), dimension(*), intent(in) :: howmany_dims - complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: in - complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: out - integer(C_INT), value :: sign - integer(C_INT), value :: flags - end function fftwf_plan_guru64_dft - - type(C_PTR) function fftwf_plan_guru64_split_dft(rank,dims,howmany_rank,howmany_dims,ri,ii,ro,io,flags) & - bind(C, name='fftwf_plan_guru64_split_dft') - import - integer(C_INT), value :: rank - type(fftwf_iodim64), dimension(*), intent(in) :: dims - integer(C_INT), value :: howmany_rank - type(fftwf_iodim64), dimension(*), intent(in) :: howmany_dims - real(C_FLOAT), dimension(*), intent(out) :: ri - real(C_FLOAT), dimension(*), intent(out) :: ii - real(C_FLOAT), dimension(*), intent(out) :: ro - real(C_FLOAT), dimension(*), intent(out) :: io - integer(C_INT), value :: flags - end function fftwf_plan_guru64_split_dft - - subroutine fftwf_execute_dft(p,in,out) bind(C, name='fftwf_execute_dft') - import - type(C_PTR), value :: p - complex(C_FLOAT_COMPLEX), dimension(*), intent(inout) :: in - complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: out - end subroutine fftwf_execute_dft - - subroutine fftwf_execute_split_dft(p,ri,ii,ro,io) bind(C, name='fftwf_execute_split_dft') - import - type(C_PTR), value :: p - real(C_FLOAT), dimension(*), intent(inout) :: ri - real(C_FLOAT), dimension(*), intent(inout) :: ii - real(C_FLOAT), dimension(*), intent(out) :: ro - real(C_FLOAT), dimension(*), intent(out) :: io - end subroutine fftwf_execute_split_dft - - type(C_PTR) function fftwf_plan_many_dft_r2c(rank,n,howmany,in,inembed,istride,idist,out,onembed,ostride,odist,flags) & - bind(C, name='fftwf_plan_many_dft_r2c') - import - integer(C_INT), value :: rank - integer(C_INT), dimension(*), intent(in) :: n - integer(C_INT), value :: howmany - real(C_FLOAT), dimension(*), intent(out) :: in - integer(C_INT), dimension(*), intent(in) :: inembed - integer(C_INT), value :: istride - integer(C_INT), value :: idist - complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: out - integer(C_INT), dimension(*), intent(in) :: onembed - integer(C_INT), value :: ostride - integer(C_INT), value :: odist - integer(C_INT), value :: flags - end function fftwf_plan_many_dft_r2c - - type(C_PTR) function fftwf_plan_dft_r2c(rank,n,in,out,flags) bind(C, name='fftwf_plan_dft_r2c') - import - integer(C_INT), value :: rank - integer(C_INT), dimension(*), intent(in) :: n - real(C_FLOAT), dimension(*), intent(out) :: in - complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: out - integer(C_INT), value :: flags - end function fftwf_plan_dft_r2c - - type(C_PTR) function fftwf_plan_dft_r2c_1d(n,in,out,flags) bind(C, name='fftwf_plan_dft_r2c_1d') - import - integer(C_INT), value :: n - real(C_FLOAT), dimension(*), intent(out) :: in - complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: out - integer(C_INT), value :: flags - end function fftwf_plan_dft_r2c_1d - - type(C_PTR) function fftwf_plan_dft_r2c_2d(n0,n1,in,out,flags) bind(C, name='fftwf_plan_dft_r2c_2d') - import - integer(C_INT), value :: n0 - integer(C_INT), value :: n1 - real(C_FLOAT), dimension(*), intent(out) :: in - complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: out - integer(C_INT), value :: flags - end function fftwf_plan_dft_r2c_2d - - type(C_PTR) function fftwf_plan_dft_r2c_3d(n0,n1,n2,in,out,flags) bind(C, name='fftwf_plan_dft_r2c_3d') - import - integer(C_INT), value :: n0 - integer(C_INT), value :: n1 - integer(C_INT), value :: n2 - real(C_FLOAT), dimension(*), intent(out) :: in - complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: out - integer(C_INT), value :: flags - end function fftwf_plan_dft_r2c_3d - - type(C_PTR) function fftwf_plan_many_dft_c2r(rank,n,howmany,in,inembed,istride,idist,out,onembed,ostride,odist,flags) & - bind(C, name='fftwf_plan_many_dft_c2r') - import - integer(C_INT), value :: rank - integer(C_INT), dimension(*), intent(in) :: n - integer(C_INT), value :: howmany - complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: in - integer(C_INT), dimension(*), intent(in) :: inembed - integer(C_INT), value :: istride - integer(C_INT), value :: idist - real(C_FLOAT), dimension(*), intent(out) :: out - integer(C_INT), dimension(*), intent(in) :: onembed - integer(C_INT), value :: ostride - integer(C_INT), value :: odist - integer(C_INT), value :: flags - end function fftwf_plan_many_dft_c2r - - type(C_PTR) function fftwf_plan_dft_c2r(rank,n,in,out,flags) bind(C, name='fftwf_plan_dft_c2r') - import - integer(C_INT), value :: rank - integer(C_INT), dimension(*), intent(in) :: n - complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: in - real(C_FLOAT), dimension(*), intent(out) :: out - integer(C_INT), value :: flags - end function fftwf_plan_dft_c2r - - type(C_PTR) function fftwf_plan_dft_c2r_1d(n,in,out,flags) bind(C, name='fftwf_plan_dft_c2r_1d') - import - integer(C_INT), value :: n - complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: in - real(C_FLOAT), dimension(*), intent(out) :: out - integer(C_INT), value :: flags - end function fftwf_plan_dft_c2r_1d - - type(C_PTR) function fftwf_plan_dft_c2r_2d(n0,n1,in,out,flags) bind(C, name='fftwf_plan_dft_c2r_2d') - import - integer(C_INT), value :: n0 - integer(C_INT), value :: n1 - complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: in - real(C_FLOAT), dimension(*), intent(out) :: out - integer(C_INT), value :: flags - end function fftwf_plan_dft_c2r_2d - - type(C_PTR) function fftwf_plan_dft_c2r_3d(n0,n1,n2,in,out,flags) bind(C, name='fftwf_plan_dft_c2r_3d') - import - integer(C_INT), value :: n0 - integer(C_INT), value :: n1 - integer(C_INT), value :: n2 - complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: in - real(C_FLOAT), dimension(*), intent(out) :: out - integer(C_INT), value :: flags - end function fftwf_plan_dft_c2r_3d - - type(C_PTR) function fftwf_plan_guru_dft_r2c(rank,dims,howmany_rank,howmany_dims,in,out,flags) & - bind(C, name='fftwf_plan_guru_dft_r2c') - import - integer(C_INT), value :: rank - type(fftwf_iodim), dimension(*), intent(in) :: dims - integer(C_INT), value :: howmany_rank - type(fftwf_iodim), dimension(*), intent(in) :: howmany_dims - real(C_FLOAT), dimension(*), intent(out) :: in - complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: out - integer(C_INT), value :: flags - end function fftwf_plan_guru_dft_r2c - - type(C_PTR) function fftwf_plan_guru_dft_c2r(rank,dims,howmany_rank,howmany_dims,in,out,flags) & - bind(C, name='fftwf_plan_guru_dft_c2r') - import - integer(C_INT), value :: rank - type(fftwf_iodim), dimension(*), intent(in) :: dims - integer(C_INT), value :: howmany_rank - type(fftwf_iodim), dimension(*), intent(in) :: howmany_dims - complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: in - real(C_FLOAT), dimension(*), intent(out) :: out - integer(C_INT), value :: flags - end function fftwf_plan_guru_dft_c2r - - type(C_PTR) function fftwf_plan_guru_split_dft_r2c(rank,dims,howmany_rank,howmany_dims,in,ro,io,flags) & - bind(C, name='fftwf_plan_guru_split_dft_r2c') - import - integer(C_INT), value :: rank - type(fftwf_iodim), dimension(*), intent(in) :: dims - integer(C_INT), value :: howmany_rank - type(fftwf_iodim), dimension(*), intent(in) :: howmany_dims - real(C_FLOAT), dimension(*), intent(out) :: in - real(C_FLOAT), dimension(*), intent(out) :: ro - real(C_FLOAT), dimension(*), intent(out) :: io - integer(C_INT), value :: flags - end function fftwf_plan_guru_split_dft_r2c - - type(C_PTR) function fftwf_plan_guru_split_dft_c2r(rank,dims,howmany_rank,howmany_dims,ri,ii,out,flags) & - bind(C, name='fftwf_plan_guru_split_dft_c2r') - import - integer(C_INT), value :: rank - type(fftwf_iodim), dimension(*), intent(in) :: dims - integer(C_INT), value :: howmany_rank - type(fftwf_iodim), dimension(*), intent(in) :: howmany_dims - real(C_FLOAT), dimension(*), intent(out) :: ri - real(C_FLOAT), dimension(*), intent(out) :: ii - real(C_FLOAT), dimension(*), intent(out) :: out - integer(C_INT), value :: flags - end function fftwf_plan_guru_split_dft_c2r - - type(C_PTR) function fftwf_plan_guru64_dft_r2c(rank,dims,howmany_rank,howmany_dims,in,out,flags) & - bind(C, name='fftwf_plan_guru64_dft_r2c') - import - integer(C_INT), value :: rank - type(fftwf_iodim64), dimension(*), intent(in) :: dims - integer(C_INT), value :: howmany_rank - type(fftwf_iodim64), dimension(*), intent(in) :: howmany_dims - real(C_FLOAT), dimension(*), intent(out) :: in - complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: out - integer(C_INT), value :: flags - end function fftwf_plan_guru64_dft_r2c - - type(C_PTR) function fftwf_plan_guru64_dft_c2r(rank,dims,howmany_rank,howmany_dims,in,out,flags) & - bind(C, name='fftwf_plan_guru64_dft_c2r') - import - integer(C_INT), value :: rank - type(fftwf_iodim64), dimension(*), intent(in) :: dims - integer(C_INT), value :: howmany_rank - type(fftwf_iodim64), dimension(*), intent(in) :: howmany_dims - complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: in - real(C_FLOAT), dimension(*), intent(out) :: out - integer(C_INT), value :: flags - end function fftwf_plan_guru64_dft_c2r - - type(C_PTR) function fftwf_plan_guru64_split_dft_r2c(rank,dims,howmany_rank,howmany_dims,in,ro,io,flags) & - bind(C, name='fftwf_plan_guru64_split_dft_r2c') - import - integer(C_INT), value :: rank - type(fftwf_iodim64), dimension(*), intent(in) :: dims - integer(C_INT), value :: howmany_rank - type(fftwf_iodim64), dimension(*), intent(in) :: howmany_dims - real(C_FLOAT), dimension(*), intent(out) :: in - real(C_FLOAT), dimension(*), intent(out) :: ro - real(C_FLOAT), dimension(*), intent(out) :: io - integer(C_INT), value :: flags - end function fftwf_plan_guru64_split_dft_r2c - - type(C_PTR) function fftwf_plan_guru64_split_dft_c2r(rank,dims,howmany_rank,howmany_dims,ri,ii,out,flags) & - bind(C, name='fftwf_plan_guru64_split_dft_c2r') - import - integer(C_INT), value :: rank - type(fftwf_iodim64), dimension(*), intent(in) :: dims - integer(C_INT), value :: howmany_rank - type(fftwf_iodim64), dimension(*), intent(in) :: howmany_dims - real(C_FLOAT), dimension(*), intent(out) :: ri - real(C_FLOAT), dimension(*), intent(out) :: ii - real(C_FLOAT), dimension(*), intent(out) :: out - integer(C_INT), value :: flags - end function fftwf_plan_guru64_split_dft_c2r - - subroutine fftwf_execute_dft_r2c(p,in,out) bind(C, name='fftwf_execute_dft_r2c') - import - type(C_PTR), value :: p - real(C_FLOAT), dimension(*), intent(inout) :: in - complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: out - end subroutine fftwf_execute_dft_r2c - - subroutine fftwf_execute_dft_c2r(p,in,out) bind(C, name='fftwf_execute_dft_c2r') - import - type(C_PTR), value :: p - complex(C_FLOAT_COMPLEX), dimension(*), intent(inout) :: in - real(C_FLOAT), dimension(*), intent(out) :: out - end subroutine fftwf_execute_dft_c2r - - subroutine fftwf_execute_split_dft_r2c(p,in,ro,io) bind(C, name='fftwf_execute_split_dft_r2c') - import - type(C_PTR), value :: p - real(C_FLOAT), dimension(*), intent(inout) :: in - real(C_FLOAT), dimension(*), intent(out) :: ro - real(C_FLOAT), dimension(*), intent(out) :: io - end subroutine fftwf_execute_split_dft_r2c - - subroutine fftwf_execute_split_dft_c2r(p,ri,ii,out) bind(C, name='fftwf_execute_split_dft_c2r') - import - type(C_PTR), value :: p - real(C_FLOAT), dimension(*), intent(inout) :: ri - real(C_FLOAT), dimension(*), intent(inout) :: ii - real(C_FLOAT), dimension(*), intent(out) :: out - end subroutine fftwf_execute_split_dft_c2r - - type(C_PTR) function fftwf_plan_many_r2r(rank,n,howmany,in,inembed,istride,idist,out,onembed,ostride,odist,kind,flags) & - bind(C, name='fftwf_plan_many_r2r') - import - integer(C_INT), value :: rank - integer(C_INT), dimension(*), intent(in) :: n - integer(C_INT), value :: howmany - real(C_FLOAT), dimension(*), intent(out) :: in - integer(C_INT), dimension(*), intent(in) :: inembed - integer(C_INT), value :: istride - integer(C_INT), value :: idist - real(C_FLOAT), dimension(*), intent(out) :: out - integer(C_INT), dimension(*), intent(in) :: onembed - integer(C_INT), value :: ostride - integer(C_INT), value :: odist - integer(C_FFTW_R2R_KIND), dimension(*), intent(in) :: kind - integer(C_INT), value :: flags - end function fftwf_plan_many_r2r - - type(C_PTR) function fftwf_plan_r2r(rank,n,in,out,kind,flags) bind(C, name='fftwf_plan_r2r') - import - integer(C_INT), value :: rank - integer(C_INT), dimension(*), intent(in) :: n - real(C_FLOAT), dimension(*), intent(out) :: in - real(C_FLOAT), dimension(*), intent(out) :: out - integer(C_FFTW_R2R_KIND), dimension(*), intent(in) :: kind - integer(C_INT), value :: flags - end function fftwf_plan_r2r - - type(C_PTR) function fftwf_plan_r2r_1d(n,in,out,kind,flags) bind(C, name='fftwf_plan_r2r_1d') - import - integer(C_INT), value :: n - real(C_FLOAT), dimension(*), intent(out) :: in - real(C_FLOAT), dimension(*), intent(out) :: out - integer(C_FFTW_R2R_KIND), value :: kind - integer(C_INT), value :: flags - end function fftwf_plan_r2r_1d - - type(C_PTR) function fftwf_plan_r2r_2d(n0,n1,in,out,kind0,kind1,flags) bind(C, name='fftwf_plan_r2r_2d') - import - integer(C_INT), value :: n0 - integer(C_INT), value :: n1 - real(C_FLOAT), dimension(*), intent(out) :: in - real(C_FLOAT), dimension(*), intent(out) :: out - integer(C_FFTW_R2R_KIND), value :: kind0 - integer(C_FFTW_R2R_KIND), value :: kind1 - integer(C_INT), value :: flags - end function fftwf_plan_r2r_2d - - type(C_PTR) function fftwf_plan_r2r_3d(n0,n1,n2,in,out,kind0,kind1,kind2,flags) bind(C, name='fftwf_plan_r2r_3d') - import - integer(C_INT), value :: n0 - integer(C_INT), value :: n1 - integer(C_INT), value :: n2 - real(C_FLOAT), dimension(*), intent(out) :: in - real(C_FLOAT), dimension(*), intent(out) :: out - integer(C_FFTW_R2R_KIND), value :: kind0 - integer(C_FFTW_R2R_KIND), value :: kind1 - integer(C_FFTW_R2R_KIND), value :: kind2 - integer(C_INT), value :: flags - end function fftwf_plan_r2r_3d - - type(C_PTR) function fftwf_plan_guru_r2r(rank,dims,howmany_rank,howmany_dims,in,out,kind,flags) & - bind(C, name='fftwf_plan_guru_r2r') - import - integer(C_INT), value :: rank - type(fftwf_iodim), dimension(*), intent(in) :: dims - integer(C_INT), value :: howmany_rank - type(fftwf_iodim), dimension(*), intent(in) :: howmany_dims - real(C_FLOAT), dimension(*), intent(out) :: in - real(C_FLOAT), dimension(*), intent(out) :: out - integer(C_FFTW_R2R_KIND), dimension(*), intent(in) :: kind - integer(C_INT), value :: flags - end function fftwf_plan_guru_r2r - - type(C_PTR) function fftwf_plan_guru64_r2r(rank,dims,howmany_rank,howmany_dims,in,out,kind,flags) & - bind(C, name='fftwf_plan_guru64_r2r') - import - integer(C_INT), value :: rank - type(fftwf_iodim64), dimension(*), intent(in) :: dims - integer(C_INT), value :: howmany_rank - type(fftwf_iodim64), dimension(*), intent(in) :: howmany_dims - real(C_FLOAT), dimension(*), intent(out) :: in - real(C_FLOAT), dimension(*), intent(out) :: out - integer(C_FFTW_R2R_KIND), dimension(*), intent(in) :: kind - integer(C_INT), value :: flags - end function fftwf_plan_guru64_r2r - - subroutine fftwf_execute_r2r(p,in,out) bind(C, name='fftwf_execute_r2r') - import - type(C_PTR), value :: p - real(C_FLOAT), dimension(*), intent(inout) :: in - real(C_FLOAT), dimension(*), intent(out) :: out - end subroutine fftwf_execute_r2r - - subroutine fftwf_destroy_plan(p) bind(C, name='fftwf_destroy_plan') - import - type(C_PTR), value :: p - end subroutine fftwf_destroy_plan - - subroutine fftwf_forget_wisdom() bind(C, name='fftwf_forget_wisdom') - import - end subroutine fftwf_forget_wisdom - - subroutine fftwf_cleanup() bind(C, name='fftwf_cleanup') - import - end subroutine fftwf_cleanup - - subroutine fftwf_set_timelimit(t) bind(C, name='fftwf_set_timelimit') - import - real(C_DOUBLE), value :: t - end subroutine fftwf_set_timelimit - - subroutine fftwf_plan_with_nthreads(nthreads) bind(C, name='fftwf_plan_with_nthreads') - import - integer(C_INT), value :: nthreads - end subroutine fftwf_plan_with_nthreads - - integer(C_INT) function fftwf_init_threads() bind(C, name='fftwf_init_threads') - import - end function fftwf_init_threads - - subroutine fftwf_cleanup_threads() bind(C, name='fftwf_cleanup_threads') - import - end subroutine fftwf_cleanup_threads - - integer(C_INT) function fftwf_export_wisdom_to_filename(filename) bind(C, name='fftwf_export_wisdom_to_filename') - import - character(C_CHAR), dimension(*), intent(in) :: filename - end function fftwf_export_wisdom_to_filename - - subroutine fftwf_export_wisdom_to_file(output_file) bind(C, name='fftwf_export_wisdom_to_file') - import - type(C_PTR), value :: output_file - end subroutine fftwf_export_wisdom_to_file - - type(C_PTR) function fftwf_export_wisdom_to_string() bind(C, name='fftwf_export_wisdom_to_string') - import - end function fftwf_export_wisdom_to_string - - subroutine fftwf_export_wisdom(write_char,data) bind(C, name='fftwf_export_wisdom') - import - type(C_FUNPTR), value :: write_char - type(C_PTR), value :: data - end subroutine fftwf_export_wisdom - - integer(C_INT) function fftwf_import_system_wisdom() bind(C, name='fftwf_import_system_wisdom') - import - end function fftwf_import_system_wisdom - - integer(C_INT) function fftwf_import_wisdom_from_filename(filename) bind(C, name='fftwf_import_wisdom_from_filename') - import - character(C_CHAR), dimension(*), intent(in) :: filename - end function fftwf_import_wisdom_from_filename - - integer(C_INT) function fftwf_import_wisdom_from_file(input_file) bind(C, name='fftwf_import_wisdom_from_file') - import - type(C_PTR), value :: input_file - end function fftwf_import_wisdom_from_file - - integer(C_INT) function fftwf_import_wisdom_from_string(input_string) bind(C, name='fftwf_import_wisdom_from_string') - import - character(C_CHAR), dimension(*), intent(in) :: input_string - end function fftwf_import_wisdom_from_string - - integer(C_INT) function fftwf_import_wisdom(read_char,data) bind(C, name='fftwf_import_wisdom') - import - type(C_FUNPTR), value :: read_char - type(C_PTR), value :: data - end function fftwf_import_wisdom - - subroutine fftwf_fprint_plan(p,output_file) bind(C, name='fftwf_fprint_plan') - import - type(C_PTR), value :: p - type(C_PTR), value :: output_file - end subroutine fftwf_fprint_plan - - subroutine fftwf_print_plan(p) bind(C, name='fftwf_print_plan') - import - type(C_PTR), value :: p - end subroutine fftwf_print_plan - - type(C_PTR) function fftwf_malloc(n) bind(C, name='fftwf_malloc') - import - integer(C_SIZE_T), value :: n - end function fftwf_malloc - - type(C_PTR) function fftwf_alloc_real(n) bind(C, name='fftwf_alloc_real') - import - integer(C_SIZE_T), value :: n - end function fftwf_alloc_real - - type(C_PTR) function fftwf_alloc_complex(n) bind(C, name='fftwf_alloc_complex') - import - integer(C_SIZE_T), value :: n - end function fftwf_alloc_complex - - subroutine fftwf_free(p) bind(C, name='fftwf_free') - import - type(C_PTR), value :: p - end subroutine fftwf_free - - subroutine fftwf_flops(p,add,mul,fmas) bind(C, name='fftwf_flops') - import - type(C_PTR), value :: p - real(C_DOUBLE), intent(out) :: add - real(C_DOUBLE), intent(out) :: mul - real(C_DOUBLE), intent(out) :: fmas - end subroutine fftwf_flops - - real(C_DOUBLE) function fftwf_estimate_cost(p) bind(C, name='fftwf_estimate_cost') - import - type(C_PTR), value :: p - end function fftwf_estimate_cost - - real(C_DOUBLE) function fftwf_cost(p) bind(C, name='fftwf_cost') - import - type(C_PTR), value :: p - end function fftwf_cost - - end interface diff --git a/processing/post/marc_deformedGeometry.py b/processing/post/marc_deformedGeometry.py deleted file mode 100755 index f0fbee8b1..000000000 --- a/processing/post/marc_deformedGeometry.py +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env python -# -*- coding: UTF-8 no BOM -*- - -import os,sys,shutil -import numpy as np -import damask -from optparse import OptionParser - -scriptName = os.path.splitext(os.path.basename(__file__))[0] -scriptID = ' '.join([scriptName,damask.version]) - -# ----------------------------- -# MAIN FUNCTION STARTS HERE -# ----------------------------- - -# --- input parsing - -parser = OptionParser(usage='%prog [options] resultfile', description = """ -Create vtk files for the (deformed) geometry that belongs to a .t16 (MSC.Marc) results file. - -""", version = scriptID) - -parser.add_option('-d','--dir', dest='dir', \ - help='name of subdirectory to hold output [%default]') -parser.add_option('-r','--range', dest='range', type='int', nargs=3, \ - help='range of positions (or increments) to output (start, end, step) [all]') -parser.add_option('--increments', action='store_true', dest='getIncrements', \ - help='switch to increment range [%default]') -parser.add_option('-t','--type', dest='type', type='choice', choices=['ipbased','nodebased'], \ - help='processed geometry type [ipbased and nodebased]') - -parser.set_defaults(dir = 'vtk') -parser.set_defaults(getIncrements= False) - -(options, files) = parser.parse_args() - -# --- basic sanity checks - -if files == []: - parser.print_help() - parser.error('no file specified...') - -filename = os.path.splitext(files[0])[0] -if not os.path.exists(filename+'.t16'): - parser.print_help() - parser.error('invalid file "%s" specified...'%filename+'.t16') - -if not options.type : - options.type = ['nodebased', 'ipbased'] -else: - options.type = [options.type] - - -# --- more sanity checks - -sys.path.append(damask.solver.Marc().libraryPath('../../')) -try: - import py_post -except: - print('error: no valid Mentat release found') - sys.exit(-1) - - -# --------------------------- open results file and initialize mesh ---------- - -p = py_post.post_open(filename+'.t16') -p.moveto(0) -Nnodes = p.nodes() -Nincrements = p.increments() - 1 # t16 contains one "virtual" increment (at 0) -if damask.core.mesh.mesh_init_postprocessing(filename+'.mesh') > 0: - print('error: init not successful') - sys.exit(-1) -Ncellnodes = damask.core.mesh.mesh_get_Ncellnodes() -unitlength = damask.core.mesh.mesh_get_unitlength() - - -# --------------------------- create output dir -------------------------------- - -dirname = os.path.abspath(os.path.join(os.path.dirname(filename),options.dir)) -if not os.path.isdir(dirname): - os.mkdir(dirname,0755) - - -# --------------------------- get positions -------------------------------- - -incAtPosition = {} -positionOfInc = {} - -for position in range(Nincrements): - p.moveto(position+1) - incAtPosition[position] = p.increment # remember "real" increment at this position - positionOfInc[p.increment] = position # remember position of "real" increment - -if not options.range: - options.getIncrements = False - locations = range(Nincrements) # process all positions -else: - options.range = list(options.range) # convert to list - if options.getIncrements: - locations = [positionOfInc[x] for x in range(options.range[0],options.range[1]+1,options.range[2]) - if x in positionOfInc] - else: - locations = range( max(0,options.range[0]), - min(Nincrements,options.range[1]+1), - options.range[2] ) - -increments = [incAtPosition[x] for x in locations] # build list of increments to process - - - -# --------------------------- loop over positions -------------------------------- - -for incCount,position in enumerate(locations): # walk through locations - - p.moveto(position+1) # wind to correct position - -# --- get displacements - - node_displacement = [[0,0,0] for i in range(Nnodes)] - for n in range(Nnodes): - if p.node_displacements(): - node_displacement[n] = map(lambda x:x*unitlength,list(p.node_displacement(n))) - c = damask.core.mesh.mesh_build_cellnodes(np.array(node_displacement).T,Ncellnodes) - cellnode_displacement = [[c[i][n] for i in range(3)] for n in range(Ncellnodes)] - - -# --- append displacements to corresponding files - - for geomtype in options.type: - outFilename = eval('"'+eval("'%%s_%%s_inc%%0%ii.vtk'%(math.log10(max(increments+[1]))+1)")\ - +'"%(dirname + os.sep + os.path.split(filename)[1],geomtype,increments[incCount])') - print outFilename - shutil.copyfile('%s_%s.vtk'%(filename,geomtype),outFilename) - - with open(outFilename,'a') as myfile: - myfile.write("POINT_DATA %i\n"%{'nodebased':Nnodes,'ipbased':Ncellnodes}[geomtype]) - myfile.write("VECTORS displacement double\n") - coordinates = {'nodebased':node_displacement,'ipbased':cellnode_displacement}[geomtype] - for n in range({'nodebased':Nnodes,'ipbased':Ncellnodes}[geomtype]): - myfile.write("%.8e %.8e %.8e\n"%(coordinates[n][0],coordinates[n][1],coordinates[n][2])) - - - -# --------------------------- DONE -------------------------------- diff --git a/processing/post/marc_extractData.py b/processing/post/marc_extractData.py deleted file mode 100755 index b920a9cdd..000000000 --- a/processing/post/marc_extractData.py +++ /dev/null @@ -1,421 +0,0 @@ -#!/usr/bin/env python -# -*- coding: UTF-8 no BOM -*- - -import os,sys,string,re,time -from optparse import OptionParser, OptionGroup -import damask - -scriptName = os.path.splitext(os.path.basename(__file__))[0] -scriptID = ' '.join([scriptName,damask.version]) - -# ----------------------------- -def ParseOutputFormat(filename,homogID,crystID,phaseID): - """parse .output* files in order to get a list of outputs""" - myID = {'Homogenization': homogID, - 'Crystallite': crystID, - 'Constitutive': phaseID, - } - format = {} - - for what in ['Homogenization','Crystallite','Constitutive']: - content = [] - format[what] = {'outputs':{},'specials':{'brothers':[]}} - for prefix in ['']+map(str,range(1,17)): - if os.path.exists(prefix+filename+'.output'+what): - try: - file = open(prefix+filename+'.output'+what) - content = file.readlines() - file.close() - break - except: - pass - - if content == []: continue # nothing found... - - tag = '' - tagID = 0 - for line in content: - if re.match("\s*$",line) or re.match("#",line): # skip blank lines and comments - continue - m = re.match("\[(.+)\]",line) # look for block indicator - if m: # next section - tag = m.group(1) - tagID += 1 - format[what]['specials']['brothers'].append(tag) - if tag == myID[what] or (myID[what].isdigit() and tagID == int(myID[what])): - format[what]['specials']['_id'] = tagID - format[what]['outputs'] = [] - tag = myID[what] - else: # data from section - if tag == myID[what]: - (output,length) = line.split() - output.lower() - if length.isdigit(): - length = int(length) - if re.match("\((.+)\)",output): # special data, e.g. (Ngrains) - format[what]['specials'][output] = length - elif length > 0: - format[what]['outputs'].append([output,length]) - - if '_id' not in format[what]['specials']: - print "\nsection '%s' not found in <%s>"%(myID[what], what) - print '\n'.join(map(lambda x:' [%s]'%x, format[what]['specials']['brothers'])) - - return format - - -# ----------------------------- -def ParsePostfile(p,filename, outputFormat, legacyFormat): - """ - parse postfile in order to get position and labels of outputs - - needs "outputFormat" for mapping of output names to postfile output indices - """ - startVar = {True: 'GrainCount', - False:'HomogenizationCount'} - -# --- build statistics - - stat = { \ - 'IndexOfLabel': {}, \ - 'Title': p.title(), \ - 'Extrapolation': p.extrapolate, \ - 'NumberOfIncrements': p.increments() - 1, \ - 'NumberOfNodes': p.nodes(), \ - 'NumberOfNodalScalars': p.node_scalars(), \ - 'LabelOfNodalScalar': [None]*p.node_scalars() , \ - 'NumberOfElements': p.elements(), \ - 'NumberOfElementalScalars': p.element_scalars(), \ - 'LabelOfElementalScalar': [None]*p.element_scalars() , \ - 'NumberOfElementalTensors': p.element_tensors(), \ - 'LabelOfElementalTensor': [None]*p.element_tensors(), \ - } - -# --- find labels - - for labelIndex in range(stat['NumberOfNodalScalars']): - label = p.node_scalar_label(labelIndex) - stat['IndexOfLabel'][label] = labelIndex - stat['LabelOfNodalScalar'][labelIndex] = label - - for labelIndex in range(stat['NumberOfElementalScalars']): - label = p.element_scalar_label(labelIndex) - stat['IndexOfLabel'][label] = labelIndex - stat['LabelOfElementalScalar'][labelIndex] = label - - for labelIndex in range(stat['NumberOfElementalTensors']): - label = p.element_tensor_label(labelIndex) - stat['IndexOfLabel'][label] = labelIndex - stat['LabelOfElementalTensor'][labelIndex] = label - - if 'User Defined Variable 1' in stat['IndexOfLabel']: # output format without dedicated names? - stat['IndexOfLabel'][startVar[legacyFormat]] = stat['IndexOfLabel']['User Defined Variable 1'] # adjust first named entry - - if startVar[legacyFormat] in stat['IndexOfLabel']: # does the result file contain relevant user defined output at all? - startIndex = stat['IndexOfLabel'][startVar[legacyFormat]] - stat['LabelOfElementalScalar'][startIndex] = startVar[legacyFormat] - -# We now have to find a mapping for each output label as defined in the .output* files to the output position in the post file -# Since we know where the user defined outputs start ("startIndex"), we can simply assign increasing indices to the labels -# given in the .output* file - - offset = 1 - if legacyFormat: - stat['LabelOfElementalScalar'][startIndex + offset] = startVar[not legacyFormat] # add HomogenizationCount as second - offset += 1 - - for (name,N) in outputFormat['Homogenization']['outputs']: - for i in range(N): - label = {False: '%s'%( name), - True:'%i_%s'%(i+1,name)}[N > 1] - stat['IndexOfLabel'][label] = startIndex + offset - stat['LabelOfElementalScalar'][startIndex + offset] = label - offset += 1 - - if not legacyFormat: - stat['IndexOfLabel'][startVar[not legacyFormat]] = startIndex + offset - stat['LabelOfElementalScalar'][startIndex + offset] = startVar[not legacyFormat] # add GrainCount - offset += 1 - - if '(ngrains)' in outputFormat['Homogenization']['specials']: - for grain in range(outputFormat['Homogenization']['specials']['(ngrains)']): - - stat['IndexOfLabel']['%i_CrystalliteCount'%(grain+1)] = startIndex + offset # report crystallite count - stat['LabelOfElementalScalar'][startIndex + offset] = '%i_CrystalliteCount'%(grain+1) # add GrainCount - offset += 1 - - for (name,N) in outputFormat['Crystallite']['outputs']: # add crystallite outputs - for i in range(N): - label = {False: '%i_%s'%(grain+1, name), - True:'%i_%i_%s'%(grain+1,i+1,name)}[N > 1] - stat['IndexOfLabel'][label] = startIndex + offset - stat['LabelOfElementalScalar'][startIndex + offset] = label - offset += 1 - - stat['IndexOfLabel']['%i_ConstitutiveCount'%(grain+1)] = startIndex + offset # report constitutive count - stat['LabelOfElementalScalar'][startIndex + offset] = '%i_ConstitutiveCount'%(grain+1) # add GrainCount - offset += 1 - - for (name,N) in outputFormat['Constitutive']['outputs']: # add constitutive outputs - for i in range(N): - label = {False: '%i_%s'%(grain+1, name), - True:'%i_%i_%s'%(grain+1,i+1,name)}[N > 1] - stat['IndexOfLabel'][label] = startIndex + offset - try: - stat['LabelOfElementalScalar'][startIndex + offset] = label - except IndexError: - print 'trying to assign %s at position %i+%i'%(label,startIndex,offset) - sys.exit(1) - offset += 1 - - return stat - - -# ----------------------------- -def GetIncrementLocations(p,Nincrements,options): - """get mapping between positions in postfile and increment number""" - incAtPosition = {} - positionOfInc = {} - - for position in range(Nincrements): - p.moveto(position+1) - incAtPosition[position] = p.increment # remember "real" increment at this position - positionOfInc[p.increment] = position # remember position of "real" increment - - if not options.range: - options.getIncrements = False - locations = range(Nincrements) # process all positions - else: - options.range = list(options.range) # convert to list - if options.getIncrements: - locations = [positionOfInc[x] for x in range(options.range[0],options.range[1]+1,options.range[2]) - if x in positionOfInc] - else: - locations = range( max(0,options.range[0]), - min(Nincrements,options.range[1]+1), - options.range[2] ) - - increments = [incAtPosition[x] for x in locations] # build list of increments to process - - return [increments,locations] - - -# ----------------------------- -def SummarizePostfile(stat,where=sys.stdout): - - where.write('\n\n') - where.write('title:\t%s'%stat['Title'] + '\n\n') - where.write('extraplation:\t%s'%stat['Extrapolation'] + '\n\n') - where.write('increments:\t%i'%(stat['NumberOfIncrements']) + '\n\n') - where.write('nodes:\t%i'%stat['NumberOfNodes'] + '\n\n') - where.write('elements:\t%i'%stat['NumberOfElements'] + '\n\n') - where.write('nodal scalars:\t%i'%stat['NumberOfNodalScalars'] + '\n\n '\ - +'\n '.join(stat['LabelOfNodalScalar']) + '\n\n') - where.write('elemental scalars:\t%i'%stat['NumberOfElementalScalars'] + '\n\n '\ - + '\n '.join(stat['LabelOfElementalScalar']) + '\n\n') - where.write('elemental tensors:\t%i'%stat['NumberOfElementalTensors'] + '\n\n '\ - + '\n '.join(stat['LabelOfElementalTensor']) + '\n\n') - - return True - - -# ----------------------------- -def SummarizeOutputfile(format,where=sys.stdout): - - where.write('\nUser Defined Outputs') - for what in format.keys(): - where.write('\n\n %s:'%what) - for output in format[what]['outputs']: - where.write('\n %s'%output) - - return True - - -# ----------------------------- -def writeHeader(myfile,stat,geomtype): - - myfile.write('2\theader\n') - myfile.write(string.replace('$Id$','\n','\\n')+ - '\t' + ' '.join(sys.argv[1:]) + '\n') - if geomtype == 'nodebased': - myfile.write('node') - for i in range(stat['NumberOfNodalScalars']): - myfile.write('\t%s'%''.join(stat['LabelOfNodalScalar'][i].split())) - - elif geomtype == 'ipbased': - myfile.write('elem\tip') - for i in range(stat['NumberOfElementalScalars']): - myfile.write('\t%s'%''.join(stat['LabelOfElementalScalar'][i].split())) - - myfile.write('\n') - - return True - - -# -------------------------------------------------------------------- -# MAIN -# -------------------------------------------------------------------- - -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ -Extract data from a .t16 (MSC.Marc) results file. - -""", version = scriptID) - -parser.add_option('-i','--info', action='store_true', dest='info', \ - help='list contents of resultfile [%default]') -parser.add_option('-l','--legacy', action='store_true', dest='legacy', \ - help='legacy user result block (starts with GrainCount) [%default]') -parser.add_option('-d','--dir', dest='dir', \ - help='name of subdirectory to hold output [%default]') -parser.add_option('-r','--range', dest='range', type='int', nargs=3, \ - help='range of positions (or increments) to output (start, end, step) [all]') -parser.add_option('--increments', action='store_true', dest='getIncrements', \ - help='switch to increment range [%default]') -parser.add_option('-t','--type', dest='type', type='choice', choices=['ipbased','nodebased'], \ - help='processed geometry type [ipbased and nodebased]') - -group_material = OptionGroup(parser,'Material identifier') - -group_material.add_option('--homogenization', dest='homog', \ - help='homogenization identifier (as string or integer [%default])', metavar='') -group_material.add_option('--crystallite', dest='cryst', \ - help='crystallite identifier (as string or integer [%default])', metavar='') -group_material.add_option('--phase', dest='phase', \ - help='phase identifier (as string or integer [%default])', metavar='') - -parser.add_option_group(group_material) - -parser.set_defaults(info = False) -parser.set_defaults(legacy = False) -parser.set_defaults(dir = 'vtk') -parser.set_defaults(getIncrements= False) -parser.set_defaults(homog = '1') -parser.set_defaults(cryst = '1') -parser.set_defaults(phase = '1') - -(options, files) = parser.parse_args() - - -# --- sanity checks - -if files == []: - parser.print_help() - parser.error('no file specified...') - -filename = os.path.splitext(files[0])[0] -if not os.path.exists(filename+'.t16'): - parser.print_help() - parser.error('invalid file "%s" specified...'%filename+'.t16') - -sys.path.append(damask.solver.Marc().libraryPath('../../')) -try: - import py_post -except: - print('error: no valid Mentat release found') - sys.exit(-1) - -if not options.type : - options.type = ['nodebased', 'ipbased'] -else: - options.type = [options.type] - - -# --- initialize mesh data - -if damask.core.mesh.mesh_init_postprocessing(filename+'.mesh'): - print('error: init not successful') - sys.exit(-1) - - -# --- check if ip data available for all elements; if not, then .t19 file is required - -p = py_post.post_open(filename+'.t16') -asciiFile = False -p.moveto(1) -for e in range(p.elements()): - if not damask.core.mesh.mesh_get_nodeAtIP(str(p.element(e).type),1): - if os.path.exists(filename+'.t19'): - p.close() - p = py_post.post_open(filename+'.t19') - asciiFile = True - break - - -# --- parse *.output and *.t16 file - -outputFormat = ParseOutputFormat(filename,options.homog,options.cryst,options.phase) -p.moveto(1) -p.extrapolation('translate') -stat = ParsePostfile(p,filename,outputFormat,options.legacy) - - -# --- output info - -if options.info: - print '\n\nMentat release %s'%damask.solver.Marc().version('../../') - SummarizePostfile(stat) - SummarizeOutputfile(outputFormat) - sys.exit(0) - - -# --- create output dir - -dirname = os.path.abspath(os.path.join(os.path.dirname(filename),options.dir)) -if not os.path.isdir(dirname): - os.mkdir(dirname,0755) - - -# --- get positions - -[increments,locations] = GetIncrementLocations(p,stat['NumberOfIncrements'],options) - - -# --- loop over positions - -time_start = time.time() -for incCount,position in enumerate(locations): # walk through locations - p.moveto(position+1) # wind to correct position - time_delta = (float(len(locations)) / float(incCount+1) - 1.0) * (time.time() - time_start) - sys.stdout.write("\r(%02i:%02i:%02i) processing increment %i of %i..."\ - %(time_delta//3600,time_delta%3600//60,time_delta%60,incCount+1,len(locations))) - sys.stdout.flush() - -# --- write header - - outFilename = {} - for geomtype in options.type: - outFilename[geomtype] = eval('"'+eval("'%%s_%%s_inc%%0%ii.txt'%(math.log10(max(increments+[1]))+1)")\ - +'"%(dirname + os.sep + os.path.split(filename)[1],geomtype,increments[incCount])') - with open(outFilename[geomtype],'w') as myfile: - writeHeader(myfile,stat,geomtype) - - # --- write node based data - - if geomtype == 'nodebased': - for n in range(stat['NumberOfNodes']): - myfile.write(str(n)) - for l in range(stat['NumberOfNodalScalars']): - myfile.write('\t'+str(p.node_scalar(n,l))) - myfile.write('\n') - - # --- write ip based data - - elif geomtype == 'ipbased': - for e in range(stat['NumberOfElements']): - if asciiFile: - print 'ascii postfile not yet supported' - sys.exit(-1) - else: - ipData = [[]] - for l in range(stat['NumberOfElementalScalars']): - data = p.element_scalar(e,l) - for i in range(len(data)): # at least as many nodes as ips - node = damask.core.mesh.mesh_get_nodeAtIP(str(p.element(e).type),i+1) # fortran indexing starts at 1 - if not node: break # no more ips - while i >= len(ipData): ipData.append([]) - ipData[i].extend([data[node-1].value]) # python indexing starts at 0 - for i in range(len(ipData)): - myfile.write('\t'.join(map(str,[e,i]+ipData[i]))+'\n') - -p.close() -sys.stdout.write("\n") From 7d6ebfb71cc78233694e430b16232e27d6a108eb Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 24 Mar 2016 11:58:56 +0100 Subject: [PATCH 003/412] removed core module fftw functionality --- code/math.f90 | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/code/math.f90 b/code/math.f90 index bf7460062..b92610d50 100644 --- a/code/math.f90 +++ b/code/math.f90 @@ -72,10 +72,6 @@ module math 3_pInt,3_pInt & ],[2,9]) !< arrangement in Plain notation -#ifdef Spectral - include 'fftw3.f03' -#endif - public :: & math_init, & math_qsort, & @@ -163,21 +159,6 @@ module math math_rotate_forward33, & math_rotate_backward33, & math_rotate_forward3333 -#ifdef Spectral - public :: & - fftw_set_timelimit, & - fftw_plan_dft_3d, & - fftw_plan_many_dft_r2c, & - fftw_plan_many_dft_c2r, & - fftw_plan_with_nthreads, & - fftw_init_threads, & - fftw_alloc_complex, & - fftw_execute_dft, & - fftw_execute_dft_r2c, & - fftw_execute_dft_c2r, & - fftw_destroy_plan, & - math_tensorAvg -#endif private :: & math_partition, & halton, & From 60a3ac5b0462dc6533c5cc27253ea5c9fd5335c1 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 24 Mar 2016 12:35:33 +0100 Subject: [PATCH 004/412] copied fortran code --- processing/post/addCompatibilityMismatch.py | 145 +++++++++++++++++++- 1 file changed, 144 insertions(+), 1 deletion(-) diff --git a/processing/post/addCompatibilityMismatch.py b/processing/post/addCompatibilityMismatch.py index f237f7d19..20cdd284c 100755 --- a/processing/post/addCompatibilityMismatch.py +++ b/processing/post/addCompatibilityMismatch.py @@ -9,6 +9,150 @@ import damask scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptID = ' '.join([scriptName,damask.version]) + +def volTetrahedron(vertices=None, sides=None): + """ + Return the volume of the tetrahedron with given vertices or sides. If + vertices are given they must be in a NumPy array with shape (4,3): the + position vectors of the 4 vertices in 3 dimensions; if the six sides are + given, they must be an array of length 6. If both are given, the sides + will be used in the calculation. + + This method implements + Tartaglia's formula using the Cayley-Menger determinant: + |0 1 1 1 1 | + |1 0 s1^2 s2^2 s3^2| + 288 V^2 = |1 s1^2 0 s4^2 s5^2| + |1 s2^2 s4^2 0 s6^2| + |1 s3^2 s5^2 s6^2 0 | + where s1, s2, ..., s6 are the tetrahedron side lengths. + + from http://codereview.stackexchange.com/questions/77593/calculating-the-volume-of-a-tetrahedron + + """ + + # The indexes of rows in the vertices array corresponding to all + # possible pairs of vertices + vertex_pair_indexes = np.array(((0, 1), (0, 2), (0, 3), + (1, 2), (1, 3), (2, 3))) + + # Get all the squares of all side lengths from the differences between + # the 6 different pairs of vertex positions + vertex1, vertex2 = vertex_pair_indexes[:,0], vertex_pair_indexes[:,1] + sides_squared = np.sum((vertices[vertex1] - vertices[vertex2])**2,axis=-1) + + + # Set up the Cayley-Menger determinant + M = np.zeros((5,5)) + # Fill in the upper triangle of the matrix + M[0,1:] = 1 + # The squared-side length elements can be indexed using the vertex + # pair indices (compare with the determinant illustrated above) + M[tuple(zip(*(vertex_pair_indexes + 1)))] = sides_squared + + # The matrix is symmetric, so we can fill in the lower triangle by + # adding the transpose + M = M + M.T + return np.sqrt(det / 288) + + +def mesh_volumeMismatch(size,F,nodes): + """ + calculates the mismatch between volume of reconstructed (compatible) cube and + determinant of defgrad at the FP + """ + real(pReal), intent(in), dimension(:,:,:,:,:) :: & + F + real(pReal), dimension(size(F,3),size(F,4),size(F,5)) :: & + vMismatch + real(pReal), intent(in), dimension(:,:,:,:) :: & + nodes + real(pReal), dimension(3,8) :: coords + + volInitial = size.prod()/grid.prod() + +#-------------------------------------------------------------------------------------------------- +# calculate actual volume and volume resulting from deformation gradient + for k in xrange(grid[2]): + for j in xrange(grid[1]): + for i in xrange(grid[0]): + coords(0:3,0) = nodes[0:3,i, j, k ] + coords(0:3,1) = nodes[0:3,i+1,j, k ] + coords(0:3,2) = nodes[0:3,i+1,j+1,k ] + coords(0:3,3) = nodes[0:3,i, j+1,k ] + coords(0:3,4) = nodes[0:3,i, j, k+1] + coords(0:3,5) = nodes[0:3,i+1,j, k+1] + coords(0:3,6) = nodes[0:3,i+1,j+1,k+1] + coords(0:3,7) = nodes[0:3,i, j+1,k+1] + vMismatch[i,j,k] = & + abs(volTetrahedron(coords[0:3,6],coords[0:3,0],coords[0:3,7],coords[0:3,3])) & + + abs(volTetrahedron(coords[0:3,6],coords[0:3,0],coords[0:3,7],coords[0:3,4])) & + + abs(volTetrahedron(coords[0:3,6],coords[0:3,0],coords[0:3,2],coords[0:3,3])) & + + abs(volTetrahedron(coords[0:3,6],coords[0:3,0],coords[0:3,2],coords[0:3,1])) & + + abs(volTetrahedron(coords[0:3,6],coords[0:3,4],coords[0:3,1],coords[0:3,5])) & + + abs(volTetrahedron(coords[0:3,6],coords[0:3,4],coords[0:3,1],coords[0:3,0])) + vMismatch[i,j,k] = vMismatch[i,j,k]/math_det33(F(1:3,1:3,i,j,k)) + enddo; enddo; enddo + + return vMismatch/volInitial + + + +def mesh_shapeMismatch(gDim,F,nodes,centres): + """ + Routine to calculate the mismatch between the vectors from the central point to + the corners of reconstructed (combatible) volume element and the vectors calculated by deforming + the initial volume element with the current deformation gradient + """ + + implicit none + real(pReal), intent(in), dimension(:,:,:,:,:) :: & + F + real(pReal), dimension(size(F,3),size(F,4),size(F,5)) :: & + sMismatch + real(pReal), intent(in), dimension(:,:,:,:) :: & + nodes, & + centres + real(pReal), dimension(3,8) :: coordsInitial + integer(pInt) i,j,k + +!-------------------------------------------------------------------------------------------------- +! initial positions + coordsInitial(1:3,1) = [-gDim(1)/fRes(1),-gDim(2)/fRes(2),-gDim(3)/fRes(3)] + coordsInitial(1:3,2) = [+gDim(1)/fRes(1),-gDim(2)/fRes(2),-gDim(3)/fRes(3)] + coordsInitial(1:3,3) = [+gDim(1)/fRes(1),+gDim(2)/fRes(2),-gDim(3)/fRes(3)] + coordsInitial(1:3,4) = [-gDim(1)/fRes(1),+gDim(2)/fRes(2),-gDim(3)/fRes(3)] + coordsInitial(1:3,5) = [-gDim(1)/fRes(1),-gDim(2)/fRes(2),+gDim(3)/fRes(3)] + coordsInitial(1:3,6) = [+gDim(1)/fRes(1),-gDim(2)/fRes(2),+gDim(3)/fRes(3)] + coordsInitial(1:3,7) = [+gDim(1)/fRes(1),+gDim(2)/fRes(2),+gDim(3)/fRes(3)] + coordsInitial(1:3,8) = [-gDim(1)/fRes(1),+gDim(2)/fRes(2),+gDim(3)/fRes(3)] + coordsInitial = coordsInitial/2.0_pReal + +!-------------------------------------------------------------------------------------------------- +! compare deformed original and deformed positions to actual positions + do k = 1_pInt,iRes(3) + do j = 1_pInt,iRes(2) + do i = 1_pInt,iRes(1) + sMismatch(i,j,k) = & + sqrt(sum((nodes(1:3,i, j, k ) - centres(1:3,i,j,k)& + - math_mul33x3(F(1:3,1:3,i,j,k), coordsInitial(1:3,1)))**2.0_pReal))& + + sqrt(sum((nodes(1:3,i+1_pInt,j, k ) - centres(1:3,i,j,k)& + - math_mul33x3(F(1:3,1:3,i,j,k), coordsInitial(1:3,2)))**2.0_pReal))& + + sqrt(sum((nodes(1:3,i+1_pInt,j+1_pInt,k ) - centres(1:3,i,j,k)& + - math_mul33x3(F(1:3,1:3,i,j,k), coordsInitial(1:3,3)))**2.0_pReal))& + + sqrt(sum((nodes(1:3,i, j+1_pInt,k ) - centres(1:3,i,j,k)& + - math_mul33x3(F(1:3,1:3,i,j,k), coordsInitial(1:3,4)))**2.0_pReal))& + + sqrt(sum((nodes(1:3,i, j, k+1_pInt) - centres(1:3,i,j,k)& + - math_mul33x3(F(1:3,1:3,i,j,k), coordsInitial(1:3,5)))**2.0_pReal))& + + sqrt(sum((nodes(1:3,i+1_pInt,j, k+1_pInt) - centres(1:3,i,j,k)& + - math_mul33x3(F(1:3,1:3,i,j,k), coordsInitial(1:3,6)))**2.0_pReal))& + + sqrt(sum((nodes(1:3,i+1_pInt,j+1_pInt,k+1_pInt) - centres(1:3,i,j,k)& + - math_mul33x3(F(1:3,1:3,i,j,k), coordsInitial(1:3,7)))**2.0_pReal))& + + sqrt(sum((nodes(1:3,i, j+1_pInt,k+1_pInt) - centres(1:3,i,j,k)& + - math_mul33x3(F(1:3,1:3,i,j,k), coordsInitial(1:3,8)))**2.0_pReal)) + enddo; enddo; enddo + return sMismatch + # -------------------------------------------------------------------- # MAIN # -------------------------------------------------------------------- @@ -117,7 +261,6 @@ for name in filenames: idx += 1 F[0:3,0:3,x,y,z] = np.array(map(float,table.data[column:column+9]),'d').reshape(3,3) - Favg = damask.core.math.tensorAvg(F) centres = damask.core.mesh.deformedCoordsFFT(size,F,Favg,[1.0,1.0,1.0]) nodes = damask.core.mesh.nodesAroundCentres(size,Favg,centres) From 8b8906311317061dd5f68ba15d9414fb65dd7b64 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 24 Mar 2016 14:19:00 +0100 Subject: [PATCH 005/412] less core module --- processing/post/addCompatibilityMismatch.py | 141 +++++++++----------- 1 file changed, 60 insertions(+), 81 deletions(-) diff --git a/processing/post/addCompatibilityMismatch.py b/processing/post/addCompatibilityMismatch.py index 20cdd284c..8c9e479ec 100755 --- a/processing/post/addCompatibilityMismatch.py +++ b/processing/post/addCompatibilityMismatch.py @@ -10,7 +10,7 @@ scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptID = ' '.join([scriptName,damask.version]) -def volTetrahedron(vertices=None, sides=None): +def volTetrahedron(coords): """ Return the volume of the tetrahedron with given vertices or sides. If vertices are given they must be in a NumPy array with shape (4,3): the @@ -38,6 +38,7 @@ def volTetrahedron(vertices=None, sides=None): # Get all the squares of all side lengths from the differences between # the 6 different pairs of vertex positions + vertices = np.concatenate((coords[0],coords[1],coords[2],coords[3])).reshape([4,3]) vertex1, vertex2 = vertex_pair_indexes[:,0], vertex_pair_indexes[:,1] sides_squared = np.sum((vertices[vertex1] - vertices[vertex2])**2,axis=-1) @@ -53,105 +54,83 @@ def volTetrahedron(vertices=None, sides=None): # The matrix is symmetric, so we can fill in the lower triangle by # adding the transpose M = M + M.T - return np.sqrt(det / 288) + return np.sqrt(np.linalg.det(M) / 288) -def mesh_volumeMismatch(size,F,nodes): +def volumeMismatch(size,F,nodes): """ calculates the mismatch between volume of reconstructed (compatible) cube and determinant of defgrad at the FP """ - real(pReal), intent(in), dimension(:,:,:,:,:) :: & - F - real(pReal), dimension(size(F,3),size(F,4),size(F,5)) :: & - vMismatch - real(pReal), intent(in), dimension(:,:,:,:) :: & - nodes - real(pReal), dimension(3,8) :: coords - volInitial = size.prod()/grid.prod() + coords = np.empty([8,3]) + vMismatch = np.empty(grid) + volInitial = size.prod()/grid.prod() #-------------------------------------------------------------------------------------------------- # calculate actual volume and volume resulting from deformation gradient - for k in xrange(grid[2]): - for j in xrange(grid[1]): - for i in xrange(grid[0]): - coords(0:3,0) = nodes[0:3,i, j, k ] - coords(0:3,1) = nodes[0:3,i+1,j, k ] - coords(0:3,2) = nodes[0:3,i+1,j+1,k ] - coords(0:3,3) = nodes[0:3,i, j+1,k ] - coords(0:3,4) = nodes[0:3,i, j, k+1] - coords(0:3,5) = nodes[0:3,i+1,j, k+1] - coords(0:3,6) = nodes[0:3,i+1,j+1,k+1] - coords(0:3,7) = nodes[0:3,i, j+1,k+1] - vMismatch[i,j,k] = & - abs(volTetrahedron(coords[0:3,6],coords[0:3,0],coords[0:3,7],coords[0:3,3])) & - + abs(volTetrahedron(coords[0:3,6],coords[0:3,0],coords[0:3,7],coords[0:3,4])) & - + abs(volTetrahedron(coords[0:3,6],coords[0:3,0],coords[0:3,2],coords[0:3,3])) & - + abs(volTetrahedron(coords[0:3,6],coords[0:3,0],coords[0:3,2],coords[0:3,1])) & - + abs(volTetrahedron(coords[0:3,6],coords[0:3,4],coords[0:3,1],coords[0:3,5])) & - + abs(volTetrahedron(coords[0:3,6],coords[0:3,4],coords[0:3,1],coords[0:3,0])) - vMismatch[i,j,k] = vMismatch[i,j,k]/math_det33(F(1:3,1:3,i,j,k)) - enddo; enddo; enddo + for k in xrange(grid[2]): + for j in xrange(grid[1]): + for i in xrange(grid[0]): + coords[0,0:3] = nodes[0:3,i, j, k ] + coords[1,0:3] = nodes[0:3,i+1,j, k ] + coords[2,0:3] = nodes[0:3,i+1,j+1,k ] + coords[3,0:3] = nodes[0:3,i, j+1,k ] + coords[4,0:3] = nodes[0:3,i, j, k+1] + coords[5,0:3] = nodes[0:3,i+1,j, k+1] + coords[6,0:3] = nodes[0:3,i+1,j+1,k+1] + coords[7,0:3] = nodes[0:3,i, j+1,k+1] + vMismatch[i,j,k] = \ + abs(volTetrahedron([coords[6,0:3],coords[0,0:3],coords[7,0:3],coords[3,0:3]])) \ + + abs(volTetrahedron([coords[6,0:3],coords[0,0:3],coords[7,0:3],coords[4,0:3]])) \ + + abs(volTetrahedron([coords[6,0:3],coords[0,0:3],coords[2,0:3],coords[3,0:3]])) \ + + abs(volTetrahedron([coords[6,0:3],coords[0,0:3],coords[2,0:3],coords[1,0:3]])) \ + + abs(volTetrahedron([coords[6,0:3],coords[4,0:3],coords[1,0:3],coords[5,0:3]])) \ + + abs(volTetrahedron([coords[6,0:3],coords[4,0:3],coords[1,0:3],coords[0,0:3]])) + vMismatch[i,j,k] = vMismatch[i,j,k]/np.linalg.det(F[0:3,0:3,i,j,k]) - return vMismatch/volInitial + return vMismatch/volInitial -def mesh_shapeMismatch(gDim,F,nodes,centres): +def shapeMismatch(size,F,nodes,centres): """ Routine to calculate the mismatch between the vectors from the central point to the corners of reconstructed (combatible) volume element and the vectors calculated by deforming the initial volume element with the current deformation gradient """ - implicit none - real(pReal), intent(in), dimension(:,:,:,:,:) :: & - F - real(pReal), dimension(size(F,3),size(F,4),size(F,5)) :: & - sMismatch - real(pReal), intent(in), dimension(:,:,:,:) :: & - nodes, & - centres - real(pReal), dimension(3,8) :: coordsInitial - integer(pInt) i,j,k + coordsInitial = np.empty([8,3]) + sMismatch = np.empty(grid) -!-------------------------------------------------------------------------------------------------- -! initial positions - coordsInitial(1:3,1) = [-gDim(1)/fRes(1),-gDim(2)/fRes(2),-gDim(3)/fRes(3)] - coordsInitial(1:3,2) = [+gDim(1)/fRes(1),-gDim(2)/fRes(2),-gDim(3)/fRes(3)] - coordsInitial(1:3,3) = [+gDim(1)/fRes(1),+gDim(2)/fRes(2),-gDim(3)/fRes(3)] - coordsInitial(1:3,4) = [-gDim(1)/fRes(1),+gDim(2)/fRes(2),-gDim(3)/fRes(3)] - coordsInitial(1:3,5) = [-gDim(1)/fRes(1),-gDim(2)/fRes(2),+gDim(3)/fRes(3)] - coordsInitial(1:3,6) = [+gDim(1)/fRes(1),-gDim(2)/fRes(2),+gDim(3)/fRes(3)] - coordsInitial(1:3,7) = [+gDim(1)/fRes(1),+gDim(2)/fRes(2),+gDim(3)/fRes(3)] - coordsInitial(1:3,8) = [-gDim(1)/fRes(1),+gDim(2)/fRes(2),+gDim(3)/fRes(3)] - coordsInitial = coordsInitial/2.0_pReal +#-------------------------------------------------------------------------------------------------- +# initial positions + coordsInitial[0,0:3] = [-size[0]/grid[0],-size[1]/grid[1],-size[2]/grid[2]] + coordsInitial[1,0:3] = [+size[0]/grid[0],-size[1]/grid[1],-size[2]/grid[2]] + coordsInitial[2,0:3] = [+size[0]/grid[0],+size[1]/grid[1],-size[2]/grid[2]] + coordsInitial[3,0:3] = [-size[0]/grid[0],+size[1]/grid[1],-size[2]/grid[2]] + coordsInitial[4,0:3] = [-size[0]/grid[0],-size[1]/grid[1],+size[2]/grid[2]] + coordsInitial[5,0:3] = [+size[0]/grid[0],-size[1]/grid[1],+size[2]/grid[2]] + coordsInitial[6,0:3] = [+size[0]/grid[0],+size[1]/grid[1],+size[2]/grid[2]] + coordsInitial[7,0:3] = [-size[0]/grid[0],+size[1]/grid[1],+size[2]/grid[2]] + coordsInitial = coordsInitial/2.0 -!-------------------------------------------------------------------------------------------------- -! compare deformed original and deformed positions to actual positions - do k = 1_pInt,iRes(3) - do j = 1_pInt,iRes(2) - do i = 1_pInt,iRes(1) - sMismatch(i,j,k) = & - sqrt(sum((nodes(1:3,i, j, k ) - centres(1:3,i,j,k)& - - math_mul33x3(F(1:3,1:3,i,j,k), coordsInitial(1:3,1)))**2.0_pReal))& - + sqrt(sum((nodes(1:3,i+1_pInt,j, k ) - centres(1:3,i,j,k)& - - math_mul33x3(F(1:3,1:3,i,j,k), coordsInitial(1:3,2)))**2.0_pReal))& - + sqrt(sum((nodes(1:3,i+1_pInt,j+1_pInt,k ) - centres(1:3,i,j,k)& - - math_mul33x3(F(1:3,1:3,i,j,k), coordsInitial(1:3,3)))**2.0_pReal))& - + sqrt(sum((nodes(1:3,i, j+1_pInt,k ) - centres(1:3,i,j,k)& - - math_mul33x3(F(1:3,1:3,i,j,k), coordsInitial(1:3,4)))**2.0_pReal))& - + sqrt(sum((nodes(1:3,i, j, k+1_pInt) - centres(1:3,i,j,k)& - - math_mul33x3(F(1:3,1:3,i,j,k), coordsInitial(1:3,5)))**2.0_pReal))& - + sqrt(sum((nodes(1:3,i+1_pInt,j, k+1_pInt) - centres(1:3,i,j,k)& - - math_mul33x3(F(1:3,1:3,i,j,k), coordsInitial(1:3,6)))**2.0_pReal))& - + sqrt(sum((nodes(1:3,i+1_pInt,j+1_pInt,k+1_pInt) - centres(1:3,i,j,k)& - - math_mul33x3(F(1:3,1:3,i,j,k), coordsInitial(1:3,7)))**2.0_pReal))& - + sqrt(sum((nodes(1:3,i, j+1_pInt,k+1_pInt) - centres(1:3,i,j,k)& - - math_mul33x3(F(1:3,1:3,i,j,k), coordsInitial(1:3,8)))**2.0_pReal)) - enddo; enddo; enddo - return sMismatch +#-------------------------------------------------------------------------------------------------- +# compare deformed original and deformed positions to actual positions + for k in xrange(grid[2]): + for j in xrange(grid[1]): + for i in xrange(grid[0]): + sMismatch[i,j,k] = \ + np.linalg.norm(nodes[0:3,i, j, k] - centres[0:3,i,j,k] - np.dot(F[:,:,i,j,k], coordsInitial[0,0:3]))\ + + np.linalg.norm(nodes[0:3,i+1,j, k] - centres[0:3,i,j,k] - np.dot(F[:,:,i,j,k], coordsInitial[1,0:3]))\ + + np.linalg.norm(nodes[0:3,i+1,j+1,k ] - centres[0:3,i,j,k] - np.dot(F[:,:,i,j,k], coordsInitial[2,0:3]))\ + + np.linalg.norm(nodes[0:3,i, j+1,k ] - centres[0:3,i,j,k] - np.dot(F[:,:,i,j,k], coordsInitial[3,0:3]))\ + + np.linalg.norm(nodes[0:3,i, j, k+1] - centres[0:3,i,j,k] - np.dot(F[:,:,i,j,k], coordsInitial[4,0:3]))\ + + np.linalg.norm(nodes[0:3,i+1,j, k+1] - centres[0:3,i,j,k] - np.dot(F[:,:,i,j,k], coordsInitial[5,0:3]))\ + + np.linalg.norm(nodes[0:3,i+1,j+1,k+1] - centres[0:3,i,j,k] - np.dot(F[:,:,i,j,k], coordsInitial[6,0:3]))\ + + np.linalg.norm(nodes[0:3,i, j+1,k+1] - centres[0:3,i,j,k] - np.dot(F[:,:,i,j,k], coordsInitial[7,0:3])) + return sMismatch + # -------------------------------------------------------------------- # MAIN @@ -260,12 +239,12 @@ for name in filenames: (x,y,z) = damask.util.gridLocation(idx,grid) # figure out (x,y,z) position from line count idx += 1 F[0:3,0:3,x,y,z] = np.array(map(float,table.data[column:column+9]),'d').reshape(3,3) - + Favg = damask.core.math.tensorAvg(F) centres = damask.core.mesh.deformedCoordsFFT(size,F,Favg,[1.0,1.0,1.0]) nodes = damask.core.mesh.nodesAroundCentres(size,Favg,centres) - if options.shape: shapeMismatch = damask.core.mesh.shapeMismatch( size,F,nodes,centres) - if options.volume: volumeMismatch = damask.core.mesh.volumeMismatch(size,F,nodes) + if options.shape: shapeMismatch = shapeMismatch( size,F,nodes,centres) + if options.volume: volumeMismatch = volumeMismatch(size,F,nodes) # ------------------------------------------ process data ------------------------------------------ table.data_rewind() From d765282165ee598891bc8b27ff25cd35e20ddb2a Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 24 Mar 2016 14:20:18 +0100 Subject: [PATCH 006/412] save fortran code --- lib/damask/util.py | 90 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/lib/damask/util.py b/lib/damask/util.py index 244aaa25c..81eb30713 100644 --- a/lib/damask/util.py +++ b/lib/damask/util.py @@ -451,3 +451,93 @@ def curve_fit_bound(f, xdata, ydata, p0=None, sigma=None, bounds=None, **kw): pcov = np.inf return (popt, pcov, infodict, errmsg, ier) if return_full else (popt, pcov) + + +!-------------------------------------------------------------------------------------------------- +!> @brief builds mesh of (distorted) cubes for given coordinates (= center of the cubes) +!-------------------------------------------------------------------------------------------------- +function mesh_nodesAroundCentres(gDim,Favg,centres) result(nodes) + use debug, only: & + debug_mesh, & + debug_level, & + debug_levelBasic + use math, only: & + math_mul33x3 + + implicit none + real(pReal), intent(in), dimension(:,:,:,:) :: & + centres + real(pReal), dimension(3,size(centres,2)+1,size(centres,3)+1,size(centres,4)+1) :: & + nodes + real(pReal), intent(in), dimension(3) :: & + gDim + real(pReal), intent(in), dimension(3,3) :: & + Favg + real(pReal), dimension(3,size(centres,2)+2,size(centres,3)+2,size(centres,4)+2) :: & + wrappedCentres + + integer(pInt) :: & + i,j,k,n + integer(pInt), dimension(3), parameter :: & + diag = 1_pInt + integer(pInt), dimension(3) :: & + shift = 0_pInt, & + lookup = 0_pInt, & + me = 0_pInt, & + iRes = 0_pInt + integer(pInt), dimension(3,8) :: & + neighbor = reshape([ & + 0_pInt, 0_pInt, 0_pInt, & + 1_pInt, 0_pInt, 0_pInt, & + 1_pInt, 1_pInt, 0_pInt, & + 0_pInt, 1_pInt, 0_pInt, & + 0_pInt, 0_pInt, 1_pInt, & + 1_pInt, 0_pInt, 1_pInt, & + 1_pInt, 1_pInt, 1_pInt, & + 0_pInt, 1_pInt, 1_pInt ], [3,8]) + +!-------------------------------------------------------------------------------------------------- +! initializing variables + iRes = [size(centres,2),size(centres,3),size(centres,4)] + nodes = 0.0_pReal + wrappedCentres = 0.0_pReal + +!-------------------------------------------------------------------------------------------------- +! report + if (iand(debug_level(debug_mesh),debug_levelBasic) /= 0_pInt) then + write(6,'(a)') ' Meshing cubes around centroids' + write(6,'(a,3(e12.5))') ' Dimension: ', gDim + write(6,'(a,3(i5))') ' Resolution:', iRes + endif + +!-------------------------------------------------------------------------------------------------- +! building wrappedCentres = centroids + ghosts + wrappedCentres(1:3,2_pInt:iRes(1)+1_pInt,2_pInt:iRes(2)+1_pInt,2_pInt:iRes(3)+1_pInt) = centres + do k = 0_pInt,iRes(3)+1_pInt + do j = 0_pInt,iRes(2)+1_pInt + do i = 0_pInt,iRes(1)+1_pInt + if (k==0_pInt .or. k==iRes(3)+1_pInt .or. & ! z skin + j==0_pInt .or. j==iRes(2)+1_pInt .or. & ! y skin + i==0_pInt .or. i==iRes(1)+1_pInt ) then ! x skin + me = [i,j,k] ! me on skin + shift = sign(abs(iRes+diag-2_pInt*me)/(iRes+diag),iRes+diag-2_pInt*me) + lookup = me-diag+shift*iRes + wrappedCentres(1:3,i+1_pInt, j+1_pInt, k+1_pInt) = & + centres(1:3,lookup(1)+1_pInt,lookup(2)+1_pInt,lookup(3)+1_pInt) - & + math_mul33x3(Favg, shift*gDim) + endif + enddo; enddo; enddo + +!-------------------------------------------------------------------------------------------------- +! averaging + do k = 0_pInt,iRes(3); do j = 0_pInt,iRes(2); do i = 0_pInt,iRes(1) + do n = 1_pInt,8_pInt + nodes(1:3,i+1_pInt,j+1_pInt,k+1_pInt) = & + nodes(1:3,i+1_pInt,j+1_pInt,k+1_pInt) + wrappedCentres(1:3,i+1_pInt+neighbor(1,n), & + j+1_pInt+neighbor(2,n), & + k+1_pInt+neighbor(3,n) ) + enddo + enddo; enddo; enddo + nodes = nodes/8.0_pReal + +end function mesh_nodesAroundCentres From c73382e51f62adeba2f2afb6e8484a45c7dce4f9 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 24 Mar 2016 14:36:24 +0100 Subject: [PATCH 007/412] further cleaning --- Makefile | 1 - lib/damask/__init__.py | 32 -------------------------------- 2 files changed, 33 deletions(-) diff --git a/Makefile b/Makefile index 8be738090..1850f6cca 100755 --- a/Makefile +++ b/Makefile @@ -25,7 +25,6 @@ processing: rm -rv build; \ rm *.c; \ fi - @./installation/compile_CoreModule.py ${MAKEFLAGS} .PHONY: tidy tidy: diff --git a/lib/damask/__init__.py b/lib/damask/__init__.py index 1b6ec409d..c25fc0bd8 100644 --- a/lib/damask/__init__.py +++ b/lib/damask/__init__.py @@ -22,35 +22,3 @@ from .geometry import Geometry # noqa from .solver import Solver # noqa from .test import Test # noqa from .util import extendableOption # noqa - -try: - from . import core -# cleaning up namespace -################################################################################################### -# capitalize according to convention - core.IO = core.io - core.FEsolving = core.fesolving - core.DAMASK_interface = core.damask_interface -# remove modulePrefix_ - core.prec.init = core.prec.prec_init - core.DAMASK_interface.init = core.DAMASK_interface.DAMASK_interface_init - core.IO.init = core.IO.IO_init - core.numerics.init = core.numerics.numerics_init - core.debug.init = core.debug.debug_init - core.math.init = core.math.math_init - core.math.tensorAvg = core.math.math_tensorAvg - core.FEsolving.init = core.FEsolving.FE_init - core.mesh.init = core.mesh.mesh_init - core.mesh.nodesAroundCentres = core.mesh.mesh_nodesAroundCentres - core.mesh.deformedCoordsFFT = core.mesh.mesh_deformedCoordsFFT - core.mesh.volumeMismatch = core.mesh.mesh_volumeMismatch - core.mesh.shapeMismatch = core.mesh.mesh_shapeMismatch - -except (ImportError,AttributeError) as e: - core = None # from http://www.python.org/dev/peps/pep-0008/ - if os.path.split(sys.argv[0])[1] not in ('symLink_Processing.py', - 'compile_CoreModule.py', - ): - sys.stderr.write('\nWARNING: Core module (Fortran code) not available, \n'\ - "try to run 'make processing'\n"\ - 'Error message when importing core.so: %s\n\n'%e) From 3824b683bcf3f246f565bef9348f73b61f5f7740 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 24 Mar 2016 15:06:04 +0100 Subject: [PATCH 008/412] removed extra cython file, symlink to standard orientation instead --- Makefile | 1 + lib/damask/.gitignore | 1 + lib/damask/__init__.py | 11 +- lib/damask/corientation.pyx | 1277 ----------------------------------- 4 files changed, 7 insertions(+), 1283 deletions(-) delete mode 100644 lib/damask/corientation.pyx diff --git a/Makefile b/Makefile index 1850f6cca..6c63d01f6 100755 --- a/Makefile +++ b/Makefile @@ -21,6 +21,7 @@ marc: processing: @if hash cython 2>/dev/null; then \ cd ./lib/damask; \ + ln -s orientation.py corientation.pyx; \ CC=gcc python setup_corientation.py build_ext --inplace; \ rm -rv build; \ rm *.c; \ diff --git a/lib/damask/.gitignore b/lib/damask/.gitignore index 00feaa11f..1b8936623 100644 --- a/lib/damask/.gitignore +++ b/lib/damask/.gitignore @@ -1,2 +1,3 @@ core.so corientation.so +*.pyx diff --git a/lib/damask/__init__.py b/lib/damask/__init__.py index c25fc0bd8..dc40920fa 100644 --- a/lib/damask/__init__.py +++ b/lib/damask/__init__.py @@ -10,12 +10,11 @@ from .environment import Environment # noqa from .asciitable import ASCIItable # noqa from .config import Material # noqa from .colormaps import Colormap, Color # noqa -from .orientation import Quaternion, Rodrigues, Symmetry, Orientation # noqa -# try: -# from .corientation import Quaternion, Rodrigues, Symmetry, Orientation -# print "Import Cython version of Orientation module" -# except: -# from .orientation import Quaternion, Rodrigues, Symmetry, Orientation +try: + from .corientation import Quaternion, Rodrigues, Symmetry, Orientation + print "Import Cython version of Orientation module" +except: + from .orientation import Quaternion, Rodrigues, Symmetry, Orientation #from .block import Block # only one class from .result import Result # noqa from .geometry import Geometry # noqa diff --git a/lib/damask/corientation.pyx b/lib/damask/corientation.pyx deleted file mode 100644 index 6da6ba8a5..000000000 --- a/lib/damask/corientation.pyx +++ /dev/null @@ -1,1277 +0,0 @@ -#!/usr/bin/env python -# encoding: utf-8 -# filename: corientation.pyx - -# __ __ __________ ____ __ ____ ______ ____ -# / //_// ____/ __ \/ __ \/ //_/ / / / __ \/ __ \ -# / ,< / __/ / / / / / / / ,< / / / / / / / / / / -# / /| |/ /___/ /_/ / /_/ / /| / /_/ / /_/ / /_/ / -# /_/ |_/_____/_____/\____/_/ |_\____/_____/\____/ - - -###################################################### -# This is a Cython implementation of original DAMASK # -# orientation class, mainly for speed improvement. # -###################################################### - -""" -NOTE ----- -The static method in Cython is different from Python, need more -time to figure out details. -""" - -import math, random, os -import numpy as np -cimport numpy as np - - -## -# This Rodrigues class is odd, not sure if it will function -# properly or not -cdef class Rodrigues: - """Rodrigues representation of orientation """ - cdef public double[3] r - - def __init__(self, vector): - if isinstance(vector, Rodrigues): - self.r[0] = vector.r[0] - self.r[1] = vector.r[1] - self.r[2] = vector.r[2] - else: - self.r[0] = vector[0] - self.r[1] = vector[1] - self.r[2] = vector[2] - - def asQuaternion(self): - cdef double norm, halfAngle - cdef double[4] q - - norm = np.linalg.norm(self.vector) - halfAngle = np.arctan(norm) - q[0] = np.cos(halfAngle) - tmp = np.sin(halfAngle)*self.vector/norm - q[1],q[2],q[3] = tmp[0],tmp[1],tmp[2] - - return Quaternion(q) - - def asAngleAxis(self): - cdef double norm, halfAngle - - norm = np.linalg.norm(self.vector) - halfAngle = np.arctan(norm) - - return (2.0*halfAngle,self.vector/norm) - - -## -# The Quaternion class do the heavy lifting of orientation -# calculation -cdef class Quaternion: - """ Quaternion representation of orientation """ - # All methods and naming conventions based off - # http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions - cdef public double w,x,y,z - - def __init__(self, data): - """ - @description - ------------ - copy constructor friendly - @parameters - ----------- - data: array - """ - cdef double[4] q - - if isinstance(data, Quaternion): - q[0] = data.w - q[1] = data.x - q[2] = data.y - q[3] = data.z - else: - q[0] = data[0] - q[1] = data[1] - q[2] = data[2] - q[3] = data[3] - - self.Quaternion(q) - - cdef Quaternion(self, double* quatArray): - """ - @description - ------------ - internal constructor for Quaternion - @parameters - ----------- - quatArray: double[4] // - w is the real part, (x, y, z) are the imaginary parts - """ - if quatArray[0] < 0: - self.w = -quatArray[0] - self.x = -quatArray[1] - self.y = -quatArray[2] - self.z = -quatArray[3] - else: - self.w = quatArray[0] - self.x = quatArray[1] - self.y = quatArray[2] - self.z = quatArray[3] - - def __copy__(self): - cdef double[4] q = [self.w,self.x,self.y,self.z] - return Quaternion(q) - - copy = __copy__ - - def __iter__(self): - return iter([self.w,self.x,self.y,self.z]) - - def __repr__(self): - return 'Quaternion(real={:.4f},imag=<{:.4f},{:.4f}, {:.4f}>)'.format(self.w, - self.x, - self.y, - self.z) - - def __pow__(self, exponent, modulo): - # declare local var for speed gain - cdef double omega, vRescale - cdef double[4] q - - omega = math.acos(self.w) - vRescale = math.sin(exponent*omega)/math.sin(omega) - - q[0] = math.cos(exponent*omega) - q[1] = self.x*vRescale - q[2] = self.y*vRescale - q[3] = self.z*vRescale - return Quaternion(q) - - def __ipow__(self, exponent): - self = self.__pow__(self, exponent, 1.0) - return self - - def __mul__(self, other): - # declare local var for speed gain - cdef double Aw,Ax,Ay,Az,Bw,Bx,By,Bz - cdef double w,x,y,z,Vx,Vy,Vz - cdef double[4] q - - # quaternion * quaternion - try: - Aw = self.w - Ax = self.x - Ay = self.y - Az = self.z - Bw = other.w - Bx = other.x - By = other.y - Bz = other.z - q[0] = - Ax * Bx - Ay * By - Az * Bz + Aw * Bw - q[1] = + Ax * Bw + Ay * Bz - Az * By + Aw * Bx - q[2] = - Ax * Bz + Ay * Bw + Az * Bx + Aw * By - q[3] = + Ax * By - Ay * Bx + Az * Bw + Aw * Bz - return Quaternion(q) - except: - pass - # vector (perform active rotation, i.e. q*v*q.conjugated) - try: - w = self.w - x = self.x - y = self.y - z = self.z - Vx = other[0] - Vy = other[1] - Vz = other[2] - return np.array([\ - w * w * Vx + 2 * y * w * Vz - 2 * z * w * Vy + \ - x * x * Vx + 2 * y * x * Vy + 2 * z * x * Vz - \ - z * z * Vx - y * y * Vx, - 2 * x * y * Vx + y * y * Vy + 2 * z * y * Vz + \ - 2 * w * z * Vx - z * z * Vy + w * w * Vy - \ - 2 * x * w * Vz - x * x * Vy, - 2 * x * z * Vx + 2 * y * z * Vy + \ - z * z * Vz - 2 * w * y * Vx - y * y * Vz + \ - 2 * w * x * Vy - x * x * Vz + w * w * Vz ]) - except: - pass - # quaternion * scalar - try: - Q = self.copy() - Q.w *= other - Q.x *= other - Q.y *= other - Q.z *= other - return Q - except: - return self.copy() - - def __imul__(self, other): - if isinstance(other, Quaternion): - self = self.__mul__(other) - return self - else: - return NotImplemented - - def __div__(self, other): - cdef double[4] q - - if isinstance(other, (int,float,long)): - q[0] = self.w / other - q[1] = self.x / other - q[2] = self.y / other - q[3] = self.z / other - return Quaternion(q) - else: - NotImplemented - - def __idiv__(self, other): - self = self.__div__(other) - return self - - def __add__(self, other): - cdef double[4] q - - if isinstance(other, Quaternion): - q[0] = self.w + other.w - q[1] = self.x + other.x - q[2] = self.y + other.y - q[3] = self.z + other.z - return self.__class__(q) - else: - return NotImplemented - - def __iadd__(self, other): - self = self.__add__(other) - return self - - def __sub__(self, other): - cdef double[4] q - - if isinstance(other, Quaternion): - q[0] = self.w - other.w - q[1] = self.x - other.x - q[2] = self.y - other.y - q[3] = self.z - other.z - return self.__class__(q) - else: - return NotImplemented - - def __isub__(self, other): - self = self.__sub__(other) - return self - - def __neg__(self): - cdef double[4] q - - q[0] = -self.w - q[1] = -self.x - q[2] = -self.y - q[3] = -self.z - - return self.__class__(q) - - def __abs__(self): - cdef double tmp - - tmp = self.w**2 + self.x**2 + self.y**2 + self.z**2 - tmp = math.sqrt(tmp) - return tmp - - magnitude = __abs__ - - def __richcmp__(Quaternion self, Quaternion other, int op): - cdef bint tmp - - tmp = (abs(self.w-other.w) < 1e-8 and \ - abs(self.x-other.x) < 1e-8 and \ - abs(self.y-other.y) < 1e-8 and \ - abs(self.z-other.z) < 1e-8) \ - or \ - (abs(-self.w-other.w) < 1e-8 and \ - abs(-self.x-other.x) < 1e-8 and \ - abs(-self.y-other.y) < 1e-8 and \ - abs(-self.z-other.z) < 1e-8) - if op == 2: #__eq__ - return tmp - elif op ==3: #__ne__ - return not tmp - else: - return NotImplemented - - def __cmp__(self,other): - # not sure if this actually works or not - return cmp(self.Rodrigues(),other.Rodrigues()) - - def magnitude_squared(self): - cdef double tmp - - tmp = self.w**2 + self.x**2 + self.y**2 + self.z**2 - return tmp - - def identity(self): - self.w = 1.0 - self.x = 0.0 - self.y = 0.0 - self.z = 0.0 - return self - - def normalize(self): - cdef double d - - d = self.magnitude() - if d > 0.0: - self /= d - return self - - def conjugate(self): - self.x = -self.x - self.y = -self.y - self.z = -self.z - return self - - def inverse(self): - cdef double d - - d = self.magnitude() - if d > 0.0: - self.conjugate() - self /= d - return self - - def homomorph(self): - if self.w < 0.0: - self.w = -self.w - self.x = -self.x - self.y = -self.y - self.z = -self.z - return self - - # return a copy of me - def normalized(self): - cdef Quaternion q - - q = Quaternion(self.normalize()) - return q - - def conjugated(self): - cdef Quaternion q - - q = Quaternion(self.conjugate()) - return q - - def asList(self): - cdef double[4] q = [self.w, self.x, self.y, self.z] - - return list(q) - - def asM(self): # to find Averaging Quaternions (see F. Landis Markley et al.) - return np.outer([i for i in self],[i for i in self]) - - def asMatrix(self): - return np.array([[1.0-2.0*(self.y*self.y+self.z*self.z), 2.0*(self.x*self.y-self.z*self.w), 2.0*(self.x*self.z+self.y*self.w)], - [ 2.0*(self.x*self.y+self.z*self.w), 1.0-2.0*(self.x*self.x+self.z*self.z), 2.0*(self.y*self.z-self.x*self.w)], - [ 2.0*(self.x*self.z-self.y*self.w), 2.0*(self.x*self.w+self.y*self.z), 1.0-2.0*(self.x*self.x+self.y*self.y)]]) - - def asAngleAxis(self): - # keep the return as radians for simplicity - cdef double s,x,y - - if self.w > 1: - self.normalize() - - s = math.sqrt(1. - self.w**2) - x = 2*self.w**2 - 1. - y = 2*self.w * s - - angle = math.atan2(y,x) - if angle < 0.0: - angle *= -1.0 - s *= -1.0 - - return (angle, - np.array([1.0, 0.0, 0.0] if np.abs(angle) < 1e-3 else [self.x/s, self.y/s, self.z/s]) ) - - def asRodrigues(self): - if self.w != 0.0: - return np.array([self.x, self.y, self.z])/self.w - else: - return np.array([float('inf')]*3) - - def asEulers(self, - type='bunge', - degrees=False, - standardRange=False): - """ - CONVERSION TAKEN FROM: - Melcher, A.; Unser, A.; Reichhardt, M.; Nestler, B.; Pötschke, M.; Selzer, M. - Conversion of EBSD data by a quaternion based algorithm to be used for grain structure simulations - Technische Mechanik 30 (2010) pp 401--413 - """ - cdef double x,y - - angles = [0.0,0.0,0.0] - - if type.lower() == 'bunge' or type.lower() == 'zxz': - if abs(self.x) < 1e-4 and abs(self.y) < 1e-4: - x = self.w**2 - self.z**2 - y = 2.*self.w*self.z - angles[0] = math.atan2(y,x) - elif abs(self.w) < 1e-4 and abs(self.z) < 1e-4: - x = self.x**2 - self.y**2 - y = 2.*self.x*self.y - angles[0] = math.atan2(y,x) - angles[1] = math.pi - else: - chi = math.sqrt((self.w**2 + self.z**2)*(self.x**2 + self.y**2)) - - x = (self.w * self.x - self.y * self.z)/2./chi - y = (self.w * self.y + self.x * self.z)/2./chi - angles[0] = math.atan2(y,x) - - x = self.w**2 + self.z**2 - (self.x**2 + self.y**2) - y = 2.*chi - angles[1] = math.atan2(y,x) - - x = (self.w * self.x + self.y * self.z)/2./chi - y = (self.z * self.x - self.y * self.w)/2./chi - angles[2] = math.atan2(y,x) - if standardRange: - angles[0] %= 2*math.pi - if angles[1] < 0.0: - angles[1] += math.pi - angles[2] *= -1.0 - angles[2] %= 2*math.pi - - return np.degrees(angles) if degrees else angles - - @staticmethod - def fromIdentity(): - cdef double[4] q = [1.0, 0.0, 0.0, 0.0] - - return Quaternion(q) - - @staticmethod - def fromRandom(randomSeed=None): - cdef double r1,r2,r3 - cdef double[4] q - - if randomSeed == None: - randomSeed = int(os.urandom(4).encode('hex'), 16) - random.seed(randomSeed) - - r1 = random.random() - r2 = random.random() - r3 = random.random() - q[0] = math.cos(2.0*math.pi*r1)*math.sqrt(r3) - q[1] = math.sin(2.0*math.pi*r2)*math.sqrt(1.0-r3) - q[2] = math.cos(2.0*math.pi*r2)*math.sqrt(1.0-r3) - q[3] = math.sin(2.0*math.pi*r1)*math.sqrt(r3) - return Quaternion(q) - - @staticmethod - def fromRodrigues(rodrigues): - if not isinstance(rodrigues, np.ndarray): rodrigues = np.array(rodrigues) - halfangle = math.atan(np.linalg.norm(rodrigues)) - c = math.cos(halfangle) - w = c - x,y,z = c*rodrigues - return Quaternion([w,x,y,z]) - - @staticmethod - def fromAngleAxis(angle, axis): - if not isinstance(axis, np.ndarray): axis = np.array(axis) - axis /= np.linalg.norm(axis) - s = math.sin(angle / 2.0) - w = math.cos(angle / 2.0) - x = axis[0] * s - y = axis[1] * s - z = axis[2] * s - return Quaternion([w,x,y,z]) - - @staticmethod - def fromEulers(eulers, type = 'Bunge'): - cdef double c1,s1,c2,s2,c3,s3 - cdef double[4] q - cdef double[3] halfEulers - cdef int i - - for i in range(3): - halfEulers[i] = eulers[i] * 0.5 # reduce to half angles - - - c1 = math.cos(halfEulers[0]) - s1 = math.sin(halfEulers[0]) - c2 = math.cos(halfEulers[1]) - s2 = math.sin(halfEulers[1]) - c3 = math.cos(halfEulers[2]) - s3 = math.sin(halfEulers[2]) - - if type.lower() == 'bunge' or type.lower() == 'zxz': - q[0] = c1 * c2 * c3 - s1 * c2 * s3 - q[1] = c1 * s2 * c3 + s1 * s2 * s3 - q[2] = - c1 * s2 * s3 + s1 * s2 * c3 - q[3] = c1 * c2 * s3 + s1 * c2 * c3 - else: - q[0] = c1 * c2 * c3 - s1 * s2 * s3 - q[1] = s1 * s2 * c3 + c1 * c2 * s3 - q[2] = s1 * c2 * c3 + c1 * s2 * s3 - q[3] = c1 * s2 * c3 - s1 * c2 * s3 - return Quaternion(q) - - ## Modified Method to calculate Quaternion from Orientation Matrix, Source: http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/ - - @staticmethod - def fromMatrix(m): - # This is a slow implementation - if m.shape != (3,3) and np.prod(m.shape) == 9: - m = m.reshape(3,3) - - tr=np.trace(m) - if tr > 0.00000001: - s = math.sqrt(tr + 1.0)*2.0 - - return Quaternion( - [ s*0.25, - (m[2,1] - m[1,2])/s, - (m[0,2] - m[2,0])/s, - (m[1,0] - m[0,1])/s - ]) - - elif m[0,0] > m[1,1] and m[0,0] > m[2,2]: - t = m[0,0] - m[1,1] - m[2,2] + 1.0 - s = 2.0*math.sqrt(t) - - return Quaternion( - [ (m[2,1] - m[1,2])/s, - s*0.25, - (m[0,1] + m[1,0])/s, - (m[2,0] + m[0,2])/s, - ]) - - elif m[1,1] > m[2,2]: - t = -m[0,0] + m[1,1] - m[2,2] + 1.0 - s = 2.0*math.sqrt(t) - - return Quaternion( - [ (m[0,2] - m[2,0])/s, - (m[0,1] + m[1,0])/s, - s*0.25, - (m[1,2] + m[2,1])/s, - ]) - - else: - t = -m[0,0] - m[1,1] + m[2,2] + 1.0 - s = 2.0*math.sqrt(t) - - return Quaternion( - [ (m[1,0] - m[0,1])/s, - (m[2,0] + m[0,2])/s, - (m[1,2] + m[2,1])/s, - s*0.25, - ]) - - @staticmethod - def new_interpolate(q1, q2, t): - # see http://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/20070017872_2007014421.pdf for (another?) way to interpolate quaternions - - assert isinstance(q1, Quaternion) and isinstance(q2, Quaternion) - Q = Quaternion.fromIdentity() - - costheta = q1.w * q2.w + q1.x * q2.x + q1.y * q2.y + q1.z * q2.z - if costheta < 0.: - costheta = -costheta - q1 = q1.conjugated() - elif costheta > 1: - costheta = 1 - - theta = math.acos(costheta) - if abs(theta) < 0.01: - Q.w = q2.w - Q.x = q2.x - Q.y = q2.y - Q.z = q2.z - return Q - - sintheta = math.sqrt(1.0 - costheta * costheta) - if abs(sintheta) < 0.01: - Q.w = (q1.w + q2.w) * 0.5 - Q.x = (q1.x + q2.x) * 0.5 - Q.y = (q1.y + q2.y) * 0.5 - Q.z = (q1.z + q2.z) * 0.5 - return Q - - ratio1 = math.sin((1 - t) * theta) / sintheta - ratio2 = math.sin(t * theta) / sintheta - - Q.w = q1.w * ratio1 + q2.w * ratio2 - Q.x = q1.x * ratio1 + q2.x * ratio2 - Q.y = q1.y * ratio1 + q2.y * ratio2 - Q.z = q1.z * ratio1 + q2.z * ratio2 - return Q - -## -# Define lattice_type to make it easier for future -# development -cdef enum lattice_type: - NONE = 0 - ORTHORHOMBIC= 1 - TETRAGONAL = 2 - HEXAGONAL = 3 - CUBIC = 4 -## -# Symmetry class -cdef class Symmetry: - cdef public lattice_type lattice - # cdef enum LATTICES: - # NONE = 0 - # ORTHORHOMBIC= 1 - # TETRAGONAL = 2 - # HEXAGONAL = 3 - # CUBIC = 4 - - def __init__(self, symmetry): - if symmetry == 0 or symmetry == None: - self.lattice = NONE - elif symmetry == 1 or symmetry == 'orthorhombic': - self.lattice = ORTHORHOMBIC - elif symmetry == 2 or symmetry == 'tetragonal': - self.lattice = TETRAGONAL - elif symmetry == 3 or symmetry == 'hexagonal': - self.lattice = HEXAGONAL - elif symmetry == 4 or symmetry == 'cubic': - self.lattice = CUBIC - else: - self.lattice = NONE - - def __copy__(self): - return self.__class__(self.lattice) - - copy = __copy__ - - def __repr__(self): - return '{}'.format(self.lattice) - - def __richcmp__(Symmetry self, Symmetry other, int op): - cdef bint tmp - - tmp = self.lattice == other.lattice - if op == 2: #__eq__ - return tmp - elif op ==3: #__ne__ - return not tmp - else: - return NotImplemented - - def __cmp__(self,other): - return cmp(self.lattice,other.lattice) - - def symmetryQuats(self): - ''' - List of symmetry operations as quaternions. - ''' - if self.lattice == 'cubic': - symQuats = [ - [ 1.0, 0.0, 0.0, 0.0 ], - [ 0.0, 1.0, 0.0, 0.0 ], - [ 0.0, 0.0, 1.0, 0.0 ], - [ 0.0, 0.0, 0.0, 1.0 ], - [ 0.0, 0.0, 0.5*math.sqrt(2), 0.5*math.sqrt(2) ], - [ 0.0, 0.0, 0.5*math.sqrt(2),-0.5*math.sqrt(2) ], - [ 0.0, 0.5*math.sqrt(2), 0.0, 0.5*math.sqrt(2) ], - [ 0.0, 0.5*math.sqrt(2), 0.0, -0.5*math.sqrt(2) ], - [ 0.0, 0.5*math.sqrt(2),-0.5*math.sqrt(2), 0.0 ], - [ 0.0, -0.5*math.sqrt(2),-0.5*math.sqrt(2), 0.0 ], - [ 0.5, 0.5, 0.5, 0.5 ], - [-0.5, 0.5, 0.5, 0.5 ], - [-0.5, 0.5, 0.5, -0.5 ], - [-0.5, 0.5, -0.5, 0.5 ], - [-0.5, -0.5, 0.5, 0.5 ], - [-0.5, -0.5, 0.5, -0.5 ], - [-0.5, -0.5, -0.5, 0.5 ], - [-0.5, 0.5, -0.5, -0.5 ], - [-0.5*math.sqrt(2), 0.0, 0.0, 0.5*math.sqrt(2) ], - [ 0.5*math.sqrt(2), 0.0, 0.0, 0.5*math.sqrt(2) ], - [-0.5*math.sqrt(2), 0.0, 0.5*math.sqrt(2), 0.0 ], - [-0.5*math.sqrt(2), 0.0, -0.5*math.sqrt(2), 0.0 ], - [-0.5*math.sqrt(2), 0.5*math.sqrt(2), 0.0, 0.0 ], - [-0.5*math.sqrt(2),-0.5*math.sqrt(2), 0.0, 0.0 ], - ] - elif self.lattice == 'hexagonal': - symQuats = [ - [ 1.0,0.0,0.0,0.0 ], - [-0.5*math.sqrt(3), 0.0, 0.0,-0.5 ], - [ 0.5, 0.0, 0.0, 0.5*math.sqrt(3) ], - [ 0.0,0.0,0.0,1.0 ], - [-0.5, 0.0, 0.0, 0.5*math.sqrt(3) ], - [-0.5*math.sqrt(3), 0.0, 0.0, 0.5 ], - [ 0.0,1.0,0.0,0.0 ], - [ 0.0,-0.5*math.sqrt(3), 0.5, 0.0 ], - [ 0.0, 0.5,-0.5*math.sqrt(3), 0.0 ], - [ 0.0,0.0,1.0,0.0 ], - [ 0.0,-0.5,-0.5*math.sqrt(3), 0.0 ], - [ 0.0, 0.5*math.sqrt(3), 0.5, 0.0 ], - ] - elif self.lattice == 'tetragonal': - symQuats = [ - [ 1.0,0.0,0.0,0.0 ], - [ 0.0,1.0,0.0,0.0 ], - [ 0.0,0.0,1.0,0.0 ], - [ 0.0,0.0,0.0,1.0 ], - [ 0.0, 0.5*math.sqrt(2), 0.5*math.sqrt(2), 0.0 ], - [ 0.0,-0.5*math.sqrt(2), 0.5*math.sqrt(2), 0.0 ], - [ 0.5*math.sqrt(2), 0.0, 0.0, 0.5*math.sqrt(2) ], - [-0.5*math.sqrt(2), 0.0, 0.0, 0.5*math.sqrt(2) ], - ] - elif self.lattice == 'orthorhombic': - symQuats = [ - [ 1.0,0.0,0.0,0.0 ], - [ 0.0,1.0,0.0,0.0 ], - [ 0.0,0.0,1.0,0.0 ], - [ 0.0,0.0,0.0,1.0 ], - ] - else: - symQuats = [ - [ 1.0,0.0,0.0,0.0 ], - ] - - return map(Quaternion,symQuats) - - def equivalentQuaternions(self,quaternion): - ''' - List of symmetrically equivalent quaternions based on own symmetry. - ''' - return [quaternion*Quaternion(q) for q in self.symmetryQuats()] - - def inFZ(self,R): - ''' - Check whether given Rodrigues vector falls into fundamental zone of own symmetry. - ''' - if isinstance(R, Quaternion): R = R.asRodrigues() # translate accidentially passed quaternion - R = abs(R) # fundamental zone in Rodrigues space is point symmetric around origin - if self.lattice == CUBIC: - return math.sqrt(2.0)-1.0 >= R[0] \ - and math.sqrt(2.0)-1.0 >= R[1] \ - and math.sqrt(2.0)-1.0 >= R[2] \ - and 1.0 >= R[0] + R[1] + R[2] - elif self.lattice == HEXAGONAL: - return 1.0 >= R[0] and 1.0 >= R[1] and 1.0 >= R[2] \ - and 2.0 >= math.sqrt(3)*R[0] + R[1] \ - and 2.0 >= math.sqrt(3)*R[1] + R[0] \ - and 2.0 >= math.sqrt(3) + R[2] - elif self.lattice == TETRAGONAL: - return 1.0 >= R[0] and 1.0 >= R[1] \ - and math.sqrt(2.0) >= R[0] + R[1] \ - and math.sqrt(2.0) >= R[2] + 1.0 - elif self.lattice == ORTHORHOMBIC: - return 1.0 >= R[0] and 1.0 >= R[1] and 1.0 >= R[2] - else: - return True - - def inDisorientationSST(self,R): - ''' - Check whether given Rodrigues vector (of misorientation) falls into standard stereographic triangle of own symmetry. - Determination of disorientations follow the work of A. Heinz and P. Neumann: - Representation of Orientation and Disorientation Data for Cubic, Hexagonal, Tetragonal and Orthorhombic Crystals - Acta Cryst. (1991). A47, 780-789 - ''' - if isinstance(R, Quaternion): R = R.asRodrigues() # translate accidentally passed quaternion - - cdef double epsilon = 0.0 - - if self.lattice == CUBIC: - return R[0] >= R[1]+epsilon and R[1] >= R[2]+epsilon and R[2] >= epsilon - - elif self.lattice == HEXAGONAL: - return R[0] >= math.sqrt(3)*(R[1]+epsilon) and R[1] >= epsilon and R[2] >= epsilon - - elif self.lattice == TETRAGONAL: - return R[0] >= R[1]+epsilon and R[1] >= epsilon and R[2] >= epsilon - - elif self.lattice == ORTHORHOMBIC: - return R[0] >= epsilon and R[1] >= epsilon and R[2] >= epsilon - - else: - return True - - def inSST(self, - vector, - color = False): - ''' - Check whether given vector falls into standard stereographic triangle of own symmetry. - Return inverse pole figure color if requested. - ''' -# basis = {4 : np.linalg.inv(np.array([[0.,0.,1.], # direction of red -# [1.,0.,1.]/np.sqrt(2.), # direction of green -# [1.,1.,1.]/np.sqrt(3.)]).transpose()), # direction of blue -# 3 : np.linalg.inv(np.array([[0.,0.,1.], # direction of red -# [1.,0.,0.], # direction of green -# [np.sqrt(3.),1.,0.]/np.sqrt(4.)]).transpose()), # direction of blue -# 2 : np.linalg.inv(np.array([[0.,0.,1.], # direction of red -# [1.,0.,0.], # direction of green -# [1.,1.,0.]/np.sqrt(2.)]).transpose()), # direction of blue -# 1 : np.linalg.inv(np.array([[0.,0.,1.], # direction of red -# [1.,0.,0.], # direction of green -# [0.,1.,0.]]).transpose()), # direction of blue -# } - if self.lattice == CUBIC: - basis = np.array([ [-1. , 0. , 1. ], - [ np.sqrt(2.), -np.sqrt(2.), 0. ], - [ 0. , np.sqrt(3.), 0. ] ]) - elif self.lattice == HEXAGONAL: - basis = np.array([ [ 0. , 0. , 1. ], - [ 1. , -np.sqrt(3.), 0. ], - [ 0. , 2. , 0. ] ]) - elif self.lattice == TETRAGONAL: - basis = np.array([ [ 0. , 0. , 1. ], - [ 1. , -1. , 0. ], - [ 0. , np.sqrt(2.), 0. ] ]) - elif self.lattice == ORTHORHOMBIC: - basis = np.array([ [ 0., 0., 1.], - [ 1., 0., 0.], - [ 0., 1., 0.] ]) - else: - basis = np.zeros((3,3),dtype=float) - - if np.all(basis == 0.0): - theComponents = -np.ones(3,'d') - else: - v = np.array(vector,dtype = float) - v[2] = abs(v[2]) # z component projects identical for positive and negative values - theComponents = np.dot(basis,v) - - inSST = np.all(theComponents >= 0.0) - - if color: # have to return color array - if inSST: - rgb = np.power(theComponents/np.linalg.norm(theComponents),0.5) # smoothen color ramps - rgb = np.minimum(np.ones(3,'d'),rgb) # limit to maximum intensity - rgb /= max(rgb) # normalize to (HS)V = 1 - else: - rgb = np.zeros(3,'d') - return (inSST,rgb) - else: - return inSST - -# code derived from http://pyeuclid.googlecode.com/svn/trunk/euclid.py -# suggested reading: http://web.mit.edu/2.998/www/QuaternionReport1.pdf - - -## -# Orientation class is a composite class of Symmetry and Quaternion -cdef class Orientation: - cdef public Quaternion quaternion - cdef public Symmetry symmetry - - def __init__(self, - quaternion = Quaternion.fromIdentity(), - Rodrigues = None, - angleAxis = None, - matrix = None, - Eulers = None, - random = False, # put any integer to have a fixed seed or True for real random - symmetry = None - ): - if random: # produce random orientation - if isinstance(random, bool ): - self.quaternion = Quaternion.fromRandom() - else: - self.quaternion = Quaternion.fromRandom(randomSeed=random) - elif isinstance(Eulers, np.ndarray) and Eulers.shape == (3,): # based on given Euler angles - self.quaternion = Quaternion.fromEulers(Eulers, type='bunge') - elif isinstance(matrix, np.ndarray) : # based on given rotation matrix - self.quaternion = Quaternion.fromMatrix(matrix) - elif isinstance(angleAxis, np.ndarray) and angleAxis.shape == (4,): # based on given angle and rotation axis - self.quaternion = Quaternion.fromAngleAxis(angleAxis[0],angleAxis[1:4]) - elif isinstance(Rodrigues, np.ndarray) and Rodrigues.shape == (3,): # based on given Rodrigues vector - self.quaternion = Quaternion.fromRodrigues(Rodrigues) - elif isinstance(quaternion, Quaternion): # based on given quaternion - self.quaternion = quaternion.homomorph() - elif isinstance(quaternion, np.ndarray) and quaternion.shape == (4,): # based on given quaternion - self.quaternion = Quaternion(quaternion).homomorph() - - self.symmetry = Symmetry(symmetry) - - def __copy__(self): - return self.__class__(quaternion=self.quaternion,symmetry=self.symmetry.lattice) - - copy = __copy__ - - def __repr__(self): - return 'Symmetry: %s\n' % (self.symmetry) + \ - 'Quaternion: %s\n' % (self.quaternion) + \ - 'Matrix:\n%s\n' % ( '\n'.join(['\t'.join(map(str,self.asMatrix()[i,:])) for i in range(3)]) ) + \ - 'Bunge Eulers / deg: %s' % ('\t'.join(map(lambda x:str(np.degrees(x)),self.asEulers('bunge'))) ) - - def asQuaternion(self): - return self.quaternion.asList() - - def asEulers(self,type='bunge'): - return self.quaternion.asEulers(type) - - def asRodrigues(self): - return self.quaternion.asRodrigues() - - def asAngleAxis(self): - return self.quaternion.asAngleAxis() - - def asMatrix(self): - return self.quaternion.asMatrix() - - def inFZ(self): - return self.symmetry.inFZ(self.quaternion.asRodrigues()) - - def equivalentQuaternions(self): - return self.symmetry.equivalentQuaternions(self.quaternion) - - def equivalentOrientations(self): - return map(lambda q: Orientation(quaternion=q,symmetry=self.symmetry.lattice), - self.equivalentQuaternions()) - - - def reduced(self): - '''Transform orientation to fall into fundamental zone according to symmetry''' - for me in self.symmetry.equivalentQuaternions(self.quaternion): - if self.symmetry.inFZ(me.asRodrigues()): break - - return Orientation(quaternion=me,symmetry=self.symmetry.lattice) - - def disorientation_old(self,other): - ''' - Disorientation between myself and given other orientation - (either reduced according to my own symmetry or given one) - ''' - - lowerSymmetry = min(self.symmetry,other.symmetry) - breaker = False - - for me in self.symmetry.equivalentQuaternions(self.quaternion): - me.conjugate() - for they in other.symmetry.equivalentQuaternions(other.quaternion): - theQ = they * me - breaker = lowerSymmetry.inDisorientationSST(theQ.asRodrigues()) #\ -# or lowerSymmetry.inDisorientationSST(theQ.conjugated().asRodrigues()) - if breaker: break - if breaker: break - - return Orientation(quaternion=theQ,symmetry=self.symmetry.lattice) #, me.conjugated(), they - - def disorientation(self,other): - ''' - Disorientation between myself and given other orientation - (currently needs to be of same symmetry. - look into A. Heinz and P. Neumann 1991 for cases with differing sym.) - ''' - if self.symmetry != other.symmetry: - raise TypeError('disorientation between different symmetry classes not supported yet.') - - misQ = self.quaternion.conjugated()*other.quaternion - - for i,sA in enumerate(self.symmetry.symmetryQuats()): - for j,sB in enumerate(other.symmetry.symmetryQuats()): - theQ = sA.conjugated()*misQ*sB - for k in xrange(2): - theQ.conjugate() - hitSST = other.symmetry.inDisorientationSST(theQ) - hitFZ = self.symmetry.inFZ(theQ) - breaker = hitSST and hitFZ - if breaker: break - if breaker: break - if breaker: break - return Orientation(quaternion=theQ,symmetry=self.symmetry.lattice) # disorientation, own sym, other sym, self-->other: True, self<--other: False - - def inversePole(self,axis,SST = True): - ''' - axis rotated according to orientation (using crystal symmetry to ensure location falls into SST) - ''' - - if SST: # pole requested to be within SST - for i,q in enumerate(self.symmetry.equivalentQuaternions(self.quaternion)): # test all symmetric equivalent quaternions - pole = q.conjugated()*axis # align crystal direction to axis - if self.symmetry.inSST(pole): break # found SST version - else: - pole = self.quaternion.conjugated()*axis # align crystal direction to axis - - return pole - - def IPFcolor(self,axis): - ''' TSL color of inverse pole figure for given axis ''' - color = np.zeros(3,'d') - for q in self.symmetry.equivalentQuaternions(self.quaternion): - pole = q.conjugated()*axis # align crystal direction to axis - inSST,color = self.symmetry.inSST(pole,color=True) - if inSST: break - - return color - - @staticmethod - def getAverageOrientation(orientationList): - """ - RETURN THE AVERAGE ORIENTATION - ref: F. Landis Markley, Yang Cheng, John Lucas Crassidis, and Yaakov Oshman. - Averaging Quaternions, - Journal of Guidance, Control, and Dynamics, Vol. 30, No. 4 (2007), pp. 1193-1197. - doi: 10.2514/1.28949 - sample usage: - a = Orientation(Eulers=np.radians([10, 10, 0]), symmetry=3) - b = Orientation(Eulers=np.radians([20, 0, 0]), symmetry=3) - avg = Orientation.getAverageOrientation([a,b]) - NOTE - ---- - No symmetry information is available for the average orientation. - """ - - if not all(isinstance(item, Orientation) for item in orientationList): - raise TypeError("Only instances of Orientation can be averaged.") - - N = len(orientationList) - M = orientationList.pop(0).quaternion.asM() - for o in orientationList: - M += o.quaternion.asM() - eig, vec = np.linalg.eig(M/N) - - return Orientation(quaternion = Quaternion(vec.T[eig.argmax()])) - - def related(self, relationModel, direction, targetSymmetry = None): - - if relationModel not in ['KS','GT','GTdash','NW','Pitsch','Bain']: return None - if int(direction) == 0: return None - - # KS from S. Morito et al./Journal of Alloys and Compounds 5775 (2013) S587-S592 - # GT from Y. He et al./Journal of Applied Crystallography (2006). 39, 72-81 - # GT' from Y. He et al./Journal of Applied Crystallography (2006). 39, 72-81 - # NW from H. Kitahara et al./Materials Characterization 54 (2005) 378-386 - # Pitsch from Y. He et al./Acta Materialia 53 (2005) 1179-1190 - # Bain from Y. He et al./Journal of Applied Crystallography (2006). 39, 72-81 - - variant = int(abs(direction))-1 - (me,other) = (0,1) if direction > 0 else (1,0) - - planes = {'KS': \ - np.array([[[ 1, 1, 1],[ 0, 1, 1]],\ - [[ 1, 1, 1],[ 0, 1, 1]],\ - [[ 1, 1, 1],[ 0, 1, 1]],\ - [[ 1, 1, 1],[ 0, 1, 1]],\ - [[ 1, 1, 1],[ 0, 1, 1]],\ - [[ 1, 1, 1],[ 0, 1, 1]],\ - [[ 1, -1, 1],[ 0, 1, 1]],\ - [[ 1, -1, 1],[ 0, 1, 1]],\ - [[ 1, -1, 1],[ 0, 1, 1]],\ - [[ 1, -1, 1],[ 0, 1, 1]],\ - [[ 1, -1, 1],[ 0, 1, 1]],\ - [[ 1, -1, 1],[ 0, 1, 1]],\ - [[ -1, 1, 1],[ 0, 1, 1]],\ - [[ -1, 1, 1],[ 0, 1, 1]],\ - [[ -1, 1, 1],[ 0, 1, 1]],\ - [[ -1, 1, 1],[ 0, 1, 1]],\ - [[ -1, 1, 1],[ 0, 1, 1]],\ - [[ -1, 1, 1],[ 0, 1, 1]],\ - [[ 1, 1, -1],[ 0, 1, 1]],\ - [[ 1, 1, -1],[ 0, 1, 1]],\ - [[ 1, 1, -1],[ 0, 1, 1]],\ - [[ 1, 1, -1],[ 0, 1, 1]],\ - [[ 1, 1, -1],[ 0, 1, 1]],\ - [[ 1, 1, -1],[ 0, 1, 1]]]), - 'GT': \ - np.array([[[ 1, 1, 1],[ 1, 0, 1]],\ - [[ 1, 1, 1],[ 1, 1, 0]],\ - [[ 1, 1, 1],[ 0, 1, 1]],\ - [[ -1, -1, 1],[ -1, 0, 1]],\ - [[ -1, -1, 1],[ -1, -1, 0]],\ - [[ -1, -1, 1],[ 0, -1, 1]],\ - [[ -1, 1, 1],[ -1, 0, 1]],\ - [[ -1, 1, 1],[ -1, 1, 0]],\ - [[ -1, 1, 1],[ 0, 1, 1]],\ - [[ 1, -1, 1],[ 1, 0, 1]],\ - [[ 1, -1, 1],[ 1, -1, 0]],\ - [[ 1, -1, 1],[ 0, -1, 1]],\ - [[ 1, 1, 1],[ 1, 1, 0]],\ - [[ 1, 1, 1],[ 0, 1, 1]],\ - [[ 1, 1, 1],[ 1, 0, 1]],\ - [[ -1, -1, 1],[ -1, -1, 0]],\ - [[ -1, -1, 1],[ 0, -1, 1]],\ - [[ -1, -1, 1],[ -1, 0, 1]],\ - [[ -1, 1, 1],[ -1, 1, 0]],\ - [[ -1, 1, 1],[ 0, 1, 1]],\ - [[ -1, 1, 1],[ -1, 0, 1]],\ - [[ 1, -1, 1],[ 1, -1, 0]],\ - [[ 1, -1, 1],[ 0, -1, 1]],\ - [[ 1, -1, 1],[ 1, 0, 1]]]), - 'GTdash': \ - np.array([[[ 7, 17, 17],[ 12, 5, 17]],\ - [[ 17, 7, 17],[ 17, 12, 5]],\ - [[ 17, 17, 7],[ 5, 17, 12]],\ - [[ -7,-17, 17],[-12, -5, 17]],\ - [[-17, -7, 17],[-17,-12, 5]],\ - [[-17,-17, 7],[ -5,-17, 12]],\ - [[ 7,-17,-17],[ 12, -5,-17]],\ - [[ 17, -7,-17],[ 17,-12, -5]],\ - [[ 17,-17, -7],[ 5,-17,-12]],\ - [[ -7, 17,-17],[-12, 5,-17]],\ - [[-17, 7,-17],[-17, 12, -5]],\ - [[-17, 17, -7],[ -5, 17,-12]],\ - [[ 7, 17, 17],[ 12, 17, 5]],\ - [[ 17, 7, 17],[ 5, 12, 17]],\ - [[ 17, 17, 7],[ 17, 5, 12]],\ - [[ -7,-17, 17],[-12,-17, 5]],\ - [[-17, -7, 17],[ -5,-12, 17]],\ - [[-17,-17, 7],[-17, -5, 12]],\ - [[ 7,-17,-17],[ 12,-17, -5]],\ - [[ 17, -7,-17],[ 5, -12,-17]],\ - [[ 17,-17, 7],[ 17, -5,-12]],\ - [[ -7, 17,-17],[-12, 17, -5]],\ - [[-17, 7,-17],[ -5, 12,-17]],\ - [[-17, 17, -7],[-17, 5,-12]]]), - 'NW': \ - np.array([[[ 1, 1, 1],[ 0, 1, 1]],\ - [[ 1, 1, 1],[ 0, 1, 1]],\ - [[ 1, 1, 1],[ 0, 1, 1]],\ - [[ -1, 1, 1],[ 0, 1, 1]],\ - [[ -1, 1, 1],[ 0, 1, 1]],\ - [[ -1, 1, 1],[ 0, 1, 1]],\ - [[ 1, -1, 1],[ 0, 1, 1]],\ - [[ 1, -1, 1],[ 0, 1, 1]],\ - [[ 1, -1, 1],[ 0, 1, 1]],\ - [[ -1, -1, 1],[ 0, 1, 1]],\ - [[ -1, -1, 1],[ 0, 1, 1]],\ - [[ -1, -1, 1],[ 0, 1, 1]]]), - 'Pitsch': \ - np.array([[[ 0, 1, 0],[ -1, 0, 1]],\ - [[ 0, 0, 1],[ 1, -1, 0]],\ - [[ 1, 0, 0],[ 0, 1, -1]],\ - [[ 1, 0, 0],[ 0, -1, -1]],\ - [[ 0, 1, 0],[ -1, 0, -1]],\ - [[ 0, 0, 1],[ -1, -1, 0]],\ - [[ 0, 1, 0],[ -1, 0, -1]],\ - [[ 0, 0, 1],[ -1, -1, 0]],\ - [[ 1, 0, 0],[ 0, -1, -1]],\ - [[ 1, 0, 0],[ 0, -1, 1]],\ - [[ 0, 1, 0],[ 1, 0, -1]],\ - [[ 0, 0, 1],[ -1, 1, 0]]]), - 'Bain': \ - np.array([[[ 1, 0, 0],[ 1, 0, 0]],\ - [[ 0, 1, 0],[ 0, 1, 0]],\ - [[ 0, 0, 1],[ 0, 0, 1]]]), - } - - normals = {'KS': \ - np.array([[[ -1, 0, 1],[ -1, -1, 1]],\ - [[ -1, 0, 1],[ -1, 1, -1]],\ - [[ 0, 1, -1],[ -1, -1, 1]],\ - [[ 0, 1, -1],[ -1, 1, -1]],\ - [[ 1, -1, 0],[ -1, -1, 1]],\ - [[ 1, -1, 0],[ -1, 1, -1]],\ - [[ 1, 0, -1],[ -1, -1, 1]],\ - [[ 1, 0, -1],[ -1, 1, -1]],\ - [[ -1, -1, 0],[ -1, -1, 1]],\ - [[ -1, -1, 0],[ -1, 1, -1]],\ - [[ 0, 1, 1],[ -1, -1, 1]],\ - [[ 0, 1, 1],[ -1, 1, -1]],\ - [[ 0, -1, 1],[ -1, -1, 1]],\ - [[ 0, -1, 1],[ -1, 1, -1]],\ - [[ -1, 0, -1],[ -1, -1, 1]],\ - [[ -1, 0, -1],[ -1, 1, -1]],\ - [[ 1, 1, 0],[ -1, -1, 1]],\ - [[ 1, 1, 0],[ -1, 1, -1]],\ - [[ -1, 1, 0],[ -1, -1, 1]],\ - [[ -1, 1, 0],[ -1, 1, -1]],\ - [[ 0, -1, -1],[ -1, -1, 1]],\ - [[ 0, -1, -1],[ -1, 1, -1]],\ - [[ 1, 0, 1],[ -1, -1, 1]],\ - [[ 1, 0, 1],[ -1, 1, -1]]]), - 'GT': \ - np.array([[[ -5,-12, 17],[-17, -7, 17]],\ - [[ 17, -5,-12],[ 17,-17, -7]],\ - [[-12, 17, -5],[ -7, 17,-17]],\ - [[ 5, 12, 17],[ 17, 7, 17]],\ - [[-17, 5,-12],[-17, 17, -7]],\ - [[ 12,-17, -5],[ 7,-17,-17]],\ - [[ -5, 12,-17],[-17, 7,-17]],\ - [[ 17, 5, 12],[ 17, 17, 7]],\ - [[-12,-17, 5],[ -7,-17, 17]],\ - [[ 5,-12,-17],[ 17, -7,-17]],\ - [[-17, -5, 12],[-17,-17, 7]],\ - [[ 12, 17, 5],[ 7, 17, 17]],\ - [[ -5, 17,-12],[-17, 17, -7]],\ - [[-12, -5, 17],[ -7,-17, 17]],\ - [[ 17,-12, -5],[ 17, -7,-17]],\ - [[ 5,-17,-12],[ 17,-17, -7]],\ - [[ 12, 5, 17],[ 7, 17, 17]],\ - [[-17, 12, -5],[-17, 7,-17]],\ - [[ -5,-17, 12],[-17,-17, 7]],\ - [[-12, 5,-17],[ -7, 17,-17]],\ - [[ 17, 12, 5],[ 17, 7, 17]],\ - [[ 5, 17, 12],[ 17, 17, 7]],\ - [[ 12, -5,-17],[ 7,-17,-17]],\ - [[-17,-12, 5],[-17, 7, 17]]]), - 'GTdash': \ - np.array([[[ 0, 1, -1],[ 1, 1, -1]],\ - [[ -1, 0, 1],[ -1, 1, 1]],\ - [[ 1, -1, 0],[ 1, -1, 1]],\ - [[ 0, -1, -1],[ -1, -1, -1]],\ - [[ 1, 0, 1],[ 1, -1, 1]],\ - [[ 1, -1, 0],[ 1, -1, -1]],\ - [[ 0, 1, -1],[ -1, 1, -1]],\ - [[ 1, 0, 1],[ 1, 1, 1]],\ - [[ -1, -1, 0],[ -1, -1, 1]],\ - [[ 0, -1, -1],[ 1, -1, -1]],\ - [[ -1, 0, 1],[ -1, -1, 1]],\ - [[ -1, -1, 0],[ -1, -1, -1]],\ - [[ 0, -1, 1],[ 1, -1, 1]],\ - [[ 1, 0, -1],[ 1, 1, -1]],\ - [[ -1, 1, 0],[ -1, 1, 1]],\ - [[ 0, 1, 1],[ -1, 1, 1]],\ - [[ -1, 0, -1],[ -1, -1, -1]],\ - [[ -1, 1, 0],[ -1, 1, -1]],\ - [[ 0, -1, 1],[ -1, -1, 1]],\ - [[ -1, 0, -1],[ -1, 1, -1]],\ - [[ 1, 1, 0],[ 1, 1, 1]],\ - [[ 0, 1, 1],[ 1, 1, 1]],\ - [[ 1, 0, -1],[ 1, -1, -1]],\ - [[ 1, 1, 0],[ 1, 1, -1]]]), - 'NW': \ - np.array([[[ 2, -1, -1],[ 0, -1, 1]],\ - [[ -1, 2, -1],[ 0, -1, 1]],\ - [[ -1, -1, 2],[ 0, -1, 1]],\ - [[ -2, -1, -1],[ 0, -1, 1]],\ - [[ 1, 2, -1],[ 0, -1, 1]],\ - [[ 1, -1, 2],[ 0, -1, 1]],\ - [[ 2, 1, -1],[ 0, -1, 1]],\ - [[ -1, -2, -1],[ 0, -1, 1]],\ - [[ -1, 1, 2],[ 0, -1, 1]],\ - [[ -1, 2, 1],[ 0, -1, 1]],\ - [[ -1, 2, 1],[ 0, -1, 1]],\ - [[ -1, -1, -2],[ 0, -1, 1]]]), - 'Pitsch': \ - np.array([[[ 1, 0, 1],[ 1, -1, 1]],\ - [[ 1, 1, 0],[ 1, 1, -1]],\ - [[ 0, 1, 1],[ -1, 1, 1]],\ - [[ 0, 1, -1],[ -1, 1, -1]],\ - [[ -1, 0, 1],[ -1, -1, 1]],\ - [[ 1, -1, 0],[ 1, -1, -1]],\ - [[ 1, 0, -1],[ 1, -1, -1]],\ - [[ -1, 1, 0],[ -1, 1, -1]],\ - [[ 0, -1, 1],[ -1, -1, 1]],\ - [[ 0, 1, 1],[ -1, 1, 1]],\ - [[ 1, 0, 1],[ 1, -1, 1]],\ - [[ 1, 1, 0],[ 1, 1, -1]]]), - 'Bain': \ - np.array([[[ 0, 1, 0],[ 0, 1, 1]], - [[ 0, 0, 1],[ 1, 0, 1]], - [[ 1, 0, 0],[ 1, 1, 0]]]), - } - myPlane = [float(i) for i in planes[relationModel][variant,me]] # map(float, planes[...]) does not work in python 3 - myPlane /= np.linalg.norm(myPlane) - myNormal = [float(i) for i in normals[relationModel][variant,me]] # map(float, planes[...]) does not work in python 3 - myNormal /= np.linalg.norm(myNormal) - myMatrix = np.array([myPlane,myNormal,np.cross(myPlane,myNormal)]) - - otherPlane = [float(i) for i in planes[relationModel][variant,other]] # map(float, planes[...]) does not work in python 3 - otherPlane /= np.linalg.norm(otherPlane) - otherNormal = [float(i) for i in normals[relationModel][variant,other]] # map(float, planes[...]) does not work in python 3 - otherNormal /= np.linalg.norm(otherNormal) - otherMatrix = np.array([otherPlane,otherNormal,np.cross(otherPlane,otherNormal)]) - - rot=np.dot(otherMatrix.T,myMatrix) - - return Orientation(matrix=np.dot(rot,self.asMatrix())) # no symmetry information ?? \ No newline at end of file From ea28bc8f062e3629c300084c766019cfa1410ba6 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 24 Mar 2016 16:19:49 +0100 Subject: [PATCH 009/412] restored script for calculation of nodal positions --- processing/post/nodesAroundCentres.py | 152 ++++++++++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 processing/post/nodesAroundCentres.py diff --git a/processing/post/nodesAroundCentres.py b/processing/post/nodesAroundCentres.py new file mode 100644 index 000000000..3a2624b16 --- /dev/null +++ b/processing/post/nodesAroundCentres.py @@ -0,0 +1,152 @@ +#!/usr/bin/env python +# -*- coding: UTF-8 no BOM -*- + +import os,sys,math,string +import numpy as np +from optparse import OptionParser +import damask + +scriptID = string.replace('$Id: addDeformedConfiguration.py 4500 2015-09-24 09:24:42Z MPIE\m.diehl $','\n','\\n') +scriptName = os.path.splitext(scriptID.split()[1])[0] + +#-------------------------------------------------------------------------------------------------- +def nodesAroundCentres(gDim,Favg,centres): +#-------------------------------------------------------------------------------------------------- + neighbor = np.array([0, 0, 0, + 1, 0, 0, + 1, 1, 0, + 0, 1, 0, + 0, 0, 1, + 1, 0, 1, + 1, 1, 1, + 0, 1, 1]).reshape(8,3) + +#-------------------------------------------------------------------------------------------------- +# building wrappedCentres = centroids + ghosts + diag = np.ones([3]) + wrappedCentres = np.zeros([3,grid[0]+2,grid[1]+2,grid[2]+2]) + wrappedCentres[0:3,1:grid[0]+1,1:grid[1]+1,1:grid[2]+1] = centres + for k in xrange(grid[2]+2): + for j in xrange(grid[1]+2): + for i in xrange(grid[0]+2): + if (k in [0,grid[2]+1] or j in [0,grid[1]+1] or i in[0,grid[0]+1]): + me = np.array([i,j,k],'i') # me on skin + shift = abs(grid+np.ones([3],'i')-2*me)/(grid+np.ones([3],'i'))*\ + np.sign(grid+np.ones([3],'i')-2*me) + lookup = np.array(me-diag+shift*grid,'i') + wrappedCentres[0:3,i, j, k] = \ + centres[0:3,lookup[0],lookup[1],lookup[2]] - np.dot(Favg, shift*gDim) + +#-------------------------------------------------------------------------------------------------- +# averaging + nodes = np.zeros([3,grid[0]+1,grid[1]+1,grid[2]+1]) + for k in xrange(grid[2]+1): + for j in xrange(grid[1]+1): + for i in xrange(grid[0]+1): + for n in xrange(8): + nodes[0:3,i,j,k] = \ + nodes[0:3,i,j,k] + wrappedCentres[0:3,i+neighbor[n,0],j+neighbor[n,1],k+neighbor[n,2] ] + + return nodes/8.0 + +# -------------------------------------------------------------------- +# MAIN +# -------------------------------------------------------------------- + +parser = OptionParser(option_class=damask.extendableOption, usage='%prog options file[s]', description = """ +Add deformed configuration of given initial coordinates. +Operates on periodic three-dimensional x,y,z-ordered data sets. + +""", version = scriptID) + +parser.add_option('-f', '--defgrad',dest='defgrad', metavar = 'string', + help='heading of deformation gradient columns [%default]') +parser.add_option('-u', '--unitlength', dest='unitlength', type='float', metavar = 'float', + help='set unit length for 2D model [%default]') + +parser.set_defaults(deformed = 'ipinitialcoord') +parser.set_defaults(unitlength = 0.0) + +(options,filenames) = parser.parse_args() + +options.scaling += [1.0 for i in xrange(max(0,3-len(options.scaling)))] +scaling = map(float, options.scaling) + + +# --- loop over input files ------------------------------------------------------------------------- + +if filenames == []: filenames = [None] + +for name in filenames: + try: + table = damask.ASCIItable(name = name, + buffered = False) + except: continue + damask.util.report(scriptName,name) + +# ------------------------------------------ read header ------------------------------------------ + + table.head_read() + +# ------------------------------------------ sanity checks ---------------------------------------- + + errors = [] + remarks = [] + + if table.label_dimension(options.coords) != 3: errors.append('coordinates {} are not a vector.'.format(options.coords)) + else: colCoord = table.label_index(options.coords) + + if table.label_dimension(options.defgrad) != 9: errors.append('deformation gradient {} is not a tensor.'.format(options.defgrad)) + else: colF = table.label_index(options.defgrad) + + if remarks != []: damask.util.croak(remarks) + if errors != []: + damask.util.croak(errors) + table.close(dismiss = True) + continue + +# --------------- figure out size and grid --------------------------------------------------------- + + table.data_readArray() + + coords = [np.unique(table.data[:,colCoord+i]) for i in xrange(3)] + mincorner = np.array(map(min,coords)) + maxcorner = np.array(map(max,coords)) + grid = np.array(map(len,coords),'i') + size = grid/np.maximum(np.ones(3,'d'), grid-1.0) * (maxcorner-mincorner) # size from edge to edge = dim * n/(n-1) + size = np.where(grid > 1, size, min(size[grid > 1]/grid[grid > 1])) # spacing for grid==1 equal to smallest among other spacings + + N = grid.prod() + + if N != len(table.data): errors.append('data count {} does not match grid {}x{}x{}.'.format(N,*grid)) + if errors != []: + damask.util.croak(errors) + table.close(dismiss = True) + continue + +# ------------------------------------------ assemble header --------------------------------------- + + table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) + for coord in xrange(3): + label = '{}_{}_{}'.format(coord+1,options.defgrad,options.coords) + if np.any(scaling) != 1.0: label+='_{}_{}_{}'.format(scaling) + if options.undeformed: label+='_undeformed' + table.labels_append([label]) # extend ASCII header with new labels + table.head_write() + +# ------------------------------------------ read deformation gradient field ----------------------- + centroids,Favg = deformedCoordsFFT(table.data[:,colF:colF+9].reshape(grid[0],grid[1],grid[2],3,3)) + +# ------------------------------------------ process data ------------------------------------------ + table.data_rewind() + idx = 0 + outputAlive = True + while outputAlive and table.data_read(): # read next data line of ASCII table + (x,y,z) = damask.util.gridLocation(idx,grid) # figure out (x,y,z) position from line count + idx += 1 + table.data_append(list(centroids[z,y,x,:])) + outputAlive = table.data_write() + +# ------------------------------------------ output finalization ----------------------------------- + + table.close() # close ASCII tables From 6aa6b418eacccfc0f6986ce34d18d36db64b0af1 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 15 Apr 2016 00:08:01 +0200 Subject: [PATCH 010/412] not needed (Philip has different names) --- processing/post/addDeformedConfiguration.py | 164 -------------------- processing/post/nodesAroundCentres.py | 152 ------------------ 2 files changed, 316 deletions(-) delete mode 100755 processing/post/addDeformedConfiguration.py delete mode 100644 processing/post/nodesAroundCentres.py diff --git a/processing/post/addDeformedConfiguration.py b/processing/post/addDeformedConfiguration.py deleted file mode 100755 index 3fb39ee0d..000000000 --- a/processing/post/addDeformedConfiguration.py +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/env python -# -*- coding: UTF-8 no BOM -*- - -import os,sys,math -import numpy as np -from optparse import OptionParser -import damask - -scriptName = os.path.splitext(os.path.basename(__file__))[0] -scriptID = ' '.join([scriptName,damask.version]) - -#-------------------------------------------------------------------------------------------------- -def deformedCoordsFFT(F,undeformed=False): - - wgt = 1.0/grid.prod() - integrator = np.array([0.+1.j,0.+1.j,0.+1.j],'c16') * size/ 2.0 / math.pi - step = size/grid - - F_fourier = np.fft.rfftn(F,axes=(0,1,2)) - coords_fourier = np.zeros(F_fourier.shape[0:4],'c16') - - if undeformed: - Favg=np.eye(3) - else: - Favg=np.real(F_fourier[0,0,0,:,:])*wgt -#-------------------------------------------------------------------------------------------------- -# integration in Fourier space - k_s = np.zeros([3],'i') - for i in xrange(grid[2]): - k_s[2] = i - if(i > grid[2]//2 ): k_s[2] = k_s[2] - grid[2] - for j in xrange(grid[1]): - k_s[1] = j - if(j > grid[1]//2 ): k_s[1] = k_s[1] - grid[1] - for k in xrange(grid[0]//2+1): - k_s[0] = k - for m in xrange(3): - coords_fourier[i,j,k,m] = sum(F_fourier[i,j,k,m,0:3]*k_s*integrator) - if (any(k_s != 0)): - coords_fourier[i,j,k,0:3] /= -sum(k_s*k_s) - -#-------------------------------------------------------------------------------------------------- -# add average to scaled fluctuation and put (0,0,0) on (0,0,0) - coords = np.fft.irfftn(coords_fourier,F.shape[0:3],axes=(0,1,2)) - - offset_coords = np.dot(F[0,0,0,:,:],step/2.0) - scaling*coords[0,0,0,0:3] - for z in xrange(grid[2]): - for y in xrange(grid[1]): - for x in xrange(grid[0]): - coords[z,y,x,0:3] = scaling*coords[z,y,x,0:3] \ - + offset_coords \ - + np.dot(Favg,step*np.array([x,y,z])) - - return coords - -# -------------------------------------------------------------------- -# MAIN -# -------------------------------------------------------------------- - -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options file[s]', description = """ -Add deformed configuration of given initial coordinates. -Operates on periodic three-dimensional x,y,z-ordered data sets. - -""", version = scriptID) - -parser.add_option('-f', '--defgrad',dest='defgrad', metavar = 'string', - help='heading of deformation gradient columns [%default]') -parser.add_option('--reference', dest='undeformed', action='store_true', - help='map results to reference (undeformed) average configuration [%default]') -parser.add_option('--scaling', dest='scaling', action='extend', metavar = '', - help='scaling of fluctuation') -parser.add_option('-u', '--unitlength', dest='unitlength', type='float', metavar = 'float', - help='set unit length for 2D model [%default]') -parser.add_option('--coordinates', dest='coords', metavar='string', - help='column heading for coordinates [%default]') - -parser.set_defaults(defgrad = 'f') -parser.set_defaults(coords = 'ipinitialcoord') -parser.set_defaults(scaling = []) -parser.set_defaults(undeformed = False) -parser.set_defaults(unitlength = 0.0) - -(options,filenames) = parser.parse_args() - -options.scaling += [1.0 for i in xrange(max(0,3-len(options.scaling)))] -scaling = map(float, options.scaling) - - -# --- loop over input files ------------------------------------------------------------------------- - -if filenames == []: filenames = [None] - -for name in filenames: - try: - table = damask.ASCIItable(name = name, - buffered = False) - except: continue - damask.util.report(scriptName,name) - -# ------------------------------------------ read header ------------------------------------------ - - table.head_read() - -# ------------------------------------------ sanity checks ---------------------------------------- - - errors = [] - remarks = [] - - if table.label_dimension(options.coords) != 3: errors.append('coordinates {} are not a vector.'.format(options.coords)) - else: colCoord = table.label_index(options.coords) - - if table.label_dimension(options.defgrad) != 9: errors.append('deformation gradient {} is not a tensor.'.format(options.defgrad)) - else: colF = table.label_index(options.defgrad) - - if remarks != []: damask.util.croak(remarks) - if errors != []: - damask.util.croak(errors) - table.close(dismiss = True) - continue - -# --------------- figure out size and grid --------------------------------------------------------- - - table.data_readArray() - - coords = [np.unique(table.data[:,colCoord+i]) for i in xrange(3)] - mincorner = np.array(map(min,coords)) - maxcorner = np.array(map(max,coords)) - grid = np.array(map(len,coords),'i') - size = grid/np.maximum(np.ones(3,'d'), grid-1.0) * (maxcorner-mincorner) # size from edge to edge = dim * n/(n-1) - size = np.where(grid > 1, size, min(size[grid > 1]/grid[grid > 1])) # spacing for grid==1 set to smallest among other spacings - - N = grid.prod() - - if N != len(table.data): errors.append('data count {} does not match grid {}x{}x{}.'.format(N,*grid)) - if errors != []: - damask.util.croak(errors) - table.close(dismiss = True) - continue - -# ------------------------------------------ assemble header --------------------------------------- - - table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) - for coord in xrange(3): - label = '{}_{}_{}'.format(coord+1,options.defgrad,options.coords) - if np.any(scaling) != 1.0: label+='_{}_{}_{}'.format(scaling) - if options.undeformed: label+='_undeformed' - table.labels_append([label]) # extend ASCII header with new labels - table.head_write() - -# ------------------------------------------ read deformation gradient field ----------------------- - centroids = deformedCoordsFFT(table.data[:,colF:colF+9].reshape(grid[2],grid[1],grid[0],3,3), - options.undeformed) -# ------------------------------------------ process data ------------------------------------------ - table.data_rewind() - for z in xrange(grid[2]): - for y in xrange(grid[1]): - for x in xrange(grid[0]): - table.data_read() - table.data_append(list(centroids[z,y,x,:])) - table.data_write() - -# ------------------------------------------ output finalization ----------------------------------- - - table.close() # close ASCII tables \ No newline at end of file diff --git a/processing/post/nodesAroundCentres.py b/processing/post/nodesAroundCentres.py deleted file mode 100644 index 3a2624b16..000000000 --- a/processing/post/nodesAroundCentres.py +++ /dev/null @@ -1,152 +0,0 @@ -#!/usr/bin/env python -# -*- coding: UTF-8 no BOM -*- - -import os,sys,math,string -import numpy as np -from optparse import OptionParser -import damask - -scriptID = string.replace('$Id: addDeformedConfiguration.py 4500 2015-09-24 09:24:42Z MPIE\m.diehl $','\n','\\n') -scriptName = os.path.splitext(scriptID.split()[1])[0] - -#-------------------------------------------------------------------------------------------------- -def nodesAroundCentres(gDim,Favg,centres): -#-------------------------------------------------------------------------------------------------- - neighbor = np.array([0, 0, 0, - 1, 0, 0, - 1, 1, 0, - 0, 1, 0, - 0, 0, 1, - 1, 0, 1, - 1, 1, 1, - 0, 1, 1]).reshape(8,3) - -#-------------------------------------------------------------------------------------------------- -# building wrappedCentres = centroids + ghosts - diag = np.ones([3]) - wrappedCentres = np.zeros([3,grid[0]+2,grid[1]+2,grid[2]+2]) - wrappedCentres[0:3,1:grid[0]+1,1:grid[1]+1,1:grid[2]+1] = centres - for k in xrange(grid[2]+2): - for j in xrange(grid[1]+2): - for i in xrange(grid[0]+2): - if (k in [0,grid[2]+1] or j in [0,grid[1]+1] or i in[0,grid[0]+1]): - me = np.array([i,j,k],'i') # me on skin - shift = abs(grid+np.ones([3],'i')-2*me)/(grid+np.ones([3],'i'))*\ - np.sign(grid+np.ones([3],'i')-2*me) - lookup = np.array(me-diag+shift*grid,'i') - wrappedCentres[0:3,i, j, k] = \ - centres[0:3,lookup[0],lookup[1],lookup[2]] - np.dot(Favg, shift*gDim) - -#-------------------------------------------------------------------------------------------------- -# averaging - nodes = np.zeros([3,grid[0]+1,grid[1]+1,grid[2]+1]) - for k in xrange(grid[2]+1): - for j in xrange(grid[1]+1): - for i in xrange(grid[0]+1): - for n in xrange(8): - nodes[0:3,i,j,k] = \ - nodes[0:3,i,j,k] + wrappedCentres[0:3,i+neighbor[n,0],j+neighbor[n,1],k+neighbor[n,2] ] - - return nodes/8.0 - -# -------------------------------------------------------------------- -# MAIN -# -------------------------------------------------------------------- - -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options file[s]', description = """ -Add deformed configuration of given initial coordinates. -Operates on periodic three-dimensional x,y,z-ordered data sets. - -""", version = scriptID) - -parser.add_option('-f', '--defgrad',dest='defgrad', metavar = 'string', - help='heading of deformation gradient columns [%default]') -parser.add_option('-u', '--unitlength', dest='unitlength', type='float', metavar = 'float', - help='set unit length for 2D model [%default]') - -parser.set_defaults(deformed = 'ipinitialcoord') -parser.set_defaults(unitlength = 0.0) - -(options,filenames) = parser.parse_args() - -options.scaling += [1.0 for i in xrange(max(0,3-len(options.scaling)))] -scaling = map(float, options.scaling) - - -# --- loop over input files ------------------------------------------------------------------------- - -if filenames == []: filenames = [None] - -for name in filenames: - try: - table = damask.ASCIItable(name = name, - buffered = False) - except: continue - damask.util.report(scriptName,name) - -# ------------------------------------------ read header ------------------------------------------ - - table.head_read() - -# ------------------------------------------ sanity checks ---------------------------------------- - - errors = [] - remarks = [] - - if table.label_dimension(options.coords) != 3: errors.append('coordinates {} are not a vector.'.format(options.coords)) - else: colCoord = table.label_index(options.coords) - - if table.label_dimension(options.defgrad) != 9: errors.append('deformation gradient {} is not a tensor.'.format(options.defgrad)) - else: colF = table.label_index(options.defgrad) - - if remarks != []: damask.util.croak(remarks) - if errors != []: - damask.util.croak(errors) - table.close(dismiss = True) - continue - -# --------------- figure out size and grid --------------------------------------------------------- - - table.data_readArray() - - coords = [np.unique(table.data[:,colCoord+i]) for i in xrange(3)] - mincorner = np.array(map(min,coords)) - maxcorner = np.array(map(max,coords)) - grid = np.array(map(len,coords),'i') - size = grid/np.maximum(np.ones(3,'d'), grid-1.0) * (maxcorner-mincorner) # size from edge to edge = dim * n/(n-1) - size = np.where(grid > 1, size, min(size[grid > 1]/grid[grid > 1])) # spacing for grid==1 equal to smallest among other spacings - - N = grid.prod() - - if N != len(table.data): errors.append('data count {} does not match grid {}x{}x{}.'.format(N,*grid)) - if errors != []: - damask.util.croak(errors) - table.close(dismiss = True) - continue - -# ------------------------------------------ assemble header --------------------------------------- - - table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) - for coord in xrange(3): - label = '{}_{}_{}'.format(coord+1,options.defgrad,options.coords) - if np.any(scaling) != 1.0: label+='_{}_{}_{}'.format(scaling) - if options.undeformed: label+='_undeformed' - table.labels_append([label]) # extend ASCII header with new labels - table.head_write() - -# ------------------------------------------ read deformation gradient field ----------------------- - centroids,Favg = deformedCoordsFFT(table.data[:,colF:colF+9].reshape(grid[0],grid[1],grid[2],3,3)) - -# ------------------------------------------ process data ------------------------------------------ - table.data_rewind() - idx = 0 - outputAlive = True - while outputAlive and table.data_read(): # read next data line of ASCII table - (x,y,z) = damask.util.gridLocation(idx,grid) # figure out (x,y,z) position from line count - idx += 1 - table.data_append(list(centroids[z,y,x,:])) - outputAlive = table.data_write() - -# ------------------------------------------ output finalization ----------------------------------- - - table.close() # close ASCII tables From 5682d8f6270635cbbb4ef475af3e800d1008cb25 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 15 Apr 2016 00:11:03 +0200 Subject: [PATCH 011/412] also not needed --- processing/post/3Dvisualize.py | 482 --------------------------------- 1 file changed, 482 deletions(-) delete mode 100755 processing/post/3Dvisualize.py diff --git a/processing/post/3Dvisualize.py b/processing/post/3Dvisualize.py deleted file mode 100755 index fb5465d41..000000000 --- a/processing/post/3Dvisualize.py +++ /dev/null @@ -1,482 +0,0 @@ -#!/usr/bin/env python -# -*- coding: UTF-8 no BOM -*- - -import os,sys,re,fnmatch,vtk -import numpy as np -from optparse import OptionParser -import damask - -scriptName = os.path.splitext(os.path.basename(__file__))[0] -scriptID = ' '.join([scriptName,damask.version]) - -def deformedCoordsFFT(size,F,scaling,Favg=None): - grid = np.array(np.shape(F)[:-2]) - N = grid.prod() - step = size/grid - k_s = np.zeros([3],'i') - - F_fourier = np.fft.fftpack.rfftn(F,s=grid,axes=(0,1,2)) - coords_fourier = np.zeros(F_fourier.shape[:-1],'c16') - if Favg is None: - Favg = np.real(F_fourier[0,0,0,:,:]/N) - - for i in xrange(grid[2]//2+1): - k_s[2] = i - if grid[2]%2 == 0 and i == grid[2]//2: k_s[2] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) - - for j in xrange(grid[1]): - k_s[1] = j - if grid[1]%2 == 0 and j == grid[1]//2: k_s[1] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) - elif j > grid[1]//2: k_s[1] -= grid[1] - - for k in xrange(grid[0]): - k_s[0] = k - if grid[0]%2 == 0 and k == grid[0]//2: k_s[0] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) - elif k > grid[0]//2: k_s[0] -= grid[0] - - xi = 0.0+(k_s*0.5j*size/math.pi) - for m in xrange(3): - coords_fourier[k,j,i,m] = np.sum(F_fourier[k,j,i,m,:]*xi) - - if (any(k_s != 0)): - coords_fourier[k,j,i,:]/=-np.linalg.norm(k_s)**2.0 - - coords = np.fft.fftpack.irfftn(coords_fourier,s=grid,axes=(0,1,2)) - offset_coords =np.dot(F[0,0,0,:,:],step/2.0) - scaling*coords[0,0,0,:] - - for z in xrange(grid[2]): - for y in xrange(grid[1]): - for x in xrange(grid[0]): - coords[x,y,z,:] += offset_coords + np.dot(Favg,[x,y,z]*step) - -def outStdout(cmd,locals): - if cmd[0:3] == '(!)': - exec(cmd[3:]) - elif cmd[0:3] == '(?)': - cmd = eval(cmd[3:]) - print cmd - else: - print cmd - return - -def outFile(cmd,locals): - if cmd[0:3] == '(!)': - exec(cmd[3:]) - elif cmd[0:3] == '(?)': - cmd = eval(cmd[3:]) - locals['filepointer'].write(cmd+'\n') - else: - locals['filepointer'].write(cmd+'\n') - return - - -def output(cmds,locals,dest): - for cmd in cmds: - if isinstance(cmd,list): - output(cmd,locals,dest) - else: - {\ - 'File': outFile,\ - 'Stdout': outStdout,\ - }[dest](str(cmd),locals) - return - - -def transliterateToFloat(x): - try: - return float(x) - except: - return 0.0 - - -def unravel(item): - if hasattr(item,'__contains__'): return ' '.join(map(unravel,item)) - else: return str(item) - - -# ++++++++++++++++++++++++++++++++++++++++++++++++++++ -def vtk_writeASCII_mesh(mesh,data,res,sep): - """function writes data array defined on a hexahedral mesh (geometry)""" - info = {\ - 'tensor': {'name':'tensor','len':9},\ - 'vector': {'name':'vector','len':3},\ - 'scalar': {'name':'scalar','len':1},\ - 'double': {'name':'scalar','len':2},\ - 'triple': {'name':'scalar','len':3},\ - 'quadruple': {'name':'scalar','len':4},\ - } - N1 = (res[0]+1)*(res[1]+1)*(res[2]+1) - N = res[0]*res[1]*res[2] - - cmds = [\ - '# vtk DataFile Version 3.1', - 'powered by %s'%scriptID, - 'ASCII', - 'DATASET UNSTRUCTURED_GRID', - 'POINTS %i double'%N1, - [[['\t'.join(map(str,mesh[:,i,j,k])) for i in range(res[0]+1)] for j in range(res[1]+1)] for k in range(res[2]+1)], - 'CELLS %i %i'%(N,N*9), - ] - -# cells - for z in range (res[2]): - for y in range (res[1]): - for x in range (res[0]): - base = z*(res[1]+1)*(res[0]+1)+y*(res[0]+1)+x - cmds.append('8 '+'\t'.join(map(str,[ \ - base, - base+1, - base+res[0]+2, - base+res[0]+1, - base+(res[1]+1)*(res[0]+1), - base+(res[1]+1)*(res[0]+1)+1, - base+(res[1]+1)*(res[0]+1)+res[0]+2, - base+(res[1]+1)*(res[0]+1)+res[0]+1, - ]))) - cmds += [\ - 'CELL_TYPES %i'%N, - ['12']*N, - 'CELL_DATA %i'%N, - ] - - for type in data: - plural = {True:'',False:'S'}[type.lower().endswith('s')] - for item in data[type]['_order_']: - cmds += [\ - '%s %s double'%(info[type]['name'].upper()+plural,item), - {True:'LOOKUP_TABLE default',False:''}[info[type]['name'][:3]=='sca'], - [[[sep.join(map(unravel,data[type][item][:,j,k]))] for j in range(res[1])] for k in range(res[2])], - ] - - return cmds - -#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -def vtk_writeASCII_points(coordinates,data,res,sep): - """function writes data array defined on a point field""" - N = res[0]*res[1]*res[2] - - cmds = [\ - '# vtk DataFile Version 3.1', - 'powered by %s'%scriptID, - 'ASCII', - 'DATASET UNSTRUCTURED_GRID', - 'POINTS %i double'%N, - [[['\t'.join(map(str,coordinates[i,j,k])) for i in range(res[0])] for j in range(res[1])] for k in range(res[2])], - 'CELLS %i %i'%(N,N*2), - ['1\t%i'%i for i in range(N)], - 'CELL_TYPES %i'%N, - ['1']*N, - 'POINT_DATA %i'%N, - ] - - for type in data: - plural = {True:'',False:'S'}[type.lower().endswith('s')] - for item in data[type]: - cmds += [\ - '%s %s double'%(type.upper()+plural,item), - {True:'LOOKUP_TABLE default',False:''}[type.lower()[:3]=='sca'], - [[[sep.join(map(unravel,data[type][item][:,j,k]))] for j in range(res[1])] for k in range(res[2])], - ] - - return cmds - - -# ----------------------- MAIN ------------------------------- - -parser = OptionParser(option_class=damask.extendableOption, usage='%prog [options] datafile[s]', description = """ -Produce VTK file from data field. -Coordinates are taken from (consecutive) x, y, and z columns. - -""", version = scriptID) - -sepChoices = ['n','t','s'] -parser.add_option('-s', '--scalar', dest='scalar', action='extend', metavar = '', - help='list of single scalars to visualize') -parser.add_option( '--double', dest='double', action='extend', metavar = '', - help='list of two scalars to visualize') -parser.add_option( '--triple', dest='triple', action='extend', metavar = '', - help='list of three scalars to visualize') -parser.add_option( '--quadruple', dest='quadruple', action='extend', metavar = '', - help='list of four scalars to visualize') -parser.add_option('-v', '--vector', dest='vector', action='extend', metavar = '', - help='list of vectors to visualize') -parser.add_option('-t', '--tensor', dest='tensor', action='extend', metavar = '', - help='list of tensors to visualize') -parser.add_option('-d', '--deformation', dest='defgrad', metavar = 'string', - help='heading of deformation gradient columns [%default]') -parser.add_option('--reference', dest='undeformed', action='store_true', - help='map results to reference (undeformed) configuration [%default]') -parser.add_option('-c','--cell', dest='cell', action='store_true', - help='data is cell-centered [%default]') -parser.add_option('-p','--vertex', dest='cell', action='store_false', - help='data is vertex-centered') -parser.add_option('--mesh', dest='output_mesh', action='store_true', - help='produce VTK mesh file [%default]') -parser.add_option('--nomesh', dest='output_mesh', action='store_false', - help='omit VTK mesh file') -parser.add_option('--points', dest='output_points', action='store_true', - help='produce VTK points file [%default]') -parser.add_option('--nopoints', dest='output_points', action='store_false', - help='omit VTK points file') -parser.add_option('--separator', dest='separator', type='choice', choices=sepChoices, metavar='string', - help='data separator {%s} [t]'%(' '.join(map(str,sepChoices)))) -parser.add_option('--scaling', dest='scaling', action='extend', metavar = '', - help='scaling of fluctuation') -parser.add_option('-u', '--unitlength', dest='unitlength', type='float', metavar = 'float', - help='set unit length for 2D model [%default]') - -parser.set_defaults(defgrad = 'f') -parser.set_defaults(separator = 't') -parser.set_defaults(scalar = []) -parser.set_defaults(double = []) -parser.set_defaults(triple = []) -parser.set_defaults(quadruple = []) -parser.set_defaults(vector = []) -parser.set_defaults(tensor = []) -parser.set_defaults(output_mesh = True) -parser.set_defaults(output_points = False) -parser.set_defaults(scaling = []) -parser.set_defaults(undeformed = False) -parser.set_defaults(unitlength = 0.0) -parser.set_defaults(cell = True) - -sep = {'n': '\n', 't': '\t', 's': ' '} - -(options, args) = parser.parse_args() - -options.scaling += [1.0 for i in xrange(max(0,3-len(options.scaling)))] -options.scaling = map(float, options.scaling) - -for filename in args: - if not os.path.exists(filename): - continue - file = open(filename) - content = file.readlines() - file.close() - m = re.search('(\d+)\s*head', content[0].lower()) - if m is None: - continue - print filename,'\n' - sys.stdout.flush() - - headrow = int(m.group(1)) - headings = content[headrow].split() - column = {} - matches = {} - maxcol = 0 - locol = -1 - - for col,head in enumerate(headings): - if head == {True:'1_ipinitialcoord',False:'1_nodeinitialcoord'}[options.cell]: - locol = col - maxcol = max(maxcol,col+3) - break - - if locol < 0: - print 'missing coordinates..!' - continue - - column['tensor'] = {} - matches['tensor'] = {} - for label in [options.defgrad] + options.tensor: - column['tensor'][label] = -1 - for col,head in enumerate(headings): - if head == label or head == '1_'+label: - column['tensor'][label] = col - maxcol = max(maxcol,col+9) - matches['tensor'][label] = [label] - break - - if not options.undeformed and column['tensor'][options.defgrad] < 0: - print 'missing deformation gradient "%s"..!'%options.defgrad - continue - - column['vector'] = {} - matches['vector'] = {} - for label in options.vector: - column['vector'][label] = -1 - for col,head in enumerate(headings): - if head == label or head == '1_'+label: - column['vector'][label] = col - maxcol = max(maxcol,col+3) - matches['vector'][label] = [label] - break - - for length,what in enumerate(['scalar','double','triple','quadruple']): - column[what] = {} - labels = eval("options.%s"%what) - matches[what] = {} - for col,head in enumerate(headings): - for needle in labels: - if fnmatch.fnmatch(head,needle): - column[what][head] = col - maxcol = max(maxcol,col+1+length) - if needle not in matches[what]: - matches[what][needle] = [head] - else: - matches[what][needle] += [head] - - - values = np.array(sorted([map(transliterateToFloat,line.split()[:maxcol]) for line in content[headrow+1:]], - key=lambda x:(x[locol+0],x[locol+1],x[locol+2])),'d') # sort with z as fastest and x as slowest index - values2 = np.array([map(transliterateToFloat,line.split()[:maxcol]) for line in content[headrow+1:]],'d') # sort with x as fastest and z as slowest index - - N = len(values) - - tempGrid = [{},{},{}] - for j in xrange(3): - for i in xrange(N): - tempGrid[j][str(values[i,locol+j])] = True - - grid = np.array([len(tempGrid[0]),\ - len(tempGrid[1]),\ - len(tempGrid[2]),],'i') - - dim = np.ones(3) - - for i,r in enumerate(grid): - if r > 1: - dim[i] = (max(map(float,tempGrid[i].keys()))-min(map(float,tempGrid[i].keys())))*r/(r-1.0) - if grid[2]==1: # for 2D case set undefined dimension to given unitlength or alternatively give it the length of the smallest element - if options.unitlength == 0.0: - dim[2] = min(dim/grid) - else: - dim[2] = options.unitlength - print dim - if options.undeformed: - Favg = np.eye(3) - else: - Favg = damask.core.math.tensorAvg( - np.reshape(np.transpose(values[:,column['tensor'][options.defgrad]: - column['tensor'][options.defgrad]+9]), - (3,3,grid[0],grid[1],grid[2]))) - - F = np.reshape(np.transpose(values[:,column['tensor'][options.defgrad]: - column['tensor'][options.defgrad]+9]), - (3,3,grid[0],grid[1],grid[2])) - F2 = np.reshape(values[:,column['tensor'][options.defgrad]: - column['tensor'][options.defgrad]+9], - (grid[0],grid[1],grid[2],3,3)) - for z in xrange(grid[2]): - for y in xrange(grid[1]): - for x in xrange(grid[0]): - F2[x,y,z,:,:] = F2[x,y,z,:,:].T - centroids2 = deformedCoordsFFT(dim,F2,options.scaling,None) - centroids = damask.core.mesh.deformedCoordsFFT(dim,F,Favg,options.scaling) - - nodes = damask.core.mesh.nodesAroundCentres(dim,Favg,centroids) - - fields = {\ - 'tensor': {},\ - 'vector': {},\ - 'scalar': {},\ - 'double': {},\ - 'triple': {},\ - 'quadruple': {},\ - } - reshape = {\ - 'tensor': [3,3],\ - 'vector': [3],\ - 'scalar': [],\ - 'double': [2],\ - 'triple': [3],\ - 'quadruple': [4],\ - } - length = {\ - 'tensor': 9,\ - 'vector': 3,\ - 'scalar': 1,\ - 'double': 2,\ - 'triple': 3,\ - 'quadruple': 4,\ - } - - -# vtk lib out - if False: - points = vtk.vtkPoints() - for z in range (grid[2]+1): - for y in range (grid[1]+1): - for x in range (grid[0]+1): - points.InsertNextPoint(nodes[:,x,y,z]) - - data=[] - j=0 - for datatype in fields.keys(): - for what in eval('options.'+datatype): - for label in matches[datatype][what]: - col = column[datatype][label] - if col != -1: - data.append(vtk.vtkFloatArray()) - data[j].SetNumberOfComponents(length[datatype]) - for i in xrange(grid[2]*grid[1]*grid[0]): - for k in xrange(length[datatype]): - data[j].InsertNextValue(values2[i,col+k]) - data[j].SetName(label) - j+=1 - - if options.output_mesh: - hexs = vtk.vtkCellArray() - i = 0 - elems=[] - for z in range (grid[2]): - for y in range (grid[1]): - for x in range (grid[0]): - - elems.append(vtk.vtkHexahedron()) - base = z*(grid[1]+1)*(grid[0]+1)+y*(grid[0]+1)+x - elems[i].GetPointIds().SetId(0, base) - elems[i].GetPointIds().SetId(1, base+1) - elems[i].GetPointIds().SetId(2, base+grid[0]+2) - elems[i].GetPointIds().SetId(3, base+grid[0]+1) - elems[i].GetPointIds().SetId(4, base+(grid[1]+1)*(grid[0]+1)) - elems[i].GetPointIds().SetId(5, base+(grid[1]+1)*(grid[0]+1)+1) - elems[i].GetPointIds().SetId(6, base+(grid[1]+1)*(grid[0]+1)+grid[0]+2) - elems[i].GetPointIds().SetId(7, base+(grid[1]+1)*(grid[0]+1)+grid[0]+1) - hexs.InsertNextCell(elems[i]) - i+=1 - - uGrid = vtk.vtkUnstructuredGrid() - uGrid.SetPoints(points) - i = 0 - for z in range (grid[2]): - for y in range (grid[1]): - for x in range (grid[0]): - uGrid.InsertNextCell(elems[i].GetCellType(), elems[i].GetPointIds()) - i+=1 - - for i in xrange(len(data)): - uGrid.GetCellData().AddArray(data[i]) - - outWriter = vtk.vtkXMLUnstructuredGridWriter() - outWriter.SetDataModeToBinary() - outWriter.SetCompressorTypeToZLib() - (head,tail) = os.path.split(filename) - outWriter.SetFileName(os.path.join(head,'mesh_'+os.path.splitext(tail)[0]+'.vtu')) - outWriter.SetInput(uGrid) - outWriter.Write() - - - for datatype in fields.keys(): - print '\n%s:'%datatype, - fields[datatype]['_order_'] = [] - for what in eval('options.'+datatype): - for label in matches[datatype][what]: - col = column[datatype][label] - if col != -1: - print label, - fields[datatype][label] = np.reshape(values[:,col:col+length[datatype]],[grid[0],grid[1],grid[2]]+reshape[datatype]) - fields[datatype]['_order_'] += [label] - print '\n' - - out = {} - if options.output_mesh: out['mesh'] = vtk_writeASCII_mesh(nodes,fields,grid,sep[options.separator]) - if options.output_points: out['points'] = vtk_writeASCII_points(centroids,fields,grid,sep[options.separator]) - - for what in out.keys(): - print what - (head,tail) = os.path.split(filename) - vtk = open(os.path.join(head,what+'_'+os.path.splitext(tail)[0]+'.vtk'), 'w') - output(out[what],{'filepointer':vtk},'File') - vtk.close() - print From 0632dc1308e5061c4d8e6ea99e5f16ff58aea503 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 15 Apr 2016 00:21:45 +0200 Subject: [PATCH 012/412] pyflakes complained --- lib/damask/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/damask/__init__.py b/lib/damask/__init__.py index dc40920fa..3edaa9efa 100644 --- a/lib/damask/__init__.py +++ b/lib/damask/__init__.py @@ -1,7 +1,7 @@ # -*- coding: UTF-8 no BOM -*- """Main aggregator""" -import sys, os +import os with open(os.path.join(os.path.dirname(__file__),'../../VERSION')) as f: version = f.readline()[:-1] @@ -11,10 +11,10 @@ from .asciitable import ASCIItable # noqa from .config import Material # noqa from .colormaps import Colormap, Color # noqa try: - from .corientation import Quaternion, Rodrigues, Symmetry, Orientation + from .corientation import Quaternion, Rodrigues, Symmetry, Orientation # noqa print "Import Cython version of Orientation module" except: - from .orientation import Quaternion, Rodrigues, Symmetry, Orientation + from .orientation import Quaternion, Rodrigues, Symmetry, Orientation # noqa #from .block import Block # only one class from .result import Result # noqa from .geometry import Geometry # noqa From 72639d174b90fdd9b0a216bd3a718becc98843c2 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 15 Apr 2016 00:25:12 +0200 Subject: [PATCH 013/412] fortran code was translated by philip --- lib/damask/util.py | 92 +--------------------------------------------- 1 file changed, 1 insertion(+), 91 deletions(-) diff --git a/lib/damask/util.py b/lib/damask/util.py index 81eb30713..07bb55865 100644 --- a/lib/damask/util.py +++ b/lib/damask/util.py @@ -450,94 +450,4 @@ def curve_fit_bound(f, xdata, ydata, p0=None, sigma=None, bounds=None, **kw): else: pcov = np.inf - return (popt, pcov, infodict, errmsg, ier) if return_full else (popt, pcov) - - -!-------------------------------------------------------------------------------------------------- -!> @brief builds mesh of (distorted) cubes for given coordinates (= center of the cubes) -!-------------------------------------------------------------------------------------------------- -function mesh_nodesAroundCentres(gDim,Favg,centres) result(nodes) - use debug, only: & - debug_mesh, & - debug_level, & - debug_levelBasic - use math, only: & - math_mul33x3 - - implicit none - real(pReal), intent(in), dimension(:,:,:,:) :: & - centres - real(pReal), dimension(3,size(centres,2)+1,size(centres,3)+1,size(centres,4)+1) :: & - nodes - real(pReal), intent(in), dimension(3) :: & - gDim - real(pReal), intent(in), dimension(3,3) :: & - Favg - real(pReal), dimension(3,size(centres,2)+2,size(centres,3)+2,size(centres,4)+2) :: & - wrappedCentres - - integer(pInt) :: & - i,j,k,n - integer(pInt), dimension(3), parameter :: & - diag = 1_pInt - integer(pInt), dimension(3) :: & - shift = 0_pInt, & - lookup = 0_pInt, & - me = 0_pInt, & - iRes = 0_pInt - integer(pInt), dimension(3,8) :: & - neighbor = reshape([ & - 0_pInt, 0_pInt, 0_pInt, & - 1_pInt, 0_pInt, 0_pInt, & - 1_pInt, 1_pInt, 0_pInt, & - 0_pInt, 1_pInt, 0_pInt, & - 0_pInt, 0_pInt, 1_pInt, & - 1_pInt, 0_pInt, 1_pInt, & - 1_pInt, 1_pInt, 1_pInt, & - 0_pInt, 1_pInt, 1_pInt ], [3,8]) - -!-------------------------------------------------------------------------------------------------- -! initializing variables - iRes = [size(centres,2),size(centres,3),size(centres,4)] - nodes = 0.0_pReal - wrappedCentres = 0.0_pReal - -!-------------------------------------------------------------------------------------------------- -! report - if (iand(debug_level(debug_mesh),debug_levelBasic) /= 0_pInt) then - write(6,'(a)') ' Meshing cubes around centroids' - write(6,'(a,3(e12.5))') ' Dimension: ', gDim - write(6,'(a,3(i5))') ' Resolution:', iRes - endif - -!-------------------------------------------------------------------------------------------------- -! building wrappedCentres = centroids + ghosts - wrappedCentres(1:3,2_pInt:iRes(1)+1_pInt,2_pInt:iRes(2)+1_pInt,2_pInt:iRes(3)+1_pInt) = centres - do k = 0_pInt,iRes(3)+1_pInt - do j = 0_pInt,iRes(2)+1_pInt - do i = 0_pInt,iRes(1)+1_pInt - if (k==0_pInt .or. k==iRes(3)+1_pInt .or. & ! z skin - j==0_pInt .or. j==iRes(2)+1_pInt .or. & ! y skin - i==0_pInt .or. i==iRes(1)+1_pInt ) then ! x skin - me = [i,j,k] ! me on skin - shift = sign(abs(iRes+diag-2_pInt*me)/(iRes+diag),iRes+diag-2_pInt*me) - lookup = me-diag+shift*iRes - wrappedCentres(1:3,i+1_pInt, j+1_pInt, k+1_pInt) = & - centres(1:3,lookup(1)+1_pInt,lookup(2)+1_pInt,lookup(3)+1_pInt) - & - math_mul33x3(Favg, shift*gDim) - endif - enddo; enddo; enddo - -!-------------------------------------------------------------------------------------------------- -! averaging - do k = 0_pInt,iRes(3); do j = 0_pInt,iRes(2); do i = 0_pInt,iRes(1) - do n = 1_pInt,8_pInt - nodes(1:3,i+1_pInt,j+1_pInt,k+1_pInt) = & - nodes(1:3,i+1_pInt,j+1_pInt,k+1_pInt) + wrappedCentres(1:3,i+1_pInt+neighbor(1,n), & - j+1_pInt+neighbor(2,n), & - k+1_pInt+neighbor(3,n) ) - enddo - enddo; enddo; enddo - nodes = nodes/8.0_pReal - -end function mesh_nodesAroundCentres + return (popt, pcov, infodict, errmsg, ier) if return_full else (popt, pcov) \ No newline at end of file From 91753d53228a26504c371b8df485f776b3a8b8fa Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 15 Apr 2016 00:32:30 +0200 Subject: [PATCH 014/412] more style related changes --- processing/post/addCompatibilityMismatch.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/processing/post/addCompatibilityMismatch.py b/processing/post/addCompatibilityMismatch.py index 8c9e479ec..a8f9dfd2b 100755 --- a/processing/post/addCompatibilityMismatch.py +++ b/processing/post/addCompatibilityMismatch.py @@ -12,8 +12,9 @@ scriptID = ' '.join([scriptName,damask.version]) def volTetrahedron(coords): """ - Return the volume of the tetrahedron with given vertices or sides. If - vertices are given they must be in a NumPy array with shape (4,3): the + Return the volume of the tetrahedron with given vertices or sides. + + Ifvertices are given they must be in a NumPy array with shape (4,3): the position vectors of the 4 vertices in 3 dimensions; if the six sides are given, they must be an array of length 6. If both are given, the sides will be used in the calculation. @@ -28,9 +29,7 @@ def volTetrahedron(coords): where s1, s2, ..., s6 are the tetrahedron side lengths. from http://codereview.stackexchange.com/questions/77593/calculating-the-volume-of-a-tetrahedron - """ - # The indexes of rows in the vertices array corresponding to all # possible pairs of vertices vertex_pair_indexes = np.array(((0, 1), (0, 2), (0, 3), @@ -59,10 +58,11 @@ def volTetrahedron(coords): def volumeMismatch(size,F,nodes): """ - calculates the mismatch between volume of reconstructed (compatible) cube and - determinant of defgrad at the FP + calculates the volume mismatch + + volume mismatch is defined as the difference between volume of reconstructed + (compatible) cube and determinant of defgrad at the FP """ - coords = np.empty([8,3]) vMismatch = np.empty(grid) volInitial = size.prod()/grid.prod() @@ -95,11 +95,12 @@ def volumeMismatch(size,F,nodes): def shapeMismatch(size,F,nodes,centres): """ - Routine to calculate the mismatch between the vectors from the central point to + Routine to calculate the shape mismatch + + shape mismatch is defined as difference between the vectors from the central point to the corners of reconstructed (combatible) volume element and the vectors calculated by deforming the initial volume element with the current deformation gradient """ - coordsInitial = np.empty([8,3]) sMismatch = np.empty(grid) @@ -121,7 +122,7 @@ def shapeMismatch(size,F,nodes,centres): for j in xrange(grid[1]): for i in xrange(grid[0]): sMismatch[i,j,k] = \ - np.linalg.norm(nodes[0:3,i, j, k] - centres[0:3,i,j,k] - np.dot(F[:,:,i,j,k], coordsInitial[0,0:3]))\ + + np.linalg.norm(nodes[0:3,i, j, k] - centres[0:3,i,j,k] - np.dot(F[:,:,i,j,k], coordsInitial[0,0:3]))\ + np.linalg.norm(nodes[0:3,i+1,j, k] - centres[0:3,i,j,k] - np.dot(F[:,:,i,j,k], coordsInitial[1,0:3]))\ + np.linalg.norm(nodes[0:3,i+1,j+1,k ] - centres[0:3,i,j,k] - np.dot(F[:,:,i,j,k], coordsInitial[2,0:3]))\ + np.linalg.norm(nodes[0:3,i, j+1,k ] - centres[0:3,i,j,k] - np.dot(F[:,:,i,j,k], coordsInitial[3,0:3]))\ From 4b860fb08394370c405cd15bbde9f3b9991e759c Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 22 May 2016 17:18:15 +0200 Subject: [PATCH 015/412] added c routines to core module compilation --- installation/compile_CoreModule.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/installation/compile_CoreModule.py b/installation/compile_CoreModule.py index 8772c4cd6..94df21f91 100755 --- a/installation/compile_CoreModule.py +++ b/installation/compile_CoreModule.py @@ -100,6 +100,8 @@ os.chdir(codeDir) cmd = 'f2py damask.core.pyf' +\ ' -c --no-lower %s'%(compiler) +\ compileOptions+\ + ' C_routines.c'+\ + ' system_routines.f90'+\ ' prec.f90'+\ ' spectral_interface.f90'+\ ' IO.f90'+\ From 540e1cbec84b4c3edb9cde307fdef1d93f41e059 Mon Sep 17 00:00:00 2001 From: Test User Date: Mon, 23 May 2016 04:22:49 +0200 Subject: [PATCH 016/412] updated version information after successful test of v2.0.0-278-g4b860fb --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 2f31eda87..14db07f65 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.0-262-gbd1beb4 +v2.0.0-278-g4b860fb From a58e85e96d7286124652923247713722473d5405 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 25 May 2016 07:52:56 +0200 Subject: [PATCH 017/412] explicit casting and overlong constants regognized by compiler --- code/IO.f90 | 6 +++--- code/material.f90 | 10 +++++----- code/math.f90 | 4 ++-- code/mesh.f90 | 12 ++++++------ code/prec.f90 | 22 ++++++++++++++-------- 5 files changed, 30 insertions(+), 24 deletions(-) diff --git a/code/IO.f90 b/code/IO.f90 index ff6b7b091..2a13ce3d8 100644 --- a/code/IO.f90 +++ b/code/IO.f90 @@ -546,7 +546,7 @@ function IO_hybridIA(Nast,ODFfileName) !-------------------------------------------------------------------------------------------------- ! math module is not available - real(pReal), parameter :: PI = 3.14159265358979323846264338327950288419716939937510_pReal + real(pReal), parameter :: PI = 3.141592653589793_pReal real(pReal), parameter :: INRAD = PI/180.0_pReal integer(pInt) :: i,j,bin,NnonZero,Nset,Nreps,reps,phi1,Phi,phi2 @@ -666,7 +666,7 @@ function IO_hybridIA(Nast,ODFfileName) else prob = 0.0_pReal endif - dV_V(phi2,Phi,phi1) = prob*dg_0*sin((Phi-1.0_pReal+center)*deltas(2)) + dV_V(phi2,Phi,phi1) = prob*dg_0*sin((real(Phi-1_pInt,pReal)+center)*deltas(2)) enddo; enddo; enddo close(FILEUNIT) dV_V = dV_V/sum_dV_V ! normalize to 1 @@ -713,7 +713,7 @@ function IO_hybridIA(Nast,ODFfileName) do i=1_pInt,Nast if (i < Nast) then call random_number(rnd) - j = nint(rnd*(Nreps-i)+i+0.5_pReal,pInt) + j = nint(rnd*real(Nreps-i,pReal)+real(i,pReal)+0.5_pReal,pInt) else j = i endif diff --git a/code/material.f90 b/code/material.f90 index 372c9dd7e..40c403b8c 100644 --- a/code/material.f90 +++ b/code/material.f90 @@ -1371,7 +1371,7 @@ subroutine material_populateGrains else forall (i = 1_pInt:FE_Nips(t)) & ! loop over IPs volumeOfGrain(grain+(i-1)*dGrains+1_pInt:grain+i*dGrains) = & - mesh_ipVolume(i,e)/dGrains ! assign IPvolume/Ngrains@IP to all grains of IP + mesh_ipVolume(i,e)/real(dGrains,pReal) ! assign IPvolume/Ngrains@IP to all grains of IP grain = grain + FE_Nips(t) * dGrains ! wind forward by Nips*Ngrains@IP endif enddo @@ -1393,7 +1393,7 @@ subroutine material_populateGrains NgrainsOfConstituent = 0_pInt ! reset counter of grains per constituent forall (i = 1_pInt:myNconstituents) & - NgrainsOfConstituent(i) = nint(microstructure_fraction(i,micro) * myNgrains, pInt) ! do rounding integer conversion + NgrainsOfConstituent(i) = nint(microstructure_fraction(i,micro)*real(myNgrains,pReal),pInt)! do rounding integer conversion do while (sum(NgrainsOfConstituent) /= myNgrains) ! total grain count over constituents wrong? sgn = sign(1_pInt, myNgrains - sum(NgrainsOfConstituent)) ! direction of required change extreme = 0.0_pReal @@ -1434,17 +1434,17 @@ subroutine material_populateGrains ! ...has texture components if (texture_ODFfile(textureID) == '') then gauss: do t = 1_pInt,texture_Ngauss(textureID) ! loop over Gauss components - do g = 1_pInt,int(myNorientations*texture_Gauss(5,t,textureID),pInt) ! loop over required grain count + do g = 1_pInt,int(real(myNorientations,pReal)*texture_Gauss(5,t,textureID),pInt) ! loop over required grain count orientationOfGrain(:,grain+constituentGrain+g) = & math_sampleGaussOri(texture_Gauss(1:3,t,textureID),& texture_Gauss( 4,t,textureID)) enddo constituentGrain = & - constituentGrain + int(myNorientations*texture_Gauss(5,t,textureID)) ! advance counter for grains of current constituent + constituentGrain + int(real(myNorientations,pReal)*texture_Gauss(5,t,textureID)) ! advance counter for grains of current constituent enddo gauss fiber: do t = 1_pInt,texture_Nfiber(textureID) ! loop over fiber components - do g = 1_pInt,int(myNorientations*texture_Fiber(6,t,textureID),pInt) ! loop over required grain count + do g = 1_pInt,int(real(myNorientations,pReal)*texture_Fiber(6,t,textureID),pInt) ! loop over required grain count orientationOfGrain(:,grain+constituentGrain+g) = & math_sampleFiberOri(texture_Fiber(1:2,t,textureID),& texture_Fiber(3:4,t,textureID),& diff --git a/code/math.f90 b/code/math.f90 index 9ad98df9e..401e46630 100644 --- a/code/math.f90 +++ b/code/math.f90 @@ -13,10 +13,10 @@ module math implicit none private - real(pReal), parameter, public :: PI = 3.14159265358979323846264338327950288419716939937510_pReal !< ratio of a circle's circumference to its diameter + real(pReal), parameter, public :: PI = 3.141592653589793_pReal !< ratio of a circle's circumference to its diameter real(pReal), parameter, public :: INDEG = 180.0_pReal/PI !< conversion from radian into degree real(pReal), parameter, public :: INRAD = PI/180.0_pReal !< conversion from degree into radian - complex(pReal), parameter, public :: TWOPIIMG = (0.0_pReal,2.0_pReal)* PI !< Re(0.0), Im(2xPi) + complex(pReal), parameter, public :: TWOPIIMG = (0.0_pReal,2.0_pReal)*(PI,0.0_pReal) !< Re(0.0), Im(2xPi) real(pReal), dimension(3,3), parameter, public :: & MATH_I3 = reshape([& diff --git a/code/mesh.f90 b/code/mesh.f90 index 22e103df0..ecf2dd6f3 100644 --- a/code/mesh.f90 +++ b/code/mesh.f90 @@ -963,7 +963,7 @@ subroutine mesh_build_ipCoordinates do n = 1_pInt,FE_NcellnodesPerCell(c) ! loop over cell nodes in this cell myCoords = myCoords + mesh_cellnode(1:3,mesh_cell(n,i,e)) enddo - mesh_ipCoordinates(1:3,i,e) = myCoords / FE_NcellnodesPerCell(c) + mesh_ipCoordinates(1:3,i,e) = myCoords / real(FE_NcellnodesPerCell(c),pReal) enddo enddo !$OMP END PARALLEL DO @@ -990,7 +990,7 @@ pure function mesh_cellCenterCoordinates(ip,el) do n = 1_pInt,FE_NcellnodesPerCell(c) ! loop over cell nodes in this cell mesh_cellCenterCoordinates = mesh_cellCenterCoordinates + mesh_cellnode(1:3,mesh_cell(n,ip,el)) enddo - mesh_cellCenterCoordinates = mesh_cellCenterCoordinates / FE_NcellnodesPerCell(c) + mesh_cellCenterCoordinates = mesh_cellCenterCoordinates / real(FE_NcellnodesPerCell(c),pReal) end function mesh_cellCenterCoordinates @@ -3070,7 +3070,6 @@ use IO, only: & implicit none integer(pInt), intent(in) :: fileUnit - #ifndef Spectral integer(pInt), allocatable, dimension(:) :: chunkPos integer(pInt) chunk, Nchunks @@ -3082,10 +3081,9 @@ use IO, only: & mesh_periodicSurface = .true. #else mesh_periodicSurface = .false. -#ifdef Marc4DAMASK +#if defined(Marc4DAMASK) keyword = '$damask' -#endif -#ifdef Abaqus +#elif defined(Abaqus) keyword = '**damask' #endif @@ -3693,6 +3691,7 @@ integer(pInt) function FE_mapElemtype(what) 'c3d20t') FE_mapElemtype = 13_pInt ! Three-dimensional Arbitrarily Distorted quadratic hexahedral case default + FE_mapElemtype = -1_pInt ! error return call IO_error(error_ID=190_pInt,ext_msg=IO_lc(what)) end select @@ -3701,6 +3700,7 @@ end function FE_mapElemtype !-------------------------------------------------------------------------------------------------- !> @brief find face-matching element of same type +!> @details currently not used, check if needed for HDF5 output, otherwise delete !-------------------------------------------------------------------------------------------------- subroutine mesh_faceMatch(elem, face ,matchingElem, matchingFace) diff --git a/code/prec.f90 b/code/prec.f90 index e099c8964..f3cba540a 100644 --- a/code/prec.f90 +++ b/code/prec.f90 @@ -185,10 +185,13 @@ end function prec_isNaN ! http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm !-------------------------------------------------------------------------------------------------- logical elemental pure function dEq(a,b,tol) - real(pReal), intent(in) :: a,b - real(pReal), intent(in), optional :: tol - real(pReal), parameter :: eps = 2.2204460492503131E-16 ! DBL_EPSILON in C - dEq = merge(.True., .False.,abs(a-b) <= merge(tol,eps,present(tol))*maxval(abs([a,b]))) + + implicit none + real(pReal), intent(in) :: a,b + real(pReal), intent(in), optional :: tol + real(pReal), parameter :: eps = 2.220446049250313E-16 ! DBL_EPSILON in C + + dEq = merge(.True., .False.,abs(a-b) <= merge(tol,eps,present(tol))*maxval(abs([a,b]))) end function dEq @@ -198,10 +201,13 @@ end function dEq ! http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm !-------------------------------------------------------------------------------------------------- logical elemental pure function dNeq(a,b,tol) - real(pReal), intent(in) :: a,b - real(pReal), intent(in), optional :: tol - real(pReal), parameter :: eps = 2.2204460492503131E-16 ! DBL_EPSILON in C - dNeq = merge(.False., .True.,abs(a-b) <= merge(tol,eps,present(tol))*maxval(abs([a,b]))) + + implicit none + real(pReal), intent(in) :: a,b + real(pReal), intent(in), optional :: tol + real(pReal), parameter :: eps = 2.220446049250313E-16 ! DBL_EPSILON in C + + dNeq = merge(.False., .True.,abs(a-b) <= merge(tol,eps,present(tol))*maxval(abs([a,b]))) end function dNeq end module prec From 8d285e4190decc738d96b162068dc39a208992c4 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 27 May 2016 11:46:34 +0200 Subject: [PATCH 018/412] removed compiler warnings about conversion and floating point comparison --- code/CPFEM2.f90 | 6 +- code/constitutive.f90 | 2 - code/crystallite.f90 | 30 +++++----- code/damage_local.f90 | 6 +- code/damage_nonlocal.f90 | 13 ++--- code/debug.f90 | 9 +-- code/kinematics_thermal_expansion.f90 | 1 - code/material.f90 | 10 ++-- code/math.f90 | 4 +- code/plastic_dislotwin.f90 | 6 +- code/plastic_nonlocal.f90 | 35 +++++------- code/plastic_phenoplus.f90 | 2 +- code/porosity_phasefield.f90 | 17 +++--- code/prec.f90 | 8 +-- code/spectral_utilities.f90 | 81 +++++++++++++++------------ code/thermal_adiabatic.f90 | 12 ++-- code/thermal_conduction.f90 | 15 ++--- code/vacancyflux_cahnhilliard.f90 | 21 +++---- code/vacancyflux_isochempot.f90 | 6 +- 19 files changed, 139 insertions(+), 145 deletions(-) diff --git a/code/CPFEM2.f90 b/code/CPFEM2.f90 index 51a26dc55..3e926ee71 100644 --- a/code/CPFEM2.f90 +++ b/code/CPFEM2.f90 @@ -43,7 +43,7 @@ subroutine CPFEM_initAll(el,ip) crystallite_init use homogenization, only: & homogenization_init, & -materialpoint_postResults + materialpoint_postResults use IO, only: & IO_init use DAMASK_interface @@ -73,7 +73,7 @@ materialpoint_postResults call crystallite_init call homogenization_init call materialpoint_postResults - call CPFEM_init + call CPFEM_init end subroutine CPFEM_initAll @@ -251,8 +251,6 @@ subroutine CPFEM_general(age, dt) crystallite_Tstar0_v, & crystallite_Tstar_v use homogenization, only: & - materialpoint_F, & - materialpoint_F0, & materialpoint_stressAndItsTangent, & materialpoint_postResults use IO, only: & diff --git a/code/constitutive.f90 b/code/constitutive.f90 index c72af06ca..7d4efd289 100644 --- a/code/constitutive.f90 +++ b/code/constitutive.f90 @@ -604,8 +604,6 @@ subroutine constitutive_LiAndItsTangent(Li, dLi_dTstar3333, dLi_dFi3333, Tstar_v use material, only: & phase_plasticity, & material_phase, & - material_homog, & - phaseAt, phasememberAt, & phase_kinematics, & phase_Nkinematics, & PLASTICITY_isotropic_ID, & diff --git a/code/crystallite.f90 b/code/crystallite.f90 index 60fc373b7..b50c71272 100644 --- a/code/crystallite.f90 +++ b/code/crystallite.f90 @@ -197,8 +197,6 @@ subroutine crystallite_init nMax, & !< maximum number of ip neighbors myNcomponents, & !< number of components at current IP section = 0_pInt, & - j, & - p, & mySize character(len=65536) :: & @@ -511,7 +509,8 @@ end subroutine crystallite_init !-------------------------------------------------------------------------------------------------- subroutine crystallite_stressAndItsTangent(updateJaco) use prec, only: & - tol_math_check + tol_math_check, & + dNeq use numerics, only: & subStepMinCryst, & subStepSizeCryst, & @@ -803,7 +802,7 @@ subroutine crystallite_stressAndItsTangent(updateJaco) endif else subFracIntermediate = maxval(crystallite_subFrac, mask=.not.crystallite_localPlasticity) - if (abs(subFracIntermediate) > tiny(0.0_pReal)) then + if (dNeq(subFracIntermediate,0.0_pReal)) then crystallite_neighborEnforcedCutback = .false. ! look for ips that require a cutback because of a nonconverged neighbor !$OMP PARALLEL !$OMP DO PRIVATE(neighboring_e,neighboring_i) @@ -3352,7 +3351,8 @@ end subroutine crystallite_integrateStateFPI !-------------------------------------------------------------------------------------------------- logical function crystallite_stateJump(ipc,ip,el) use prec, only: & - prec_isNaN + prec_isNaN, & + dNeq use debug, only: & debug_level, & debug_crystallite, & @@ -3404,7 +3404,7 @@ logical function crystallite_stateJump(ipc,ip,el) enddo #ifndef _OPENMP - if (any(plasticState(p)%deltaState(1:mySizePlasticDeltaState,c) /= 0.0_pReal) & + if (any(dNeq(plasticState(p)%deltaState(1:mySizePlasticDeltaState,c),0.0_pReal)) & .and. iand(debug_level(debug_crystallite), debug_levelExtensive) /= 0_pInt & .and. ((el == debug_e .and. ip == debug_i .and. ipc == debug_g) & .or. .not. iand(debug_level(debug_crystallite), debug_levelSelective) /= 0_pInt)) then @@ -3459,7 +3459,8 @@ logical function crystallite_integrateStress(& ) use prec, only: pLongInt, & tol_math_check, & - prec_isNaN + prec_isNaN, & + dEq use numerics, only: nStress, & aTol_crystalliteStress, & rTol_crystalliteStress, & @@ -3607,7 +3608,7 @@ logical function crystallite_integrateStress(& !* inversion of Fp_current... invFp_current = math_inv33(Fp_current) - if (all(abs(invFp_current) <= tiny(0.0_pReal))) then ! math_inv33 returns zero when failed, avoid floating point comparison + failedInversionFp: if (all(dEq(invFp_current,0.0_pReal))) then #ifndef _OPENMP if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then write(6,'(a,i8,1x,a,i8,a,1x,i2,1x,i3)') '<< CRYST >> integrateStress failed on inversion of Fp_current at el (elFE) ip g ',& @@ -3617,13 +3618,12 @@ logical function crystallite_integrateStress(& endif #endif return - endif + endif failedInversionFp A = math_mul33x33(Fg_new,invFp_current) ! intermediate tensor needed later to calculate dFe_dLp !* inversion of Fi_current... - invFi_current = math_inv33(Fi_current) - if (all(abs(invFi_current) <= tiny(0.0_pReal))) then ! math_inv33 returns zero when failed, avoid floating point comparison + failedInversionFi: if (all(dEq(invFi_current,0.0_pReal))) then #ifndef _OPENMP if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then write(6,'(a,i8,1x,a,i8,a,1x,i2,1x,i3)') '<< CRYST >> integrateStress failed on inversion of Fi_current at el (elFE) ip ipc ',& @@ -3633,7 +3633,7 @@ logical function crystallite_integrateStress(& endif #endif return - endif + endif failedInversionFi !* start LpLoop with normal step length @@ -3883,7 +3883,7 @@ logical function crystallite_integrateStress(& invFp_new = math_mul33x33(invFp_current,B) invFp_new = invFp_new / math_det33(invFp_new)**(1.0_pReal/3.0_pReal) ! regularize by det Fp_new = math_inv33(invFp_new) - if (all(abs(Fp_new)<= tiny(0.0_pReal))) then ! math_inv33 returns zero when failed, avoid floating point comparison + failedInversionFp2: if (all(dEq(invFp_new,0.0_pReal))) then #ifndef _OPENMP if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then write(6,'(a,i8,1x,a,i8,a,1x,i2,1x,i3,a,i3)') '<< CRYST >> integrateStress failed on invFp_new inversion at el ip ipc ',& @@ -3895,7 +3895,7 @@ logical function crystallite_integrateStress(& endif #endif return - endif + endif failedInversionFp2 Fe_new = math_mul33x33(math_mul33x33(Fg_new,invFp_new),invFi_new) ! calc resulting Fe !* calculate 1st Piola-Kirchhoff stress @@ -4116,7 +4116,7 @@ function crystallite_postResults(ipc, ip, el) mySize = 1_pInt detF = math_det33(crystallite_partionedF(1:3,1:3,ipc,ip,el)) ! V_current = det(F) * V_reference crystallite_postResults(c+1) = detF * mesh_ipVolume(ip,el) & - / homogenization_Ngrains(mesh_element(3,el)) ! grain volume (not fraction but absolute) + / real(homogenization_Ngrains(mesh_element(3,el)),pReal) ! grain volume (not fraction but absolute) case (orientation_ID) mySize = 4_pInt crystallite_postResults(c+1:c+mySize) = crystallite_orientation(1:4,ipc,ip,el) ! grain orientation as quaternion diff --git a/code/damage_local.f90 b/code/damage_local.f90 index 1437213d7..b604c2be4 100644 --- a/code/damage_local.f90 +++ b/code/damage_local.f90 @@ -223,7 +223,7 @@ subroutine damage_local_getSourceAndItsTangent(phiDot, dPhiDot_dPhi, phi, ip, el use material, only: & homogenization_Ngrains, & mappingHomogenization, & - phaseAt, phasememberAt, & + phaseAt, & phase_source, & phase_Nsources, & SOURCE_damage_isoBrittle_ID, & @@ -280,8 +280,8 @@ subroutine damage_local_getSourceAndItsTangent(phiDot, dPhiDot_dPhi, phi, ip, el enddo enddo - phiDot = phiDot/homogenization_Ngrains(mappingHomogenization(2,ip,el)) - dPhiDot_dPhi = dPhiDot_dPhi/homogenization_Ngrains(mappingHomogenization(2,ip,el)) + phiDot = phiDot/real(homogenization_Ngrains(mappingHomogenization(2,ip,el)),pReal) + dPhiDot_dPhi = dPhiDot_dPhi/real(homogenization_Ngrains(mappingHomogenization(2,ip,el)),pReal) end subroutine damage_local_getSourceAndItsTangent diff --git a/code/damage_nonlocal.f90 b/code/damage_nonlocal.f90 index 86805c21b..65d012705 100644 --- a/code/damage_nonlocal.f90 +++ b/code/damage_nonlocal.f90 @@ -184,7 +184,7 @@ subroutine damage_nonlocal_getSourceAndItsTangent(phiDot, dPhiDot_dPhi, phi, ip, use material, only: & homogenization_Ngrains, & mappingHomogenization, & - phaseAt, phasememberAt, & + phaseAt, & phase_source, & phase_Nsources, & SOURCE_damage_isoBrittle_ID, & @@ -241,8 +241,8 @@ subroutine damage_nonlocal_getSourceAndItsTangent(phiDot, dPhiDot_dPhi, phi, ip, enddo enddo - phiDot = phiDot/homogenization_Ngrains(mappingHomogenization(2,ip,el)) - dPhiDot_dPhi = dPhiDot_dPhi/homogenization_Ngrains(mappingHomogenization(2,ip,el)) + phiDot = phiDot/real(homogenization_Ngrains(mappingHomogenization(2,ip,el)),pReal) + dPhiDot_dPhi = dPhiDot_dPhi/real(homogenization_Ngrains(mappingHomogenization(2,ip,el)),pReal) end subroutine damage_nonlocal_getSourceAndItsTangent @@ -279,9 +279,7 @@ function damage_nonlocal_getDiffusion33(ip,el) enddo damage_nonlocal_getDiffusion33 = & - charLength*charLength* & - damage_nonlocal_getDiffusion33/ & - homogenization_Ngrains(homog) + charLength**2_pInt*damage_nonlocal_getDiffusion33/real(homogenization_Ngrains(homog),pReal) end function damage_nonlocal_getDiffusion33 @@ -310,7 +308,8 @@ real(pReal) function damage_nonlocal_getMobility(ip,el) damage_nonlocal_getMobility = damage_nonlocal_getMobility + lattice_DamageMobility(material_phase(ipc,ip,el)) enddo - damage_nonlocal_getMobility = damage_nonlocal_getMobility /homogenization_Ngrains(mesh_element(3,el)) + damage_nonlocal_getMobility = damage_nonlocal_getMobility/& + real(homogenization_Ngrains(mesh_element(3,el)),pReal) end function damage_nonlocal_getMobility diff --git a/code/debug.f90 b/code/debug.f90 index 01020dd39..21a5443fe 100644 --- a/code/debug.f90 +++ b/code/debug.f90 @@ -46,10 +46,10 @@ module debug integer(pInt),protected, dimension(debug_maxNtype+2_pInt), public :: & ! specific ones, and 2 for "all" and "other" debug_level = 0_pInt - integer(pInt), public :: & - debug_cumLpCalls = 0_pInt, & !< total number of calls to LpAndItsTangent - debug_cumDeltaStateCalls = 0_pInt, & !< total number of calls to deltaState - debug_cumDotStateCalls = 0_pInt !< total number of calls to dotState + integer(pLongInt), public :: & + debug_cumLpCalls = 0_pLongInt, & !< total number of calls to LpAndItsTangent + debug_cumDeltaStateCalls = 0_pLongInt, & !< total number of calls to deltaState + debug_cumDotStateCalls = 0_pLongInt !< total number of calls to dotState integer(pInt), protected, public :: & debug_e = 1_pInt, & @@ -67,6 +67,7 @@ module debug debug_jacobianMaxLocation = 0_pInt, & debug_jacobianMinLocation = 0_pInt + integer(pInt), dimension(:), allocatable, public :: & debug_CrystalliteLoopDistribution, & !< distribution of crystallite cutbacks debug_MaterialpointStateLoopDistribution, & diff --git a/code/kinematics_thermal_expansion.f90 b/code/kinematics_thermal_expansion.f90 index c5a221a7b..572fd91af 100644 --- a/code/kinematics_thermal_expansion.f90 +++ b/code/kinematics_thermal_expansion.f90 @@ -77,7 +77,6 @@ subroutine kinematics_thermal_expansion_init(fileUnit) integer(pInt) :: maxNinstance,phase,instance,kinematics character(len=65536) :: & tag = '', & - output = '', & line = '' mainProcess: if (worldrank == 0) then diff --git a/code/material.f90 b/code/material.f90 index 40c403b8c..37d5741dd 100644 --- a/code/material.f90 +++ b/code/material.f90 @@ -1232,6 +1232,8 @@ end subroutine material_parseTexture !! calculates the volume of the grains and deals with texture components and hybridIA !-------------------------------------------------------------------------------------------------- subroutine material_populateGrains + use prec, only: & + dEq use math, only: & math_RtoEuler, & math_EulerToR, & @@ -1451,7 +1453,7 @@ subroutine material_populateGrains texture_Fiber( 5,t,textureID)) enddo constituentGrain = & - constituentGrain + int(myNorientations*texture_fiber(6,t,textureID),pInt) ! advance counter for grains of current constituent + constituentGrain + int(real(myNorientations,pReal)*texture_fiber(6,t,textureID),pInt) ! advance counter for grains of current constituent enddo fiber random: do constituentGrain = constituentGrain+1_pInt,myNorientations ! fill remainder with random @@ -1462,7 +1464,7 @@ subroutine material_populateGrains else orientationOfGrain(1:3,grain+1_pInt:grain+myNorientations) = & IO_hybridIA(myNorientations,texture_ODFfile(textureID)) - if (all(orientationOfGrain(1:3,grain+1_pInt) == -1.0_pReal)) call IO_error(156_pInt) + if (all(dEq(orientationOfGrain(1:3,grain+1_pInt),-1.0_pReal))) call IO_error(156_pInt) endif !-------------------------------------------------------------------------------------------------- @@ -1501,7 +1503,7 @@ subroutine material_populateGrains do j = 1_pInt,NgrainsOfConstituent(i)-1_pInt ! walk thru grains of current constituent call random_number(rnd) - t = nint(rnd*(NgrainsOfConstituent(i)-j)+j+0.5_pReal,pInt) ! select a grain in remaining list + t = nint(rnd*real(NgrainsOfConstituent(i)-j,pReal)+real(j,pReal)+0.5_pReal,pInt) ! select a grain in remaining list m = phaseOfGrain(grain+t) ! exchange current with random phaseOfGrain(grain+t) = phaseOfGrain(grain+j) phaseOfGrain(grain+j) = m @@ -1539,7 +1541,7 @@ subroutine material_populateGrains randomOrder = math_range(microstructure_maxNconstituents) ! start out with ordered sequence of constituents call random_number(rndArray) ! as many rnd numbers as (max) constituents do j = 1_pInt, myNconstituents - 1_pInt ! loop over constituents ... - r = nint(rndArray(j)*(myNconstituents-j)+j+0.5_pReal,pInt) ! ... select one in remaining list + r = nint(rndArray(j)*real(myNconstituents-j,pReal)+real(j,pReal)+0.5_pReal,pInt) ! ... select one in remaining list c = randomOrder(r) ! ... call it "c" randomOrder(r) = randomOrder(j) ! ... and exchange with present position in constituent list grain = sum(NgrainsOfConstituent(1:c-1_pInt)) ! figure out actual starting index in overall/consecutive grain population diff --git a/code/math.f90 b/code/math.f90 index 401e46630..a5a525461 100644 --- a/code/math.f90 +++ b/code/math.f90 @@ -723,6 +723,8 @@ end function math_transpose33 ! returns all zeroes if not possible, i.e. if det close to zero !-------------------------------------------------------------------------------------------------- pure function math_inv33(A) + use prec, only: & + dNeq implicit none real(pReal),dimension(3,3),intent(in) :: A @@ -735,7 +737,7 @@ pure function math_inv33(A) DetA = A(1,1) * math_inv33(1,1) + A(1,2) * math_inv33(2,1) + A(1,3) * math_inv33(3,1) - if (abs(DetA) > tiny(DetA)) then ! use a real threshold here + if (dNeq(DetA,0.0_pReal)) then math_inv33(1,2) = -A(1,2) * A(3,3) + A(1,3) * A(3,2) math_inv33(2,2) = A(1,1) * A(3,3) - A(1,3) * A(3,1) math_inv33(3,2) = -A(1,1) * A(3,2) + A(1,2) * A(3,1) diff --git a/code/plastic_dislotwin.f90 b/code/plastic_dislotwin.f90 index b9ffde804..ebee2738a 100644 --- a/code/plastic_dislotwin.f90 +++ b/code/plastic_dislotwin.f90 @@ -199,6 +199,8 @@ contains !-------------------------------------------------------------------------------------------------- subroutine plastic_dislotwin_init(fileUnit) use, intrinsic :: iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment) + use prec, only: & + dNeq use debug, only: & debug_level,& debug_constitutive,& @@ -773,8 +775,8 @@ subroutine plastic_dislotwin_init(fileUnit) if (plastic_dislotwin_sbVelocity(instance) > 0.0_pReal .and. & plastic_dislotwin_pShearBand(instance) <= 0.0_pReal) & call IO_error(211_pInt,el=instance,ext_msg='pShearBand ('//PLASTICITY_DISLOTWIN_label//')') - if (abs(plastic_dislotwin_dipoleFormationFactor(instance)) > tiny(0.0_pReal) .and. & - plastic_dislotwin_dipoleFormationFactor(instance) /= 1.0_pReal) & + if (dNeq(plastic_dislotwin_dipoleFormationFactor(instance), 0.0_pReal) .and. & + dNeq(plastic_dislotwin_dipoleFormationFactor(instance), 1.0_pReal)) & call IO_error(211_pInt,el=instance,ext_msg='dipoleFormationFactor ('//PLASTICITY_DISLOTWIN_label//')') if (plastic_dislotwin_sbVelocity(instance) > 0.0_pReal .and. & plastic_dislotwin_qShearBand(instance) <= 0.0_pReal) & diff --git a/code/plastic_nonlocal.f90 b/code/plastic_nonlocal.f90 index b699c57ed..4557ca237 100644 --- a/code/plastic_nonlocal.f90 +++ b/code/plastic_nonlocal.f90 @@ -2382,7 +2382,8 @@ end subroutine plastic_nonlocal_deltaState subroutine plastic_nonlocal_dotState(Tstar_v, Fe, Fp, Temperature, & timestep,subfrac, ip,el) -use prec, only: DAMASK_NaN +use prec, only: DAMASK_NaN, & + dNeq use numerics, only: numerics_integrationMode, & numerics_timeSyncing use IO, only: IO_error @@ -2760,8 +2761,7 @@ if (.not. phase_localPlasticity(material_phase(1_pInt,ip,el))) then endif if (considerEnteringFlux) then - if(numerics_timeSyncing .and. (subfrac(1_pInt,neighbor_ip,neighbor_el) /= subfrac(1_pInt,ip,el))) & - then ! for timesyncing: in case of a timestep at the interface we have to use "state0" to make sure that fluxes n both sides are equal + if(numerics_timeSyncing .and. (dNeq(subfrac(1,neighbor_ip,neighbor_el),subfrac(1,ip,el)))) then ! for timesyncing: in case of a timestep at the interface we have to use "state0" to make sure that fluxes n both sides are equal forall (s = 1:ns, t = 1_pInt:4_pInt) neighbor_v(s,t) = plasticState(np)%state0(iV (s,t,neighbor_instance),no) @@ -3078,13 +3078,11 @@ slipDirection(1:3,1:ns) = lattice_sd(1:3, slipSystemLattice(1:ns,instance), ph) !*** start out fully compatible my_compatibility = 0.0_pReal -forall(s1 = 1_pInt:ns) & - my_compatibility(1:2,s1,s1,1:Nneighbors) = 1.0_pReal - +forall(s1 = 1_pInt:ns) my_compatibility(1:2,s1,s1,1:Nneighbors) = 1.0_pReal !*** Loop thrugh neighbors and check whether there is any my_compatibility. -do n = 1_pInt,Nneighbors +neighbors: do n = 1_pInt,Nneighbors neighbor_e = mesh_ipNeighborhood(1,n,i,e) neighbor_i = mesh_ipNeighborhood(2,n,i,e) @@ -3093,8 +3091,7 @@ do n = 1_pInt,Nneighbors !* Set surface transmissivity to the value specified in the material.config if (neighbor_e <= 0_pInt .or. neighbor_i <= 0_pInt) then - forall(s1 = 1_pInt:ns) & - my_compatibility(1:2,s1,s1,n) = sqrt(surfaceTransmissivity(instance)) + forall(s1 = 1_pInt:ns) my_compatibility(1:2,s1,s1,n) = sqrt(surfaceTransmissivity(instance)) cycle endif @@ -3107,10 +3104,8 @@ do n = 1_pInt,Nneighbors neighbor_phase = material_phase(1,neighbor_i,neighbor_e) if (neighbor_phase /= ph) then - if (.not. phase_localPlasticity(neighbor_phase) .and. .not. phase_localPlasticity(ph)) then - forall(s1 = 1_pInt:ns) & - my_compatibility(1:2,s1,s1,n) = 0.0_pReal ! = sqrt(0.0) - endif + if (.not. phase_localPlasticity(neighbor_phase) .and. .not. phase_localPlasticity(ph))& + forall(s1 = 1_pInt:ns) my_compatibility(1:2,s1,s1,n) = 0.0_pReal cycle endif @@ -3141,33 +3136,33 @@ do n = 1_pInt,Nneighbors else absoluteMisorientation = lattice_qDisorientation(orientation(1:4,1,i,e), & orientation(1:4,1,neighbor_i,neighbor_e)) ! no symmetry - do s1 = 1_pInt,ns ! my slip systems - do s2 = 1_pInt,ns ! my neighbor's slip systems + mySlipSystems: do s1 = 1_pInt,ns + neighborSlipSystems: do s2 = 1_pInt,ns my_compatibility(1,s2,s1,n) = math_mul3x3(slipNormal(1:3,s1), math_qRot(absoluteMisorientation, slipNormal(1:3,s2))) & * abs(math_mul3x3(slipDirection(1:3,s1), math_qRot(absoluteMisorientation, slipDirection(1:3,s2)))) my_compatibility(2,s2,s1,n) = abs(math_mul3x3(slipNormal(1:3,s1), math_qRot(absoluteMisorientation, slipNormal(1:3,s2)))) & * abs(math_mul3x3(slipDirection(1:3,s1), math_qRot(absoluteMisorientation, slipDirection(1:3,s2)))) - enddo + enddo neighborSlipSystems my_compatibilitySum = 0.0_pReal belowThreshold = .true. do while (my_compatibilitySum < 1.0_pReal .and. any(belowThreshold(1:ns))) thresholdValue = maxval(my_compatibility(2,1:ns,s1,n), belowThreshold(1:ns)) ! screws always positive - nThresholdValues = real(count(my_compatibility(2,1:ns,s1,n) == thresholdValue),pReal) + nThresholdValues = real(count(my_compatibility(2,1:ns,s1,n) >= thresholdValue),pReal) where (my_compatibility(2,1:ns,s1,n) >= thresholdValue) & belowThreshold(1:ns) = .false. if (my_compatibilitySum + thresholdValue * nThresholdValues > 1.0_pReal) & - where (abs(my_compatibility(1:2,1:ns,s1,n)) == thresholdValue) & ! MD: rather check below threshold? + where (abs(my_compatibility(1:2,1:ns,s1,n)) >= thresholdValue) & ! MD: rather check below threshold? my_compatibility(1:2,1:ns,s1,n) = sign((1.0_pReal - my_compatibilitySum) & / nThresholdValues, my_compatibility(1:2,1:ns,s1,n)) my_compatibilitySum = my_compatibilitySum + nThresholdValues * thresholdValue enddo where (belowThreshold(1:ns)) my_compatibility(1,1:ns,s1,n) = 0.0_pReal where (belowThreshold(1:ns)) my_compatibility(2,1:ns,s1,n) = 0.0_pReal - enddo ! my slip systems cycle + enddo mySlipSystems endif -enddo ! neighbor cycle +enddo neighbors compatibility(1:2,1:ns,1:ns,1:Nneighbors,i,e) = my_compatibility diff --git a/code/plastic_phenoplus.f90 b/code/plastic_phenoplus.f90 index 0887da239..96ad0d647 100644 --- a/code/plastic_phenoplus.f90 +++ b/code/plastic_phenoplus.f90 @@ -873,7 +873,7 @@ subroutine plastic_phenoplus_microstructure(orientation,ipc,ip,el) ENDDO LOOPFINDNEISHEAR !***calculate the average accumulative shear and use it as cutoff - avg_acshear_ne = SUM(ne_acshear)/ns + avg_acshear_ne = sum(ne_acshear)/real(ns,pReal) !*** IF (ph==neighbor_ph) THEN diff --git a/code/porosity_phasefield.f90 b/code/porosity_phasefield.f90 index ec7e4c341..b41ae2756 100644 --- a/code/porosity_phasefield.f90 +++ b/code/porosity_phasefield.f90 @@ -210,8 +210,7 @@ function porosity_phasefield_getFormationEnergy(ip,el) enddo porosity_phasefield_getFormationEnergy = & - porosity_phasefield_getFormationEnergy/ & - homogenization_Ngrains(mesh_element(3,el)) + porosity_phasefield_getFormationEnergy/real(homogenization_Ngrains(mesh_element(3,el)),pReal) end function porosity_phasefield_getFormationEnergy @@ -243,8 +242,7 @@ function porosity_phasefield_getSurfaceEnergy(ip,el) enddo porosity_phasefield_getSurfaceEnergy = & - porosity_phasefield_getSurfaceEnergy/ & - homogenization_Ngrains(mesh_element(3,el)) + porosity_phasefield_getSurfaceEnergy/real(homogenization_Ngrains(mesh_element(3,el)),pReal) end function porosity_phasefield_getSurfaceEnergy @@ -308,7 +306,7 @@ subroutine porosity_phasefield_getSourceAndItsTangent(phiDot, dPhiDot_dPhi, phi, enddo W_e = W_e + sum(abs(strain*math_mul66x6(C,strain))) enddo - W_e = W_e/homogenization_Ngrains(homog) + W_e = W_e/real(homogenization_Ngrains(homog),pReal) phiDot = 2.0_pReal*(1.0_pReal - phi)*(1.0_pReal - Cv)*(1.0_pReal - Cv) - & 2.0_pReal*phi*(W_e + Cv*porosity_phasefield_getFormationEnergy(ip,el))/ & @@ -350,8 +348,7 @@ function porosity_phasefield_getDiffusion33(ip,el) enddo porosity_phasefield_getDiffusion33 = & - porosity_phasefield_getDiffusion33/ & - homogenization_Ngrains(homog) + porosity_phasefield_getDiffusion33/real(homogenization_Ngrains(homog),pReal) end function porosity_phasefield_getDiffusion33 @@ -377,10 +374,12 @@ real(pReal) function porosity_phasefield_getMobility(ip,el) porosity_phasefield_getMobility = 0.0_pReal do ipc = 1, homogenization_Ngrains(mesh_element(3,el)) - porosity_phasefield_getMobility = porosity_phasefield_getMobility + lattice_PorosityMobility(material_phase(ipc,ip,el)) + porosity_phasefield_getMobility = porosity_phasefield_getMobility & + + lattice_PorosityMobility(material_phase(ipc,ip,el)) enddo - porosity_phasefield_getMobility = porosity_phasefield_getMobility/homogenization_Ngrains(mesh_element(3,el)) + porosity_phasefield_getMobility = & + porosity_phasefield_getMobility/real(homogenization_Ngrains(mesh_element(3,el)),pReal) end function porosity_phasefield_getMobility diff --git a/code/prec.f90 b/code/prec.f90 index f3cba540a..d9375bafa 100644 --- a/code/prec.f90 +++ b/code/prec.f90 @@ -21,10 +21,10 @@ module prec #if (FLOAT==8) integer, parameter, public :: pReal = 8 !< floating point double precision (was selected_real_kind(15,300), number with 15 significant digits, up to 1e+-300) #ifdef __INTEL_COMPILER - real(pReal), parameter, public :: DAMASK_NaN = Z'7FF8000000000000' !< quiet NaN for double precision (from http://www.hpc.unimelb.edu.au/doc/f90lrm/dfum_035.html, copy can be found in documentation/Code/Fortran) + real(pReal), parameter, public :: DAMASK_NaN = Z'7FF8000000000000' !< quiet NaN for double precision (from http://www.hpc.unimelb.edu.au/doc/f90lrm/dfum_035.html) #endif #ifdef __GFORTRAN__ - real(pReal), parameter, public :: DAMASK_NaN = real(Z'7FF8000000000000',pReal) !< quiet NaN for double precision (from http://www.hpc.unimelb.edu.au/doc/f90lrm/dfum_035.html, copy can be found in documentation/Code/Fortran) + real(pReal), parameter, public :: DAMASK_NaN = real(Z'7FF8000000000000',pReal) !< quiet NaN for double precision (from http://www.hpc.unimelb.edu.au/doc/f90lrm/dfum_035.html) #endif #else NO SUITABLE PRECISION FOR REAL SELECTED, STOPPING COMPILATION @@ -189,7 +189,7 @@ logical elemental pure function dEq(a,b,tol) implicit none real(pReal), intent(in) :: a,b real(pReal), intent(in), optional :: tol - real(pReal), parameter :: eps = 2.220446049250313E-16 ! DBL_EPSILON in C + real(pReal), parameter :: eps = 2.220446049250313E-16 ! DBL_EPSILON in C dEq = merge(.True., .False.,abs(a-b) <= merge(tol,eps,present(tol))*maxval(abs([a,b]))) end function dEq @@ -205,7 +205,7 @@ logical elemental pure function dNeq(a,b,tol) implicit none real(pReal), intent(in) :: a,b real(pReal), intent(in), optional :: tol - real(pReal), parameter :: eps = 2.220446049250313E-16 ! DBL_EPSILON in C + real(pReal), parameter :: eps = 2.220446049250313E-16 ! DBL_EPSILON in C dNeq = merge(.False., .True.,abs(a-b) <= merge(tol,eps,present(tol))*maxval(abs([a,b]))) end function dNeq diff --git a/code/spectral_utilities.f90 b/code/spectral_utilities.f90 index 8344ff7ce..2979fb52e 100644 --- a/code/spectral_utilities.f90 +++ b/code/spectral_utilities.f90 @@ -102,8 +102,6 @@ module spectral_utilities real(pReal) :: density end type tSolutionParams - type(tSolutionParams), private :: params - type, public :: phaseFieldDataBin !< set of parameters defining a phase field real(pReal) :: diffusion = 0.0_pReal, & !< thermal conductivity mobility = 0.0_pReal, & !< thermal mobility @@ -265,8 +263,9 @@ subroutine utilities_init() enddo elseif (divergence_correction == 2_pInt) then do j = 1_pInt, 3_pInt - if (j /= minloc(geomSize/grid,1) .and. j /= maxloc(geomSize/grid,1)) & - scaledGeomSize = geomSize/geomSize(j)*grid(j) + if ( j /= int(minloc(geomSize/real(grid,pReal),1),pInt) & + .and. j /= int(maxloc(geomSize/real(grid,pReal),1),pInt)) & + scaledGeomSize = geomSize/geomSize(j)*real(grid(j),pReal) enddo else scaledGeomSize = geomSize @@ -543,7 +542,7 @@ subroutine utilities_fourierGammaConvolution(fieldAim) integer(pInt) :: & i, j, k, & l, m, n, o - logical :: ierr + logical :: err if (worldrank == 0_pInt) then @@ -563,7 +562,7 @@ subroutine utilities_fourierGammaConvolution(fieldAim) matA(1:3,1:3) = real(temp33_complex); matA(4:6,4:6) = real(temp33_complex) matA(1:3,4:6) = aimag(temp33_complex); matA(4:6,1:3) = -aimag(temp33_complex) if (abs(math_det33(matA(1:3,1:3))) > 1e-16) then - call math_invert(6_pInt, matA, matInvA, ierr) + call math_invert(6_pInt, matA, matInvA, err) temp33_complex = cmplx(matInvA(1:3,1:3),matInvA(1:3,4:6),pReal) forall(l=1_pInt:3_pInt, m=1_pInt:3_pInt, n=1_pInt:3_pInt, o=1_pInt:3_pInt) & gamma_hat(l,m,n,o,1,1,1) = temp33_complex(l,n)*conjg(-xi1st(o,i,j,k))*xi1st(m,i,j,k) @@ -623,6 +622,8 @@ end subroutine utilities_fourierGreenConvolution !> @brief calculate root mean square of divergence of field_fourier !-------------------------------------------------------------------------------------------------- real(pReal) function utilities_divergenceRMS() + use IO, only: & + IO_error use numerics, only: & worldrank use mesh, only: & @@ -631,8 +632,8 @@ real(pReal) function utilities_divergenceRMS() grid3 implicit none - integer(pInt) :: i, j, k - PetscErrorCode :: ierr + integer(pInt) :: i, j, k, ierr + complex(pReal), dimension(3) :: rescaledGeom external :: & MPI_Allreduce @@ -641,6 +642,7 @@ real(pReal) function utilities_divergenceRMS() write(6,'(/,a)') ' ... calculating divergence ................................................' flush(6) endif + rescaledGeom = cmplx(geomSize/scaledGeomSize,0.0_pReal) !-------------------------------------------------------------------------------------------------- ! calculating RMS divergence criterion in Fourier space @@ -648,23 +650,24 @@ real(pReal) function utilities_divergenceRMS() do k = 1_pInt, grid3; do j = 1_pInt, grid(2) do i = 2_pInt, grid1Red -1_pInt ! Has somewhere a conj. complex counterpart. Therefore count it twice. utilities_divergenceRMS = utilities_divergenceRMS & - + 2.0_pReal*(sum (real(matmul(tensorField_fourier(1:3,1:3,i,j,k),& ! (sqrt(real(a)**2 + aimag(a)**2))**2 = real(a)**2 + aimag(a)**2. do not take square root and square again - conjg(-xi1st(1:3,i,j,k))*geomSize/scaledGeomSize))**2.0_pReal)& ! --> sum squared L_2 norm of vector + + 2.0_pReal*(sum (real(matmul(tensorField_fourier(1:3,1:3,i,j,k),& ! (sqrt(real(a)**2 + aimag(a)**2))**2 = real(a)**2 + aimag(a)**2. do not take square root and square again + conjg(-xi1st(1:3,i,j,k))*rescaledGeom))**2.0_pReal)& ! --> sum squared L_2 norm of vector +sum(aimag(matmul(tensorField_fourier(1:3,1:3,i,j,k),& - conjg(-xi1st(1:3,i,j,k))*geomSize/scaledGeomSize))**2.0_pReal)) + conjg(-xi1st(1:3,i,j,k))*rescaledGeom))**2.0_pReal)) enddo utilities_divergenceRMS = utilities_divergenceRMS & ! these two layers (DC and Nyquist) do not have a conjugate complex counterpart (if grid(1) /= 1) + sum( real(matmul(tensorField_fourier(1:3,1:3,1 ,j,k), & - conjg(-xi1st(1:3,1,j,k))*geomSize/scaledGeomSize))**2.0_pReal) & + conjg(-xi1st(1:3,1,j,k))*rescaledGeom))**2.0_pReal) & + sum(aimag(matmul(tensorField_fourier(1:3,1:3,1 ,j,k), & - conjg(-xi1st(1:3,1,j,k))*geomSize/scaledGeomSize))**2.0_pReal) & + conjg(-xi1st(1:3,1,j,k))*rescaledGeom))**2.0_pReal) & + sum( real(matmul(tensorField_fourier(1:3,1:3,grid1Red,j,k), & - conjg(-xi1st(1:3,grid1Red,j,k))*geomSize/scaledGeomSize))**2.0_pReal) & + conjg(-xi1st(1:3,grid1Red,j,k))*rescaledGeom))**2.0_pReal) & + sum(aimag(matmul(tensorField_fourier(1:3,1:3,grid1Red,j,k), & - conjg(-xi1st(1:3,grid1Red,j,k))*geomSize/scaledGeomSize))**2.0_pReal) + conjg(-xi1st(1:3,grid1Red,j,k))*rescaledGeom))**2.0_pReal) enddo; enddo if(grid(1) == 1_pInt) utilities_divergenceRMS = utilities_divergenceRMS * 0.5_pReal ! counted twice in case of grid(1) == 1 call MPI_Allreduce(MPI_IN_PLACE,utilities_divergenceRMS,1,MPI_DOUBLE,MPI_SUM,PETSC_COMM_WORLD,ierr) + if(ierr /=0_pInt) call IO_error(894_pInt, ext_msg='utilities_divergenceRMS') utilities_divergenceRMS = sqrt(utilities_divergenceRMS) * wgt ! RMS in real space calculated with Parsevals theorem from Fourier space @@ -675,6 +678,8 @@ end function utilities_divergenceRMS !> @brief calculate max of curl of field_fourier !-------------------------------------------------------------------------------------------------- real(pReal) function utilities_curlRMS() + use IO, only: & + IO_error use numerics, only: & worldrank use mesh, only: & @@ -683,9 +688,9 @@ real(pReal) function utilities_curlRMS() grid3 implicit none - integer(pInt) :: i, j, k, l - complex(pReal), dimension(3,3) :: curl_fourier - PetscErrorCode :: ierr + integer(pInt) :: i, j, k, l, ierr + complex(pReal), dimension(3,3) :: curl_fourier + complex(pReal), dimension(3) :: rescaledGeom external :: & MPI_Reduce, & @@ -695,47 +700,49 @@ real(pReal) function utilities_curlRMS() write(6,'(/,a)') ' ... calculating curl ......................................................' flush(6) endif + rescaledGeom = cmplx(geomSize/scaledGeomSize,0.0_pReal) - !-------------------------------------------------------------------------------------------------- +!-------------------------------------------------------------------------------------------------- ! calculating max curl criterion in Fourier space utilities_curlRMS = 0.0_pReal do k = 1_pInt, grid3; do j = 1_pInt, grid(2); do i = 2_pInt, grid1Red - 1_pInt do l = 1_pInt, 3_pInt - curl_fourier(l,1) = (+tensorField_fourier(l,3,i,j,k)*xi1st(2,i,j,k)*geomSize(2)/scaledGeomSize(2) & - -tensorField_fourier(l,2,i,j,k)*xi1st(3,i,j,k)*geomSize(3)/scaledGeomSize(3)) - curl_fourier(l,2) = (+tensorField_fourier(l,1,i,j,k)*xi1st(3,i,j,k)*geomSize(3)/scaledGeomSize(3) & - -tensorField_fourier(l,3,i,j,k)*xi1st(1,i,j,k)*geomSize(1)/scaledGeomSize(1)) - curl_fourier(l,3) = (+tensorField_fourier(l,2,i,j,k)*xi1st(1,i,j,k)*geomSize(1)/scaledGeomSize(1) & - -tensorField_fourier(l,1,i,j,k)*xi1st(2,i,j,k)*geomSize(2)/scaledGeomSize(2)) + curl_fourier(l,1) = (+tensorField_fourier(l,3,i,j,k)*xi1st(2,i,j,k)*rescaledGeom(2) & + -tensorField_fourier(l,2,i,j,k)*xi1st(3,i,j,k)*rescaledGeom(3)) + curl_fourier(l,2) = (+tensorField_fourier(l,1,i,j,k)*xi1st(3,i,j,k)*rescaledGeom(3) & + -tensorField_fourier(l,3,i,j,k)*xi1st(1,i,j,k)*rescaledGeom(1)) + curl_fourier(l,3) = (+tensorField_fourier(l,2,i,j,k)*xi1st(1,i,j,k)*rescaledGeom(1) & + -tensorField_fourier(l,1,i,j,k)*xi1st(2,i,j,k)*rescaledGeom(2)) enddo utilities_curlRMS = utilities_curlRMS + & 2.0_pReal*sum(real(curl_fourier)**2.0_pReal + aimag(curl_fourier)**2.0_pReal)! Has somewhere a conj. complex counterpart. Therefore count it twice. enddo do l = 1_pInt, 3_pInt - curl_fourier = (+tensorField_fourier(l,3,1,j,k)*xi1st(2,1,j,k)*geomSize(2)/scaledGeomSize(2) & - -tensorField_fourier(l,2,1,j,k)*xi1st(3,1,j,k)*geomSize(3)/scaledGeomSize(3)) - curl_fourier = (+tensorField_fourier(l,1,1,j,k)*xi1st(3,1,j,k)*geomSize(3)/scaledGeomSize(3) & - -tensorField_fourier(l,3,1,j,k)*xi1st(1,1,j,k)*geomSize(1)/scaledGeomSize(1)) - curl_fourier = (+tensorField_fourier(l,2,1,j,k)*xi1st(1,1,j,k)*geomSize(1)/scaledGeomSize(1) & - -tensorField_fourier(l,1,1,j,k)*xi1st(2,1,j,k)*geomSize(2)/scaledGeomSize(2)) + curl_fourier = (+tensorField_fourier(l,3,1,j,k)*xi1st(2,1,j,k)*rescaledGeom(2) & + -tensorField_fourier(l,2,1,j,k)*xi1st(3,1,j,k)*rescaledGeom(3)) + curl_fourier = (+tensorField_fourier(l,1,1,j,k)*xi1st(3,1,j,k)*rescaledGeom(3) & + -tensorField_fourier(l,3,1,j,k)*xi1st(1,1,j,k)*rescaledGeom(1)) + curl_fourier = (+tensorField_fourier(l,2,1,j,k)*xi1st(1,1,j,k)*rescaledGeom(1) & + -tensorField_fourier(l,1,1,j,k)*xi1st(2,1,j,k)*rescaledGeom(2)) enddo utilities_curlRMS = utilities_curlRMS + & sum(real(curl_fourier)**2.0_pReal + aimag(curl_fourier)**2.0_pReal)! this layer (DC) does not have a conjugate complex counterpart (if grid(1) /= 1) do l = 1_pInt, 3_pInt - curl_fourier = (+tensorField_fourier(l,3,grid1Red,j,k)*xi1st(2,grid1Red,j,k)*geomSize(2)/scaledGeomSize(2) & - -tensorField_fourier(l,2,grid1Red,j,k)*xi1st(3,grid1Red,j,k)*geomSize(3)/scaledGeomSize(3)) - curl_fourier = (+tensorField_fourier(l,1,grid1Red,j,k)*xi1st(3,grid1Red,j,k)*geomSize(3)/scaledGeomSize(3) & - -tensorField_fourier(l,3,grid1Red,j,k)*xi1st(1,grid1Red,j,k)*geomSize(1)/scaledGeomSize(1)) - curl_fourier = (+tensorField_fourier(l,2,grid1Red,j,k)*xi1st(1,grid1Red,j,k)*geomSize(1)/scaledGeomSize(1) & - -tensorField_fourier(l,1,grid1Red,j,k)*xi1st(2,grid1Red,j,k)*geomSize(2)/scaledGeomSize(2)) + curl_fourier = (+tensorField_fourier(l,3,grid1Red,j,k)*xi1st(2,grid1Red,j,k)*rescaledGeom(2) & + -tensorField_fourier(l,2,grid1Red,j,k)*xi1st(3,grid1Red,j,k)*rescaledGeom(3)) + curl_fourier = (+tensorField_fourier(l,1,grid1Red,j,k)*xi1st(3,grid1Red,j,k)*rescaledGeom(3) & + -tensorField_fourier(l,3,grid1Red,j,k)*xi1st(1,grid1Red,j,k)*rescaledGeom(1)) + curl_fourier = (+tensorField_fourier(l,2,grid1Red,j,k)*xi1st(1,grid1Red,j,k)*rescaledGeom(1) & + -tensorField_fourier(l,1,grid1Red,j,k)*xi1st(2,grid1Red,j,k)*rescaledGeom(2)) enddo utilities_curlRMS = utilities_curlRMS + & sum(real(curl_fourier)**2.0_pReal + aimag(curl_fourier)**2.0_pReal)! this layer (Nyquist) does not have a conjugate complex counterpart (if grid(1) /= 1) enddo; enddo call MPI_Allreduce(MPI_IN_PLACE,utilities_curlRMS,1,MPI_DOUBLE,MPI_SUM,PETSC_COMM_WORLD,ierr) + if(ierr /=0_pInt) call IO_error(894_pInt, ext_msg='utilities_curlRMS') utilities_curlRMS = sqrt(utilities_curlRMS) * wgt if(grid(1) == 1_pInt) utilities_curlRMS = utilities_curlRMS * 0.5_pReal ! counted twice in case of grid(1) == 1 diff --git a/code/thermal_adiabatic.f90 b/code/thermal_adiabatic.f90 index e2d26fbb1..f4f01f3c3 100644 --- a/code/thermal_adiabatic.f90 +++ b/code/thermal_adiabatic.f90 @@ -236,7 +236,7 @@ subroutine thermal_adiabatic_getSourceAndItsTangent(Tdot, dTdot_dT, T, ip, el) use material, only: & homogenization_Ngrains, & mappingHomogenization, & - phaseAt, phasememberAt, & + phaseAt, & thermal_typeInstance, & phase_Nsources, & phase_source, & @@ -297,8 +297,8 @@ subroutine thermal_adiabatic_getSourceAndItsTangent(Tdot, dTdot_dT, T, ip, el) enddo enddo - Tdot = Tdot/homogenization_Ngrains(homog) - dTdot_dT = dTdot_dT/homogenization_Ngrains(homog) + Tdot = Tdot/real(homogenization_Ngrains(homog),pReal) + dTdot_dT = dTdot_dT/real(homogenization_Ngrains(homog),pReal) end subroutine thermal_adiabatic_getSourceAndItsTangent @@ -336,8 +336,7 @@ function thermal_adiabatic_getSpecificHeat(ip,el) enddo thermal_adiabatic_getSpecificHeat = & - thermal_adiabatic_getSpecificHeat/ & - homogenization_Ngrains(mesh_element(3,el)) + thermal_adiabatic_getSpecificHeat/real(homogenization_Ngrains(mesh_element(3,el)),pReal) end function thermal_adiabatic_getSpecificHeat @@ -375,8 +374,7 @@ function thermal_adiabatic_getMassDensity(ip,el) enddo thermal_adiabatic_getMassDensity = & - thermal_adiabatic_getMassDensity/ & - homogenization_Ngrains(mesh_element(3,el)) + thermal_adiabatic_getMassDensity/real(homogenization_Ngrains(mesh_element(3,el)),pReal) end function thermal_adiabatic_getMassDensity diff --git a/code/thermal_conduction.f90 b/code/thermal_conduction.f90 index c85923050..38e642be4 100644 --- a/code/thermal_conduction.f90 +++ b/code/thermal_conduction.f90 @@ -190,7 +190,7 @@ subroutine thermal_conduction_getSourceAndItsTangent(Tdot, dTdot_dT, T, ip, el) use material, only: & homogenization_Ngrains, & mappingHomogenization, & - phaseAt, phasememberAt, & + phaseAt, & thermal_typeInstance, & phase_Nsources, & phase_source, & @@ -252,8 +252,8 @@ subroutine thermal_conduction_getSourceAndItsTangent(Tdot, dTdot_dT, T, ip, el) enddo enddo - Tdot = Tdot/homogenization_Ngrains(homog) - dTdot_dT = dTdot_dT/homogenization_Ngrains(homog) + Tdot = Tdot/real(homogenization_Ngrains(homog),pReal) + dTdot_dT = dTdot_dT/real(homogenization_Ngrains(homog),pReal) end subroutine thermal_conduction_getSourceAndItsTangent @@ -291,8 +291,7 @@ function thermal_conduction_getConductivity33(ip,el) enddo thermal_conduction_getConductivity33 = & - thermal_conduction_getConductivity33/ & - homogenization_Ngrains(mesh_element(3,el)) + thermal_conduction_getConductivity33/real(homogenization_Ngrains(mesh_element(3,el)),pReal) end function thermal_conduction_getConductivity33 @@ -330,8 +329,7 @@ function thermal_conduction_getSpecificHeat(ip,el) enddo thermal_conduction_getSpecificHeat = & - thermal_conduction_getSpecificHeat/ & - homogenization_Ngrains(mesh_element(3,el)) + thermal_conduction_getSpecificHeat/real(homogenization_Ngrains(mesh_element(3,el)),pReal) end function thermal_conduction_getSpecificHeat @@ -369,8 +367,7 @@ function thermal_conduction_getMassDensity(ip,el) enddo thermal_conduction_getMassDensity = & - thermal_conduction_getMassDensity/ & - homogenization_Ngrains(mesh_element(3,el)) + thermal_conduction_getMassDensity/real(homogenization_Ngrains(mesh_element(3,el)),pReal) end function thermal_conduction_getMassDensity diff --git a/code/vacancyflux_cahnhilliard.f90 b/code/vacancyflux_cahnhilliard.f90 index be68e24a0..5abc923dc 100644 --- a/code/vacancyflux_cahnhilliard.f90 +++ b/code/vacancyflux_cahnhilliard.f90 @@ -219,7 +219,7 @@ subroutine vacancyflux_cahnhilliard_getSourceAndItsTangent(CvDot, dCvDot_dCv, Cv use material, only: & homogenization_Ngrains, & mappingHomogenization, & - phaseAt, phasememberAt, & + phaseAt, & phase_source, & phase_Nsources, & SOURCE_vacancy_phenoplasticity_ID, & @@ -266,8 +266,8 @@ subroutine vacancyflux_cahnhilliard_getSourceAndItsTangent(CvDot, dCvDot_dCv, Cv enddo enddo - CvDot = CvDot/homogenization_Ngrains(mappingHomogenization(2,ip,el)) - dCvDot_dCv = dCvDot_dCv/homogenization_Ngrains(mappingHomogenization(2,ip,el)) + CvDot = CvDot/real(homogenization_Ngrains(mappingHomogenization(2,ip,el)),pReal) + dCvDot_dCv = dCvDot_dCv/real(homogenization_Ngrains(mappingHomogenization(2,ip,el)),pReal) end subroutine vacancyflux_cahnhilliard_getSourceAndItsTangent @@ -301,8 +301,7 @@ function vacancyflux_cahnhilliard_getMobility33(ip,el) enddo vacancyflux_cahnhilliard_getMobility33 = & - vacancyflux_cahnhilliard_getMobility33/ & - homogenization_Ngrains(mesh_element(3,el)) + vacancyflux_cahnhilliard_getMobility33/real(homogenization_Ngrains(mesh_element(3,el)),pReal) end function vacancyflux_cahnhilliard_getMobility33 @@ -336,8 +335,7 @@ function vacancyflux_cahnhilliard_getDiffusion33(ip,el) enddo vacancyflux_cahnhilliard_getDiffusion33 = & - vacancyflux_cahnhilliard_getDiffusion33/ & - homogenization_Ngrains(mesh_element(3,el)) + vacancyflux_cahnhilliard_getDiffusion33/real(homogenization_Ngrains(mesh_element(3,el)),pReal) end function vacancyflux_cahnhilliard_getDiffusion33 @@ -371,8 +369,7 @@ real(pReal) function vacancyflux_cahnhilliard_getFormationEnergy(ip,el) enddo vacancyflux_cahnhilliard_getFormationEnergy = & - vacancyflux_cahnhilliard_getFormationEnergy/ & - homogenization_Ngrains(mesh_element(3,el)) + vacancyflux_cahnhilliard_getFormationEnergy/real(homogenization_Ngrains(mesh_element(3,el)),pReal) end function vacancyflux_cahnhilliard_getFormationEnergy @@ -408,7 +405,7 @@ real(pReal) function vacancyflux_cahnhilliard_getEntropicCoeff(ip,el) vacancyflux_cahnhilliard_getEntropicCoeff = & vacancyflux_cahnhilliard_getEntropicCoeff* & temperature(material_homog(ip,el))%p(thermalMapping(material_homog(ip,el))%p(ip,el))/ & - homogenization_Ngrains(material_homog(ip,el)) + real(homogenization_Ngrains(material_homog(ip,el)),pReal) end function vacancyflux_cahnhilliard_getEntropicCoeff @@ -467,8 +464,8 @@ subroutine vacancyflux_cahnhilliard_KinematicChemPotAndItsTangent(KPot, dKPot_dC enddo enddo - KPot = KPot/homogenization_Ngrains(material_homog(ip,el)) - dKPot_dCv = dKPot_dCv/homogenization_Ngrains(material_homog(ip,el)) + KPot = KPot/real(homogenization_Ngrains(material_homog(ip,el)),pReal) + dKPot_dCv = dKPot_dCv/real(homogenization_Ngrains(material_homog(ip,el)),pReal) end subroutine vacancyflux_cahnhilliard_KinematicChemPotAndItsTangent diff --git a/code/vacancyflux_isochempot.f90 b/code/vacancyflux_isochempot.f90 index 286eb37b7..b5b060a18 100644 --- a/code/vacancyflux_isochempot.f90 +++ b/code/vacancyflux_isochempot.f90 @@ -235,7 +235,7 @@ subroutine vacancyflux_isochempot_getSourceAndItsTangent(CvDot, dCvDot_dCv, Cv, use material, only: & homogenization_Ngrains, & mappingHomogenization, & - phaseAt, phasememberAt, & + phaseAt, & phase_source, & phase_Nsources, & SOURCE_vacancy_phenoplasticity_ID, & @@ -282,8 +282,8 @@ subroutine vacancyflux_isochempot_getSourceAndItsTangent(CvDot, dCvDot_dCv, Cv, enddo enddo - CvDot = CvDot/homogenization_Ngrains(mappingHomogenization(2,ip,el)) - dCvDot_dCv = dCvDot_dCv/homogenization_Ngrains(mappingHomogenization(2,ip,el)) + CvDot = CvDot/real(homogenization_Ngrains(mappingHomogenization(2,ip,el)),pReal) + dCvDot_dCv = dCvDot_dCv/real(homogenization_Ngrains(mappingHomogenization(2,ip,el)),pReal) end subroutine vacancyflux_isochempot_getSourceAndItsTangent From fadf726ef7b026549bea4976f8eca33f86400dec Mon Sep 17 00:00:00 2001 From: Test User Date: Tue, 31 May 2016 17:25:05 +0200 Subject: [PATCH 019/412] updated version information after successful test of v2.0.0-280-ga58e85e --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 14db07f65..1417f948c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.0-278-g4b860fb +v2.0.0-280-ga58e85e From bbf09506e6ab4dc98a498ea777052e04117284b9 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 29 May 2016 10:45:03 +0200 Subject: [PATCH 020/412] using dEq, dNeq, cEq, dEq --- code/crystallite.f90 | 7 ++--- code/homogenization_RGC.f90 | 8 +++--- code/math.f90 | 17 +++++++----- code/plastic_disloUCLA.f90 | 12 +++++---- code/plastic_dislotwin.f90 | 35 ++++++++++++------------ code/plastic_isotropic.f90 | 4 ++- code/plastic_nonlocal.f90 | 35 +++++++++++++++--------- code/plastic_phenoplus.f90 | 12 ++++++--- code/plastic_phenopowerlaw.f90 | 12 ++++++--- code/prec.f90 | 49 +++++++++++++++++++++++++++++----- code/spectral_utilities.f90 | 28 +++++++++++++------ 11 files changed, 149 insertions(+), 70 deletions(-) diff --git a/code/crystallite.f90 b/code/crystallite.f90 index b50c71272..450da5685 100644 --- a/code/crystallite.f90 +++ b/code/crystallite.f90 @@ -843,7 +843,7 @@ subroutine crystallite_stressAndItsTangent(updateJaco) !$OMP DO PRIVATE(neighboring_e,neighboring_i) do e = FEsolving_execElem(1),FEsolving_execElem(2) do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e) - if (.not. crystallite_localPlasticity(1,i,e) .and. abs(crystallite_subFrac(1,i,e)) > tiny(0.0_pReal)) then + if (.not. crystallite_localPlasticity(1,i,e) .and. dNeq(crystallite_subFrac(1,i,e),0.0_pReal)) then do n = 1_pInt,FE_NipNeighbors(FE_celltype(FE_geomtype(mesh_element(2,e)))) neighboring_e = mesh_ipNeighborhood(1,n,i,e) neighboring_i = mesh_ipNeighborhood(2,n,i,e) @@ -3623,6 +3623,7 @@ logical function crystallite_integrateStress(& !* inversion of Fi_current... + invFi_current = math_inv33(Fi_current) failedInversionFi: if (all(dEq(invFi_current,0.0_pReal))) then #ifndef _OPENMP if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then @@ -3883,7 +3884,7 @@ logical function crystallite_integrateStress(& invFp_new = math_mul33x33(invFp_current,B) invFp_new = invFp_new / math_det33(invFp_new)**(1.0_pReal/3.0_pReal) ! regularize by det Fp_new = math_inv33(invFp_new) - failedInversionFp2: if (all(dEq(invFp_new,0.0_pReal))) then + failedInversionInvFp: if (all(dEq(Fp_new,0.0_pReal))) then #ifndef _OPENMP if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then write(6,'(a,i8,1x,a,i8,a,1x,i2,1x,i3,a,i3)') '<< CRYST >> integrateStress failed on invFp_new inversion at el ip ipc ',& @@ -3895,7 +3896,7 @@ logical function crystallite_integrateStress(& endif #endif return - endif failedInversionFp2 + endif failedInversionInvFp Fe_new = math_mul33x33(math_mul33x33(Fg_new,invFp_new),invFi_new) ! calc resulting Fe !* calculate 1st Piola-Kirchhoff stress diff --git a/code/homogenization_RGC.f90 b/code/homogenization_RGC.f90 index 0919b1e5e..3b75ec016 100644 --- a/code/homogenization_RGC.f90 +++ b/code/homogenization_RGC.f90 @@ -386,6 +386,8 @@ end subroutine homogenization_RGC_partitionDeformation ! "happy" with result !-------------------------------------------------------------------------------------------------- function homogenization_RGC_updateState(P,F,F0,avgF,dt,dPdF,ip,el) + use prec, only: & + dEq use debug, only: & debug_level, & debug_homogenization,& @@ -441,10 +443,10 @@ function homogenization_RGC_updateState(P,F,F0,avgF,dt,dPdF,ip,el) real(pReal), dimension(:,:), allocatable :: tract,jmatrix,jnverse,smatrix,pmatrix,rmatrix real(pReal), dimension(:), allocatable :: resid,relax,p_relax,p_resid,drelax - if(abs(dt) < tiny(0.0_pReal)) then ! zero time step - homogenization_RGC_updateState = .true. ! pretend everything is fine and return + zeroTimeStep: if(dEq(dt,0.0_pReal)) then + homogenization_RGC_updateState = .true. ! pretend everything is fine and return return - endif + endif zeroTimeStep !-------------------------------------------------------------------------------------------------- ! get the dimension of the cluster (grains and interfaces) diff --git a/code/math.f90 b/code/math.f90 index a5a525461..12803ba3d 100644 --- a/code/math.f90 +++ b/code/math.f90 @@ -761,6 +761,8 @@ end function math_inv33 ! returns error if not possible, i.e. if det close to zero !-------------------------------------------------------------------------------------------------- pure subroutine math_invert33(A, InvA, DetA, error) + use prec, only: & + dEq implicit none logical, intent(out) :: error @@ -774,7 +776,7 @@ pure subroutine math_invert33(A, InvA, DetA, error) DetA = A(1,1) * InvA(1,1) + A(1,2) * InvA(2,1) + A(1,3) * InvA(3,1) - if (abs(DetA) <= tiny(DetA)) then + if (dEq(DetA,0.0_pReal)) then InvA = 0.0_pReal error = .true. else @@ -1279,6 +1281,8 @@ end function math_qNorm !> @brief quaternion inversion !-------------------------------------------------------------------------------------------------- pure function math_qInv(Q) + use prec, only: & + dNeq implicit none real(pReal), dimension(4), intent(in) :: Q @@ -1288,8 +1292,7 @@ pure function math_qInv(Q) math_qInv = 0.0_pReal squareNorm = math_qDot(Q,Q) - if (abs(squareNorm) > tiny(squareNorm)) & - math_qInv = math_qConj(Q) / squareNorm + if (dNeq(squareNorm,0.0_pReal)) math_qInv = math_qConj(Q) / squareNorm end function math_qInv @@ -2093,6 +2096,8 @@ end function math_eigenvectorBasisSym33 !> @brief rotational part from polar decomposition of 33 tensor m !-------------------------------------------------------------------------------------------------- function math_rotationalPart33(m) + use prec, only: & + dEq use IO, only: & IO_warning @@ -2104,12 +2109,12 @@ function math_rotationalPart33(m) U = math_eigenvectorBasisSym33(math_mul33x33(transpose(m),m)) Uinv = math_inv33(U) - if (all(abs(Uinv) <= tiny(Uinv))) then ! math_inv33 returns zero when failed, avoid floating point equality comparison + inversionFailed: if (all(dEq(Uinv,0.0_pReal))) then math_rotationalPart33 = math_I3 call IO_warning(650_pInt) - else + else inversionFailed math_rotationalPart33 = math_mul33x33(m,Uinv) - endif + endif inversionFailed end function math_rotationalPart33 diff --git a/code/plastic_disloUCLA.f90 b/code/plastic_disloUCLA.f90 index 11863c5c4..0e7105c70 100644 --- a/code/plastic_disloUCLA.f90 +++ b/code/plastic_disloUCLA.f90 @@ -981,7 +981,8 @@ end subroutine plastic_disloUCLA_LpAndItsTangent !-------------------------------------------------------------------------------------------------- subroutine plastic_disloUCLA_dotState(Tstar_v,Temperature,ipc,ip,el) use prec, only: & - tol_math_check + tol_math_check, & + dEq use math, only: & pi use material, only: & @@ -1119,7 +1120,7 @@ subroutine plastic_disloUCLA_dotState(Tstar_v,Temperature,ipc,ip,el) !* Dipole formation EdgeDipMinDistance = & plastic_disloUCLA_CEdgeDipMinDistance(instance)*plastic_disloUCLA_burgersPerSlipSystem(j,instance) - if (abs(tau_slip_pos) <= tiny(0.0_pReal)) then + if (dEq(tau_slip_pos,0.0_pReal)) then DotRhoDipFormation = 0.0_pReal else EdgeDipDistance = & @@ -1147,7 +1148,7 @@ subroutine plastic_disloUCLA_dotState(Tstar_v,Temperature,ipc,ip,el) plastic_disloUCLA_CAtomicVolume(instance)*plastic_disloUCLA_burgersPerSlipSystem(j,instance)**(3.0_pReal) VacancyDiffusion = & plastic_disloUCLA_D0(instance)*exp(-plastic_disloUCLA_Qsd(instance)/(kB*Temperature)) - if (abs(tau_slip_pos) <= tiny(0.0_pReal)) then + if (dEq(tau_slip_pos,0.0_pReal)) then DotRhoEdgeDipClimb = 0.0_pReal else ClimbVelocity = & @@ -1180,7 +1181,8 @@ end subroutine plastic_disloUCLA_dotState !-------------------------------------------------------------------------------------------------- function plastic_disloUCLA_postResults(Tstar_v,Temperature,ipc,ip,el) use prec, only: & - tol_math_check + tol_math_check, & + dEq use math, only: & pi use material, only: & @@ -1408,7 +1410,7 @@ function plastic_disloUCLA_postResults(Tstar_v,Temperature,ipc,ip,el) c = c + ns elseif(plastic_disloUCLA_outputID(o,instance) == stress_exponent_ID) then do j = 1_pInt, ns - if (abs(gdot_slip_pos(j)+gdot_slip_neg(j))<=tiny(0.0_pReal)) then + if (dEq(gdot_slip_pos(j)+gdot_slip_neg(j),0.0_pReal)) then plastic_disloUCLA_postResults(c+j) = 0.0_pReal else plastic_disloUCLA_postResults(c+j) = (tau_slip_pos(j)+tau_slip_neg(j))/& diff --git a/code/plastic_dislotwin.f90 b/code/plastic_dislotwin.f90 index ebee2738a..0902ecad6 100644 --- a/code/plastic_dislotwin.f90 +++ b/code/plastic_dislotwin.f90 @@ -200,6 +200,7 @@ contains subroutine plastic_dislotwin_init(fileUnit) use, intrinsic :: iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment) use prec, only: & + dEq, & dNeq use debug, only: & debug_level,& @@ -751,8 +752,8 @@ subroutine plastic_dislotwin_init(fileUnit) if (plastic_dislotwin_Qsd(instance) <= 0.0_pReal) & call IO_error(211_pInt,el=instance,ext_msg='Qsd ('//PLASTICITY_DISLOTWIN_label//')') if (sum(plastic_dislotwin_Ntwin(:,instance)) > 0_pInt) then - if (abs(plastic_dislotwin_SFE_0K(instance)) <= tiny(0.0_pReal) .and. & - abs(plastic_dislotwin_dSFE_dT(instance)) <= tiny(0.0_pReal) .and. & + if (dEq(plastic_dislotwin_SFE_0K(instance), 0.0_pReal) .and. & + dEq(plastic_dislotwin_dSFE_dT(instance),0.0_pReal) .and. & lattice_structure(phase) == LATTICE_fcc_ID) & call IO_error(211_pInt,el=instance,ext_msg='SFE0K ('//PLASTICITY_DISLOTWIN_label//')') if (plastic_dislotwin_aTolRho(instance) <= 0.0_pReal) & @@ -761,8 +762,8 @@ subroutine plastic_dislotwin_init(fileUnit) call IO_error(211_pInt,el=instance,ext_msg='aTolTwinFrac ('//PLASTICITY_DISLOTWIN_label//')') endif if (sum(plastic_dislotwin_Ntrans(:,instance)) > 0_pInt) then - if (abs(plastic_dislotwin_SFE_0K(instance)) <= tiny(0.0_pReal) .and. & - abs(plastic_dislotwin_dSFE_dT(instance)) <= tiny(0.0_pReal) .and. & + if (dEq(plastic_dislotwin_SFE_0K(instance), 0.0_pReal) .and. & + dEq(plastic_dislotwin_dSFE_dT(instance),0.0_pReal) .and. & lattice_structure(phase) == LATTICE_fcc_ID) & call IO_error(211_pInt,el=instance,ext_msg='SFE0K ('//PLASTICITY_DISLOTWIN_label//')') if (plastic_dislotwin_aTolTransFrac(instance) <= 0.0_pReal) & @@ -1630,7 +1631,8 @@ end subroutine plastic_dislotwin_microstructure !-------------------------------------------------------------------------------------------------- subroutine plastic_dislotwin_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,Temperature,ipc,ip,el) use prec, only: & - tol_math_check + tol_math_check, & + dNeq use math, only: & math_Plain3333to99, & math_Mandel6to33, & @@ -1777,8 +1779,8 @@ subroutine plastic_dislotwin_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,Temperature !-------------------------------------------------------------------------------------------------- ! Shear banding (shearband) part - if(abs(plastic_dislotwin_sbVelocity(instance)) > tiny(0.0_pReal) .and. & - abs(plastic_dislotwin_sbResistance(instance)) > tiny(0.0_pReal)) then + if(dNeq(plastic_dislotwin_sbVelocity(instance), 0.0_pReal) .and. & + dNeq(plastic_dislotwin_sbResistance(instance),0.0_pReal)) then gdot_sb = 0.0_pReal dgdot_dtausb = 0.0_pReal call math_eigenValuesVectorsSym(math_Mandel6to33(Tstar_v),eigValues,eigVectors,error) @@ -1944,7 +1946,8 @@ end subroutine plastic_dislotwin_LpAndItsTangent !-------------------------------------------------------------------------------------------------- subroutine plastic_dislotwin_dotState(Tstar_v,Temperature,ipc,ip,el) use prec, only: & - tol_math_check + tol_math_check, & + dEq use math, only: & pi use material, only: & @@ -2045,7 +2048,7 @@ subroutine plastic_dislotwin_dotState(Tstar_v,Temperature,ipc,ip,el) !* Dipole formation EdgeDipMinDistance = & plastic_dislotwin_CEdgeDipMinDistance(instance)*plastic_dislotwin_burgersPerSlipSystem(j,instance) - if (abs(tau_slip(j)) <= tiny(0.0_pReal)) then + if (dEq(tau_slip(j),0.0_pReal)) then DotRhoDipFormation = 0.0_pReal else EdgeDipDistance = & @@ -2073,10 +2076,10 @@ subroutine plastic_dislotwin_dotState(Tstar_v,Temperature,ipc,ip,el) plastic_dislotwin_CAtomicVolume(instance)*plastic_dislotwin_burgersPerSlipSystem(j,instance)**(3.0_pReal) VacancyDiffusion = & plastic_dislotwin_D0(instance)*exp(-plastic_dislotwin_Qsd(instance)/(kB*Temperature)) - if (abs(tau_slip(j)) <= tiny(0.0_pReal)) then + if (dEq(tau_slip(j),0.0_pReal)) then DotRhoEdgeDipClimb = 0.0_pReal else - if (EdgeDipDistance-EdgeDipMinDistance <= tiny(0.0_pReal)) then + if (dEq(EdgeDipDistance-EdgeDipMinDistance,0.0_pReal)) then DotRhoEdgeDipClimb = 0.0_pReal else ClimbVelocity = 3.0_pReal*lattice_mu(ph)*VacancyDiffusion*AtomicVolume/ & @@ -2191,7 +2194,8 @@ end subroutine plastic_dislotwin_dotState !-------------------------------------------------------------------------------------------------- function plastic_dislotwin_postResults(Tstar_v,Temperature,ipc,ip,el) use prec, only: & - tol_math_check + tol_math_check, & + dEq use math, only: & pi, & math_Mandel6to33, & @@ -2506,11 +2510,8 @@ function plastic_dislotwin_postResults(Tstar_v,Temperature,ipc,ip,el) endif !* Stress exponent - if (abs(gdot_slip(j))<=tiny(0.0_pReal)) then - plastic_dislotwin_postResults(c+j) = 0.0_pReal - else - plastic_dislotwin_postResults(c+j) = (tau/gdot_slip(j))*dgdot_dtauslip - endif + plastic_dislotwin_postResults(c+j) = & + merge(0.0_pReal,(tau/gdot_slip(j))*dgdot_dtauslip,dEq(gdot_slip(j),0.0_pReal)) enddo ; enddo c = c + ns case (sb_eigenvalues_ID) diff --git a/code/plastic_isotropic.f90 b/code/plastic_isotropic.f90 index a074c3862..7d3e1aa7c 100644 --- a/code/plastic_isotropic.f90 +++ b/code/plastic_isotropic.f90 @@ -524,6 +524,8 @@ end subroutine plastic_isotropic_LiAndItsTangent !> @brief calculates the rate of change of microstructure !-------------------------------------------------------------------------------------------------- subroutine plastic_isotropic_dotState(Tstar_v,ipc,ip,el) + use prec, only: & + dEq use math, only: & math_mul6x6 use material, only: & @@ -570,7 +572,7 @@ subroutine plastic_isotropic_dotState(Tstar_v,ipc,ip,el) !-------------------------------------------------------------------------------------------------- ! hardening coefficient if (abs(gamma_dot) > 1e-12_pReal) then - if (abs(param(instance)%tausat_SinhFitA) <= tiny(0.0_pReal)) then + if (dEq(param(instance)%tausat_SinhFitA,0.0_pReal)) then saturation = param(instance)%tausat else saturation = ( param(instance)%tausat & diff --git a/code/plastic_nonlocal.f90 b/code/plastic_nonlocal.f90 index 4557ca237..a6c7acad1 100644 --- a/code/plastic_nonlocal.f90 +++ b/code/plastic_nonlocal.f90 @@ -1549,6 +1549,8 @@ end subroutine plastic_nonlocal_aTolState !> @brief calculates quantities characterizing the microstructure !-------------------------------------------------------------------------------------------------- subroutine plastic_nonlocal_microstructure(Fe, Fp, ip, el) +use prec, only: & + dEq use IO, only: & IO_error use math, only: & @@ -1792,7 +1794,7 @@ if (.not. phase_localPlasticity(ph) .and. shortRangeStressCorrection(instance)) - neighbor_rhoExcess(c,s,neighbors(2)) enddo invConnections = math_inv33(connections) - if (all(abs(invConnections) <= tiny(0.0_pReal))) & ! check for failed in version (math_inv33 returns 0) and avoid floating point equality comparison + if (all(dEq(invConnections,0.0_pReal))) & call IO_error(-1_pInt,ext_msg='back stress calculation: inversion error') rhoExcessGradient(c) = math_mul3x3(m(1:3,s,c), & math_mul33x3(invConnections,rhoExcessDifferences)) @@ -2200,6 +2202,8 @@ end subroutine plastic_nonlocal_LpAndItsTangent !> @brief (instantaneous) incremental change of microstructure !-------------------------------------------------------------------------------------------------- subroutine plastic_nonlocal_deltaState(Tstar_v,ip,el) +use prec, only: & + dNeq use debug, only: debug_level, & debug_constitutive, & debug_levelBasic, & @@ -2322,8 +2326,8 @@ dUpper(1:ns,2) = lattice_mu(ph) * burgers(1:ns,instance) / (4.0_pReal * pi * abs forall (c = 1_pInt:2_pInt) - where(sqrt(rhoSgl(1:ns,2*c-1)+rhoSgl(1:ns,2*c)+& - abs(rhoSgl(1:ns,2*c+3))+abs(rhoSgl(1:ns,2*c+4))+rhoDip(1:ns,c)) >= tiny(0.0_pReal)) & + where(dNeq(sqrt(rhoSgl(1:ns,2*c-1)+rhoSgl(1:ns,2*c)+& + abs(rhoSgl(1:ns,2*c+3))+abs(rhoSgl(1:ns,2*c+4))+rhoDip(1:ns,c)),0.0_pReal)) & dUpper(1:ns,c) = min(1.0_pReal / sqrt(rhoSgl(1:ns,2*c-1) + rhoSgl(1:ns,2*c) & + abs(rhoSgl(1:ns,2*c+3)) + abs(rhoSgl(1:ns,2*c+4)) + rhoDip(1:ns,c)), & dUpper(1:ns,c)) @@ -2335,7 +2339,7 @@ deltaDUpper = dUpper - dUpperOld !*** dissociation by stress increase deltaRhoDipole2SingleStress = 0.0_pReal forall (c=1_pInt:2_pInt, s=1_pInt:ns, deltaDUpper(s,c) < 0.0_pReal .and. & - abs(dUpperOld(s,c) - dLower(s,c)) > tiny(0.0_pReal)) & + dNeq(dUpperOld(s,c) - dLower(s,c),0.0_pReal)) & deltaRhoDipole2SingleStress(s,8_pInt+c) = rhoDip(s,c) * deltaDUpper(s,c) & / (dUpperOld(s,c) - dLower(s,c)) @@ -2383,7 +2387,8 @@ subroutine plastic_nonlocal_dotState(Tstar_v, Fe, Fp, Temperature, & timestep,subfrac, ip,el) use prec, only: DAMASK_NaN, & - dNeq + dNeq, & + dEq use numerics, only: numerics_integrationMode, & numerics_timeSyncing use IO, only: IO_error @@ -2617,8 +2622,8 @@ dUpper(1:ns,1) = lattice_mu(ph) * burgers(1:ns,instance) & dUpper(1:ns,2) = lattice_mu(ph) * burgers(1:ns,instance) & / (4.0_pReal * pi * abs(tau)) forall (c = 1_pInt:2_pInt) - where(sqrt(rhoSgl(1:ns,2*c-1)+rhoSgl(1:ns,2*c)+& - abs(rhoSgl(1:ns,2*c+3))+abs(rhoSgl(1:ns,2*c+4))+rhoDip(1:ns,c)) >= tiny(0.0_pReal)) & + where(dNeq(sqrt(rhoSgl(1:ns,2*c-1)+rhoSgl(1:ns,2*c)+& + abs(rhoSgl(1:ns,2*c+3))+abs(rhoSgl(1:ns,2*c+4))+rhoDip(1:ns,c)),0.0_pReal)) & dUpper(1:ns,c) = min(1.0_pReal / sqrt(rhoSgl(1:ns,2*c-1) + rhoSgl(1:ns,2*c) & + abs(rhoSgl(1:ns,2*c+3)) + abs(rhoSgl(1:ns,2*c+4)) + rhoDip(1:ns,c)), & dUpper(1:ns,c)) @@ -2830,11 +2835,11 @@ if (.not. phase_localPlasticity(material_phase(1_pInt,ip,el))) then my_rhoSgl = rhoSgl my_v = v if(numerics_timeSyncing) then - if (abs(subfrac(1_pInt,ip,el))<= tiny(0.0_pReal)) then + if (dEq(subfrac(1_pInt,ip,el),0.0_pReal)) then my_rhoSgl = rhoSgl0 my_v = v0 elseif (neighbor_n > 0_pInt) then - if (abs(subfrac(1_pInt,neighbor_ip,neighbor_el))<= tiny(0.0_pReal)) then + if (dEq(subfrac(1_pInt,neighbor_ip,neighbor_el),0.0_pReal)) then my_rhoSgl = rhoSgl0 my_v = v0 endif @@ -3172,6 +3177,8 @@ end subroutine plastic_nonlocal_updateCompatibility !* calculates quantities characterizing the microstructure * !********************************************************************* function plastic_nonlocal_dislocationstress(Fe, ip, el) +use prec, only: & + dEq use math, only: math_mul33x33, & math_mul33x3, & math_inv33, & @@ -3384,7 +3391,7 @@ if (.not. phase_localPlasticity(ph)) then Rsquare = R * R Rcube = Rsquare * R denominator = R * (R + flipSign * lambda) - if (abs(denominator)<= tiny(0.0_pReal)) exit ipLoop + if (dEq(denominator,0.0_pReal)) exit ipLoop sigma(1,1) = sigma(1,1) - real(side,pReal) & * flipSign * z / denominator & @@ -3429,7 +3436,7 @@ if (.not. phase_localPlasticity(ph)) then Rsquare = R * R Rcube = Rsquare * R denominator = R * (R + flipSign * lambda) - if (abs(denominator)<= tiny(0.0_pReal)) exit ipLoop + if (dEq(denominator,0.0_pReal)) exit ipLoop sigma(1,2) = sigma(1,2) - real(side,pReal) * flipSign * z & * (1.0_pReal - lattice_nu(ph)) / denominator & @@ -3518,6 +3525,8 @@ end function plastic_nonlocal_dislocationstress !> @brief return array of constitutive results !-------------------------------------------------------------------------------------------------- function plastic_nonlocal_postResults(Tstar_v,Fe,ip,el) + use prec, only: & + dNeq use math, only: & math_mul6x6, & math_mul33x3, & @@ -3634,8 +3643,8 @@ dUpper(1:ns,1) = lattice_mu(ph) * burgers(1:ns,instance) & dUpper(1:ns,2) = lattice_mu(ph) * burgers(1:ns,instance) & / (4.0_pReal * pi * abs(tau)) forall (c = 1_pInt:2_pInt) - where(sqrt(rhoSgl(1:ns,2*c-1)+rhoSgl(1:ns,2*c)+& - abs(rhoSgl(1:ns,2*c+3))+abs(rhoSgl(1:ns,2*c+4))+rhoDip(1:ns,c)) >= tiny(0.0_pReal)) & + where(dNeq(sqrt(rhoSgl(1:ns,2*c-1)+rhoSgl(1:ns,2*c)+& + abs(rhoSgl(1:ns,2*c+3))+abs(rhoSgl(1:ns,2*c+4))+rhoDip(1:ns,c)),0.0_pReal)) & dUpper(1:ns,c) = min(1.0_pReal / sqrt(rhoSgl(1:ns,2*c-1) + rhoSgl(1:ns,2*c) & + abs(rhoSgl(1:ns,2*c+3)) + abs(rhoSgl(1:ns,2*c+4)) + rhoDip(1:ns,c)), & dUpper(1:ns,c)) diff --git a/code/plastic_phenoplus.f90 b/code/plastic_phenoplus.f90 index 96ad0d647..5df3d490b 100644 --- a/code/plastic_phenoplus.f90 +++ b/code/plastic_phenoplus.f90 @@ -112,6 +112,8 @@ contains !-------------------------------------------------------------------------------------------------- subroutine plastic_phenoplus_init(fileUnit) use, intrinsic :: iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment) + use prec, only: & + dEq use debug, only: & debug_level, & debug_constitutive,& @@ -481,7 +483,7 @@ subroutine plastic_phenoplus_init(fileUnit) if (any(plastic_phenoplus_tausat_slip(:,instance) <= 0.0_pReal .and. & plastic_phenoplus_Nslip(:,instance) > 0)) & call IO_error(211_pInt,el=instance,ext_msg='tausat_slip ('//PLASTICITY_PHENOPLUS_label//')') - if (any(abs(plastic_phenoplus_a_slip(instance)) <= tiny(0.0_pReal) .and. & + if (any(dEq(plastic_phenoplus_a_slip(instance),0.0_pReal) .and. & plastic_phenoplus_Nslip(:,instance) > 0)) & call IO_error(211_pInt,el=instance,ext_msg='a_slip ('//PLASTICITY_PHENOPLUS_label//')') if (any(plastic_phenoplus_tau0_twin(:,instance) < 0.0_pReal .and. & @@ -923,6 +925,8 @@ end subroutine plastic_phenoplus_microstructure !> @brief calculates plastic velocity gradient and its tangent !-------------------------------------------------------------------------------------------------- subroutine plastic_phenoplus_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip,el) + use prec, only: & + dNeq use math, only: & math_Plain3333to99, & math_Mandel6to33 @@ -1038,7 +1042,7 @@ subroutine plastic_phenoplus_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip,el) (gdot_slip_pos+gdot_slip_neg)*lattice_Sslip(1:3,1:3,1,index_myFamily+i,ph) ! Calculation of the tangent of Lp - if (abs(gdot_slip_pos) > tiny(0.0_pReal)) then + if (dNeq(gdot_slip_pos,0.0_pReal)) then dgdot_dtauslip_pos = gdot_slip_pos*plastic_phenoplus_n_slip(instance)/tau_slip_pos forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt,m=1_pInt:3_pInt,n=1_pInt:3_pInt) & dLp_dTstar3333(k,l,m,n) = dLp_dTstar3333(k,l,m,n) + & @@ -1046,7 +1050,7 @@ subroutine plastic_phenoplus_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip,el) nonSchmid_tensor(m,n,1) endif - if (abs(gdot_slip_neg) > tiny(0.0_pReal)) then + if (dNeq(gdot_slip_neg,0.0_pReal)) then dgdot_dtauslip_neg = gdot_slip_neg*plastic_phenoplus_n_slip(instance)/tau_slip_neg forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt,m=1_pInt:3_pInt,n=1_pInt:3_pInt) & dLp_dTstar3333(k,l,m,n) = dLp_dTstar3333(k,l,m,n) + & @@ -1073,7 +1077,7 @@ subroutine plastic_phenoplus_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip,el) Lp = Lp + gdot_twin*lattice_Stwin(1:3,1:3,index_myFamily+i,ph) ! Calculation of the tangent of Lp - if (abs(gdot_twin) > tiny(0.0_pReal)) then + if (dNeq(gdot_twin,0.0_pReal)) then dgdot_dtautwin = gdot_twin*plastic_phenoplus_n_twin(instance)/tau_twin forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt,m=1_pInt:3_pInt,n=1_pInt:3_pInt) & dLp_dTstar3333(k,l,m,n) = dLp_dTstar3333(k,l,m,n) + & diff --git a/code/plastic_phenopowerlaw.f90 b/code/plastic_phenopowerlaw.f90 index 8bc86c97d..15b7aa78b 100644 --- a/code/plastic_phenopowerlaw.f90 +++ b/code/plastic_phenopowerlaw.f90 @@ -124,6 +124,8 @@ contains !-------------------------------------------------------------------------------------------------- subroutine plastic_phenopowerlaw_init(fileUnit) use, intrinsic :: iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment) + use prec, only: & + dEq use debug, only: & debug_level, & debug_constitutive,& @@ -487,7 +489,7 @@ subroutine plastic_phenopowerlaw_init(fileUnit) if (any(plastic_phenopowerlaw_tausat_slip(:,instance) <= 0.0_pReal .and. & plastic_phenopowerlaw_Nslip(:,instance) > 0)) & call IO_error(211_pInt,el=instance,ext_msg='tausat_slip ('//PLASTICITY_PHENOPOWERLAW_label//')') - if (any(abs(plastic_phenopowerlaw_a_slip(instance)) <= tiny(0.0_pReal) .and. & + if (any(dEq(plastic_phenopowerlaw_a_slip(instance),0.0_pReal) .and. & plastic_phenopowerlaw_Nslip(:,instance) > 0)) & call IO_error(211_pInt,el=instance,ext_msg='a_slip ('//PLASTICITY_PHENOPOWERLAW_label//')') if (any(plastic_phenopowerlaw_tau0_twin(:,instance) < 0.0_pReal .and. & @@ -774,6 +776,8 @@ end subroutine plastic_phenopowerlaw_aTolState !> @brief calculates plastic velocity gradient and its tangent !-------------------------------------------------------------------------------------------------- subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip,el) + use prec, only: & + dNeq use math, only: & math_Plain3333to99, & math_Mandel6to33 @@ -863,7 +867,7 @@ subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip, (gdot_slip_pos+gdot_slip_neg)*lattice_Sslip(1:3,1:3,1,index_myFamily+i,ph) ! Calculation of the tangent of Lp - if (abs(gdot_slip_pos) > tiny(0.0_pReal)) then + if (dNeq(gdot_slip_pos,0.0_pReal)) then dgdot_dtauslip_pos = gdot_slip_pos*plastic_phenopowerlaw_n_slip(instance)/tau_slip_pos forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt,m=1_pInt:3_pInt,n=1_pInt:3_pInt) & dLp_dTstar3333(k,l,m,n) = dLp_dTstar3333(k,l,m,n) + & @@ -871,7 +875,7 @@ subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip, nonSchmid_tensor(m,n,1) endif - if (abs(gdot_slip_neg) > tiny(0.0_pReal)) then + if (dNeq(gdot_slip_neg,0.0_pReal)) then dgdot_dtauslip_neg = gdot_slip_neg*plastic_phenopowerlaw_n_slip(instance)/tau_slip_neg forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt,m=1_pInt:3_pInt,n=1_pInt:3_pInt) & dLp_dTstar3333(k,l,m,n) = dLp_dTstar3333(k,l,m,n) + & @@ -898,7 +902,7 @@ subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip, Lp = Lp + gdot_twin*lattice_Stwin(1:3,1:3,index_myFamily+i,ph) ! Calculation of the tangent of Lp - if (abs(gdot_twin) > tiny(0.0_pReal)) then + if (dNeq(gdot_twin,0.0_pReal)) then dgdot_dtautwin = gdot_twin*plastic_phenopowerlaw_n_twin(instance)/tau_twin forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt,m=1_pInt:3_pInt,n=1_pInt:3_pInt) & dLp_dTstar3333(k,l,m,n) = dLp_dTstar3333(k,l,m,n) + & diff --git a/code/prec.f90 b/code/prec.f90 index d9375bafa..594201bee 100644 --- a/code/prec.f90 +++ b/code/prec.f90 @@ -115,7 +115,9 @@ module prec prec_init, & prec_isNaN, & dEq, & - dNeq + cEq, & + dNeq, & + cNeq contains @@ -180,23 +182,23 @@ end function prec_isNaN !-------------------------------------------------------------------------------------------------- -!> @brief equality comparison for double precision +!> @brief equality comparison for float with double precision ! replaces "==" but for certain (relative) tolerance. Counterpart to dNeq ! http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm !-------------------------------------------------------------------------------------------------- logical elemental pure function dEq(a,b,tol) implicit none - real(pReal), intent(in) :: a,b + real(pReal), intent(in) :: a,b real(pReal), intent(in), optional :: tol - real(pReal), parameter :: eps = 2.220446049250313E-16 ! DBL_EPSILON in C + real(pReal), parameter :: eps = 2.220446049250313E-16 ! DBL_EPSILON in C dEq = merge(.True., .False.,abs(a-b) <= merge(tol,eps,present(tol))*maxval(abs([a,b]))) end function dEq !-------------------------------------------------------------------------------------------------- -!> @brief inequality comparison for double precision +!> @brief inequality comparison for float with double precision ! replaces "!=" but for certain (relative) tolerance. Counterpart to dEq ! http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm !-------------------------------------------------------------------------------------------------- @@ -205,9 +207,44 @@ logical elemental pure function dNeq(a,b,tol) implicit none real(pReal), intent(in) :: a,b real(pReal), intent(in), optional :: tol - real(pReal), parameter :: eps = 2.220446049250313E-16 ! DBL_EPSILON in C + real(pReal), parameter :: eps = 2.220446049250313E-16 ! DBL_EPSILON in C dNeq = merge(.False., .True.,abs(a-b) <= merge(tol,eps,present(tol))*maxval(abs([a,b]))) end function dNeq +!-------------------------------------------------------------------------------------------------- +!> @brief equality comparison for complex with double precision +! replaces "==" but for certain (relative) tolerance. Counterpart to cNeq +! http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm +! probably a component wise comparison would be more accurate than the comparsion of the absolute +! value +!-------------------------------------------------------------------------------------------------- +logical elemental pure function cEq(a,b,tol) + + implicit none + complex(pReal), intent(in) :: a,b + real(pReal), intent(in), optional :: tol + real(pReal), parameter :: eps = 2.220446049250313E-16 ! DBL_EPSILON in C + + cEq = merge(.True., .False.,abs(a-b) <= merge(tol,eps,present(tol))*maxval(abs([a,b]))) +end function cEq + + +!-------------------------------------------------------------------------------------------------- +!> @brief inequality comparison for complex with double precision +! replaces "!=" but for certain (relative) tolerance. Counterpart to cEq +! http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm +! probably a component wise comparison would be more accurate than the comparsion of the absolute +! value +!-------------------------------------------------------------------------------------------------- +logical elemental pure function cNeq(a,b,tol) + + implicit none + complex(pReal), intent(in) :: a,b + real(pReal), intent(in), optional :: tol + real(pReal), parameter :: eps = 2.220446049250313E-16 ! DBL_EPSILON in C + + cNeq = merge(.False., .True.,abs(a-b) <= merge(tol,eps,present(tol))*maxval(abs([a,b]))) +end function cNeq + end module prec diff --git a/code/spectral_utilities.f90 b/code/spectral_utilities.f90 index 2979fb52e..1bf322843 100644 --- a/code/spectral_utilities.f90 +++ b/code/spectral_utilities.f90 @@ -402,7 +402,7 @@ subroutine utilities_updateGamma(C,saveReference) integer(pInt) :: & i, j, k, & l, m, n, o - logical :: ierr + logical :: err C_ref = C if (saveReference) then @@ -426,7 +426,7 @@ subroutine utilities_updateGamma(C,saveReference) matA(1:3,1:3) = real(temp33_complex); matA(4:6,4:6) = real(temp33_complex) matA(1:3,4:6) = aimag(temp33_complex); matA(4:6,1:3) = -aimag(temp33_complex) if (abs(math_det33(matA(1:3,1:3))) > 1e-16) then - call math_invert(6_pInt, matA, matInvA, ierr) + call math_invert(6_pInt, matA, matInvA, err) temp33_complex = cmplx(matInvA(1:3,1:3),matInvA(1:3,4:6),pReal) forall(l=1_pInt:3_pInt, m=1_pInt:3_pInt, n=1_pInt:3_pInt, o=1_pInt:3_pInt) & gamma_hat(l,m,n,o,i,j,k-grid3Offset) = temp33_complex(l,n)* & @@ -938,6 +938,10 @@ end subroutine utilities_fourierTensorDivergence !-------------------------------------------------------------------------------------------------- subroutine utilities_constitutiveResponse(F_lastInc,F,timeinc, & P,C_volAvg,C_minmaxAvg,P_av,forwardData,rotation_BC) + use prec, only: & + dNeq + use IO, only: & + IO_error use debug, only: & debug_reset, & debug_info @@ -976,10 +980,9 @@ subroutine utilities_constitutiveResponse(F_lastInc,F,timeinc, & age integer(pInt) :: & - j,k + j,k,ierr real(pReal), dimension(3,3,3,3) :: max_dPdF, min_dPdF real(pReal) :: max_dPdF_norm, min_dPdF_norm, defgradDetMin, defgradDetMax, defgradDet - PetscErrorCode :: ierr external :: & MPI_Reduce, & @@ -1013,7 +1016,9 @@ subroutine utilities_constitutiveResponse(F_lastInc,F,timeinc, & defgradDetMin = min(defgradDetMin,defgradDet) end do call MPI_reduce(MPI_IN_PLACE,defgradDetMax,1,MPI_DOUBLE,MPI_MAX,0,PETSC_COMM_WORLD,ierr) + if(ierr /=0_pInt) call IO_error(894_pInt, ext_msg='MPI_Allreduce max') call MPI_reduce(MPI_IN_PLACE,defgradDetMin,1,MPI_DOUBLE,MPI_MIN,0,PETSC_COMM_WORLD,ierr) + if(ierr /=0_pInt) call IO_error(894_pInt, ext_msg='MPI_Allreduce min') if (worldrank == 0_pInt) then write(6,'(a,1x,es11.4)') ' max determinant of deformation =', defgradDetMax write(6,'(a,1x,es11.4)') ' min determinant of deformation =', defgradDetMin @@ -1039,7 +1044,9 @@ subroutine utilities_constitutiveResponse(F_lastInc,F,timeinc, & end do call MPI_Allreduce(MPI_IN_PLACE,max_dPdF,81,MPI_DOUBLE,MPI_MAX,PETSC_COMM_WORLD,ierr) + if(ierr /=0_pInt) call IO_error(894_pInt, ext_msg='MPI_Allreduce max') call MPI_Allreduce(MPI_IN_PLACE,min_dPdF,81,MPI_DOUBLE,MPI_MIN,PETSC_COMM_WORLD,ierr) + if(ierr /=0_pInt) call IO_error(894_pInt, ext_msg='MPI_Allreduce min') C_minmaxAvg = 0.5_pReal*(max_dPdF + min_dPdF) C_volAvg = sum(sum(materialpoint_dPdF,dim=6),dim=5) * wgt @@ -1194,6 +1201,10 @@ end function utilities_getFreqDerivative ! convolution !-------------------------------------------------------------------------------------------------- subroutine utilities_updateIPcoords(F) + use prec, only: & + cNeq + use IO, only: & + IO_error use math, only: & math_mul33x3 use mesh, only: & @@ -1205,10 +1216,9 @@ subroutine utilities_updateIPcoords(F) implicit none real(pReal), dimension(3,3,grid(1),grid(2),grid3), intent(in) :: F - integer(pInt) :: i, j, k, m + integer(pInt) :: i, j, k, m, ierr real(pReal), dimension(3) :: step, offset_coords real(pReal), dimension(3,3) :: Favg - PetscErrorCode :: ierr external & MPI_Bcast @@ -1219,8 +1229,8 @@ subroutine utilities_updateIPcoords(F) call utilities_FFTtensorForward() call utilities_fourierTensorDivergence() - do k = 1_pInt, grid3; do j = 1_pInt, grid(2) ;do i = 1_pInt, grid1Red - if (any(abs(xi1st(1:3,i,j,k)) > tiny(0.0_pReal))) & + do k = 1_pInt, grid3; do j = 1_pInt, grid(2); do i = 1_pInt, grid1Red + if (any(cNeq(xi1st(1:3,i,j,k),cmplx(0.0_pReal,0.0_pReal)))) & vectorField_fourier(1:3,i,j,k) = vectorField_fourier(1:3,i,j,k)/ & sum(conjg(-xi1st(1:3,i,j,k))*xi1st(1:3,i,j,k)) enddo; enddo; enddo @@ -1230,12 +1240,14 @@ subroutine utilities_updateIPcoords(F) ! average F if (grid3Offset == 0_pInt) Favg = real(tensorField_fourier(1:3,1:3,1,1,1),pReal)*wgt call MPI_Bcast(Favg,9,MPI_DOUBLE,0,PETSC_COMM_WORLD,ierr) + if(ierr /=0_pInt) call IO_error(894_pInt, ext_msg='update_IPcoords') !-------------------------------------------------------------------------------------------------- ! add average to fluctuation and put (0,0,0) on (0,0,0) step = geomSize/real(grid, pReal) if (grid3Offset == 0_pInt) offset_coords = vectorField_real(1:3,1,1,1) call MPI_Bcast(offset_coords,3,MPI_DOUBLE,0,PETSC_COMM_WORLD,ierr) + if(ierr /=0_pInt) call IO_error(894_pInt, ext_msg='update_IPcoords') offset_coords = math_mul33x3(Favg,step/2.0_pReal) - offset_coords m = 1_pInt do k = 1_pInt,grid3; do j = 1_pInt,grid(2); do i = 1_pInt,grid(1) From 825e09e4eaac3039fed56e247a9bb92722453c2e Mon Sep 17 00:00:00 2001 From: Test User Date: Thu, 2 Jun 2016 04:25:08 +0200 Subject: [PATCH 021/412] updated version information after successful test of v2.0.0-284-gae36212 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 1417f948c..527a3a26f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.0-280-ga58e85e +v2.0.0-284-gae36212 From 4a3617906049e95561fd09bea9848aa69844f900 Mon Sep 17 00:00:00 2001 From: Franz Roters Date: Tue, 14 Jun 2016 22:06:04 +0200 Subject: [PATCH 022/412] unified way gamma_dot is calculated --- code/plastic_phenopowerlaw.f90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/plastic_phenopowerlaw.f90 b/code/plastic_phenopowerlaw.f90 index 15b7aa78b..2f9051c71 100644 --- a/code/plastic_phenopowerlaw.f90 +++ b/code/plastic_phenopowerlaw.f90 @@ -1013,8 +1013,9 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) enddo nonSchmidSystems gdot_slip(j) = plastic_phenopowerlaw_gdot0_slip(instance)*0.5_pReal* & ((abs(tau_slip_pos)/(plasticState(ph)%state(j,of)))**plastic_phenopowerlaw_n_slip(instance) & - +(abs(tau_slip_neg)/(plasticState(ph)%state(j,of)))**plastic_phenopowerlaw_n_slip(instance))& *sign(1.0_pReal,tau_slip_pos) + +(abs(tau_slip_neg)/(plasticState(ph)%state(j,of)))**plastic_phenopowerlaw_n_slip(instance) & + *sign(1.0_pReal,tau_slip_neg)) enddo slipSystems1 enddo slipFamilies1 From bf5e6fee075b528e30c7ea973057a10d9a8f37c2 Mon Sep 17 00:00:00 2001 From: Franz Roters Date: Tue, 14 Jun 2016 22:10:24 +0200 Subject: [PATCH 023/412] added missing line continuation --- code/plastic_phenopowerlaw.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/plastic_phenopowerlaw.f90 b/code/plastic_phenopowerlaw.f90 index 2f9051c71..28a8946c8 100644 --- a/code/plastic_phenopowerlaw.f90 +++ b/code/plastic_phenopowerlaw.f90 @@ -1013,7 +1013,7 @@ subroutine plastic_phenopowerlaw_dotState(Tstar_v,ipc,ip,el) enddo nonSchmidSystems gdot_slip(j) = plastic_phenopowerlaw_gdot0_slip(instance)*0.5_pReal* & ((abs(tau_slip_pos)/(plasticState(ph)%state(j,of)))**plastic_phenopowerlaw_n_slip(instance) & - *sign(1.0_pReal,tau_slip_pos) + *sign(1.0_pReal,tau_slip_pos) & +(abs(tau_slip_neg)/(plasticState(ph)%state(j,of)))**plastic_phenopowerlaw_n_slip(instance) & *sign(1.0_pReal,tau_slip_neg)) enddo slipSystems1 From a15eae57ed52b1ad0ad44fa0054f4224f97dc6f7 Mon Sep 17 00:00:00 2001 From: Test User Date: Wed, 15 Jun 2016 04:24:30 +0200 Subject: [PATCH 024/412] updated version information after successful test of v2.0.0-287-gbf5e6fe --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 527a3a26f..fb2e73fcc 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.0-284-gae36212 +v2.0.0-287-gbf5e6fe From 5fb5edc2ed7bcef103d77d834d41a83524ddc9ee Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 24 Jun 2016 07:31:46 +0200 Subject: [PATCH 025/412] should be executable --- processing/misc/calculateAnisotropy.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 processing/misc/calculateAnisotropy.py diff --git a/processing/misc/calculateAnisotropy.py b/processing/misc/calculateAnisotropy.py old mode 100644 new mode 100755 From 001c6e595168fc12ffa86a55de43cede59a980aa Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 24 Jun 2016 10:59:04 +0200 Subject: [PATCH 026/412] unneded variables --- code/spectral_damage.f90 | 4 ---- code/spectral_thermal.f90 | 4 ---- 2 files changed, 8 deletions(-) diff --git a/code/spectral_damage.f90 b/code/spectral_damage.f90 index e2bb80b31..27d513175 100644 --- a/code/spectral_damage.f90 +++ b/code/spectral_damage.f90 @@ -176,10 +176,6 @@ type(tSolutionState) function spectral_damage_solution(guess,timeinc,timeinc_old itmax, & err_damage_tolAbs, & err_damage_tolRel - use spectral_utilities, only: & - tBoundaryCondition, & - Utilities_maskedCompliance, & - Utilities_updateGamma use mesh, only: & grid, & grid3 diff --git a/code/spectral_thermal.f90 b/code/spectral_thermal.f90 index 83e290a4c..985bdf0c6 100644 --- a/code/spectral_thermal.f90 +++ b/code/spectral_thermal.f90 @@ -178,10 +178,6 @@ type(tSolutionState) function spectral_thermal_solution(guess,timeinc,timeinc_ol itmax, & err_thermal_tolAbs, & err_thermal_tolRel - use spectral_utilities, only: & - tBoundaryCondition, & - Utilities_maskedCompliance, & - Utilities_updateGamma use mesh, only: & grid, & grid3 From 12ac5e3c49a5a1417139b03df76d00f4d04114f8 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 24 Jun 2016 10:59:23 +0200 Subject: [PATCH 027/412] switch to analytic tangent --- examples/AbaqusStandard/numerics.config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/AbaqusStandard/numerics.config b/examples/AbaqusStandard/numerics.config index 723bc3934..2b0b8a96e 100644 --- a/examples/AbaqusStandard/numerics.config +++ b/examples/AbaqusStandard/numerics.config @@ -1,2 +1,2 @@ -fixed_seed 144921823 -analyticJaco 0 +fixed_seed 1697667030 +analyticJaco 1 From 848e9674afef66918cb9b23f05289efae71a2c2a Mon Sep 17 00:00:00 2001 From: Test User Date: Sun, 26 Jun 2016 18:03:44 +0200 Subject: [PATCH 028/412] updated version information after successful test of v2.0.0-290-g12ac5e3 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index fb2e73fcc..6cc584f93 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.0-287-gbf5e6fe +v2.0.0-290-g12ac5e3 From 2ebc5ec8ea987feeba600d3b664f0c3a3926d505 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 27 Jun 2016 12:23:42 +0200 Subject: [PATCH 029/412] request thread aware MPI when using openMP --- code/spectral_interface.f90 | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/code/spectral_interface.f90 b/code/spectral_interface.f90 index 911e6c72e..b10399cbd 100644 --- a/code/spectral_interface.f90 +++ b/code/spectral_interface.f90 @@ -61,6 +61,7 @@ subroutine DAMASK_interface_init(loadCaseParameterIn,geometryParameterIn) tag integer :: & i, & + threadLevel, & worldrank = 0 integer, allocatable, dimension(:) :: & chunkPos @@ -73,15 +74,22 @@ subroutine DAMASK_interface_init(loadCaseParameterIn,geometryParameterIn) quit,& MPI_Comm_rank,& PETScInitialize, & + MPI_Init_Thread, & MPI_abort !-------------------------------------------------------------------------------------------------- ! PETSc Init #ifdef PETSc - call PetscInitialize(PETSC_NULL_CHARACTER,ierr) ! according to PETSc manual, that should be the first line in the code +#ifdef _OPENMP + call MPI_Init_Thread(MPI_THREAD_FUNNELED,threadLevel,ierr);CHKERRQ(ierr) ! in case of OpenMP, don't rely on PETScInitialize doing MPI init + if (threadLevel4.4, ifort >11 support it) + open(6, encoding='UTF-8') call MPI_Comm_rank(PETSC_COMM_WORLD,worldrank,ierr);CHKERRQ(ierr) #endif mainProcess: if (worldrank == 0) then @@ -313,6 +321,7 @@ character(len=1024) function getGeometryFile(geometryParameter) integer :: posExt, posSep logical :: error character :: pathSep + external :: quit getGeometryFile = geometryParameter pathSep = getPathSep() @@ -322,6 +331,7 @@ character(len=1024) function getGeometryFile(geometryParameter) if (posExt <= posSep) getGeometryFile = trim(getGeometryFile)//('.geom') ! no extension present if (scan(getGeometryFile,pathSep) /= 1) then ! relative path given as command line argument error = getcwd(cwd) + if (error) call quit(1_pInt) getGeometryFile = rectifyPath(trim(cwd)//pathSep//getGeometryFile) else getGeometryFile = rectifyPath(getGeometryFile) @@ -347,6 +357,7 @@ character(len=1024) function getLoadCaseFile(loadCaseParameter) integer :: posExt, posSep logical :: error character :: pathSep + external :: quit getLoadCaseFile = loadcaseParameter pathSep = getPathSep() @@ -356,6 +367,7 @@ character(len=1024) function getLoadCaseFile(loadCaseParameter) if (posExt <= posSep) getLoadCaseFile = trim(getLoadCaseFile)//('.load') ! no extension present if (scan(getLoadCaseFile,pathSep) /= 1) then ! relative path given as command line argument error = getcwd(cwd) + if (error) call quit(1_pInt) getLoadCaseFile = rectifyPath(trim(cwd)//pathSep//getLoadCaseFile) else getLoadCaseFile = rectifyPath(getLoadCaseFile) From b40cbd68bb3dea5584590b1e1b9cbed1ec462ac8 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 27 Jun 2016 15:19:02 +0200 Subject: [PATCH 030/412] "-"sign caused reversed deformation mode --- processing/post/addDisplacement.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/processing/post/addDisplacement.py b/processing/post/addDisplacement.py index b421979c4..bcc02f869 100755 --- a/processing/post/addDisplacement.py +++ b/processing/post/addDisplacement.py @@ -69,7 +69,7 @@ def displacementFluctFFT(F,grid,size,nodal=False,transformed=False): #-------------------------------------------------------------------------------------------------- # integration in Fourier space - displacement_fourier = -np.einsum('ijkml,ijkl,l->ijkm', + displacement_fourier = +np.einsum('ijkml,ijkl,l->ijkm', F if transformed else np.fft.rfftn(F,axes=(0,1,2)), k_s, integrator, From a3a36ead39f39400a98eaf35c5077c593b795926 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 27 Jun 2016 15:43:04 +0200 Subject: [PATCH 031/412] Libs not needed (got back during merge) --- code/Makefile | 7 +- code/spectral_interface.f90 | 163 +++++++++++++++++------------------- 2 files changed, 79 insertions(+), 91 deletions(-) diff --git a/code/Makefile b/code/Makefile index 110d595f3..a0f419ce0 100644 --- a/code/Makefile +++ b/code/Makefile @@ -351,7 +351,7 @@ DAMASK_spectral.o: INTERFACENAME := spectral_interface.f90 SPECTRAL_SOLVER_FILES = spectral_mech_AL.o spectral_mech_Basic.o spectral_mech_Polarisation.o \ spectral_thermal.o spectral_damage.o -SPECTRAL_FILES = C_routines.o system_routines.o prec.o DAMASK_interface.o IO.o libs.o numerics.o debug.o math.o \ +SPECTRAL_FILES = C_routines.o system_routines.o prec.o DAMASK_interface.o IO.o numerics.o debug.o math.o \ FEsolving.o mesh.o material.o lattice.o \ $(SOURCE_FILES) $(KINEMATICS_FILES) $(PLASTIC_FILES) constitutive.o \ crystallite.o \ @@ -401,7 +401,7 @@ DAMASK_FEM.exe: INCLUDE_DIRS += -I./ FEM_SOLVER_FILES = FEM_mech.o FEM_thermal.o FEM_damage.o FEM_vacancyflux.o FEM_porosity.o FEM_hydrogenflux.o -FEM_FILES = prec.o DAMASK_interface.o FEZoo.o IO.o libs.o numerics.o debug.o math.o \ +FEM_FILES = prec.o DAMASK_interface.o FEZoo.o IO.o numerics.o debug.o math.o \ FEsolving.o mesh.o material.o lattice.o \ $(SOURCE_FILES) $(KINEMATICS_FILES) $(PLASTIC_FILES) constitutive.o \ crystallite.o \ @@ -612,9 +612,6 @@ debug.o: debug.f90 \ numerics.o numerics.o: numerics.f90 \ - libs.o - -libs.o: libs.f90 \ IO.o IO.o: IO.f90 \ diff --git a/code/spectral_interface.f90 b/code/spectral_interface.f90 index b10399cbd..862b8e849 100644 --- a/code/spectral_interface.f90 +++ b/code/spectral_interface.f90 @@ -44,13 +44,10 @@ contains !> @brief initializes the solver by interpreting the command line arguments. Also writes !! information on computation to screen !-------------------------------------------------------------------------------------------------- -subroutine DAMASK_interface_init(loadCaseParameterIn,geometryParameterIn) +subroutine DAMASK_interface_init() use, intrinsic :: iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment) implicit none - character(len=1024), optional, intent(in) :: & - loadCaseParameterIn, & !< if using the f2py variant, the -l argument of DAMASK_spectral.exe - geometryParameterIn !< if using the f2py variant, the -g argument of DAMASK_spectral.exe character(len=1024) :: & commandLine, & !< command line call as string loadCaseArg ='', & !< -l argument given to DAMASK_spectral.exe @@ -105,88 +102,82 @@ subroutine DAMASK_interface_init(loadCaseParameterIn,geometryParameterIn) write(6,'(/,a)') ' <<<+- DAMASK_interface init -+>>>' #include "compilation_info.f90" endif mainProcess - if ( present(loadcaseParameterIn) .and. present(geometryParameterIn)) then ! both mandatory parameters given in function call - geometryArg = geometryParameterIn - loadcaseArg = loadcaseParameterIn - commandLine = 'n/a' - else if ( .not.( present(loadcaseParameterIn) .and. present(geometryParameterIn))) then ! none parameters given in function call, trying to get them from command line - call get_command(commandLine) - chunkPos = IIO_stringPos(commandLine) - do i = 1, chunkPos(1) - tag = IIO_lc(IIO_stringValue(commandLine,chunkPos,i)) ! extract key - select case(tag) - case ('-h','--help') - mainProcess2: if (worldrank == 0) then - write(6,'(a)') ' #######################################################################' - write(6,'(a)') ' DAMASK_spectral:' - write(6,'(a)') ' The spectral method boundary value problem solver for' - write(6,'(a)') ' the Düsseldorf Advanced Material Simulation Kit' - write(6,'(a,/)')' #######################################################################' - write(6,'(a,/)')' Valid command line switches:' - write(6,'(a)') ' --geom (-g, --geometry)' - write(6,'(a)') ' --load (-l, --loadcase)' - write(6,'(a)') ' --workingdir (-w, --wd, --workingdirectory, -d, --directory)' - write(6,'(a)') ' --restart (-r, --rs)' - write(6,'(a)') ' --regrid (--rg)' - write(6,'(a)') ' --help (-h)' - write(6,'(/,a)')' -----------------------------------------------------------------------' - write(6,'(a)') ' Mandatory arguments:' - write(6,'(/,a)')' --geom PathToGeomFile/NameOfGeom.geom' - write(6,'(a)') ' Specifies the location of the geometry definition file,' - write(6,'(a)') ' if no extension is given, .geom will be appended.' - write(6,'(a)') ' "PathToGeomFile" will be the working directory if not specified' - write(6,'(a)') ' via --workingdir.' - write(6,'(a)') ' Make sure the file "material.config" exists in the working' - write(6,'(a)') ' directory.' - write(6,'(a)') ' For further configuration place "numerics.config"' - write(6,'(a)')' and "numerics.config" in that directory.' - write(6,'(/,a)')' --load PathToLoadFile/NameOfLoadFile.load' - write(6,'(a)') ' Specifies the location of the load case definition file,' - write(6,'(a)') ' if no extension is given, .load will be appended.' - write(6,'(/,a)')' -----------------------------------------------------------------------' - write(6,'(a)') ' Optional arguments:' - write(6,'(/,a)')' --workingdirectory PathToWorkingDirectory' - write(6,'(a)') ' Specifies the working directory and overwrites the default' - write(6,'(a)') ' "PathToGeomFile".' - write(6,'(a)') ' Make sure the file "material.config" exists in the working' - write(6,'(a)') ' directory.' - write(6,'(a)') ' For further configuration place "numerics.config"' - write(6,'(a)')' and "numerics.config" in that directory.' - write(6,'(/,a)')' --restart XX' - write(6,'(a)') ' Reads in total increment No. XX-1 and continues to' - write(6,'(a)') ' calculate total increment No. XX.' - write(6,'(a)') ' Appends to existing results file ' - write(6,'(a)') ' "NameOfGeom_NameOfLoadFile.spectralOut".' - write(6,'(a)') ' Works only if the restart information for total increment' - write(6,'(a)') ' No. XX-1 is available in the working directory.' - write(6,'(/,a)')' --regrid XX' - write(6,'(a)') ' Reads in total increment No. XX-1 and continues to' - write(6,'(a)') ' calculate total increment No. XX.' - write(6,'(a)') ' Attention: Overwrites existing results file ' - write(6,'(a)') ' "NameOfGeom_NameOfLoadFile.spectralOut".' - write(6,'(a)') ' Works only if the restart information for total increment' - write(6,'(a)') ' No. XX-1 is available in the working directory.' - write(6,'(/,a)')' -----------------------------------------------------------------------' - write(6,'(a)') ' Help:' - write(6,'(/,a)')' --help' - write(6,'(a,/)')' Prints this message and exits' - call quit(0_pInt) ! normal Termination - endif mainProcess2 - case ('-l', '--load', '--loadcase') - loadcaseArg = IIO_stringValue(commandLine,chunkPos,i+1_pInt) - case ('-g', '--geom', '--geometry') - geometryArg = IIO_stringValue(commandLine,chunkPos,i+1_pInt) - case ('-w', '-d', '--wd', '--directory', '--workingdir', '--workingdirectory') - workingDirArg = IIO_stringValue(commandLine,chunkPos,i+1_pInt) - case ('-r', '--rs', '--restart') - spectralRestartInc = IIO_IntValue(commandLine,chunkPos,i+1_pInt) - appendToOutFile = .true. - case ('--rg', '--regrid') - spectralRestartInc = IIO_IntValue(commandLine,chunkPos,i+1_pInt) - appendToOutFile = .false. - end select - enddo - endif + call get_command(commandLine) + chunkPos = IIO_stringPos(commandLine) + do i = 1, chunkPos(1) + tag = IIO_lc(IIO_stringValue(commandLine,chunkPos,i)) ! extract key + select case(tag) + case ('-h','--help') + mainProcess2: if (worldrank == 0) then + write(6,'(a)') ' #######################################################################' + write(6,'(a)') ' DAMASK_spectral:' + write(6,'(a)') ' The spectral method boundary value problem solver for' + write(6,'(a)') ' the Düsseldorf Advanced Material Simulation Kit' + write(6,'(a,/)')' #######################################################################' + write(6,'(a,/)')' Valid command line switches:' + write(6,'(a)') ' --geom (-g, --geometry)' + write(6,'(a)') ' --load (-l, --loadcase)' + write(6,'(a)') ' --workingdir (-w, --wd, --workingdirectory, -d, --directory)' + write(6,'(a)') ' --restart (-r, --rs)' + write(6,'(a)') ' --regrid (--rg)' + write(6,'(a)') ' --help (-h)' + write(6,'(/,a)')' -----------------------------------------------------------------------' + write(6,'(a)') ' Mandatory arguments:' + write(6,'(/,a)')' --geom PathToGeomFile/NameOfGeom.geom' + write(6,'(a)') ' Specifies the location of the geometry definition file,' + write(6,'(a)') ' if no extension is given, .geom will be appended.' + write(6,'(a)') ' "PathToGeomFile" will be the working directory if not specified' + write(6,'(a)') ' via --workingdir.' + write(6,'(a)') ' Make sure the file "material.config" exists in the working' + write(6,'(a)') ' directory.' + write(6,'(a)') ' For further configuration place "numerics.config"' + write(6,'(a)')' and "numerics.config" in that directory.' + write(6,'(/,a)')' --load PathToLoadFile/NameOfLoadFile.load' + write(6,'(a)') ' Specifies the location of the load case definition file,' + write(6,'(a)') ' if no extension is given, .load will be appended.' + write(6,'(/,a)')' -----------------------------------------------------------------------' + write(6,'(a)') ' Optional arguments:' + write(6,'(/,a)')' --workingdirectory PathToWorkingDirectory' + write(6,'(a)') ' Specifies the working directory and overwrites the default' + write(6,'(a)') ' "PathToGeomFile".' + write(6,'(a)') ' Make sure the file "material.config" exists in the working' + write(6,'(a)') ' directory.' + write(6,'(a)') ' For further configuration place "numerics.config"' + write(6,'(a)')' and "numerics.config" in that directory.' + write(6,'(/,a)')' --restart XX' + write(6,'(a)') ' Reads in total increment No. XX-1 and continues to' + write(6,'(a)') ' calculate total increment No. XX.' + write(6,'(a)') ' Appends to existing results file ' + write(6,'(a)') ' "NameOfGeom_NameOfLoadFile.spectralOut".' + write(6,'(a)') ' Works only if the restart information for total increment' + write(6,'(a)') ' No. XX-1 is available in the working directory.' + write(6,'(/,a)')' --regrid XX' + write(6,'(a)') ' Reads in total increment No. XX-1 and continues to' + write(6,'(a)') ' calculate total increment No. XX.' + write(6,'(a)') ' Attention: Overwrites existing results file ' + write(6,'(a)') ' "NameOfGeom_NameOfLoadFile.spectralOut".' + write(6,'(a)') ' Works only if the restart information for total increment' + write(6,'(a)') ' No. XX-1 is available in the working directory.' + write(6,'(/,a)')' -----------------------------------------------------------------------' + write(6,'(a)') ' Help:' + write(6,'(/,a)')' --help' + write(6,'(a,/)')' Prints this message and exits' + call quit(0_pInt) ! normal Termination + endif mainProcess2 + case ('-l', '--load', '--loadcase') + loadcaseArg = IIO_stringValue(commandLine,chunkPos,i+1_pInt) + case ('-g', '--geom', '--geometry') + geometryArg = IIO_stringValue(commandLine,chunkPos,i+1_pInt) + case ('-w', '-d', '--wd', '--directory', '--workingdir', '--workingdirectory') + workingDirArg = IIO_stringValue(commandLine,chunkPos,i+1_pInt) + case ('-r', '--rs', '--restart') + spectralRestartInc = IIO_IntValue(commandLine,chunkPos,i+1_pInt) + appendToOutFile = .true. + case ('--rg', '--regrid') + spectralRestartInc = IIO_IntValue(commandLine,chunkPos,i+1_pInt) + appendToOutFile = .false. + end select + enddo if (len(trim(loadcaseArg)) == 0 .or. len(trim(geometryArg)) == 0) then write(6,'(a)') ' Please specify geometry AND load case (-h for help)' From e7f0014ae84a4bfcc13790461a43dfdac7f88b94 Mon Sep 17 00:00:00 2001 From: Test User Date: Mon, 27 Jun 2016 16:24:11 +0200 Subject: [PATCH 032/412] updated version information after successful test of v2.0.0-292-g2ebc5ec --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 6cc584f93..9c296336f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.0-290-g12ac5e3 +v2.0.0-292-g2ebc5ec From 985eee094f889eb17e44fe2a2159b8e4c2ff8a83 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 27 Jun 2016 17:46:34 +0200 Subject: [PATCH 033/412] respecting compiler warnings --- code/DAMASK_spectral.f90 | 11 ++++++----- code/hydrogenflux_cahnhilliard.f90 | 18 +++++++----------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/code/DAMASK_spectral.f90 b/code/DAMASK_spectral.f90 index e999bf5dc..53c9c4423 100644 --- a/code/DAMASK_spectral.f90 +++ b/code/DAMASK_spectral.f90 @@ -139,6 +139,7 @@ program DAMASK_spectral integer(MPI_OFFSET_KIND) :: fileOffset integer(MPI_OFFSET_KIND), dimension(:), allocatable :: outputSize integer(pInt), parameter :: maxByteOut = 2147483647-4096 !< limit of one file output write https://trac.mpich.org/projects/mpich/ticket/1742 + integer(pInt), parameter :: maxRealOut = maxByteOut/pReal integer(pLongInt), dimension(2) :: outputIndex PetscErrorCode :: ierr external :: & @@ -444,8 +445,8 @@ program DAMASK_spectral if (.not. appendToOutFile) then ! if not restarting, write 0th increment do i=1, size(materialpoint_results,3)/(maxByteOut/(materialpoint_sizeResults*pReal))+1 ! slice the output of my process in chunks not exceeding the limit for one output - outputIndex=int([(i-1_pInt)*((maxByteOut/pReal)/materialpoint_sizeResults)+1_pInt, & - min(i*((maxByteOut/pReal)/materialpoint_sizeResults),size(materialpoint_results,3))],pLongInt) + outputIndex=int([(i-1_pInt)*((maxRealOut)/materialpoint_sizeResults)+1_pInt, & + min(i*((maxRealOut)/materialpoint_sizeResults),size(materialpoint_results,3))],pLongInt) call MPI_file_write(resUnit,reshape(materialpoint_results(:,:,outputIndex(1):outputIndex(2)),& [(outputIndex(2)-outputIndex(1)+1)*materialpoint_sizeResults]), & (outputIndex(2)-outputIndex(1)+1)*materialpoint_sizeResults,& @@ -471,7 +472,7 @@ program DAMASK_spectral ! forwarding time timeIncOld = timeinc if (loadCases(currentLoadCase)%logscale == 0_pInt) then ! linear scale - timeinc = loadCases(currentLoadCase)%time/loadCases(currentLoadCase)%incs ! only valid for given linear time scale. will be overwritten later in case loglinear scale is used + timeinc = loadCases(currentLoadCase)%time/real(loadCases(currentLoadCase)%incs,pReal) ! only valid for given linear time scale. will be overwritten later in case loglinear scale is used else if (currentLoadCase == 1_pInt) then ! 1st currentLoadCase of logarithmic scale if (inc == 1_pInt) then ! 1st inc of 1st currentLoadCase of logarithmic scale @@ -653,8 +654,8 @@ program DAMASK_spectral call MPI_file_seek (resUnit,fileOffset,MPI_SEEK_SET,ierr) if(ierr /=0_pInt) call IO_error(894_pInt, ext_msg='MPI_file_seek') do i=1, size(materialpoint_results,3)/(maxByteOut/(materialpoint_sizeResults*pReal))+1 ! slice the output of my process in chunks not exceeding the limit for one output - outputIndex=int([(i-1_pInt)*((maxByteOut/pReal)/materialpoint_sizeResults)+1_pInt, & - min(i*((maxByteOut/pReal)/materialpoint_sizeResults),size(materialpoint_results,3))],pLongInt) + outputIndex=int([(i-1_pInt)*((maxRealOut)/materialpoint_sizeResults)+1_pInt, & + min(i*((maxRealOut)/materialpoint_sizeResults),size(materialpoint_results,3))],pLongInt) call MPI_file_write(resUnit,reshape(materialpoint_results(:,:,outputIndex(1):outputIndex(2)),& [(outputIndex(2)-outputIndex(1)+1)*materialpoint_sizeResults]), & (outputIndex(2)-outputIndex(1)+1)*materialpoint_sizeResults,& diff --git a/code/hydrogenflux_cahnhilliard.f90 b/code/hydrogenflux_cahnhilliard.f90 index 898e7ed8d..35168da2d 100644 --- a/code/hydrogenflux_cahnhilliard.f90 +++ b/code/hydrogenflux_cahnhilliard.f90 @@ -223,8 +223,7 @@ function hydrogenflux_cahnhilliard_getMobility33(ip,el) enddo hydrogenflux_cahnhilliard_getMobility33 = & - hydrogenflux_cahnhilliard_getMobility33/ & - homogenization_Ngrains(mesh_element(3,el)) + hydrogenflux_cahnhilliard_getMobility33/real(homogenization_Ngrains(mesh_element(3,el)),pReal) end function hydrogenflux_cahnhilliard_getMobility33 @@ -258,8 +257,7 @@ function hydrogenflux_cahnhilliard_getDiffusion33(ip,el) enddo hydrogenflux_cahnhilliard_getDiffusion33 = & - hydrogenflux_cahnhilliard_getDiffusion33/ & - homogenization_Ngrains(mesh_element(3,el)) + hydrogenflux_cahnhilliard_getDiffusion33/real(homogenization_Ngrains(mesh_element(3,el)),pReal) end function hydrogenflux_cahnhilliard_getDiffusion33 @@ -295,8 +293,7 @@ function hydrogenflux_cahnhilliard_getFormationEnergy(ip,el) enddo hydrogenflux_cahnhilliard_getFormationEnergy = & - hydrogenflux_cahnhilliard_getFormationEnergy/ & - homogenization_Ngrains(mesh_element(3,el)) + hydrogenflux_cahnhilliard_getFormationEnergy/real(homogenization_Ngrains(mesh_element(3,el)),pReal) end function hydrogenflux_cahnhilliard_getFormationEnergy @@ -331,10 +328,9 @@ function hydrogenflux_cahnhilliard_getEntropicCoeff(ip,el) lattice_hydrogenSurfaceEnergy(material_phase(grain,ip,el)) enddo - hydrogenflux_cahnhilliard_getEntropicCoeff = & - hydrogenflux_cahnhilliard_getEntropicCoeff* & + hydrogenflux_cahnhilliard_getEntropicCoeff = hydrogenflux_cahnhilliard_getEntropicCoeff* & temperature(material_homog(ip,el))%p(thermalMapping(material_homog(ip,el))%p(ip,el))/ & - homogenization_Ngrains(material_homog(ip,el)) + real(homogenization_Ngrains(material_homog(ip,el)),pReal) end function hydrogenflux_cahnhilliard_getEntropicCoeff @@ -393,8 +389,8 @@ subroutine hydrogenflux_cahnhilliard_KinematicChemPotAndItsTangent(KPot, dKPot_d enddo enddo - KPot = KPot/homogenization_Ngrains(material_homog(ip,el)) - dKPot_dCh = dKPot_dCh/homogenization_Ngrains(material_homog(ip,el)) + KPot = KPot/real(homogenization_Ngrains(material_homog(ip,el)),pReal) + dKPot_dCh = dKPot_dCh/real(homogenization_Ngrains(material_homog(ip,el)),pReal) end subroutine hydrogenflux_cahnhilliard_KinematicChemPotAndItsTangent From a27aba1a47305baa4106b9a013aa22ff1acec561 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 27 Jun 2016 17:47:32 +0200 Subject: [PATCH 034/412] correct casting to cmplx --- code/spectral_utilities.f90 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/spectral_utilities.f90 b/code/spectral_utilities.f90 index 1bf322843..b9ed5245d 100644 --- a/code/spectral_utilities.f90 +++ b/code/spectral_utilities.f90 @@ -422,7 +422,7 @@ subroutine utilities_updateGamma(C,saveReference) forall(l = 1_pInt:3_pInt, m = 1_pInt:3_pInt) & xiDyad_cmplx(l,m) = conjg(-xi1st(l,i,j,k-grid3Offset))*xi1st(m,i,j,k-grid3Offset) forall(l = 1_pInt:3_pInt, m = 1_pInt:3_pInt) & - temp33_complex(l,m) = sum(C_ref(l,1:3,m,1:3)*xiDyad_cmplx) + temp33_complex(l,m) = sum(cmplx(C_ref(l,1:3,m,1:3),0.0_pReal)*xiDyad_cmplx) matA(1:3,1:3) = real(temp33_complex); matA(4:6,4:6) = real(temp33_complex) matA(1:3,4:6) = aimag(temp33_complex); matA(4:6,1:3) = -aimag(temp33_complex) if (abs(math_det33(matA(1:3,1:3))) > 1e-16) then @@ -558,7 +558,7 @@ subroutine utilities_fourierGammaConvolution(fieldAim) forall(l = 1_pInt:3_pInt, m = 1_pInt:3_pInt) & xiDyad_cmplx(l,m) = conjg(-xi1st(l,i,j,k))*xi1st(m,i,j,k) forall(l = 1_pInt:3_pInt, m = 1_pInt:3_pInt) & - temp33_complex(l,m) = sum(C_ref(l,1:3,m,1:3)*xiDyad_cmplx) + temp33_complex(l,m) = sum(cmplx(C_ref(l,1:3,m,1:3),0.0_pReal)*xiDyad_cmplx) matA(1:3,1:3) = real(temp33_complex); matA(4:6,4:6) = real(temp33_complex) matA(1:3,4:6) = aimag(temp33_complex); matA(4:6,1:3) = -aimag(temp33_complex) if (abs(math_det33(matA(1:3,1:3))) > 1e-16) then @@ -610,8 +610,8 @@ subroutine utilities_fourierGreenConvolution(D_ref, mobility_ref, deltaT) ! do the actual spectral method calculation do k = 1_pInt, grid3; do j = 1_pInt, grid(2) ;do i = 1_pInt, grid1Red GreenOp_hat = cmplx(1.0_pReal,0.0_pReal,pReal)/ & - (cmplx(mobility_ref,0.0_pReal,pReal) + & - deltaT*sum(conjg(xi1st(1:3,i,j,k))*matmul(D_ref,xi1st(1:3,i,j,k)))) ! why not use dot_product + (cmplx(mobility_ref,0.0_pReal,pReal) + cmplx(deltaT,0.0_pReal)*& + sum(conjg(xi1st(1:3,i,j,k))* matmul(cmplx(D_ref,0.0_pReal),xi1st(1:3,i,j,k)))) ! why not use dot_product scalarField_fourier(i,j,k) = scalarField_fourier(i,j,k)*GreenOp_hat enddo; enddo; enddo From de614f5ce7619448023432096ca36de5af6fdb37 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 27 Jun 2016 17:50:43 +0200 Subject: [PATCH 035/412] declaring external only where needed --- code/spectral_damage.f90 | 55 ++++++++++------- code/spectral_mech_AL.f90 | 67 +++++++++++--------- code/spectral_mech_Basic.f90 | 95 +++++++++++++++++------------ code/spectral_mech_Polarisation.f90 | 67 +++++++++++--------- code/spectral_thermal.f90 | 50 +++++++++------ 5 files changed, 196 insertions(+), 138 deletions(-) diff --git a/code/spectral_damage.f90 b/code/spectral_damage.f90 index 27d513175..6260fe43a 100644 --- a/code/spectral_damage.f90 +++ b/code/spectral_damage.f90 @@ -42,7 +42,6 @@ module spectral_damage integer(pInt), private :: totalIter = 0_pInt !< total iteration in current increment real(pReal), dimension(3,3), private :: D_ref real(pReal), private :: mobility_ref - character(len=1024), private :: incInfo public :: & spectral_damage_init, & @@ -50,21 +49,7 @@ module spectral_damage spectral_damage_forward, & spectral_damage_destroy external :: & - VecDestroy, & - DMDestroy, & - DMDACreate3D, & - DMCreateGlobalVector, & - DMDASNESSetFunctionLocal, & PETScFinalize, & - SNESDestroy, & - SNESGetNumberFunctionEvals, & - SNESGetIterationNumber, & - SNESSolve, & - SNESSetDM, & - SNESGetConvergedReason, & - SNESSetConvergenceTest, & - SNESSetFromOptions, & - SNESCreate, & MPI_Abort, & MPI_Bcast, & MPI_Allreduce @@ -90,15 +75,30 @@ subroutine spectral_damage_init() damage_nonlocal_getMobility implicit none + integer(pInt), dimension(:), allocatable :: localK + integer(pInt) :: proc + integer(pInt) :: i, j, k, cell DM :: damage_grid Vec :: uBound, lBound PetscErrorCode :: ierr PetscObject :: dummy - integer(pInt), dimension(:), allocatable :: localK - integer(pInt) :: proc - integer(pInt) :: i, j, k, cell character(len=100) :: snes_type + external :: & + SNESCreate, & + SNESSetOptionsPrefix, & + DMDACreate3D, & + SNESSetDM, & + DMDAGetCorners, & + DMCreateGlobalVector, & + DMDASNESSetFunctionLocal, & + SNESSetFromOptions, & + SNESGetType, & + VecSet, & + DMGetGlobalVector, & + DMRestoreGlobalVector, & + SNESVISetVariableBounds + mainProcess: if (worldrank == 0_pInt) then write(6,'(/,a)') ' <<<+- spectral_damage init -+>>>' write(6,'(a15,a)') ' Current time: ',IO_timeStamp() @@ -194,12 +194,18 @@ type(tSolutionState) function spectral_damage_solution(guess,timeinc,timeinc_old integer(pInt) :: i, j, k, cell PetscInt ::position PetscReal :: minDamage, maxDamage, stagNorm, solnNorm - + !-------------------------------------------------------------------------------------------------- ! PETSc Data PetscErrorCode :: ierr SNESConvergedReason :: reason - + + external :: & + VecMin, & + VecMax, & + SNESSolve, & + SNESGetConvergedReason + spectral_damage_solution%converged =.false. !-------------------------------------------------------------------------------------------------- @@ -353,10 +359,13 @@ subroutine spectral_damage_forward(guess,timeinc,timeinc_old,loadCaseTime) timeinc, & loadCaseTime !< remaining time of current load case logical, intent(in) :: guess - PetscErrorCode :: ierr integer(pInt) :: i, j, k, cell DM :: dm_local PetscScalar, dimension(:,:,:), pointer :: x_scal + PetscErrorCode :: ierr + + external :: & + SNESGetDM if (cutBack) then damage_current = damage_lastInc @@ -400,6 +409,10 @@ subroutine spectral_damage_destroy() implicit none PetscErrorCode :: ierr + external :: & + VecDestroy, & + SNESDestroy + call VecDestroy(solution,ierr); CHKERRQ(ierr) call SNESDestroy(damage_snes,ierr); CHKERRQ(ierr) diff --git a/code/spectral_mech_AL.f90 b/code/spectral_mech_AL.f90 index b6a8c9353..0077ba2c3 100644 --- a/code/spectral_mech_AL.f90 +++ b/code/spectral_mech_AL.f90 @@ -22,7 +22,7 @@ module spectral_mech_AL DAMASK_spectral_solverAL_label = 'al' !-------------------------------------------------------------------------------------------------- -! derived types +! derived types type(tSolutionParams), private :: params real(pReal), private, dimension(3,3) :: mask_stress = 0.0_pReal @@ -31,7 +31,7 @@ module spectral_mech_AL DM, private :: da SNES, private :: snes Vec, private :: solution_vec - + !-------------------------------------------------------------------------------------------------- ! common pointwise data real(pReal), private, dimension(:,:,:,:,:), allocatable :: & @@ -72,21 +72,7 @@ module spectral_mech_AL AL_forward, & AL_destroy external :: & - VecDestroy, & - DMDestroy, & - DMDACreate3D, & - DMCreateGlobalVector, & - DMDASNESSetFunctionLocal, & PETScFinalize, & - SNESDestroy, & - SNESGetNumberFunctionEvals, & - SNESGetIterationNumber, & - SNESSolve, & - SNESSetDM, & - SNESGetConvergedReason, & - SNESSetConvergenceTest, & - SNESSetFromOptions, & - SNESCreate, & MPI_Abort, & MPI_Bcast, & MPI_Allreduce @@ -136,11 +122,22 @@ subroutine AL_init integer(pInt) :: proc character(len=1024) :: rankStr - if (worldrank == 0_pInt) then + external :: & + SNESCreate, & + SNESSetOptionsPrefix, & + DMDACreate3D, & + SNESSetDM, & + DMCreateGlobalVector, & + DMDASNESSetFunctionLocal, & + SNESGetConvergedReason, & + SNESSetConvergenceTest, & + SNESSetFromOptions + + mainProcess: if (worldrank == 0_pInt) then write(6,'(/,a)') ' <<<+- DAMASK_spectral_solverAL init -+>>>' write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif + endif mainProcess !-------------------------------------------------------------------------------------------------- ! allocate global fields @@ -150,7 +147,7 @@ subroutine AL_init allocate (F_lambdaDot (3,3,grid(1),grid(2),grid3),source = 0.0_pReal) !-------------------------------------------------------------------------------------------------- -! PETSc Init +! initialize solver specific parts of PETSc call SNESCreate(PETSC_COMM_WORLD,snes,ierr); CHKERRQ(ierr) call SNESSetOptionsPrefix(snes,'mech_',ierr);CHKERRQ(ierr) allocate(localK(worldsize), source = 0); localK(worldrank+1) = grid3 @@ -185,10 +182,10 @@ subroutine AL_init 'reading values of increment ', restartInc - 1_pInt, ' from file' flush(6) write(rankStr,'(a1,i0)')'_',worldrank - call IO_read_realFile(777,'F'//trim(rankStr), trim(getSolverJobName()),size(F)) + call IO_read_realFile(777,'F'//trim(rankStr),trim(getSolverJobName()),size(F)) read (777,rec=1) F close (777) - call IO_read_realFile(777,'F_lastInc'//trim(rankStr), trim(getSolverJobName()),size(F_lastInc)) + call IO_read_realFile(777,'F_lastInc'//trim(rankStr),trim(getSolverJobName()),size(F_lastInc)) read (777,rec=1) F_lastInc close (777) call IO_read_realFile(777,'F_lambda'//trim(rankStr),trim(getSolverJobName()),size(F_lambda)) @@ -214,15 +211,14 @@ subroutine AL_init F_lambda_lastInc = F_lastInc endif restart - call Utilities_updateIPcoords(reshape(F,shape(F_lastInc))) call Utilities_constitutiveResponse(F_lastInc, reshape(F,shape(F_lastInc)), & 0.0_pReal,P,C_volAvg,C_minMaxAvg,temp33_Real,.false.,math_I3) nullify(F) nullify(F_lambda) call DMDAVecRestoreArrayF90(da,solution_vec,xx_psc,ierr); CHKERRQ(ierr) ! write data back to PETSc - - readRestart: if (restartInc > 1_pInt) then + + restartRead: if (restartInc > 1_pInt) then if (iand(debug_level(debug_spectral),debug_spectralRestart)/= 0 .and. worldrank == 0_pInt) & write(6,'(/,a,'//IO_intOut(restartInc-1_pInt)//',a)') & 'reading more values of increment', restartInc - 1_pInt, 'from file' @@ -236,7 +232,7 @@ subroutine AL_init call IO_read_realFile(777,'C_ref',trim(getSolverJobName()),size(C_minMaxAvg)) read (777,rec=1) C_minMaxAvg close (777) - endif readRestart + endif restartRead call Utilities_updateGamma(C_minMaxAvg,.True.) C_scale = C_minMaxAvg @@ -263,7 +259,7 @@ type(tSolutionState) function & use FEsolving, only: & restartWrite, & terminallyIll - + implicit none !-------------------------------------------------------------------------------------------------- @@ -286,6 +282,10 @@ type(tSolutionState) function & PetscErrorCode :: ierr SNESConvergedReason :: reason + external :: & + SNESSolve, & + SNESGetConvergedReason + incInfo = incInfoIn !-------------------------------------------------------------------------------------------------- @@ -298,7 +298,7 @@ type(tSolutionState) function & endif !-------------------------------------------------------------------------------------------------- -! set module wide availabe data +! set module wide availabe data mask_stress = P_BC%maskFloat params%P_BC = P_BC%values params%rotation_BC = rotation_BC @@ -387,6 +387,10 @@ subroutine AL_formResidual(in,x_scal,f_scal,dummy,ierr) integer(pInt) :: & i, j, k, e + external :: & + SNESGetNumberFunctionEvals, & + SNESGetIterationNumber + F => x_scal(1:3,1:3,1,& XG_RANGE,YG_RANGE,ZG_RANGE) F_lambda => x_scal(1:3,1:3,2,& @@ -414,7 +418,7 @@ subroutine AL_formResidual(in,x_scal,f_scal,dummy,ierr) write(6,'(/,a,/,3(3(f12.7,1x)/))',advance='no') ' deformation gradient aim (lab) =', & math_transpose33(math_rotate_backward33(F_aim,params%rotation_BC)) write(6,'(/,a,/,3(3(f12.7,1x)/))',advance='no') ' deformation gradient aim =', & - math_transpose33(F_aim) + math_transpose33(F_aim) flush(6) endif endif newIteration @@ -507,7 +511,7 @@ subroutine AL_converged(snes_local,PETScIter,xnorm,snorm,fnorm,reason,dummy,ierr fnorm SNESConvergedReason :: reason PetscObject :: dummy - PetscErrorCode ::ierr + PetscErrorCode :: ierr real(pReal) :: & curlTol, & divTol, & @@ -704,6 +708,11 @@ subroutine AL_destroy() implicit none PetscErrorCode :: ierr + external :: & + VecDestroy, & + SNESDestroy, & + DMDestroy + call VecDestroy(solution_vec,ierr); CHKERRQ(ierr) call SNESDestroy(snes,ierr); CHKERRQ(ierr) call DMDestroy(da,ierr); CHKERRQ(ierr) diff --git a/code/spectral_mech_Basic.f90 b/code/spectral_mech_Basic.f90 index 358a095d1..445fbdf10 100644 --- a/code/spectral_mech_Basic.f90 +++ b/code/spectral_mech_Basic.f90 @@ -48,7 +48,7 @@ module spectral_mech_basic C_volAvg = 0.0_pReal, & !< current volume average stiffness C_volAvgLastInc = 0.0_pReal, & !< previous volume average stiffness C_minMaxAvg = 0.0_pReal, & !< current (min+max)/2 stiffness - S = 0.0_pReal !< current compliance (filled up with zeros) + S = 0.0_pReal !< current compliance (filled up with zeros) real(pReal), private :: err_stress, err_div logical, private :: ForwardData integer(pInt), private :: & @@ -61,21 +61,7 @@ module spectral_mech_basic BasicPETSc_forward, & basicPETSc_destroy external :: & - VecDestroy, & - DMDestroy, & - DMDACreate3D, & - DMCreateGlobalVector, & - DMDASNESSetFunctionLocal, & PETScFinalize, & - SNESDestroy, & - SNESGetNumberFunctionEvals, & - SNESGetIterationNumber, & - SNESSolve, & - SNESSetDM, & - SNESGetConvergedReason, & - SNESSetConvergenceTest, & - SNESSetFromOptions, & - SNESCreate, & MPI_Abort, & MPI_Bcast, & MPI_Allreduce @@ -105,7 +91,7 @@ subroutine basicPETSc_init use spectral_utilities, only: & Utilities_constitutiveResponse, & Utilities_updateGamma, & - utilities_updateIPcoords, & + Utilities_updateIPcoords, & wgt use mesh, only: & grid, & @@ -115,15 +101,28 @@ subroutine basicPETSc_init implicit none real(pReal), dimension(3,3,grid(1),grid(2),grid3) :: P - PetscScalar, dimension(:,:,:,:), pointer :: F - PetscErrorCode :: ierr - PetscObject :: dummy real(pReal), dimension(3,3) :: & temp33_Real = 0.0_pReal + + PetscErrorCode :: ierr + PetscObject :: dummy + PetscScalar, pointer, dimension(:,:,:,:) :: F + integer(pInt), dimension(:), allocatable :: localK integer(pInt) :: proc character(len=1024) :: rankStr - + + external :: & + SNESCreate, & + SNESSetOptionsPrefix, & + DMDACreate3D, & + SNESSetDM, & + DMCreateGlobalVector, & + DMDASNESSetFunctionLocal, & + SNESGetConvergedReason, & + SNESSetConvergenceTest, & + SNESSetFromOptions + mainProcess: if (worldrank == 0_pInt) then write(6,'(/,a)') ' <<<+- DAMASK_spectral_solverBasicPETSc init -+>>>' write(6,'(a15,a)') ' Current time: ',IO_timeStamp() @@ -147,9 +146,9 @@ subroutine basicPETSc_init DM_BOUNDARY_NONE, DM_BOUNDARY_NONE, DM_BOUNDARY_NONE, & ! cut off stencil at boundary DMDA_STENCIL_BOX, & ! Moore (26) neighborhood around central point grid(1),grid(2),grid(3), & ! global grid - 1, 1, worldsize, & + 1 , 1, worldsize, & 9, 0, & ! #dof (F tensor), ghost boundary width (domain overlap) - grid (1),grid (2),localK, & ! local grid + grid(1),grid(2),localK, & ! local grid da,ierr) ! handle, error CHKERRQ(ierr) call SNESSetDM(snes,da,ierr); CHKERRQ(ierr) @@ -195,10 +194,9 @@ subroutine basicPETSc_init temp33_Real, & .false., & math_I3) - call DMDAVecRestoreArrayF90(da,solution_vec,F,ierr); CHKERRQ(ierr) ! write data back to PETSc - restartRead: if (restartInc > 1_pInt) then + restartRead: if (restartInc > 1_pInt) then if (iand(debug_level(debug_spectral),debug_spectralRestart)/= 0 .and. worldrank == 0_pInt) & write(6,'(/,a,'//IO_intOut(restartInc-1_pInt)//',a)') & 'reading more values of increment', restartInc - 1_pInt, 'from file' @@ -243,19 +241,24 @@ type(tSolutionState) function & timeinc, & !< increment in time for current solution timeinc_old, & !< increment in time of last increment loadCaseTime !< remaining time of current load case + logical, intent(in) :: & + guess type(tBoundaryCondition), intent(in) :: & P_BC, & F_BC character(len=*), intent(in) :: & incInfoIn real(pReal), dimension(3,3), intent(in) :: rotation_BC - logical, intent(in) :: & - guess !-------------------------------------------------------------------------------------------------- ! PETSc Data PetscErrorCode :: ierr SNESConvergedReason :: reason + + external :: & + SNESSolve, & + SNESGetConvergedReason + incInfo = incInfoIn !-------------------------------------------------------------------------------------------------- @@ -263,9 +266,9 @@ type(tSolutionState) function & S = Utilities_maskedCompliance(rotation_BC,P_BC%maskLogical,C_volAvg) if (update_gamma) call Utilities_updateGamma(C_minmaxAvg,restartWrite) - + !-------------------------------------------------------------------------------------------------- -! set module wide availabe data +! set module wide availabe data mask_stress = P_BC%maskFloat params%P_BC = P_BC%values params%rotation_BC = rotation_BC @@ -292,7 +295,7 @@ end function BasicPETSc_solution !-------------------------------------------------------------------------------------------------- -!> @brief forms the AL residual vector +!> @brief forms the basic residual vector !-------------------------------------------------------------------------------------------------- subroutine BasicPETSC_formResidual(in,x_scal,f_scal,dummy,ierr) use numerics, only: & @@ -312,10 +315,11 @@ subroutine BasicPETSC_formResidual(in,x_scal,f_scal,dummy,ierr) debug_spectral, & debug_spectralRotation use spectral_utilities, only: & + wgt, & tensorField_real, & utilities_FFTtensorForward, & - utilities_FFTtensorBackward, & utilities_fourierGammaConvolution, & + utilities_FFTtensorBackward, & Utilities_constitutiveResponse, & Utilities_divergenceRMS use IO, only: & @@ -338,11 +342,15 @@ subroutine BasicPETSC_formResidual(in,x_scal,f_scal,dummy,ierr) PetscObject :: dummy PetscErrorCode :: ierr + external :: & + SNESGetNumberFunctionEvals, & + SNESGetIterationNumber + call SNESGetNumberFunctionEvals(snes,nfuncs,ierr); CHKERRQ(ierr) call SNESGetIterationNumber(snes,PETScIter,ierr); CHKERRQ(ierr) if(nfuncs== 0 .and. PETScIter == 0) totalIter = -1_pInt ! new increment - newIteration: if (totalIter <= PETScIter) then + newIteration: if(totalIter <= PETScIter) then !-------------------------------------------------------------------------------------------------- ! report begin of new iteration totalIter = totalIter + 1_pInt @@ -351,7 +359,7 @@ subroutine BasicPETSC_formResidual(in,x_scal,f_scal,dummy,ierr) ' @ Iteration ', itmin, '≤',totalIter, '≤', itmax if (iand(debug_level(debug_spectral),debug_spectralRotation) /= 0) & write(6,'(/,a,/,3(3(f12.7,1x)/))',advance='no') ' deformation gradient aim (lab) =', & - math_transpose33(math_rotate_backward33(F_aim,params%rotation_BC)) + math_transpose33(math_rotate_backward33(F_aim,params%rotation_BC)) write(6,'(/,a,/,3(3(f12.7,1x)/))',advance='no') ' deformation gradient aim =', & math_transpose33(F_aim) flush(6) @@ -401,7 +409,7 @@ subroutine BasicPETSc_converged(snes_local,PETScIter,xnorm,snorm,fnorm,reason,du worldrank use FEsolving, only: & terminallyIll - + implicit none SNES :: snes_local PetscInt :: PETScIter @@ -415,10 +423,10 @@ subroutine BasicPETSc_converged(snes_local,PETScIter,xnorm,snorm,fnorm,reason,du real(pReal) :: & divTol, & stressTol - + divTol = max(maxval(abs(P_av))*err_div_tolRel,err_div_tolAbs) stressTol = max(maxval(abs(P_av))*err_stress_tolrel,err_stress_tolabs) - + converged: if ((totalIter >= itmin .and. & all([ err_div/divTol, & err_stress/stressTol ] < 1.0_pReal)) & @@ -451,21 +459,21 @@ subroutine BasicPETSc_forward(guess,timeinc,timeinc_old,loadCaseTime,F_BC,P_BC,r use math, only: & math_mul33x33 ,& math_rotate_backward33 + use numerics, only: & + worldrank use mesh, only: & grid, & grid3 use spectral_utilities, only: & Utilities_calculateRate, & Utilities_forwardField, & - utilities_updateIPcoords, & + Utilities_updateIPcoords, & tBoundaryCondition, & cutBack use IO, only: & IO_write_JobRealFile use FEsolving, only: & restartWrite - use numerics, only: & - worldrank implicit none real(pReal), intent(in) :: & @@ -478,8 +486,9 @@ subroutine BasicPETSc_forward(guess,timeinc,timeinc_old,loadCaseTime,F_BC,P_BC,r real(pReal), dimension(3,3), intent(in) :: rotation_BC logical, intent(in) :: & guess + PetscErrorCode :: ierr PetscScalar, pointer :: F(:,:,:,:) - PetscErrorCode :: ierr + character(len=1024) :: rankStr call DMDAVecGetArrayF90(da,solution_vec,F,ierr) @@ -508,7 +517,7 @@ subroutine BasicPETSc_forward(guess,timeinc,timeinc_old,loadCaseTime,F_BC,P_BC,r write (777,rec=1) C_volAvgLastInc close(777) endif - endif + endif call utilities_updateIPcoords(F) @@ -538,6 +547,7 @@ subroutine BasicPETSc_forward(guess,timeinc,timeinc_old,loadCaseTime,F_BC,P_BC,r timeinc_old,guess,F_lastInc,reshape(F,[3,3,grid(1),grid(2),grid3])) F_lastInc = reshape(F, [3,3,grid(1),grid(2),grid3]) endif + F_aim = F_aim + f_aimDot * timeinc !-------------------------------------------------------------------------------------------------- @@ -558,6 +568,11 @@ subroutine BasicPETSc_destroy() implicit none PetscErrorCode :: ierr + external :: & + VecDestroy, & + SNESDestroy, & + DMDestroy + call VecDestroy(solution_vec,ierr); CHKERRQ(ierr) call SNESDestroy(snes,ierr); CHKERRQ(ierr) call DMDestroy(da,ierr); CHKERRQ(ierr) diff --git a/code/spectral_mech_Polarisation.f90 b/code/spectral_mech_Polarisation.f90 index d7f1599e5..fc9fae7d7 100644 --- a/code/spectral_mech_Polarisation.f90 +++ b/code/spectral_mech_Polarisation.f90 @@ -22,7 +22,7 @@ module spectral_mech_Polarisation DAMASK_spectral_solverPolarisation_label = 'polarisation' !-------------------------------------------------------------------------------------------------- -! derived types +! derived types type(tSolutionParams), private :: params real(pReal), private, dimension(3,3) :: mask_stress = 0.0_pReal @@ -31,7 +31,7 @@ module spectral_mech_Polarisation DM, private :: da SNES, private :: snes Vec, private :: solution_vec - + !-------------------------------------------------------------------------------------------------- ! common pointwise data real(pReal), private, dimension(:,:,:,:,:), allocatable :: & @@ -57,7 +57,7 @@ module spectral_mech_Polarisation S = 0.0_pReal, & !< current compliance (filled up with zeros) C_scale = 0.0_pReal, & S_scale = 0.0_pReal - + real(pReal), private :: & err_BC, & !< deviation from stress BC err_curl, & !< RMS of curl of F @@ -72,21 +72,7 @@ module spectral_mech_Polarisation Polarisation_forward, & Polarisation_destroy external :: & - VecDestroy, & - DMDestroy, & - DMDACreate3D, & - DMCreateGlobalVector, & - DMDASNESSetFunctionLocal, & PETScFinalize, & - SNESDestroy, & - SNESGetNumberFunctionEvals, & - SNESGetIterationNumber, & - SNESSolve, & - SNESSetDM, & - SNESGetConvergedReason, & - SNESSetConvergenceTest, & - SNESSetFromOptions, & - SNESCreate, & MPI_Abort, & MPI_Bcast, & MPI_Allreduce @@ -136,11 +122,22 @@ subroutine Polarisation_init integer(pInt) :: proc character(len=1024) :: rankStr - if (worldrank == 0_pInt) then + external :: & + SNESCreate, & + SNESSetOptionsPrefix, & + DMDACreate3D, & + SNESSetDM, & + DMCreateGlobalVector, & + DMDASNESSetFunctionLocal, & + SNESGetConvergedReason, & + SNESSetConvergenceTest, & + SNESSetFromOptions + + mainProcess: if (worldrank == 0_pInt) then write(6,'(/,a)') ' <<<+- DAMASK_spectral_solverPolarisation init -+>>>' write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif + endif mainProcess !-------------------------------------------------------------------------------------------------- ! allocate global fields @@ -150,7 +147,7 @@ subroutine Polarisation_init allocate (F_tauDot (3,3,grid(1),grid(2),grid3),source = 0.0_pReal) !-------------------------------------------------------------------------------------------------- -! PETSc Init +! initialize solver specific parts of PETSc call SNESCreate(PETSC_COMM_WORLD,snes,ierr); CHKERRQ(ierr) call SNESSetOptionsPrefix(snes,'mech_',ierr);CHKERRQ(ierr) allocate(localK(worldsize), source = 0); localK(worldrank+1) = grid3 @@ -163,7 +160,7 @@ subroutine Polarisation_init grid(1),grid(2),grid(3), & ! global grid 1 , 1, worldsize, & 18, 0, & ! #dof (F tensor), ghost boundary width (domain overlap) - grid (1),grid (2),localK, & ! local grid + grid(1),grid(2),localK, & ! local grid da,ierr) ! handle, error CHKERRQ(ierr) call SNESSetDM(snes,da,ierr); CHKERRQ(ierr) @@ -182,7 +179,7 @@ subroutine Polarisation_init restart: if (restartInc > 1_pInt) then if (iand(debug_level(debug_spectral),debug_spectralRestart)/= 0 .and. worldrank == 0_pInt) & write(6,'(/,a,'//IO_intOut(restartInc-1_pInt)//',a)') & - 'reading values of increment', restartInc - 1_pInt, 'from file' + 'reading values of increment ', restartInc - 1_pInt, ' from file' flush(6) write(rankStr,'(a1,i0)')'_',worldrank call IO_read_realFile(777,'F'//trim(rankStr),trim(getSolverJobName()),size(F)) @@ -221,7 +218,7 @@ subroutine Polarisation_init nullify(F_tau) call DMDAVecRestoreArrayF90(da,solution_vec,xx_psc,ierr); CHKERRQ(ierr) ! write data back to PETSc - readRestart: if (restartInc > 1_pInt) then + restartRead: if (restartInc > 1_pInt) then if (iand(debug_level(debug_spectral),debug_spectralRestart)/= 0 .and. worldrank == 0_pInt) & write(6,'(/,a,'//IO_intOut(restartInc-1_pInt)//',a)') & 'reading more values of increment', restartInc - 1_pInt, 'from file' @@ -235,7 +232,7 @@ subroutine Polarisation_init call IO_read_realFile(777,'C_ref',trim(getSolverJobName()),size(C_minMaxAvg)) read (777,rec=1) C_minMaxAvg close (777) - endif readRestart + endif restartRead call Utilities_updateGamma(C_minMaxAvg,.True.) C_scale = C_minMaxAvg @@ -262,7 +259,7 @@ type(tSolutionState) function & use FEsolving, only: & restartWrite, & terminallyIll - + implicit none !-------------------------------------------------------------------------------------------------- @@ -285,6 +282,10 @@ type(tSolutionState) function & PetscErrorCode :: ierr SNESConvergedReason :: reason + external :: & + SNESSolve, & + SNESGetConvergedReason + incInfo = incInfoIn !-------------------------------------------------------------------------------------------------- @@ -385,7 +386,11 @@ subroutine Polarisation_formResidual(in,x_scal,f_scal,dummy,ierr) PetscErrorCode :: ierr integer(pInt) :: & i, j, k, e - + + external :: & + SNESGetNumberFunctionEvals, & + SNESGetIterationNumber + F => x_scal(1:3,1:3,1,& XG_RANGE,YG_RANGE,ZG_RANGE) F_tau => x_scal(1:3,1:3,2,& @@ -505,7 +510,7 @@ subroutine Polarisation_converged(snes_local,PETScIter,xnorm,snorm,fnorm,reason, fnorm SNESConvergedReason :: reason PetscObject :: dummy - PetscErrorCode ::ierr + PetscErrorCode :: ierr real(pReal) :: & curlTol, & divTol, & @@ -631,7 +636,8 @@ subroutine Polarisation_forward(guess,timeinc,timeinc_old,loadCaseTime,F_BC,P_BC write (777,rec=1) C_volAvgLastInc close(777) endif - endif + endif + call utilities_updateIPcoords(F) if (cutBack) then @@ -701,6 +707,11 @@ subroutine Polarisation_destroy() implicit none PetscErrorCode :: ierr + external :: & + VecDestroy, & + SNESDestroy, & + DMDestroy + call VecDestroy(solution_vec,ierr); CHKERRQ(ierr) call SNESDestroy(snes,ierr); CHKERRQ(ierr) call DMDestroy(da,ierr); CHKERRQ(ierr) diff --git a/code/spectral_thermal.f90 b/code/spectral_thermal.f90 index 985bdf0c6..ab980e091 100644 --- a/code/spectral_thermal.f90 +++ b/code/spectral_thermal.f90 @@ -42,7 +42,6 @@ module spectral_thermal integer(pInt), private :: totalIter = 0_pInt !< total iteration in current increment real(pReal), dimension(3,3), private :: D_ref real(pReal), private :: mobility_ref - character(len=1024), private :: incInfo public :: & spectral_thermal_init, & @@ -50,21 +49,7 @@ module spectral_thermal spectral_thermal_forward, & spectral_thermal_destroy external :: & - VecDestroy, & - DMDestroy, & - DMDACreate3D, & - DMCreateGlobalVector, & - DMDASNESSetFunctionLocal, & PETScFinalize, & - SNESDestroy, & - SNESGetNumberFunctionEvals, & - SNESGetIterationNumber, & - SNESSolve, & - SNESSetDM, & - SNESGetConvergedReason, & - SNESSetConvergenceTest, & - SNESSetFromOptions, & - SNESCreate, & MPI_Abort, & MPI_Bcast, & MPI_Allreduce @@ -99,10 +84,20 @@ subroutine spectral_thermal_init integer(pInt) :: proc integer(pInt) :: i, j, k, cell DM :: thermal_grid - PetscScalar, pointer :: x_scal(:,:,:) + PetscScalar, dimension(:,:,:), pointer :: x_scal PetscErrorCode :: ierr PetscObject :: dummy + external :: & + SNESCreate, & + SNESSetOptionsPrefix, & + DMDACreate3D, & + SNESSetDM, & + DMDAGetCorners, & + DMCreateGlobalVector, & + DMDASNESSetFunctionLocal, & + SNESSetFromOptions + mainProcess: if (worldrank == 0_pInt) then write(6,'(/,a)') ' <<<+- spectral_thermal init -+>>>' write(6,'(a15,a)') ' Current time: ',IO_timeStamp() @@ -154,6 +149,8 @@ subroutine spectral_thermal_init x_scal(xstart:xend,ystart:yend,zstart:zend) = temperature_current call DMDAVecRestoreArrayF90(thermal_grid,solution,x_scal,ierr); CHKERRQ(ierr) +!-------------------------------------------------------------------------------------------------- +! thermal reference diffusion update cell = 0_pInt D_ref = 0.0_pReal mobility_ref = 0.0_pReal @@ -171,7 +168,7 @@ subroutine spectral_thermal_init end subroutine spectral_thermal_init !-------------------------------------------------------------------------------------------------- -!> @brief solution for the Basic PETSC scheme with internal iterations +!> @brief solution for the spectral thermal scheme with internal iterations !-------------------------------------------------------------------------------------------------- type(tSolutionState) function spectral_thermal_solution(guess,timeinc,timeinc_old,loadCaseTime) use numerics, only: & @@ -196,12 +193,18 @@ type(tSolutionState) function spectral_thermal_solution(guess,timeinc,timeinc_ol integer(pInt) :: i, j, k, cell PetscInt :: position PetscReal :: minTemperature, maxTemperature, stagNorm, solnNorm - + !-------------------------------------------------------------------------------------------------- ! PETSc Data PetscErrorCode :: ierr SNESConvergedReason :: reason - + + external :: & + VecMin, & + VecMax, & + SNESSolve, & + SNESGetConvergedReason + spectral_thermal_solution%converged =.false. !-------------------------------------------------------------------------------------------------- @@ -355,8 +358,11 @@ subroutine spectral_thermal_forward(guess,timeinc,timeinc_old,loadCaseTime) logical, intent(in) :: guess integer(pInt) :: i, j, k, cell DM :: dm_local - PetscScalar, pointer :: x_scal(:,:,:) + PetscScalar, dimension(:,:,:), pointer :: x_scal PetscErrorCode :: ierr + + external :: & + SNESGetDM if (cutBack) then temperature_current = temperature_lastInc @@ -405,6 +411,10 @@ subroutine spectral_thermal_destroy() implicit none PetscErrorCode :: ierr + external :: & + VecDestroy, & + SNESDestroy + call VecDestroy(solution,ierr); CHKERRQ(ierr) call SNESDestroy(thermal_snes,ierr); CHKERRQ(ierr) From 21cfe0941230605fae556673a4d1e6478ad0897a Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 27 Jun 2016 18:15:56 +0200 Subject: [PATCH 036/412] removed a bunch of unneded functions --- code/mesh.f90 | 332 +------------------------------------------------- 1 file changed, 3 insertions(+), 329 deletions(-) diff --git a/code/mesh.f90 b/code/mesh.f90 index ada304d9e..5b999cdb4 100644 --- a/code/mesh.f90 +++ b/code/mesh.f90 @@ -640,7 +640,7 @@ subroutine mesh_init(ip,el) if (myDebug) write(6,'(a)') ' Built shared elements'; flush(6) call mesh_build_ipNeighborhood #else - call mesh_spectral_build_ipNeighborhood(FILEUNIT) + call mesh_spectral_build_ipNeighborhood #endif if (myDebug) write(6,'(a)') ' Built IP neighborhood'; flush(6) @@ -1388,11 +1388,9 @@ end subroutine mesh_spectral_build_elements !> @brief build neighborhood relations for spectral !> @details assign globals: mesh_ipNeighborhood !-------------------------------------------------------------------------------------------------- -subroutine mesh_spectral_build_ipNeighborhood(fileUnit) +subroutine mesh_spectral_build_ipNeighborhood implicit none - integer(pInt), intent(in) :: & - fileUnit integer(pInt) :: & x,y,z, & e @@ -1529,332 +1527,8 @@ function mesh_nodesAroundCentres(gDim,Favg,centres) result(nodes) nodes = nodes/8.0_pReal end function mesh_nodesAroundCentres - - -!-------------------------------------------------------------------------------------------------- -!> @brief calculate coordinates in current configuration for given defgrad -! using integration in Fourier space -!-------------------------------------------------------------------------------------------------- -function mesh_deformedCoordsFFT(gDim,F,FavgIn,scalingIn) result(coords) - use IO, only: & - IO_error - use numerics, only: & - fftw_timelimit, & - fftw_planner_flag - use debug, only: & - debug_mesh, & - debug_level, & - debug_levelBasic - use math, only: & - PI, & - math_mul33x3 - - implicit none - real(pReal), intent(in), dimension(:,:,:,:,:) :: F - real(pReal), dimension(3,size(F,3),size(F,4),size(F,5)) :: coords - real(pReal), intent(in), dimension(3) :: gDim - real(pReal), intent(in), dimension(3,3), optional :: FavgIn - real(pReal), intent(in), dimension(3), optional :: scalingIn - -! allocatable arrays for fftw c routines - type(C_PTR) :: planForth, planBack - type(C_PTR) :: coords_fftw, defgrad_fftw - real(pReal), dimension(:,:,:,:,:), pointer :: F_real - complex(pReal), dimension(:,:,:,:,:), pointer :: F_fourier - real(pReal), dimension(:,:,:,:), pointer :: coords_real - complex(pReal), dimension(:,:,:,:), pointer :: coords_fourier - ! other variables - integer(pInt) :: i, j, k, m, res1Red - integer(pInt), dimension(3) :: k_s, iRes - real(pReal), dimension(3) :: scaling, step, offset_coords, integrator - real(pReal), dimension(3,3) :: Favg - integer(pInt), dimension(2:3,2) :: Nyquist ! highest frequencies to be removed (1 if even, 2 if odd) - - if (present(scalingIn)) then - where (scalingIn < 0.0_pReal) ! invalid values. in case of f2py -1 if not present - scaling = [1.0_pReal,1.0_pReal,1.0_pReal] - elsewhere - scaling = scalingIn - end where - else - scaling = 1.0_pReal - endif - - iRes = [size(F,3),size(F,4),size(F,5)] - integrator = gDim / 2.0_pReal / PI ! see notes where it is used - res1Red = iRes(1)/2_pInt + 1_pInt ! size of complex array in first dimension (c2r, r2c) - step = gDim/real(iRes, pReal) - Nyquist(2,1:2) = [iRes(2)/2_pInt + 1_pInt, iRes(2)/2_pInt + 1_pInt + mod(iRes(2),2_pInt)] - Nyquist(3,1:2) = [iRes(3)/2_pInt + 1_pInt, iRes(3)/2_pInt + 1_pInt + mod(iRes(3),2_pInt)] - -!-------------------------------------------------------------------------------------------------- -! report - if (iand(debug_level(debug_mesh),debug_levelBasic) /= 0_pInt) then - write(6,'(a)') ' Restore geometry using FFT-based integration' - write(6,'(a,3(i12 ))') ' grid a b c: ', iRes - write(6,'(a,3(es12.5))') ' size x y z: ', gDim - endif - -!-------------------------------------------------------------------------------------------------- -! sanity check - if (pReal /= C_DOUBLE .or. pInt /= C_INT) & - call IO_error(0_pInt,ext_msg='Fortran to C in mesh_deformedCoordsFFT') - -!-------------------------------------------------------------------------------------------------- -! allocation and FFTW initialization - defgrad_fftw = fftw_alloc_complex(int(res1Red *iRes(2)*iRes(3)*9_pInt,C_SIZE_T)) ! C_SIZE_T is of type integer(8) - coords_fftw = fftw_alloc_complex(int(res1Red *iRes(2)*iRes(3)*3_pInt,C_SIZE_T)) ! C_SIZE_T is of type integer(8) - call c_f_pointer(defgrad_fftw, F_real, & - [iRes(1)+2_pInt-mod(iRes(1),2_pInt),iRes(2),iRes(3),3_pInt,3_pInt]) - call c_f_pointer(defgrad_fftw, F_fourier, & - [res1Red, iRes(2),iRes(3),3_pInt,3_pInt]) - call c_f_pointer(coords_fftw, coords_real, & - [iRes(1)+2_pInt-mod(iRes(1),2_pInt),iRes(2),iRes(3),3_pInt]) - call c_f_pointer(coords_fftw, coords_fourier, & - [res1Red, iRes(2),iRes(3),3_pInt]) - - call fftw_set_timelimit(fftw_timelimit) - planForth = fftw_plan_many_dft_r2c(3_pInt,[iRes(3),iRes(2) ,iRes(1)],9_pInt,& ! dimensions , length in each dimension in reversed order - F_real,[iRes(3),iRes(2) ,iRes(1)+2_pInt-mod(iRes(1),2_pInt)],& ! input data , physical length in each dimension in reversed order - 1_pInt, iRes(3)*iRes(2)*(iRes(1)+2_pInt-mod(iRes(1),2_pInt)),& ! striding , product of physical lenght in the 3 dimensions - F_fourier,[iRes(3),iRes(2) ,res1Red],& - 1_pInt, iRes(3)*iRes(2)* res1Red,fftw_planner_flag) - - planBack = fftw_plan_many_dft_c2r(3_pInt,[iRes(3),iRes(2) ,iRes(1)],3_pInt,& - coords_fourier,[iRes(3),iRes(2) ,res1Red],& - 1_pInt, iRes(3)*iRes(2)* res1Red,& - coords_real,[iRes(3),iRes(2) ,iRes(1)+2_pInt-mod(iRes(1),2_pInt)],& - 1_pInt, iRes(3)*iRes(2)*(iRes(1)+2_pInt-mod(iRes(1),2_pInt)),& - fftw_planner_flag) - F_real(1:iRes(1),1:iRes(2),1:iRes(3),1:3,1:3) = & - reshape(F,[iRes(1),iRes(2),iRes(3),3,3], order = [4,5,1,2,3]) ! F_real is overwritten during plan creatio, is larger (padding) and has different order - -!-------------------------------------------------------------------------------------------------- -! FFT - call fftw_execute_dft_r2c(planForth, F_real, F_fourier) - -!-------------------------------------------------------------------------------------------------- -! if no average F is given, compute it in Fourier space - if (present(FavgIn)) then - if (all(FavgIn < 0.0_pReal)) then - Favg = real(F_fourier(1,1,1,1:3,1:3),pReal)/real(product(iRes),pReal) !the f2py way to tell it is not present - else - Favg = FavgIn - endif - else - Favg = real(F_fourier(1,1,1,1:3,1:3),pReal)/real(product(iRes),pReal) - endif - -!-------------------------------------------------------------------------------------------------- -! remove highest frequency in each direction, in third direction only if not 2D - - if(iRes(1)/=1_pInt) & ! do not delete the whole slice in case of 2D calculation - F_fourier (res1Red, 1:iRes(2), 1:iRes(3), 1:3,1:3) & - = cmplx(0.0_pReal,0.0_pReal,pReal) - if(iRes(2)/=1_pInt) & ! do not delete the whole slice in case of 2D calculation - F_fourier (1:res1Red,Nyquist(2,1):Nyquist(2,2),1:iRes(3), 1:3,1:3) & - = cmplx(0.0_pReal,0.0_pReal,pReal) - if(iRes(3)/=1_pInt) & ! do not delete the whole slice in case of 2D calculation - F_fourier (1:res1Red,1:iRes(2), Nyquist(3,1):Nyquist(3,2),1:3,1:3) & - = cmplx(0.0_pReal,0.0_pReal,pReal) - -!-------------------------------------------------------------------------------------------------- -! integration in Fourier space - coords_fourier = cmplx(0.0_pReal,0.0_pReal,pReal) - do k = 1_pInt, iRes(3) - k_s(3) = k-1_pInt - if(k > iRes(3)/2_pInt+1_pInt) k_s(3) = k_s(3)-iRes(3) - do j = 1_pInt, iRes(2) - k_s(2) = j-1_pInt - if(j > iRes(2)/2_pInt+1_pInt) k_s(2) = k_s(2)-iRes(2) - do i = 1_pInt, res1Red - k_s(1) = i-1_pInt - do m = 1_pInt,3_pInt - coords_fourier(i,j,k,m) = sum(F_fourier(i,j,k,m,1:3)*& - cmplx(0.0_pReal,real(k_s,pReal)*integrator,pReal)) - enddo - if (any(k_s /= 0_pInt)) coords_fourier(i,j,k,1:3) = & - coords_fourier(i,j,k,1:3) / cmplx(-sum(k_s*k_s),0.0_pReal,pReal) - enddo; enddo; enddo - -!-------------------------------------------------------------------------------------------------- -! iFFT and freeing memory - call fftw_execute_dft_c2r(planBack,coords_fourier,coords_real) - coords = reshape(coords_real(1:iRes(1),1:iRes(2),1:iRes(3),1:3), [3,iRes(1),iRes(2),iRes(3)], & - order = [2,3,4,1])/real(product(iRes),pReal) ! weight and change order - call fftw_destroy_plan(planForth) - call fftw_destroy_plan(planBack) - call fftw_free(defgrad_fftw) - call fftw_free(coords_fftw) - -!-------------------------------------------------------------------------------------------------- -! add average to scaled fluctuation and put (0,0,0) on (0,0,0) - offset_coords = math_mul33x3(F(1:3,1:3,1,1,1),step/2.0_pReal) - scaling*coords(1:3,1,1,1) - forall(k = 1_pInt:iRes(3), j = 1_pInt:iRes(2), i = 1_pInt:iRes(1)) & - coords(1:3,i,j,k) = scaling(1:3)*coords(1:3,i,j,k) & - + offset_coords & - + math_mul33x3(Favg,step*real([i,j,k]-1_pInt,pReal)) - -end function mesh_deformedCoordsFFT - - -!-------------------------------------------------------------------------------------------------- -!> @brief calculates the mismatch between volume of reconstructed (compatible) cube and -! determinant of defgrad at the FP -!-------------------------------------------------------------------------------------------------- -function mesh_volumeMismatch(gDim,F,nodes) result(vMismatch) - use IO, only: & - IO_error - use debug, only: & - debug_mesh, & - debug_level, & - debug_levelBasic - use math, only: & - math_det33, & - math_volTetrahedron - - implicit none - real(pReal), intent(in), dimension(:,:,:,:,:) :: & - F - real(pReal), dimension(size(F,3),size(F,4),size(F,5)) :: & - vMismatch - real(pReal), intent(in), dimension(:,:,:,:) :: & - nodes - real(pReal), dimension(3) :: & - gDim - integer(pInt), dimension(3) :: & - iRes - real(pReal), dimension(3,8) :: coords - integer(pInt) :: i,j,k - real(pReal) :: volInitial - - iRes = [size(F,3),size(F,4),size(F,5)] - volInitial = product(gDim)/real(product(iRes), pReal) - -!-------------------------------------------------------------------------------------------------- -! report and check - if (iand(debug_level(debug_mesh),debug_levelBasic) /= 0_pInt) then - write(6,'(a)') ' Calculating volume mismatch' - write(6,'(a,3(i12 ))') ' grid a b c: ', iRes - write(6,'(a,3(es12.5))') ' size x y z: ', gDim - endif - - if (any([iRes/=size(nodes,2)-1_pInt,iRes/=size(nodes,3)-1_pInt,iRes/=size(nodes,4)-1_pInt]))& - call IO_error(0_pInt,ext_msg='Arrays F and nodes in mesh_volumeMismatch') - -!-------------------------------------------------------------------------------------------------- -! calculate actual volume and volume resulting from deformation gradient - do k = 1_pInt,iRes(3) - do j = 1_pInt,iRes(2) - do i = 1_pInt,iRes(1) - coords(1:3,1) = nodes(1:3,i, j, k ) - coords(1:3,2) = nodes(1:3,i+1_pInt,j, k ) - coords(1:3,3) = nodes(1:3,i+1_pInt,j+1_pInt,k ) - coords(1:3,4) = nodes(1:3,i, j+1_pInt,k ) - coords(1:3,5) = nodes(1:3,i, j, k+1_pInt) - coords(1:3,6) = nodes(1:3,i+1_pInt,j, k+1_pInt) - coords(1:3,7) = nodes(1:3,i+1_pInt,j+1_pInt,k+1_pInt) - coords(1:3,8) = nodes(1:3,i, j+1_pInt,k+1_pInt) - vMismatch(i,j,k) = & - abs(math_volTetrahedron(coords(1:3,7),coords(1:3,1),coords(1:3,8),coords(1:3,4))) & - + abs(math_volTetrahedron(coords(1:3,7),coords(1:3,1),coords(1:3,8),coords(1:3,5))) & - + abs(math_volTetrahedron(coords(1:3,7),coords(1:3,1),coords(1:3,3),coords(1:3,4))) & - + abs(math_volTetrahedron(coords(1:3,7),coords(1:3,1),coords(1:3,3),coords(1:3,2))) & - + abs(math_volTetrahedron(coords(1:3,7),coords(1:3,5),coords(1:3,2),coords(1:3,6))) & - + abs(math_volTetrahedron(coords(1:3,7),coords(1:3,5),coords(1:3,2),coords(1:3,1))) - vMismatch(i,j,k) = vMismatch(i,j,k)/math_det33(F(1:3,1:3,i,j,k)) - enddo; enddo; enddo - vMismatch = vMismatch/volInitial - -end function mesh_volumeMismatch - - -!-------------------------------------------------------------------------------------------------- -!> @brief Routine to calculate the mismatch between the vectors from the central point to -! the corners of reconstructed (combatible) volume element and the vectors calculated by deforming -! the initial volume element with the current deformation gradient -!-------------------------------------------------------------------------------------------------- -function mesh_shapeMismatch(gDim,F,nodes,centres) result(sMismatch) - use IO, only: & - IO_error - use debug, only: & - debug_mesh, & - debug_level, & - debug_levelBasic - use math, only: & - math_mul33x3 - - implicit none - real(pReal), intent(in), dimension(:,:,:,:,:) :: & - F - real(pReal), dimension(size(F,3),size(F,4),size(F,5)) :: & - sMismatch - real(pReal), intent(in), dimension(:,:,:,:) :: & - nodes, & - centres - real(pReal), dimension(3) :: & - gDim, & - fRes - integer(pInt), dimension(3) :: & - iRes - real(pReal), dimension(3,8) :: coordsInitial - integer(pInt) i,j,k - - iRes = [size(F,3),size(F,4),size(F,5)] - fRes = real(iRes,pReal) - -!-------------------------------------------------------------------------------------------------- -! report and check - if (iand(debug_level(debug_mesh),debug_levelBasic) /= 0_pInt) then - write(6,'(a)') ' Calculating shape mismatch' - write(6,'(a,3(i12 ))') ' grid a b c: ', iRes - write(6,'(a,3(es12.5))') ' size x y z: ', gDim - endif - - if(any([iRes/=size(nodes,2)-1_pInt,iRes/=size(nodes,3)-1_pInt,iRes/=size(nodes,4)-1_pInt]) .or.& - any([iRes/=size(centres,2), iRes/=size(centres,3), iRes/=size(centres,4)]))& - call IO_error(0_pInt,ext_msg='Arrays F and nodes/centres in mesh_shapeMismatch') - -!-------------------------------------------------------------------------------------------------- -! initial positions - coordsInitial(1:3,1) = [-gDim(1)/fRes(1),-gDim(2)/fRes(2),-gDim(3)/fRes(3)] - coordsInitial(1:3,2) = [+gDim(1)/fRes(1),-gDim(2)/fRes(2),-gDim(3)/fRes(3)] - coordsInitial(1:3,3) = [+gDim(1)/fRes(1),+gDim(2)/fRes(2),-gDim(3)/fRes(3)] - coordsInitial(1:3,4) = [-gDim(1)/fRes(1),+gDim(2)/fRes(2),-gDim(3)/fRes(3)] - coordsInitial(1:3,5) = [-gDim(1)/fRes(1),-gDim(2)/fRes(2),+gDim(3)/fRes(3)] - coordsInitial(1:3,6) = [+gDim(1)/fRes(1),-gDim(2)/fRes(2),+gDim(3)/fRes(3)] - coordsInitial(1:3,7) = [+gDim(1)/fRes(1),+gDim(2)/fRes(2),+gDim(3)/fRes(3)] - coordsInitial(1:3,8) = [-gDim(1)/fRes(1),+gDim(2)/fRes(2),+gDim(3)/fRes(3)] - coordsInitial = coordsInitial/2.0_pReal - -!-------------------------------------------------------------------------------------------------- -! compare deformed original and deformed positions to actual positions - do k = 1_pInt,iRes(3) - do j = 1_pInt,iRes(2) - do i = 1_pInt,iRes(1) - sMismatch(i,j,k) = & - sqrt(sum((nodes(1:3,i, j, k ) - centres(1:3,i,j,k)& - - math_mul33x3(F(1:3,1:3,i,j,k), coordsInitial(1:3,1)))**2.0_pReal))& - + sqrt(sum((nodes(1:3,i+1_pInt,j, k ) - centres(1:3,i,j,k)& - - math_mul33x3(F(1:3,1:3,i,j,k), coordsInitial(1:3,2)))**2.0_pReal))& - + sqrt(sum((nodes(1:3,i+1_pInt,j+1_pInt,k ) - centres(1:3,i,j,k)& - - math_mul33x3(F(1:3,1:3,i,j,k), coordsInitial(1:3,3)))**2.0_pReal))& - + sqrt(sum((nodes(1:3,i, j+1_pInt,k ) - centres(1:3,i,j,k)& - - math_mul33x3(F(1:3,1:3,i,j,k), coordsInitial(1:3,4)))**2.0_pReal))& - + sqrt(sum((nodes(1:3,i, j, k+1_pInt) - centres(1:3,i,j,k)& - - math_mul33x3(F(1:3,1:3,i,j,k), coordsInitial(1:3,5)))**2.0_pReal))& - + sqrt(sum((nodes(1:3,i+1_pInt,j, k+1_pInt) - centres(1:3,i,j,k)& - - math_mul33x3(F(1:3,1:3,i,j,k), coordsInitial(1:3,6)))**2.0_pReal))& - + sqrt(sum((nodes(1:3,i+1_pInt,j+1_pInt,k+1_pInt) - centres(1:3,i,j,k)& - - math_mul33x3(F(1:3,1:3,i,j,k), coordsInitial(1:3,7)))**2.0_pReal))& - + sqrt(sum((nodes(1:3,i, j+1_pInt,k+1_pInt) - centres(1:3,i,j,k)& - - math_mul33x3(F(1:3,1:3,i,j,k), coordsInitial(1:3,8)))**2.0_pReal)) - enddo; enddo; enddo - -end function mesh_shapeMismatch #endif - - + #ifdef Marc4DAMASK !-------------------------------------------------------------------------------------------------- !> @brief Figures out table styles (Marc only) and stores to 'initialcondTableStyle' and From 8307a4a9abe5a8ab65b9d7ec3b8015fd1ad7844c Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 27 Jun 2016 19:38:12 +0200 Subject: [PATCH 037/412] trying to get the last things work without the core module --- processing/post/addCompatibilityMismatch.py | 165 +++++++++++++++----- 1 file changed, 122 insertions(+), 43 deletions(-) diff --git a/processing/post/addCompatibilityMismatch.py b/processing/post/addCompatibilityMismatch.py index 4e474a482..b082ca45b 100755 --- a/processing/post/addCompatibilityMismatch.py +++ b/processing/post/addCompatibilityMismatch.py @@ -3,12 +3,85 @@ import os,sys import numpy as np +import math +import scipy.ndimage from optparse import OptionParser import damask scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptID = ' '.join([scriptName,damask.version]) +#-------------------------------------------------------------------------------------------------- +def cell2node(cellData,grid): + + nodeData = 0.0 + datalen = np.array(cellData.shape[3:]).prod() + + for i in xrange(datalen): + node = scipy.ndimage.convolve(cellData.reshape(tuple(grid)+(datalen,))[...,i], + np.ones((2,2,2))/8., # 2x2x2 neighborhood of cells + mode = 'wrap', + origin = -1, # offset to have cell origin as center + ) # now averaged at cell origins + node = np.append(node,node[np.newaxis,0,:,:,...],axis=0) # wrap along z + node = np.append(node,node[:,0,np.newaxis,:,...],axis=1) # wrap along y + node = np.append(node,node[:,:,0,np.newaxis,...],axis=2) # wrap along x + + nodeData = node[...,np.newaxis] if i==0 else np.concatenate((nodeData,node[...,np.newaxis]),axis=-1) + + return nodeData + +#-------------------------------------------------------------------------------------------------- +def displacementAvgFFT(F,grid,size,nodal=False,transformed=False): + """calculate average cell center (or nodal) displacement for deformation gradient field specified in each grid cell""" + if nodal: + x, y, z = np.meshgrid(np.linspace(0,size[0],1+grid[0]), + np.linspace(0,size[1],1+grid[1]), + np.linspace(0,size[2],1+grid[2]), + indexing = 'ij') + else: + x, y, z = np.meshgrid(np.linspace(0,size[0],grid[0],endpoint=False), + np.linspace(0,size[1],grid[1],endpoint=False), + np.linspace(0,size[2],grid[2],endpoint=False), + indexing = 'ij') + + origCoords = np.concatenate((z[:,:,:,None],y[:,:,:,None],x[:,:,:,None]),axis = 3) + + F_fourier = F if transformed else np.fft.rfftn(F,axes=(0,1,2)) # transform or use provided data + Favg = np.real(F_fourier[0,0,0,:,:])/grid.prod() # take zero freq for average + avgDisplacement = np.einsum('ml,ijkl->ijkm',Favg-np.eye(3),origCoords) # dX = Favg.X + + return avgDisplacement + +#-------------------------------------------------------------------------------------------------- +def displacementFluctFFT(F,grid,size,nodal=False,transformed=False): + """calculate cell center (or nodal) displacement for deformation gradient field specified in each grid cell""" + integrator = 0.5j * size / math.pi + + kk, kj, ki = np.meshgrid(np.where(np.arange(grid[2])>grid[2]//2,np.arange(grid[2])-grid[2],np.arange(grid[2])), + np.where(np.arange(grid[1])>grid[1]//2,np.arange(grid[1])-grid[1],np.arange(grid[1])), + np.arange(grid[0]//2+1), + indexing = 'ij') + k_s = np.concatenate((ki[:,:,:,None],kj[:,:,:,None],kk[:,:,:,None]),axis = 3) + k_sSquared = np.einsum('...l,...l',k_s,k_s) + k_sSquared[0,0,0] = 1.0 # ignore global average frequency + +#-------------------------------------------------------------------------------------------------- +# integration in Fourier space + + displacement_fourier = +np.einsum('ijkml,ijkl,l->ijkm', + F if transformed else np.fft.rfftn(F,axes=(0,1,2)), + k_s, + integrator, + ) / k_sSquared[...,np.newaxis] + +#-------------------------------------------------------------------------------------------------- +# backtransformation to real space + + displacement = np.fft.irfftn(displacement_fourier,grid,axes=(0,1,2)) + + return cell2node(displacement,grid) if nodal else displacement + def volTetrahedron(coords): """ @@ -188,66 +261,71 @@ for name in filenames: errors = [] remarks = [] - if table.label_dimension(options.pos) != 3: - errors.append('coordinates "{}" are not a vector.'.format(options.pos)) - else: colCoord = table.label_index(options.pos) - if table.label_dimension(options.defgrad) != 9: - errors.append('deformation gradient "{}" is not a tensor.'.format(options.defgrad)) - else: colF = table.label_index(options.defgrad) + errors.append('deformation gradient "{}" is not a 3x3 tensor.'.format(options.defgrad)) + + coordDim = table.label_dimension(options.pos) + if not 3 >= coordDim >= 1: + errors.append('coordinates "{}" need to have one, two, or three dimensions.'.format(options.pos)) + elif coordDim < 3: + remarks.append('appending {} dimension{} to coordinates "{}"...'.format(3-coordDim, + 's' if coordDim < 2 else '', + options.pos)) if remarks != []: damask.util.croak(remarks) if errors != []: damask.util.croak(errors) - table.close(dismiss = True) + table.close(dismiss=True) continue -# ------------------------------------------ assemble header -------------------------------------- - - table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) - if options.shape: table.labels_append('shapeMismatch({})'.format(options.defgrad)) - if options.volume: table.labels_append('volMismatch({})'.format(options.defgrad)) - # --------------- figure out size and grid --------------------------------------------------------- - table.data_readArray() + table.data_readArray([options.defgrad,options.pos]) + table.data_rewind() - coords = [np.unique(table.data[:,colCoord+i]) for i in xrange(3)] + if len(table.data.shape) < 2: table.data.shape += (1,) # expand to 2D shape + if table.data[:,9:].shape[1] < 3: + table.data = np.hstack((table.data, + np.zeros((table.data.shape[0], + 3-table.data[:,9:].shape[1]),dtype='f'))) # fill coords up to 3D with zeros + + coords = [np.unique(table.data[:,9+i]) for i in xrange(3)] mincorner = np.array(map(min,coords)) maxcorner = np.array(map(max,coords)) grid = np.array(map(len,coords),'i') size = grid/np.maximum(np.ones(3,'d'), grid-1.0) * (maxcorner-mincorner) # size from edge to edge = dim * n/(n-1) - size = np.where(grid > 1, size, min(size[grid > 1]/grid[grid > 1])) # grid==1 spacing set to smallest among other ones + size = np.where(grid > 1, size, min(size[grid > 1]/grid[grid > 1])) # spacing for grid==1 set to smallest among other spacings N = grid.prod() - -# --------------- figure out columns to process --------------------------------------------------- - key = '1_'+options.defgrad - if table.label_index(key) == -1: - damask.util.croak('column "{}" not found...'.format(key)) + + if N != len(table.data): errors.append('data count {} does not match grid {}x{}x{}.'.format(N,*grid)) + if errors != []: + damask.util.croak(errors) + table.close(dismiss = True) continue - else: - column = table.label_index(key) # remember columns of requested data - -# ------------------------------------------ assemble header --------------------------------------- - if options.shape: table.labels_append(['shapeMismatch({})'.format(options.defgrad)]) - if options.volume: table.labels_append(['volMismatch({})'.format(options.defgrad)]) - table.head_write() - -# ------------------------------------------ read deformation gradient field ----------------------- - table.data_rewind() - F = np.zeros(N*9,'d').reshape([3,3]+list(grid)) - idx = 0 - while table.data_read(): - (x,y,z) = damask.util.gridLocation(idx,grid) # figure out (x,y,z) position from line count - idx += 1 - F[0:3,0:3,x,y,z] = np.array(map(float,table.data[column:column+9]),'d').reshape(3,3) - Favg = damask.core.math.tensorAvg(F) - centres = damask.core.mesh.deformedCoordsFFT(size,F,Favg,[1.0,1.0,1.0]) - nodes = damask.core.mesh.nodesAroundCentres(size,Favg,centres) - if options.shape: shapeMismatch = shapeMismatch( size,F,nodes,centres) - if options.volume: volumeMismatch = volumeMismatch(size,F,nodes) +# -----------------------------process data and assemble header ------------------------------------- + + F_fourier = np.fft.rfftn(table.data[:,:9].reshape(grid[2],grid[1],grid[0],3,3),axes=(0,1,2)) # perform transform only once... + nodes = np.vstack(np.meshgrid(np.linspace(0.0,size[0],grid[0]+1), + np.linspace(0.0,size[1],grid[1]+1), + np.linspace(0.0,size[2],grid[2]+1))).reshape([3,17,17,17]).T\ + + displacementFluctFFT(F_fourier,grid,size,True,transformed=True)\ + + displacementAvgFFT (F_fourier,grid,size,True,transformed=True) + if options.shape: + table.labels_append(['shapeMismatch({})'.format(options.defgrad)]) + centres = np.vstack(np.meshgrid(np.linspace(size[0]/grid[0]*.5,size[0]-size[0]/grid[0]*.5,grid[0]), + np.linspace(size[1]/grid[1]*.5,size[1]-size[1]/grid[1]*.5,grid[1]), + np.linspace(size[2]/grid[2]*.5,size[2]-size[2]/grid[2]*.5,grid[2]))).reshape([3,16,16,16]).T\ + + displacementFluctFFT(F_fourier,grid,size,False,transformed=True)\ + + displacementAvgFFT (F_fourier,grid,size,False,transformed=True) + + if options.volume: + table.labels_append(['volMismatch({})'.format(options.defgrad)]) + + table.head_write() + if options.shape: shapeMismatch = shapeMismatch( size,table.data[:,:9].reshape(grid[2],grid[1],grid[0],3,3),nodes,centres) + if options.volume: volumeMismatch = volumeMismatch(size,table.data[:,:9].reshape(grid[2],grid[1],grid[0],3,3),nodes) # ------------------------------------------ process data ------------------------------------------ table.data_rewind() @@ -262,4 +340,5 @@ for name in filenames: # ------------------------------------------ output finalization ----------------------------------- - table.close() # close ASCII tables + table.close() + From bfc02af5150427c576ea129c5d6d5fc5bfdaf7b2 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 27 Jun 2016 23:15:41 +0200 Subject: [PATCH 038/412] closing stdout for mpi rannk >0 (enables to get rid of many if statements and allows for central debug handling like writing to file per process) --- code/spectral_interface.f90 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/spectral_interface.f90 b/code/spectral_interface.f90 index b10399cbd..e506bff7a 100644 --- a/code/spectral_interface.f90 +++ b/code/spectral_interface.f90 @@ -89,10 +89,10 @@ subroutine DAMASK_interface_init(loadCaseParameterIn,geometryParameterIn) #endif call PetscInitialize(PETSC_NULL_CHARACTER,ierr) ! according to PETSc manual, that should be the first line in the code CHKERRQ(ierr) ! this is a macro definition, it is case sensitive - open(6, encoding='UTF-8') call MPI_Comm_rank(PETSC_COMM_WORLD,worldrank,ierr);CHKERRQ(ierr) #endif mainProcess: if (worldrank == 0) then + open(6, encoding='UTF-8') call date_and_time(values = dateAndTime) write(6,'(/,a)') ' <<<+- DAMASK_spectral -+>>>' write(6,'(/,a)') ' Version: '//DAMASKVERSION @@ -104,6 +104,8 @@ subroutine DAMASK_interface_init(loadCaseParameterIn,geometryParameterIn) dateAndTime(7) write(6,'(/,a)') ' <<<+- DAMASK_interface init -+>>>' #include "compilation_info.f90" + else mainProcess + close(6) endif mainProcess if ( present(loadcaseParameterIn) .and. present(geometryParameterIn)) then ! both mandatory parameters given in function call geometryArg = geometryParameterIn From af2404f0f8accd01c211c407a12f905f825df9fc Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 27 Jun 2016 23:27:30 +0200 Subject: [PATCH 039/412] no access out of bounds anymore (but incorrect results) --- processing/post/addCompatibilityMismatch.py | 34 ++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/processing/post/addCompatibilityMismatch.py b/processing/post/addCompatibilityMismatch.py index b082ca45b..77e215acc 100755 --- a/processing/post/addCompatibilityMismatch.py +++ b/processing/post/addCompatibilityMismatch.py @@ -145,14 +145,14 @@ def volumeMismatch(size,F,nodes): for k in xrange(grid[2]): for j in xrange(grid[1]): for i in xrange(grid[0]): - coords[0,0:3] = nodes[0:3,i, j, k ] - coords[1,0:3] = nodes[0:3,i+1,j, k ] - coords[2,0:3] = nodes[0:3,i+1,j+1,k ] - coords[3,0:3] = nodes[0:3,i, j+1,k ] - coords[4,0:3] = nodes[0:3,i, j, k+1] - coords[5,0:3] = nodes[0:3,i+1,j, k+1] - coords[6,0:3] = nodes[0:3,i+1,j+1,k+1] - coords[7,0:3] = nodes[0:3,i, j+1,k+1] + coords[0,0:3] = nodes[i, j, k ,0:3] + coords[1,0:3] = nodes[i+1,j, k ,0:3] + coords[2,0:3] = nodes[i+1,j+1,k ,0:3] + coords[3,0:3] = nodes[i, j+1,k ,0:3] + coords[4,0:3] = nodes[i, j, k+1,0:3] + coords[5,0:3] = nodes[i+1,j, k+1,0:3] + coords[6,0:3] = nodes[i+1,j+1,k+1,0:3] + coords[7,0:3] = nodes[i, j+1,k+1,0:3] vMismatch[i,j,k] = \ abs(volTetrahedron([coords[6,0:3],coords[0,0:3],coords[7,0:3],coords[3,0:3]])) \ + abs(volTetrahedron([coords[6,0:3],coords[0,0:3],coords[7,0:3],coords[4,0:3]])) \ @@ -160,7 +160,7 @@ def volumeMismatch(size,F,nodes): + abs(volTetrahedron([coords[6,0:3],coords[0,0:3],coords[2,0:3],coords[1,0:3]])) \ + abs(volTetrahedron([coords[6,0:3],coords[4,0:3],coords[1,0:3],coords[5,0:3]])) \ + abs(volTetrahedron([coords[6,0:3],coords[4,0:3],coords[1,0:3],coords[0,0:3]])) - vMismatch[i,j,k] = vMismatch[i,j,k]/np.linalg.det(F[0:3,0:3,i,j,k]) + vMismatch[i,j,k] = vMismatch[i,j,k]/np.linalg.det(F[i,j,k,0:3,0:3]) return vMismatch/volInitial @@ -195,14 +195,14 @@ def shapeMismatch(size,F,nodes,centres): for j in xrange(grid[1]): for i in xrange(grid[0]): sMismatch[i,j,k] = \ - + np.linalg.norm(nodes[0:3,i, j, k] - centres[0:3,i,j,k] - np.dot(F[:,:,i,j,k], coordsInitial[0,0:3]))\ - + np.linalg.norm(nodes[0:3,i+1,j, k] - centres[0:3,i,j,k] - np.dot(F[:,:,i,j,k], coordsInitial[1,0:3]))\ - + np.linalg.norm(nodes[0:3,i+1,j+1,k ] - centres[0:3,i,j,k] - np.dot(F[:,:,i,j,k], coordsInitial[2,0:3]))\ - + np.linalg.norm(nodes[0:3,i, j+1,k ] - centres[0:3,i,j,k] - np.dot(F[:,:,i,j,k], coordsInitial[3,0:3]))\ - + np.linalg.norm(nodes[0:3,i, j, k+1] - centres[0:3,i,j,k] - np.dot(F[:,:,i,j,k], coordsInitial[4,0:3]))\ - + np.linalg.norm(nodes[0:3,i+1,j, k+1] - centres[0:3,i,j,k] - np.dot(F[:,:,i,j,k], coordsInitial[5,0:3]))\ - + np.linalg.norm(nodes[0:3,i+1,j+1,k+1] - centres[0:3,i,j,k] - np.dot(F[:,:,i,j,k], coordsInitial[6,0:3]))\ - + np.linalg.norm(nodes[0:3,i, j+1,k+1] - centres[0:3,i,j,k] - np.dot(F[:,:,i,j,k], coordsInitial[7,0:3])) + + np.linalg.norm(nodes[i, j, k,0:3] - centres[i,j,k,0:3] - np.dot(F[i,j,k,:,:], coordsInitial[0,0:3]))\ + + np.linalg.norm(nodes[i+1,j, k,0:3] - centres[i,j,k,0:3] - np.dot(F[i,j,k,:,:], coordsInitial[1,0:3]))\ + + np.linalg.norm(nodes[i+1,j+1,k ,0:3] - centres[i,j,k,0:3] - np.dot(F[i,j,k,:,:], coordsInitial[2,0:3]))\ + + np.linalg.norm(nodes[i, j+1,k ,0:3] - centres[i,j,k,0:3] - np.dot(F[i,j,k,:,:], coordsInitial[3,0:3]))\ + + np.linalg.norm(nodes[i, j, k+1,0:3] - centres[i,j,k,0:3] - np.dot(F[i,j,k,:,:], coordsInitial[4,0:3]))\ + + np.linalg.norm(nodes[i+1,j, k+1,0:3] - centres[i,j,k,0:3] - np.dot(F[i,j,k,:,:], coordsInitial[5,0:3]))\ + + np.linalg.norm(nodes[i+1,j+1,k+1,0:3] - centres[i,j,k,0:3] - np.dot(F[i,j,k,:,:], coordsInitial[6,0:3]))\ + + np.linalg.norm(nodes[i, j+1,k+1,0:3] - centres[i,j,k,0:3] - np.dot(F[i,j,k,:,:], coordsInitial[7,0:3])) return sMismatch From b759a79f9aad988a7849aa51896d4fdedf85584a Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 27 Jun 2016 23:36:09 +0200 Subject: [PATCH 040/412] small check to see if 6 is really STDOUT (no idea what to do if not) --- code/spectral_interface.f90 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/spectral_interface.f90 b/code/spectral_interface.f90 index e506bff7a..d5be8ad75 100644 --- a/code/spectral_interface.f90 +++ b/code/spectral_interface.f90 @@ -92,6 +92,10 @@ subroutine DAMASK_interface_init(loadCaseParameterIn,geometryParameterIn) call MPI_Comm_rank(PETSC_COMM_WORLD,worldrank,ierr);CHKERRQ(ierr) #endif mainProcess: if (worldrank == 0) then + if (output_unit /= 6) then + write(output_unit,'(a)') 'STDOUT != 6' + call quit(1_pInt) + endif open(6, encoding='UTF-8') call date_and_time(values = dateAndTime) write(6,'(/,a)') ' <<<+- DAMASK_spectral -+>>>' From 0a89900f72902ce311781b6416c0ba0ba44a246f Mon Sep 17 00:00:00 2001 From: Test User Date: Tue, 28 Jun 2016 04:24:11 +0200 Subject: [PATCH 041/412] updated version information after successful test of v2.0.0-297-ga27aba1 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 9c296336f..38c2a636c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.0-292-g2ebc5ec +v2.0.0-297-ga27aba1 From 9ea6d3afd7a874e7a00d03eb7149b75cdb7975de Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 29 Jun 2016 10:58:15 +0200 Subject: [PATCH 042/412] simplified FFT statements --- processing/post/addCurl.py | 6 +++--- processing/post/addDivergence.py | 6 +++--- processing/post/addGradient.py | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/processing/post/addCurl.py b/processing/post/addCurl.py index 3afec570a..79bb5f848 100755 --- a/processing/post/addCurl.py +++ b/processing/post/addCurl.py @@ -18,7 +18,7 @@ def curlFFT(geomdim,field): if n == 3: dataType = 'vector' elif n == 9: dataType = 'tensor' - field_fourier = np.fft.fftpack.rfftn(field,axes=(0,1,2),s=shapeFFT) + field_fourier = np.fft.rfftn(field,axes=(0,1,2),s=shapeFFT) curl_fourier = np.empty(field_fourier.shape,'c16') # differentiation in Fourier space @@ -56,7 +56,7 @@ def curlFFT(geomdim,field): curl_fourier[i,j,k,2] = ( field_fourier[i,j,k,1]*xi[0]\ -field_fourier[i,j,k,0]*xi[1]) *TWOPIIMG - return np.fft.fftpack.irfftn(curl_fourier,axes=(0,1,2),s=shapeFFT).reshape([N,n]) + return np.fft.irfftn(curl_fourier,axes=(0,1,2),s=shapeFFT).reshape([N,n]) # -------------------------------------------------------------------- @@ -158,7 +158,7 @@ for name in filenames: # we need to reverse order here, because x is fastest,ie rightmost, but leftmost in our x,y,z notation stack.append(curlFFT(size[::-1], table.data[:,data['column'][i]:data['column'][i]+data['dim']]. - reshape([grid[2],grid[1],grid[0]]+data['shape']))) + reshape(grid[::-1].tolist()+data['shape']))) # ------------------------------------------ output result ----------------------------------------- diff --git a/processing/post/addDivergence.py b/processing/post/addDivergence.py index 56ccb1b07..4c24eea3c 100755 --- a/processing/post/addDivergence.py +++ b/processing/post/addDivergence.py @@ -15,7 +15,7 @@ def divFFT(geomdim,field): N = grid.prod() # field size n = np.array(np.shape(field)[3:]).prod() # data size - field_fourier = np.fft.fftpack.rfftn(field,axes=(0,1,2),s=shapeFFT) + field_fourier = np.fft.rfftn(field,axes=(0,1,2),s=shapeFFT) div_fourier = np.empty(field_fourier.shape[0:len(np.shape(field))-1],'c16') # size depents on whether tensor or vector # differentiation in Fourier space @@ -42,7 +42,7 @@ def divFFT(geomdim,field): elif n == 3: # vector, 3 -> 1 div_fourier[i,j,k] = sum(field_fourier[i,j,k,0:3]*xi) *TWOPIIMG - return np.fft.fftpack.irfftn(div_fourier,axes=(0,1,2),s=shapeFFT).reshape([N,n/3]) + return np.fft.irfftn(div_fourier,axes=(0,1,2),s=shapeFFT).reshape([N,n/3]) # -------------------------------------------------------------------- @@ -145,7 +145,7 @@ for name in filenames: # we need to reverse order here, because x is fastest,ie rightmost, but leftmost in our x,y,z notation stack.append(divFFT(size[::-1], table.data[:,data['column'][i]:data['column'][i]+data['dim']]. - reshape([grid[2],grid[1],grid[0]]+data['shape']))) + reshape(grid[::-1].tolist()+data['shape']))) # ------------------------------------------ output result ----------------------------------------- diff --git a/processing/post/addGradient.py b/processing/post/addGradient.py index 66018a890..5ded3fc90 100755 --- a/processing/post/addGradient.py +++ b/processing/post/addGradient.py @@ -18,7 +18,7 @@ def gradFFT(geomdim,field): if n == 3: dataType = 'vector' elif n == 1: dataType = 'scalar' - field_fourier = np.fft.fftpack.rfftn(field,axes=(0,1,2),s=shapeFFT) + field_fourier = np.fft.rfftn(field,axes=(0,1,2),s=shapeFFT) grad_fourier = np.empty(field_fourier.shape+(3,),'c16') # differentiation in Fourier space @@ -46,7 +46,7 @@ def gradFFT(geomdim,field): grad_fourier[i,j,k,1,:] = field_fourier[i,j,k,1]*xi *TWOPIIMG # tensor field from vector data grad_fourier[i,j,k,2,:] = field_fourier[i,j,k,2]*xi *TWOPIIMG - return np.fft.fftpack.irfftn(grad_fourier,axes=(0,1,2),s=shapeFFT).reshape([N,3*n]) + return np.fft.irfftn(grad_fourier,axes=(0,1,2),s=shapeFFT).reshape([N,3*n]) # -------------------------------------------------------------------- @@ -148,7 +148,7 @@ for name in filenames: # we need to reverse order here, because x is fastest,ie rightmost, but leftmost in our x,y,z notation stack.append(gradFFT(size[::-1], table.data[:,data['column'][i]:data['column'][i]+data['dim']]. - reshape([grid[2],grid[1],grid[0]]+data['shape']))) + reshape(grid[::-1].tolist()+data['shape']))) # ------------------------------------------ output result ----------------------------------------- From a64388355af11cdee30741b755776e29ff69556b Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 29 Jun 2016 11:02:49 +0200 Subject: [PATCH 043/412] simplified --- processing/post/addCalculation.py | 32 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/processing/post/addCalculation.py b/processing/post/addCalculation.py index 8bfc7692f..8b5dd1d33 100755 --- a/processing/post/addCalculation.py +++ b/processing/post/addCalculation.py @@ -74,32 +74,30 @@ for name in filenames: } # ------------------------------------------ Evaluate condition --------------------------------------- - if options.condition: + if options.condition is not None: interpolator = [] - condition = options.condition # copy per file, since might be altered inline + condition = options.condition # copy per file, since might be altered inline breaker = False - for position,operand in enumerate(set(re.findall(r'#(([s]#)?(.+?))#',condition))): # find three groups + for position,operand in enumerate(set(re.findall(r'#(([s]#)?(.+?))#',condition))): # find three groups condition = condition.replace('#'+operand[0]+'#', { '': '{%i}'%position, 's#':'"{%i}"'%position}[operand[1]]) - if operand[2] in specials: # special label + if operand[2] in specials: # special label interpolator += ['specials["%s"]'%operand[2]] else: try: interpolator += ['%s(table.data[%i])'%({ '':'float', 's#':'str'}[operand[1]], - table.label_index(operand[2]))] # ccould be generalized to indexrange as array lookup + table.label_index(operand[2]))] # could be generalized to indexrange as array lookup except: damask.util.croak('column "{}" not found.'.format(operand[2])) breaker = True - if breaker: continue # found mistake in condition evaluation --> next file + if breaker: continue # found mistake in condition evaluation --> next file evaluator_condition = "'" + condition + "'.format(" + ','.join(interpolator) + ")" - else: condition = '' - # ------------------------------------------ build formulae ---------------------------------------- evaluator = {} @@ -165,19 +163,19 @@ for name in filenames: for label in output.labels(): oldIndices = table.label_indexrange(label) - Nold = max(1,len(oldIndices)) # Nold could be zero for new columns + Nold = max(1,len(oldIndices)) # Nold could be zero for new columns Nnew = len(output.label_indexrange(label)) output.data_append(eval(evaluator[label]) if label in options.labels and - (condition == '' or eval(eval(evaluator_condition))) - else np.tile([table.data[i] for i in oldIndices] - if label in tabLabels - else np.nan, - np.ceil(float(Nnew)/Nold))[:Nnew]) # spread formula result into given number of columns + (options.condition is None or eval(eval(evaluator_condition))) + else np.tile([table.data[i] for i in oldIndices] + if label in tabLabels + else np.nan, + np.ceil(float(Nnew)/Nold))[:Nnew]) # spread formula result into given number of columns - outputAlive = output.data_write() # output processed line + outputAlive = output.data_write() # output processed line # ------------------------------------------ output finalization ----------------------------------- - table.input_close() # close ASCII tables - output.close() # close ASCII tables + table.input_close() # close ASCII tables + output.close() # close ASCII tables From 9bf8b6221c39607ecde95bba35c37ab944e0f9cc Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 29 Jun 2016 12:11:07 +0200 Subject: [PATCH 044/412] fixed fluct displacement --- processing/post/addDisplacement.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/processing/post/addDisplacement.py b/processing/post/addDisplacement.py index bcc02f869..fe78fb02b 100755 --- a/processing/post/addDisplacement.py +++ b/processing/post/addDisplacement.py @@ -18,7 +18,7 @@ def cell2node(cellData,grid): datalen = np.array(cellData.shape[3:]).prod() for i in xrange(datalen): - node = scipy.ndimage.convolve(cellData.reshape(tuple(grid)+(datalen,))[...,i], + node = scipy.ndimage.convolve(cellData.reshape(tuple(grid[::-1])+(datalen,))[...,i], np.ones((2,2,2))/8., # 2x2x2 neighborhood of cells mode = 'wrap', origin = -1, # offset to have cell origin as center @@ -69,7 +69,7 @@ def displacementFluctFFT(F,grid,size,nodal=False,transformed=False): #-------------------------------------------------------------------------------------------------- # integration in Fourier space - displacement_fourier = +np.einsum('ijkml,ijkl,l->ijkm', + displacement_fourier = -np.einsum('ijkml,ijkl,l->ijkm', F if transformed else np.fft.rfftn(F,axes=(0,1,2)), k_s, integrator, @@ -78,7 +78,7 @@ def displacementFluctFFT(F,grid,size,nodal=False,transformed=False): #-------------------------------------------------------------------------------------------------- # backtransformation to real space - displacement = np.fft.irfftn(displacement_fourier,grid,axes=(0,1,2)) + displacement = np.fft.irfftn(displacement_fourier,grid[::-1],axes=(0,1,2)) return cell2node(displacement,grid) if nodal else displacement @@ -187,7 +187,7 @@ for name in filenames: F_fourier = np.fft.rfftn(table.data[:,:9].reshape(grid[2],grid[1],grid[0],3,3),axes=(0,1,2)) # perform transform only once... displacement = displacementFluctFFT(F_fourier,grid,size,options.nodal,transformed=True) - avgDisplacement = displacementAvgFFT (F_fourier,grid,size,options.nodal,transformed=True) + #avgDisplacement = displacementAvgFFT (F_fourier,grid,size,options.nodal,transformed=True) # ------------------------------------------ assemble header --------------------------------------- @@ -196,24 +196,24 @@ for name in filenames: table.labels_clear() table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) + #['{}_avg({}).{}' .format(i+1,options.defgrad,options.pos) for i in xrange(3)] + table.labels_append((['{}_pos' .format(i+1) for i in xrange(3)] if options.nodal else []) + - ['{}_avg({}).{}' .format(i+1,options.defgrad,options.pos) for i in xrange(3)] + ['{}_fluct({}).{}'.format(i+1,options.defgrad,options.pos) for i in xrange(3)] ) table.head_write() # ------------------------------------------ output data ------------------------------------------- - zrange = np.linspace(0,size[2],1+grid[2]) if options.nodal else xrange(grid[2]) - yrange = np.linspace(0,size[1],1+grid[1]) if options.nodal else xrange(grid[1]) - xrange = np.linspace(0,size[0],1+grid[0]) if options.nodal else xrange(grid[0]) + Zrange = np.linspace(0,size[2],1+grid[2]) if options.nodal else xrange(grid[2]) + Yrange = np.linspace(0,size[1],1+grid[1]) if options.nodal else xrange(grid[1]) + Xrange = np.linspace(0,size[0],1+grid[0]) if options.nodal else xrange(grid[0]) - for i,z in enumerate(zrange): - for j,y in enumerate(yrange): - for k,x in enumerate(xrange): + for i,z in enumerate(Zrange): + for j,y in enumerate(Yrange): + for k,x in enumerate(Xrange): if options.nodal: table.data_clear() else: table.data_read() table.data_append([x,y,z] if options.nodal else []) - table.data_append(list(avgDisplacement[i,j,k,:])) + #table.data_append(list(avgDisplacement[i,j,k,:])) table.data_append(list( displacement[i,j,k,:])) table.data_write() From 2c8427eb2ac0458aaf7ce03b3134ed8a8b658759 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 29 Jun 2016 12:35:50 +0200 Subject: [PATCH 045/412] seems to work now --- processing/post/addDisplacement.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/processing/post/addDisplacement.py b/processing/post/addDisplacement.py index fe78fb02b..a1a476185 100755 --- a/processing/post/addDisplacement.py +++ b/processing/post/addDisplacement.py @@ -35,14 +35,14 @@ def cell2node(cellData,grid): def displacementAvgFFT(F,grid,size,nodal=False,transformed=False): """calculate average cell center (or nodal) displacement for deformation gradient field specified in each grid cell""" if nodal: - x, y, z = np.meshgrid(np.linspace(0,size[0],1+grid[0]), + x, y, z = np.meshgrid(np.linspace(0,size[2],1+grid[2]), np.linspace(0,size[1],1+grid[1]), - np.linspace(0,size[2],1+grid[2]), + np.linspace(0,size[0],1+grid[0]), indexing = 'ij') else: - x, y, z = np.meshgrid(np.linspace(0,size[0],grid[0],endpoint=False), + x, y, z = np.meshgrid(np.linspace(0,size[2],grid[2],endpoint=False), np.linspace(0,size[1],grid[1],endpoint=False), - np.linspace(0,size[2],grid[2],endpoint=False), + np.linspace(0,size[0],grid[0],endpoint=False), indexing = 'ij') origCoords = np.concatenate((z[:,:,:,None],y[:,:,:,None],x[:,:,:,None]),axis = 3) @@ -186,8 +186,8 @@ for name in filenames: F_fourier = np.fft.rfftn(table.data[:,:9].reshape(grid[2],grid[1],grid[0],3,3),axes=(0,1,2)) # perform transform only once... - displacement = displacementFluctFFT(F_fourier,grid,size,options.nodal,transformed=True) - #avgDisplacement = displacementAvgFFT (F_fourier,grid,size,options.nodal,transformed=True) + fluctDisplacement = displacementFluctFFT(F_fourier,grid,size,options.nodal,transformed=True) + avgDisplacement = displacementAvgFFT (F_fourier,grid,size,options.nodal,transformed=True) # ------------------------------------------ assemble header --------------------------------------- @@ -196,8 +196,8 @@ for name in filenames: table.labels_clear() table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) - #['{}_avg({}).{}' .format(i+1,options.defgrad,options.pos) for i in xrange(3)] + table.labels_append((['{}_pos' .format(i+1) for i in xrange(3)] if options.nodal else []) + + ['{}_avg({}).{}' .format(i+1,options.defgrad,options.pos) for i in xrange(3)] + ['{}_fluct({}).{}'.format(i+1,options.defgrad,options.pos) for i in xrange(3)] ) table.head_write() @@ -213,8 +213,8 @@ for name in filenames: if options.nodal: table.data_clear() else: table.data_read() table.data_append([x,y,z] if options.nodal else []) - #table.data_append(list(avgDisplacement[i,j,k,:])) - table.data_append(list( displacement[i,j,k,:])) + table.data_append(list( avgDisplacement[i,j,k,:])) + table.data_append(list(fluctDisplacement[i,j,k,:])) table.data_write() # ------------------------------------------ output finalization ----------------------------------- From 39c9c18ade4c54376df092a9fd6880254c4694dd Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 29 Jun 2016 13:40:54 +0200 Subject: [PATCH 046/412] disabling stdout for MPIrank>0 now working for ifort: --- code/prec.f90 | 29 ++++++++--------------------- code/spectral_interface.f90 | 31 ++++++++++++++++++------------- 2 files changed, 26 insertions(+), 34 deletions(-) diff --git a/code/prec.f90 b/code/prec.f90 index 594201bee..bf9ac7124 100644 --- a/code/prec.f90 +++ b/code/prec.f90 @@ -130,30 +130,17 @@ subroutine prec_init iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment) implicit none - integer(pInt) :: worldrank = 0_pInt -#ifdef PETSc -#include - PetscErrorCode :: ierr -#endif external :: & - quit, & - MPI_Comm_rank, & - MPI_Abort - -#ifdef PETSc - call MPI_Comm_rank(PETSC_COMM_WORLD,worldrank,ierr);CHKERRQ(ierr) -#endif + quit - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- prec init -+>>>' + write(6,'(/,a)') ' <<<+- prec init -+>>>' #include "compilation_info.f90" - write(6,'(a,i3)') ' Bytes for pReal: ',pReal - write(6,'(a,i3)') ' Bytes for pInt: ',pInt - write(6,'(a,i3)') ' Bytes for pLongInt: ',pLongInt - write(6,'(a,e10.3)') ' NaN: ', DAMASK_NaN - write(6,'(a,l3)') ' NaN != NaN: ',DAMASK_NaN /= DAMASK_NaN - write(6,'(a,l3,/)') ' NaN check passed ',prec_isNAN(DAMASK_NaN) - endif mainProcess + write(6,'(a,i3)') ' Bytes for pReal: ',pReal + write(6,'(a,i3)') ' Bytes for pInt: ',pInt + write(6,'(a,i3)') ' Bytes for pLongInt: ',pLongInt + write(6,'(a,e10.3)') ' NaN: ', DAMASK_NaN + write(6,'(a,l3)') ' NaN != NaN: ',DAMASK_NaN /= DAMASK_NaN + write(6,'(a,l3,/)') ' NaN check passed ',prec_isNAN(DAMASK_NaN) if ((.not. prec_isNaN(DAMASK_NaN)) .or. (DAMASK_NaN == DAMASK_NaN)) call quit(9000) realloc_lhs_test = [1_pInt,2_pInt] diff --git a/code/spectral_interface.f90 b/code/spectral_interface.f90 index d5be8ad75..c774a2202 100644 --- a/code/spectral_interface.f90 +++ b/code/spectral_interface.f90 @@ -77,6 +77,8 @@ subroutine DAMASK_interface_init(loadCaseParameterIn,geometryParameterIn) MPI_Init_Thread, & MPI_abort + open(6, encoding='UTF-8') ! for special characters in output + !-------------------------------------------------------------------------------------------------- ! PETSc Init #ifdef PETSc @@ -91,26 +93,29 @@ subroutine DAMASK_interface_init(loadCaseParameterIn,geometryParameterIn) CHKERRQ(ierr) ! this is a macro definition, it is case sensitive call MPI_Comm_rank(PETSC_COMM_WORLD,worldrank,ierr);CHKERRQ(ierr) #endif + mainProcess: if (worldrank == 0) then if (output_unit /= 6) then write(output_unit,'(a)') 'STDOUT != 6' call quit(1_pInt) endif - open(6, encoding='UTF-8') - call date_and_time(values = dateAndTime) - write(6,'(/,a)') ' <<<+- DAMASK_spectral -+>>>' - write(6,'(/,a)') ' Version: '//DAMASKVERSION - write(6,'(a,2(i2.2,a),i4.4)') ' Date: ',dateAndTime(3),'/',& - dateAndTime(2),'/',& - dateAndTime(1) - write(6,'(a,2(i2.2,a),i2.2)') ' Time: ',dateAndTime(5),':',& - dateAndTime(6),':',& - dateAndTime(7) - write(6,'(/,a)') ' <<<+- DAMASK_interface init -+>>>' -#include "compilation_info.f90" else mainProcess - close(6) + close(6) ! disable output for non-master processes (open 6 to rank specific file for debug) + open(6,file='/dev/null',status='replace') ! close(6) alone will leave some temp files in cwd endif mainProcess + + call date_and_time(values = dateAndTime) + write(6,'(/,a)') ' <<<+- DAMASK_spectral -+>>>' + write(6,'(/,a)') ' Version: '//DAMASKVERSION + write(6,'(a,2(i2.2,a),i4.4)') ' Date: ',dateAndTime(3),'/',& + dateAndTime(2),'/',& + dateAndTime(1) + write(6,'(a,2(i2.2,a),i2.2)') ' Time: ',dateAndTime(5),':',& + dateAndTime(6),':',& + dateAndTime(7) + write(6,'(/,a)') ' <<<+- DAMASK_interface init -+>>>' +#include "compilation_info.f90" + if ( present(loadcaseParameterIn) .and. present(geometryParameterIn)) then ! both mandatory parameters given in function call geometryArg = geometryParameterIn loadcaseArg = loadcaseParameterIn From e1802cb31dfa7abc3fab860f83374f3903fac783 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 29 Jun 2016 16:28:15 +0200 Subject: [PATCH 047/412] removed some more core module functionality --- code/core_quit.f90 | 12 ------------ code/spectral_interface.f90 | 19 +------------------ 2 files changed, 1 insertion(+), 30 deletions(-) delete mode 100644 code/core_quit.f90 diff --git a/code/core_quit.f90 b/code/core_quit.f90 deleted file mode 100644 index 3a730c82d..000000000 --- a/code/core_quit.f90 +++ /dev/null @@ -1,12 +0,0 @@ -!******************************************************************** -! quit subroutine to satisfy IO_error for core module -! -!******************************************************************** -subroutine quit(stop_id) - use prec, only: & - pInt - - implicit none - integer(pInt), intent(in) :: stop_id - -end subroutine diff --git a/code/spectral_interface.f90 b/code/spectral_interface.f90 index 862b8e849..ce4f6b6d7 100644 --- a/code/spectral_interface.f90 +++ b/code/spectral_interface.f90 @@ -13,10 +13,8 @@ module DAMASK_interface pInt implicit none private -#ifdef PETSc #include -#endif - logical, public, protected :: appendToOutFile = .false. !< Append to existing spectralOut file (in case of restart, not in case of regridding) + logical, public, protected :: appendToOutFile = .false. !< Append to existing spectralOut file (in case of restart) integer(pInt), public, protected :: spectralRestartInc = 1_pInt !< Increment at which calculation starts character(len=1024), public, protected :: & geometryFile = '', & !< parameter given for geometry file @@ -64,9 +62,7 @@ subroutine DAMASK_interface_init() chunkPos integer, dimension(8) :: & dateAndTime ! type default integer -#ifdef PETSc PetscErrorCode :: ierr -#endif external :: & quit,& MPI_Comm_rank,& @@ -76,7 +72,6 @@ subroutine DAMASK_interface_init() !-------------------------------------------------------------------------------------------------- ! PETSc Init -#ifdef PETSc #ifdef _OPENMP call MPI_Init_Thread(MPI_THREAD_FUNNELED,threadLevel,ierr);CHKERRQ(ierr) ! in case of OpenMP, don't rely on PETScInitialize doing MPI init if (threadLevel>>' @@ -119,7 +113,6 @@ subroutine DAMASK_interface_init() write(6,'(a)') ' --load (-l, --loadcase)' write(6,'(a)') ' --workingdir (-w, --wd, --workingdirectory, -d, --directory)' write(6,'(a)') ' --restart (-r, --rs)' - write(6,'(a)') ' --regrid (--rg)' write(6,'(a)') ' --help (-h)' write(6,'(/,a)')' -----------------------------------------------------------------------' write(6,'(a)') ' Mandatory arguments:' @@ -151,13 +144,6 @@ subroutine DAMASK_interface_init() write(6,'(a)') ' "NameOfGeom_NameOfLoadFile.spectralOut".' write(6,'(a)') ' Works only if the restart information for total increment' write(6,'(a)') ' No. XX-1 is available in the working directory.' - write(6,'(/,a)')' --regrid XX' - write(6,'(a)') ' Reads in total increment No. XX-1 and continues to' - write(6,'(a)') ' calculate total increment No. XX.' - write(6,'(a)') ' Attention: Overwrites existing results file ' - write(6,'(a)') ' "NameOfGeom_NameOfLoadFile.spectralOut".' - write(6,'(a)') ' Works only if the restart information for total increment' - write(6,'(a)') ' No. XX-1 is available in the working directory.' write(6,'(/,a)')' -----------------------------------------------------------------------' write(6,'(a)') ' Help:' write(6,'(/,a)')' --help' @@ -173,9 +159,6 @@ subroutine DAMASK_interface_init() case ('-r', '--rs', '--restart') spectralRestartInc = IIO_IntValue(commandLine,chunkPos,i+1_pInt) appendToOutFile = .true. - case ('--rg', '--regrid') - spectralRestartInc = IIO_IntValue(commandLine,chunkPos,i+1_pInt) - appendToOutFile = .false. end select enddo From 3a0a7dea9aa6e29ae2873ce345c204498be8b8c0 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 29 Jun 2016 16:35:49 +0200 Subject: [PATCH 048/412] not needed for disabled output MPI rank>0 --- code/IO.f90 | 19 +---- code/numerics.f90 | 202 ++++++++++++++++++++++------------------------ 2 files changed, 98 insertions(+), 123 deletions(-) diff --git a/code/IO.f90 b/code/IO.f90 index 2a13ce3d8..91b3e2a7f 100644 --- a/code/IO.f90 +++ b/code/IO.f90 @@ -80,25 +80,10 @@ subroutine IO_init use, intrinsic :: iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment) implicit none - integer(pInt) :: worldrank = 0_pInt -#ifdef PETSc -#include - PetscErrorCode :: ierr -#endif - external :: & - MPI_Comm_rank, & - MPI_Abort -#ifdef PETSc - call MPI_Comm_rank(PETSC_COMM_WORLD,worldrank,ierr);CHKERRQ(ierr) -#endif - - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- IO init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- IO init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess - end subroutine IO_init diff --git a/code/numerics.f90 b/code/numerics.f90 index 365b078ec..9b3449e95 100644 --- a/code/numerics.f90 +++ b/code/numerics.f90 @@ -236,11 +236,9 @@ subroutine numerics_init call MPI_Comm_rank(PETSC_COMM_WORLD,worldrank,ierr);CHKERRQ(ierr) call MPI_Comm_size(PETSC_COMM_WORLD,worldsize,ierr);CHKERRQ(ierr) #endif - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- numerics init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- numerics init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess !$ call GET_ENVIRONMENT_VARIABLE(NAME='DAMASK_NUM_THREADS',VALUE=DAMASK_NumThreadsString,STATUS=gotDAMASK_NUM_THREADS) ! get environment variable DAMASK_NUM_THREADS... !$ if(gotDAMASK_NUM_THREADS /= 0) then ! could not get number of threads, set it to 1 @@ -489,14 +487,8 @@ subroutine numerics_init close(FILEUNIT) else fileExists -#ifdef FEM - if (worldrank == 0) then -#endif write(6,'(a,/)') ' using standard values' flush(6) -#ifdef FEM - endif -#endif endif fileExists #ifdef Spectral @@ -519,128 +511,126 @@ subroutine numerics_init !-------------------------------------------------------------------------------------------------- ! writing parameters to output - mainProcess3: if (worldrank == 0) then - write(6,'(a24,1x,es8.1)') ' relevantStrain: ',relevantStrain - write(6,'(a24,1x,es8.1)') ' defgradTolerance: ',defgradTolerance - write(6,'(a24,1x,i8)') ' iJacoStiffness: ',iJacoStiffness - write(6,'(a24,1x,i8)') ' iJacoLpresiduum: ',iJacoLpresiduum - write(6,'(a24,1x,es8.1)') ' pert_Fg: ',pert_Fg - write(6,'(a24,1x,i8)') ' pert_method: ',pert_method - write(6,'(a24,1x,i8)') ' nCryst: ',nCryst - write(6,'(a24,1x,es8.1)') ' subStepMinCryst: ',subStepMinCryst - write(6,'(a24,1x,es8.1)') ' subStepSizeCryst: ',subStepSizeCryst - write(6,'(a24,1x,es8.1)') ' stepIncreaseCryst: ',stepIncreaseCryst - write(6,'(a24,1x,i8)') ' nState: ',nState - write(6,'(a24,1x,i8)') ' nStress: ',nStress - write(6,'(a24,1x,es8.1)') ' rTol_crystalliteState: ',rTol_crystalliteState - write(6,'(a24,1x,es8.1)') ' rTol_crystalliteStress: ',rTol_crystalliteStress - write(6,'(a24,1x,es8.1)') ' aTol_crystalliteStress: ',aTol_crystalliteStress - write(6,'(a24,2(1x,i8))') ' integrator: ',numerics_integrator - write(6,'(a24,1x,L8)') ' timeSyncing: ',numerics_timeSyncing - write(6,'(a24,1x,L8)') ' analytic Jacobian: ',analyticJaco - write(6,'(a24,1x,L8)') ' use ping pong scheme: ',usepingpong - write(6,'(a24,1x,es8.1,/)')' unitlength: ',numerics_unitlength + write(6,'(a24,1x,es8.1)') ' relevantStrain: ',relevantStrain + write(6,'(a24,1x,es8.1)') ' defgradTolerance: ',defgradTolerance + write(6,'(a24,1x,i8)') ' iJacoStiffness: ',iJacoStiffness + write(6,'(a24,1x,i8)') ' iJacoLpresiduum: ',iJacoLpresiduum + write(6,'(a24,1x,es8.1)') ' pert_Fg: ',pert_Fg + write(6,'(a24,1x,i8)') ' pert_method: ',pert_method + write(6,'(a24,1x,i8)') ' nCryst: ',nCryst + write(6,'(a24,1x,es8.1)') ' subStepMinCryst: ',subStepMinCryst + write(6,'(a24,1x,es8.1)') ' subStepSizeCryst: ',subStepSizeCryst + write(6,'(a24,1x,es8.1)') ' stepIncreaseCryst: ',stepIncreaseCryst + write(6,'(a24,1x,i8)') ' nState: ',nState + write(6,'(a24,1x,i8)') ' nStress: ',nStress + write(6,'(a24,1x,es8.1)') ' rTol_crystalliteState: ',rTol_crystalliteState + write(6,'(a24,1x,es8.1)') ' rTol_crystalliteStress: ',rTol_crystalliteStress + write(6,'(a24,1x,es8.1)') ' aTol_crystalliteStress: ',aTol_crystalliteStress + write(6,'(a24,2(1x,i8))') ' integrator: ',numerics_integrator + write(6,'(a24,1x,L8)') ' timeSyncing: ',numerics_timeSyncing + write(6,'(a24,1x,L8)') ' analytic Jacobian: ',analyticJaco + write(6,'(a24,1x,L8)') ' use ping pong scheme: ',usepingpong + write(6,'(a24,1x,es8.1,/)')' unitlength: ',numerics_unitlength - write(6,'(a24,1x,i8)') ' nHomog: ',nHomog - write(6,'(a24,1x,es8.1)') ' subStepMinHomog: ',subStepMinHomog - write(6,'(a24,1x,es8.1)') ' subStepSizeHomog: ',subStepSizeHomog - write(6,'(a24,1x,es8.1)') ' stepIncreaseHomog: ',stepIncreaseHomog - write(6,'(a24,1x,i8,/)') ' nMPstate: ',nMPstate + write(6,'(a24,1x,i8)') ' nHomog: ',nHomog + write(6,'(a24,1x,es8.1)') ' subStepMinHomog: ',subStepMinHomog + write(6,'(a24,1x,es8.1)') ' subStepSizeHomog: ',subStepSizeHomog + write(6,'(a24,1x,es8.1)') ' stepIncreaseHomog: ',stepIncreaseHomog + write(6,'(a24,1x,i8,/)') ' nMPstate: ',nMPstate !-------------------------------------------------------------------------------------------------- ! RGC parameters - write(6,'(a24,1x,es8.1)') ' aTol_RGC: ',absTol_RGC - write(6,'(a24,1x,es8.1)') ' rTol_RGC: ',relTol_RGC - write(6,'(a24,1x,es8.1)') ' aMax_RGC: ',absMax_RGC - write(6,'(a24,1x,es8.1)') ' rMax_RGC: ',relMax_RGC - write(6,'(a24,1x,es8.1)') ' perturbPenalty_RGC: ',pPert_RGC - write(6,'(a24,1x,es8.1)') ' relevantMismatch_RGC: ',xSmoo_RGC - write(6,'(a24,1x,es8.1)') ' viscosityrate_RGC: ',viscPower_RGC - write(6,'(a24,1x,es8.1)') ' viscositymodulus_RGC: ',viscModus_RGC - write(6,'(a24,1x,es8.1)') ' maxrelaxation_RGC: ',maxdRelax_RGC - write(6,'(a24,1x,es8.1)') ' maxVolDiscrepancy_RGC: ',maxVolDiscr_RGC - write(6,'(a24,1x,es8.1)') ' volDiscrepancyMod_RGC: ',volDiscrMod_RGC - write(6,'(a24,1x,es8.1,/)') ' discrepancyPower_RGC: ',volDiscrPow_RGC + write(6,'(a24,1x,es8.1)') ' aTol_RGC: ',absTol_RGC + write(6,'(a24,1x,es8.1)') ' rTol_RGC: ',relTol_RGC + write(6,'(a24,1x,es8.1)') ' aMax_RGC: ',absMax_RGC + write(6,'(a24,1x,es8.1)') ' rMax_RGC: ',relMax_RGC + write(6,'(a24,1x,es8.1)') ' perturbPenalty_RGC: ',pPert_RGC + write(6,'(a24,1x,es8.1)') ' relevantMismatch_RGC: ',xSmoo_RGC + write(6,'(a24,1x,es8.1)') ' viscosityrate_RGC: ',viscPower_RGC + write(6,'(a24,1x,es8.1)') ' viscositymodulus_RGC: ',viscModus_RGC + write(6,'(a24,1x,es8.1)') ' maxrelaxation_RGC: ',maxdRelax_RGC + write(6,'(a24,1x,es8.1)') ' maxVolDiscrepancy_RGC: ',maxVolDiscr_RGC + write(6,'(a24,1x,es8.1)') ' volDiscrepancyMod_RGC: ',volDiscrMod_RGC + write(6,'(a24,1x,es8.1,/)') ' discrepancyPower_RGC: ',volDiscrPow_RGC !-------------------------------------------------------------------------------------------------- ! Random seeding parameter - write(6,'(a24,1x,i16,/)') ' fixed_seed: ',fixedSeed - if (fixedSeed <= 0_pInt) & - write(6,'(a,/)') ' No fixed Seed: Random is random!' + write(6,'(a24,1x,i16,/)') ' fixed_seed: ',fixedSeed + if (fixedSeed <= 0_pInt) & + write(6,'(a,/)') ' No fixed Seed: Random is random!' !-------------------------------------------------------------------------------------------------- ! gradient parameter - write(6,'(a24,1x,es8.1)') ' charLength: ',charLength - write(6,'(a24,1x,es8.1)') ' residualStiffness: ',residualStiffness + write(6,'(a24,1x,es8.1)') ' charLength: ',charLength + write(6,'(a24,1x,es8.1)') ' residualStiffness: ',residualStiffness !-------------------------------------------------------------------------------------------------- ! openMP parameter - !$ write(6,'(a24,1x,i8,/)') ' number of threads: ',DAMASK_NumThreadsInt + !$ write(6,'(a24,1x,i8,/)') ' number of threads: ',DAMASK_NumThreadsInt !-------------------------------------------------------------------------------------------------- ! field parameters - write(6,'(a24,1x,i8)') ' itmax: ',itmax - write(6,'(a24,1x,i8)') ' itmin: ',itmin - write(6,'(a24,1x,i8)') ' maxCutBack: ',maxCutBack - write(6,'(a24,1x,i8)') ' maxStaggeredIter: ',stagItMax - write(6,'(a24,1x,i8)') ' vacancyPolyOrder: ',vacancyPolyOrder - write(6,'(a24,1x,i8)') ' hydrogenPolyOrder: ',hydrogenPolyOrder - write(6,'(a24,1x,es8.1)') ' err_struct_tolAbs: ',err_struct_tolAbs - write(6,'(a24,1x,es8.1)') ' err_struct_tolRel: ',err_struct_tolRel - write(6,'(a24,1x,es8.1)') ' err_thermal_tolabs: ',err_thermal_tolabs - write(6,'(a24,1x,es8.1)') ' err_thermal_tolrel: ',err_thermal_tolrel - write(6,'(a24,1x,es8.1)') ' err_damage_tolabs: ',err_damage_tolabs - write(6,'(a24,1x,es8.1)') ' err_damage_tolrel: ',err_damage_tolrel - write(6,'(a24,1x,es8.1)') ' err_vacancyflux_tolabs: ',err_vacancyflux_tolabs - write(6,'(a24,1x,es8.1)') ' err_vacancyflux_tolrel: ',err_vacancyflux_tolrel - write(6,'(a24,1x,es8.1)') ' err_porosity_tolabs: ',err_porosity_tolabs - write(6,'(a24,1x,es8.1)') ' err_porosity_tolrel: ',err_porosity_tolrel - write(6,'(a24,1x,es8.1)') ' err_hydrogenflux_tolabs:',err_hydrogenflux_tolabs - write(6,'(a24,1x,es8.1)') ' err_hydrogenflux_tolrel:',err_hydrogenflux_tolrel - write(6,'(a24,1x,es8.1)') ' vacancyBoundPenalty: ',vacancyBoundPenalty - write(6,'(a24,1x,es8.1)') ' hydrogenBoundPenalty: ',hydrogenBoundPenalty + write(6,'(a24,1x,i8)') ' itmax: ',itmax + write(6,'(a24,1x,i8)') ' itmin: ',itmin + write(6,'(a24,1x,i8)') ' maxCutBack: ',maxCutBack + write(6,'(a24,1x,i8)') ' maxStaggeredIter: ',stagItMax + write(6,'(a24,1x,i8)') ' vacancyPolyOrder: ',vacancyPolyOrder + write(6,'(a24,1x,i8)') ' hydrogenPolyOrder: ',hydrogenPolyOrder + write(6,'(a24,1x,es8.1)') ' err_struct_tolAbs: ',err_struct_tolAbs + write(6,'(a24,1x,es8.1)') ' err_struct_tolRel: ',err_struct_tolRel + write(6,'(a24,1x,es8.1)') ' err_thermal_tolabs: ',err_thermal_tolabs + write(6,'(a24,1x,es8.1)') ' err_thermal_tolrel: ',err_thermal_tolrel + write(6,'(a24,1x,es8.1)') ' err_damage_tolabs: ',err_damage_tolabs + write(6,'(a24,1x,es8.1)') ' err_damage_tolrel: ',err_damage_tolrel + write(6,'(a24,1x,es8.1)') ' err_vacancyflux_tolabs: ',err_vacancyflux_tolabs + write(6,'(a24,1x,es8.1)') ' err_vacancyflux_tolrel: ',err_vacancyflux_tolrel + write(6,'(a24,1x,es8.1)') ' err_porosity_tolabs: ',err_porosity_tolabs + write(6,'(a24,1x,es8.1)') ' err_porosity_tolrel: ',err_porosity_tolrel + write(6,'(a24,1x,es8.1)') ' err_hydrogenflux_tolabs:',err_hydrogenflux_tolabs + write(6,'(a24,1x,es8.1)') ' err_hydrogenflux_tolrel:',err_hydrogenflux_tolrel + write(6,'(a24,1x,es8.1)') ' vacancyBoundPenalty: ',vacancyBoundPenalty + write(6,'(a24,1x,es8.1)') ' hydrogenBoundPenalty: ',hydrogenBoundPenalty !-------------------------------------------------------------------------------------------------- ! spectral parameters #ifdef Spectral - write(6,'(a24,1x,i8)') ' continueCalculation: ',continueCalculation - write(6,'(a24,1x,L8)') ' memory_efficient: ',memory_efficient - write(6,'(a24,1x,i8)') ' divergence_correction: ',divergence_correction - write(6,'(a24,1x,a)') ' spectral_derivative: ',trim(spectral_derivative) - if(fftw_timelimit<0.0_pReal) then - write(6,'(a24,1x,L8)') ' fftw_timelimit: ',.false. - else - write(6,'(a24,1x,es8.1)') ' fftw_timelimit: ',fftw_timelimit - endif - write(6,'(a24,1x,a)') ' fftw_plan_mode: ',trim(fftw_plan_mode) - write(6,'(a24,1x,i8)') ' fftw_planner_flag: ',fftw_planner_flag - write(6,'(a24,1x,L8,/)') ' update_gamma: ',update_gamma - write(6,'(a24,1x,es8.1)') ' err_stress_tolAbs: ',err_stress_tolAbs - write(6,'(a24,1x,es8.1)') ' err_stress_tolRel: ',err_stress_tolRel - write(6,'(a24,1x,es8.1)') ' err_div_tolAbs: ',err_div_tolAbs - write(6,'(a24,1x,es8.1)') ' err_div_tolRel: ',err_div_tolRel - write(6,'(a24,1x,es8.1)') ' err_curl_tolAbs: ',err_curl_tolAbs - write(6,'(a24,1x,es8.1)') ' err_curl_tolRel: ',err_curl_tolRel - write(6,'(a24,1x,es8.1)') ' polarAlpha: ',polarAlpha - write(6,'(a24,1x,es8.1)') ' polarBeta: ',polarBeta - write(6,'(a24,1x,a)') ' spectral solver: ',trim(spectral_solver) - write(6,'(a24,1x,a)') ' PETSc_options: ',trim(petsc_defaultOptions)//' '//trim(petsc_options) + write(6,'(a24,1x,i8)') ' continueCalculation: ',continueCalculation + write(6,'(a24,1x,L8)') ' memory_efficient: ',memory_efficient + write(6,'(a24,1x,i8)') ' divergence_correction: ',divergence_correction + write(6,'(a24,1x,a)') ' spectral_derivative: ',trim(spectral_derivative) + if(fftw_timelimit<0.0_pReal) then + write(6,'(a24,1x,L8)') ' fftw_timelimit: ',.false. + else + write(6,'(a24,1x,es8.1)') ' fftw_timelimit: ',fftw_timelimit + endif + write(6,'(a24,1x,a)') ' fftw_plan_mode: ',trim(fftw_plan_mode) + write(6,'(a24,1x,i8)') ' fftw_planner_flag: ',fftw_planner_flag + write(6,'(a24,1x,L8,/)') ' update_gamma: ',update_gamma + write(6,'(a24,1x,es8.1)') ' err_stress_tolAbs: ',err_stress_tolAbs + write(6,'(a24,1x,es8.1)') ' err_stress_tolRel: ',err_stress_tolRel + write(6,'(a24,1x,es8.1)') ' err_div_tolAbs: ',err_div_tolAbs + write(6,'(a24,1x,es8.1)') ' err_div_tolRel: ',err_div_tolRel + write(6,'(a24,1x,es8.1)') ' err_curl_tolAbs: ',err_curl_tolAbs + write(6,'(a24,1x,es8.1)') ' err_curl_tolRel: ',err_curl_tolRel + write(6,'(a24,1x,es8.1)') ' polarAlpha: ',polarAlpha + write(6,'(a24,1x,es8.1)') ' polarBeta: ',polarBeta + write(6,'(a24,1x,a)') ' spectral solver: ',trim(spectral_solver) + write(6,'(a24,1x,a)') ' PETSc_options: ',trim(petsc_defaultOptions)//' '//trim(petsc_options) #endif !-------------------------------------------------------------------------------------------------- ! spectral parameters #ifdef FEM - write(6,'(a24,1x,i8)') ' integrationOrder: ',integrationOrder - write(6,'(a24,1x,i8)') ' structOrder: ',structOrder - write(6,'(a24,1x,i8)') ' thermalOrder: ',thermalOrder - write(6,'(a24,1x,i8)') ' damageOrder: ',damageOrder - write(6,'(a24,1x,i8)') ' vacancyfluxOrder: ',vacancyfluxOrder - write(6,'(a24,1x,i8)') ' porosityOrder: ',porosityOrder - write(6,'(a24,1x,i8)') ' hydrogenfluxOrder: ',hydrogenfluxOrder - write(6,'(a24,1x,a)') ' PETSc_options: ',trim(petsc_defaultOptions)//' '//trim(petsc_options) - write(6,'(a24,1x,L8)') ' B-Bar stabilisation: ',BBarStabilisation + write(6,'(a24,1x,i8)') ' integrationOrder: ',integrationOrder + write(6,'(a24,1x,i8)') ' structOrder: ',structOrder + write(6,'(a24,1x,i8)') ' thermalOrder: ',thermalOrder + write(6,'(a24,1x,i8)') ' damageOrder: ',damageOrder + write(6,'(a24,1x,i8)') ' vacancyfluxOrder: ',vacancyfluxOrder + write(6,'(a24,1x,i8)') ' porosityOrder: ',porosityOrder + write(6,'(a24,1x,i8)') ' hydrogenfluxOrder: ',hydrogenfluxOrder + write(6,'(a24,1x,a)') ' PETSc_options: ',trim(petsc_defaultOptions)//' '//trim(petsc_options) + write(6,'(a24,1x,L8)') ' B-Bar stabilisation: ',BBarStabilisation #endif - endif mainProcess3 !-------------------------------------------------------------------------------------------------- From ddff0035b6380a49b0519a39828b85187a6b72ed Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 29 Jun 2016 16:59:22 +0200 Subject: [PATCH 049/412] removed old regridding related stuff --- code/DAMASK_spectral.f90 | 29 +++++++++++++---------------- code/FEsolving.f90 | 10 ++-------- code/IO.f90 | 2 -- code/mesh.f90 | 6 ++---- 4 files changed, 17 insertions(+), 30 deletions(-) diff --git a/code/DAMASK_spectral.f90 b/code/DAMASK_spectral.f90 index 53c9c4423..706aa22d9 100644 --- a/code/DAMASK_spectral.f90 +++ b/code/DAMASK_spectral.f90 @@ -617,12 +617,12 @@ program DAMASK_spectral timeinc = timeinc/2.0_pReal elseif (solres(1)%termIll) then ! material point model cannot find a solution, exit in any casy call IO_warning(850_pInt) - call quit(-1_pInt*(lastRestartWritten+1_pInt)) ! quit and provide information about last restart inc written (e.g. for regridding) + call quit(-1_pInt*(lastRestartWritten+1_pInt)) ! quit and provide information about last restart inc written elseif (continueCalculation == 1_pInt) then guess = .true. ! accept non converged BVP solution else ! default behavior, exit if spectral solver does not converge call IO_warning(850_pInt) - call quit(-1_pInt*(lastRestartWritten+1_pInt)) ! quit and provide information about last restart inc written (e.g. for regridding) + call quit(-1_pInt*(lastRestartWritten+1_pInt)) ! quit and provide information about last restart inc written endif else guess = .true. ! start guessing after first converged (sub)inc @@ -722,7 +722,7 @@ end program DAMASK_spectral !> @brief quit subroutine to mimic behavior of FEM solvers !> @details exits the Spectral solver and reports time and duration. Exit code 0 signals !> everything went fine. Exit code 1 signals an error, message according to IO_error. Exit code -!> 2 signals request for regridding, increment of last saved restart information is written to +!> 2 signals no converged solution and increment of last saved restart information is written to !> stderr. Exit code 3 signals no severe problems, but some increments did not converge !-------------------------------------------------------------------------------------------------- subroutine quit(stop_id) @@ -735,21 +735,18 @@ subroutine quit(stop_id) integer(pInt), intent(in) :: stop_id integer, dimension(8) :: dateAndTime ! type default integer - if (worldrank == 0_pInt) then - call date_and_time(values = dateAndTime) - write(6,'(/,a)') 'DAMASK terminated on:' - write(6,'(a,2(i2.2,a),i4.4)') 'Date: ',dateAndTime(3),'/',& - dateAndTime(2),'/',& - dateAndTime(1) - write(6,'(a,2(i2.2,a),i2.2)') 'Time: ',dateAndTime(5),':',& - dateAndTime(6),':',& - dateAndTime(7) - endif + call date_and_time(values = dateAndTime) + write(6,'(/,a)') 'DAMASK terminated on:' + write(6,'(a,2(i2.2,a),i4.4)') 'Date: ',dateAndTime(3),'/',& + dateAndTime(2),'/',& + dateAndTime(1) + write(6,'(a,2(i2.2,a),i2.2)') 'Time: ',dateAndTime(5),':',& + dateAndTime(6),':',& + dateAndTime(7) if (stop_id == 0_pInt) stop 0 ! normal termination - if (stop_id < 0_pInt) then ! trigger regridding - if (worldrank == 0_pInt) & - write(0,'(a,i6)') 'restart information available at ', stop_id*(-1_pInt) + if (stop_id < 0_pInt) then ! terminally ill, restart might help + write(0,'(a,i6)') 'restart information available at ', stop_id*(-1_pInt) stop 2 endif if (stop_id == 3_pInt) stop 3 ! not all incs converged diff --git a/code/FEsolving.f90 b/code/FEsolving.f90 index 3b0aeb194..bc7588ff0 100644 --- a/code/FEsolving.f90 +++ b/code/FEsolving.f90 @@ -72,11 +72,9 @@ subroutine FE_init integer(pInt), allocatable, dimension(:) :: chunkPos #endif - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- FEsolving init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- FEsolving init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess modelName = getSolverJobName() #ifdef Spectral @@ -153,10 +151,6 @@ subroutine FE_init 200 close(FILEUNIT) endif -!-------------------------------------------------------------------------------------------------- -! the following array are allocated by mesh.f90 and need to be deallocated in case of regridding - if (allocated(calcMode)) deallocate(calcMode) - if (allocated(FEsolving_execIP)) deallocate(FEsolving_execIP) #endif if (iand(debug_level(debug_FEsolving),debug_levelBasic) /= 0_pInt) then write(6,'(a21,l1)') ' restart writing: ', restartWrite diff --git a/code/IO.f90 b/code/IO.f90 index 2a13ce3d8..55a75b78d 100644 --- a/code/IO.f90 +++ b/code/IO.f90 @@ -1640,8 +1640,6 @@ subroutine IO_error(error_ID,el,ip,g,ext_msg) msg = 'update of gamma operator not possible when pre-calculated' case (880_pInt) msg = 'mismatch of microstructure count and a*b*c in geom file' - case (890_pInt) - msg = 'invalid input for regridding' case (891_pInt) msg = 'unknown solver type selected' case (892_pInt) diff --git a/code/mesh.f90 b/code/mesh.f90 index 5b999cdb4..0562ab218 100644 --- a/code/mesh.f90 +++ b/code/mesh.f90 @@ -514,11 +514,9 @@ subroutine mesh_init(ip,el) integer(pInt) :: j logical :: myDebug - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- mesh init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- mesh init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess if (allocated(mesh_mapFEtoCPelem)) deallocate(mesh_mapFEtoCPelem) if (allocated(mesh_mapFEtoCPnode)) deallocate(mesh_mapFEtoCPnode) From c949f407e559d073edeab8819c97b69165bffd86 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 29 Jun 2016 17:13:02 +0200 Subject: [PATCH 050/412] unused variable --- code/DAMASK_spectral.f90 | 2 -- 1 file changed, 2 deletions(-) diff --git a/code/DAMASK_spectral.f90 b/code/DAMASK_spectral.f90 index 706aa22d9..0be78083b 100644 --- a/code/DAMASK_spectral.f90 +++ b/code/DAMASK_spectral.f90 @@ -728,8 +728,6 @@ end program DAMASK_spectral subroutine quit(stop_id) use prec, only: & pInt - use numerics, only: & - worldrank implicit none integer(pInt), intent(in) :: stop_id From 745c0120886abbfdd8c957e983ac0ceb2720483c Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 29 Jun 2016 20:09:42 +0200 Subject: [PATCH 051/412] fully adopted code from addDisplacement --- processing/post/addCompatibilityMismatch.py | 121 +++++++++----------- 1 file changed, 57 insertions(+), 64 deletions(-) diff --git a/processing/post/addCompatibilityMismatch.py b/processing/post/addCompatibilityMismatch.py index 77e215acc..d311c286b 100755 --- a/processing/post/addCompatibilityMismatch.py +++ b/processing/post/addCompatibilityMismatch.py @@ -1,9 +1,9 @@ #!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- -import os,sys -import numpy as np +import os import math +import numpy as np import scipy.ndimage from optparse import OptionParser import damask @@ -18,7 +18,7 @@ def cell2node(cellData,grid): datalen = np.array(cellData.shape[3:]).prod() for i in xrange(datalen): - node = scipy.ndimage.convolve(cellData.reshape(tuple(grid)+(datalen,))[...,i], + node = scipy.ndimage.convolve(cellData.reshape(tuple(grid[::-1])+(datalen,))[...,i], np.ones((2,2,2))/8., # 2x2x2 neighborhood of cells mode = 'wrap', origin = -1, # offset to have cell origin as center @@ -32,26 +32,26 @@ def cell2node(cellData,grid): return nodeData #-------------------------------------------------------------------------------------------------- -def displacementAvgFFT(F,grid,size,nodal=False,transformed=False): - """calculate average cell center (or nodal) displacement for deformation gradient field specified in each grid cell""" +def deformationAvgFFT(F,grid,size,nodal=False,transformed=False): + """calculate average cell center (or nodal) deformation for deformation gradient field specified in each grid cell""" if nodal: - x, y, z = np.meshgrid(np.linspace(0,size[0],1+grid[0]), + x, y, z = np.meshgrid(np.linspace(0,size[2],1+grid[2]), np.linspace(0,size[1],1+grid[1]), - np.linspace(0,size[2],1+grid[2]), + np.linspace(0,size[0],1+grid[0]), indexing = 'ij') else: - x, y, z = np.meshgrid(np.linspace(0,size[0],grid[0],endpoint=False), - np.linspace(0,size[1],grid[1],endpoint=False), - np.linspace(0,size[2],grid[2],endpoint=False), + x, y, z = np.meshgrid(np.linspace(size[2]/grid[2]/2.,size[2]-size[2]/grid[2]/2.,grid[2]), + np.linspace(size[1]/grid[1]/2.,size[1]-size[1]/grid[1]/2.,grid[1]), + np.linspace(size[0]/grid[0]/2.,size[0]-size[0]/grid[0]/2.,grid[0]), indexing = 'ij') origCoords = np.concatenate((z[:,:,:,None],y[:,:,:,None],x[:,:,:,None]),axis = 3) F_fourier = F if transformed else np.fft.rfftn(F,axes=(0,1,2)) # transform or use provided data Favg = np.real(F_fourier[0,0,0,:,:])/grid.prod() # take zero freq for average - avgDisplacement = np.einsum('ml,ijkl->ijkm',Favg-np.eye(3),origCoords) # dX = Favg.X + avgDeformation = np.einsum('ml,ijkl->ijkm',Favg,origCoords) # dX = Favg.X - return avgDisplacement + return avgDeformation #-------------------------------------------------------------------------------------------------- def displacementFluctFFT(F,grid,size,nodal=False,transformed=False): @@ -69,16 +69,16 @@ def displacementFluctFFT(F,grid,size,nodal=False,transformed=False): #-------------------------------------------------------------------------------------------------- # integration in Fourier space - displacement_fourier = +np.einsum('ijkml,ijkl,l->ijkm', + displacement_fourier = -np.einsum('ijkml,ijkl,l->ijkm', F if transformed else np.fft.rfftn(F,axes=(0,1,2)), k_s, integrator, - ) / k_sSquared[...,np.newaxis] + ) / k_sSquared[...,np.newaxis] #-------------------------------------------------------------------------------------------------- # backtransformation to real space - displacement = np.fft.irfftn(displacement_fourier,grid,axes=(0,1,2)) + displacement = np.fft.irfftn(displacement_fourier,grid[::-1],axes=(0,1,2)) return cell2node(displacement,grid) if nodal else displacement @@ -137,7 +137,7 @@ def volumeMismatch(size,F,nodes): (compatible) cube and determinant of defgrad at the FP """ coords = np.empty([8,3]) - vMismatch = np.empty(grid) + vMismatch = np.empty(grid[::-1]) volInitial = size.prod()/grid.prod() #-------------------------------------------------------------------------------------------------- @@ -145,23 +145,22 @@ def volumeMismatch(size,F,nodes): for k in xrange(grid[2]): for j in xrange(grid[1]): for i in xrange(grid[0]): - coords[0,0:3] = nodes[i, j, k ,0:3] - coords[1,0:3] = nodes[i+1,j, k ,0:3] - coords[2,0:3] = nodes[i+1,j+1,k ,0:3] - coords[3,0:3] = nodes[i, j+1,k ,0:3] - coords[4,0:3] = nodes[i, j, k+1,0:3] - coords[5,0:3] = nodes[i+1,j, k+1,0:3] - coords[6,0:3] = nodes[i+1,j+1,k+1,0:3] - coords[7,0:3] = nodes[i, j+1,k+1,0:3] - vMismatch[i,j,k] = \ - abs(volTetrahedron([coords[6,0:3],coords[0,0:3],coords[7,0:3],coords[3,0:3]])) \ + coords[0,0:3] = nodes[k, j, i ,0:3] + coords[1,0:3] = nodes[k ,j, i+1,0:3] + coords[2,0:3] = nodes[k ,j+1,i+1,0:3] + coords[3,0:3] = nodes[k, j+1,i ,0:3] + coords[4,0:3] = nodes[k+1,j, i ,0:3] + coords[5,0:3] = nodes[k+1,j, i+1,0:3] + coords[6,0:3] = nodes[k+1,j+1,i+1,0:3] + coords[7,0:3] = nodes[k+1,j+1,i ,0:3] + vMismatch[k,j,i] = \ + ( abs(volTetrahedron([coords[6,0:3],coords[0,0:3],coords[7,0:3],coords[3,0:3]])) \ + abs(volTetrahedron([coords[6,0:3],coords[0,0:3],coords[7,0:3],coords[4,0:3]])) \ + abs(volTetrahedron([coords[6,0:3],coords[0,0:3],coords[2,0:3],coords[3,0:3]])) \ + abs(volTetrahedron([coords[6,0:3],coords[0,0:3],coords[2,0:3],coords[1,0:3]])) \ + abs(volTetrahedron([coords[6,0:3],coords[4,0:3],coords[1,0:3],coords[5,0:3]])) \ - + abs(volTetrahedron([coords[6,0:3],coords[4,0:3],coords[1,0:3],coords[0,0:3]])) - vMismatch[i,j,k] = vMismatch[i,j,k]/np.linalg.det(F[i,j,k,0:3,0:3]) - + + abs(volTetrahedron([coords[6,0:3],coords[4,0:3],coords[1,0:3],coords[0,0:3]]))) \ + /np.linalg.det(F[k,j,i,0:3,0:3]) return vMismatch/volInitial @@ -175,7 +174,7 @@ def shapeMismatch(size,F,nodes,centres): the initial volume element with the current deformation gradient """ coordsInitial = np.empty([8,3]) - sMismatch = np.empty(grid) + sMismatch = np.empty(grid[::-1]) #-------------------------------------------------------------------------------------------------- # initial positions @@ -194,15 +193,15 @@ def shapeMismatch(size,F,nodes,centres): for k in xrange(grid[2]): for j in xrange(grid[1]): for i in xrange(grid[0]): - sMismatch[i,j,k] = \ - + np.linalg.norm(nodes[i, j, k,0:3] - centres[i,j,k,0:3] - np.dot(F[i,j,k,:,:], coordsInitial[0,0:3]))\ - + np.linalg.norm(nodes[i+1,j, k,0:3] - centres[i,j,k,0:3] - np.dot(F[i,j,k,:,:], coordsInitial[1,0:3]))\ - + np.linalg.norm(nodes[i+1,j+1,k ,0:3] - centres[i,j,k,0:3] - np.dot(F[i,j,k,:,:], coordsInitial[2,0:3]))\ - + np.linalg.norm(nodes[i, j+1,k ,0:3] - centres[i,j,k,0:3] - np.dot(F[i,j,k,:,:], coordsInitial[3,0:3]))\ - + np.linalg.norm(nodes[i, j, k+1,0:3] - centres[i,j,k,0:3] - np.dot(F[i,j,k,:,:], coordsInitial[4,0:3]))\ - + np.linalg.norm(nodes[i+1,j, k+1,0:3] - centres[i,j,k,0:3] - np.dot(F[i,j,k,:,:], coordsInitial[5,0:3]))\ - + np.linalg.norm(nodes[i+1,j+1,k+1,0:3] - centres[i,j,k,0:3] - np.dot(F[i,j,k,:,:], coordsInitial[6,0:3]))\ - + np.linalg.norm(nodes[i, j+1,k+1,0:3] - centres[i,j,k,0:3] - np.dot(F[i,j,k,:,:], coordsInitial[7,0:3])) + sMismatch[k,j,i] = \ + + np.linalg.norm(nodes[k, j, i ,0:3] - centres[k,j,i,0:3] - np.dot(F[k,j,i,:,:], coordsInitial[0,0:3]))\ + + np.linalg.norm(nodes[k, j, i+1,0:3] - centres[k,j,i,0:3] - np.dot(F[k,j,i,:,:], coordsInitial[1,0:3]))\ + + np.linalg.norm(nodes[k, j+1,i+1,0:3] - centres[k,j,i,0:3] - np.dot(F[k,j,i,:,:], coordsInitial[2,0:3]))\ + + np.linalg.norm(nodes[k, j+1,i ,0:3] - centres[k,j,i,0:3] - np.dot(F[k,j,i,:,:], coordsInitial[3,0:3]))\ + + np.linalg.norm(nodes[k+1,j, i ,0:3] - centres[k,j,i,0:3] - np.dot(F[k,j,i,:,:], coordsInitial[4,0:3]))\ + + np.linalg.norm(nodes[k+1,j, i+1,0:3] - centres[k,j,i,0:3] - np.dot(F[k,j,i,:,:], coordsInitial[5,0:3]))\ + + np.linalg.norm(nodes[k+1,j+1,i+1,0:3] - centres[k,j,i,0:3] - np.dot(F[k,j,i,:,:], coordsInitial[6,0:3]))\ + + np.linalg.norm(nodes[k+1,j+1,i ,0:3] - centres[k,j,i,0:3] - np.dot(F[k,j,i,:,:], coordsInitial[7,0:3])) return sMismatch @@ -307,38 +306,32 @@ for name in filenames: # -----------------------------process data and assemble header ------------------------------------- F_fourier = np.fft.rfftn(table.data[:,:9].reshape(grid[2],grid[1],grid[0],3,3),axes=(0,1,2)) # perform transform only once... - nodes = np.vstack(np.meshgrid(np.linspace(0.0,size[0],grid[0]+1), - np.linspace(0.0,size[1],grid[1]+1), - np.linspace(0.0,size[2],grid[2]+1))).reshape([3,17,17,17]).T\ - + displacementFluctFFT(F_fourier,grid,size,True,transformed=True)\ - + displacementAvgFFT (F_fourier,grid,size,True,transformed=True) + nodes = displacementFluctFFT(F_fourier,grid,size,True,transformed=True)\ + + deformationAvgFFT (F_fourier,grid,size,True,transformed=True) + if options.shape: table.labels_append(['shapeMismatch({})'.format(options.defgrad)]) - centres = np.vstack(np.meshgrid(np.linspace(size[0]/grid[0]*.5,size[0]-size[0]/grid[0]*.5,grid[0]), - np.linspace(size[1]/grid[1]*.5,size[1]-size[1]/grid[1]*.5,grid[1]), - np.linspace(size[2]/grid[2]*.5,size[2]-size[2]/grid[2]*.5,grid[2]))).reshape([3,16,16,16]).T\ - + displacementFluctFFT(F_fourier,grid,size,False,transformed=True)\ - + displacementAvgFFT (F_fourier,grid,size,False,transformed=True) + centres = displacementFluctFFT(F_fourier,grid,size,False,transformed=True)\ + + deformationAvgFFT (F_fourier,grid,size,False,transformed=True) if options.volume: table.labels_append(['volMismatch({})'.format(options.defgrad)]) table.head_write() - if options.shape: shapeMismatch = shapeMismatch( size,table.data[:,:9].reshape(grid[2],grid[1],grid[0],3,3),nodes,centres) - if options.volume: volumeMismatch = volumeMismatch(size,table.data[:,:9].reshape(grid[2],grid[1],grid[0],3,3),nodes) + if options.shape: + shapeMismatch = shapeMismatch( size,table.data[:,:9].reshape(grid[2],grid[1],grid[0],3,3),nodes,centres) + if options.volume: + volumeMismatch = volumeMismatch(size,table.data[:,:9].reshape(grid[2],grid[1],grid[0],3,3),nodes) -# ------------------------------------------ process data ------------------------------------------ - table.data_rewind() - idx = 0 - outputAlive = True - while outputAlive and table.data_read(): # read next data line of ASCII table - (x,y,z) = damask.util.gridLocation(idx,grid) # figure out (x,y,z) position from line count - idx += 1 - if options.shape: table.data_append( shapeMismatch[x,y,z]) - if options.volume: table.data_append(volumeMismatch[x,y,z]) - outputAlive = table.data_write() +# ------------------------------------------ output data ------------------------------------------- + for i in xrange(grid[2]): + for j in xrange(grid[1]): + for k in xrange(grid[0]): + table.data_read() + if options.shape: table.data_append(shapeMismatch[i,j,k]) + if options.volume: table.data_append(volumeMismatch[i,j,k]) + table.data_write() -# ------------------------------------------ output finalization ----------------------------------- - - table.close() +# ------------------------------------------ output finalization ----------------------------------- + table.close() # close ASCII tables From 97d6ed57e1d627a4dfff3393a7c8accdd27cad87 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 29 Jun 2016 20:13:00 +0200 Subject: [PATCH 052/412] also not needed any more --- installation/compile_CoreModule.py | 141 ----------------------------- 1 file changed, 141 deletions(-) delete mode 100755 installation/compile_CoreModule.py diff --git a/installation/compile_CoreModule.py b/installation/compile_CoreModule.py deleted file mode 100755 index 94df21f91..000000000 --- a/installation/compile_CoreModule.py +++ /dev/null @@ -1,141 +0,0 @@ -#!/usr/bin/env python2 -# -*- coding: UTF-8 no BOM -*- - -import os,sys,glob,subprocess,shlex -from damask import Environment -from damask import version as DAMASKVERSION - -# compiles fortran code for Python -scriptID = '$Id$' - -damaskEnv = Environment() -baseDir = damaskEnv.relPath('installation/') -codeDir = damaskEnv.relPath('code/') - -keywords=['IMKL_ROOT','ACML_ROOT','LAPACK_ROOT','FFTW_ROOT','F90'] -options={} - -#--- getting options from damask.conf or, if not present, from envinronment ----------------------- -for option in keywords: - try: - value = damaskEnv.options[option] - except: - value = os.getenv(option) - if value is None: value = '' # env not set - options[option]=value - -#--- overwrite default options with keyword=value pair from argument list to mimic make behavior -- -for i, arg in enumerate(sys.argv): - for option in keywords: - if arg.startswith(option): - options[option] = sys.argv[i][len(option)+1:] - -#--- check for valid compiler and set options ----------------------------------------------------- -compilers = ['ifort','gfortran'] -if options['F90'] not in compilers: - sys.exit('compiler "F90" (in installation/options or as Shell variable) has to be one out of: %s'%(', '.join(compilers))) - -compiler = { - 'gfortran': '--fcompiler=gnu95 --f90flags="-fPIC -fno-range-check -xf95-cpp-input -std=f2008 -fall-intrinsics'+\ - ' -fdefault-real-8 -fdefault-double-8"', - 'ifort': '--fcompiler=intelem --f90flags="-fPIC -fpp -stand f08 -diag-disable 5268 -assume byterecl'+\ - ' -real-size 64 -integer-size 32 -shared-intel"', - }[options['F90']] - -#--- option not depending on compiler ------------------------------------------------------------- -compileOptions = ' -DSpectral -DFLOAT=8 -DINT=4 -I%s/lib -DDAMASKVERSION=\\\\\"\\\"%s\\\\\"\\\"'%(damaskEnv.rootDir(),DAMASKVERSION) - -#--- this saves the path of libraries to core.so, hence it is known during runtime ---------------- -if options['F90'] == 'gfortran': - # solved error: Undefined symbols for architecture x86_64: "_PyArg_ParseTupleAndKeywords" - # as found on https://lists.macosforge.org/pipermail/macports-dev/2013-May/022735.html - LDFLAGS = '-shared -Wl,-undefined,dynamic_lookup' -else: - # some f2py versions/configurations compile with openMP, so linking against openMP is needed - # to prevent errors during loading of core module - LDFLAGS = ' -openmp -Wl' - -#--- run path of for fftw during runtime ---------------------------------------------------------- -LDFLAGS += ',-rpath,%s/lib,-rpath,%s/lib64'%(options['FFTW_ROOT'],options['FFTW_ROOT']) - -# see http://cens.ioc.ee/pipermail/f2py-users/2003-December/000621.html -if options['IMKL_ROOT']: - if options['F90'] == 'gfortran': - arch = 'gf' - elif options['F90'] == 'ifort': - arch = 'intel' - lib_lapack = '-L%s/lib/intel64 -lmkl_%s_lp64 -lmkl_core -lmkl_sequential -lm'\ - %(options['IMKL_ROOT'],arch) - LDFLAGS +=',-rpath,%s/lib/intel64'%(options['IMKL_ROOT']) -elif options['ACML_ROOT'] != '': - lib_lapack = '-L%s/%s64/lib -lacml'%(options['ACML_ROOT'],options['F90']) - LDFLAGS +=',-rpath,%s/%s64/lib'%(options['ACML_ROOT'],options['F90']) -elif options['LAPACK_ROOT'] != '': - lib_lapack = '-L%s/lib -L%s/lib64 -llapack'%(options['LAPACK_ROOT'],options['LAPACK_ROOT']) - LDFLAGS +=',-rpath,%s/lib,-rpath,%s/lib64'%(options['LAPACK_ROOT'],options['LAPACK_ROOT']) - -#-------------------------------------------------------------------------------------------------- -# f2py does not (yet) support setting of special flags for the linker, hence they must be set via -# environment variable ---------------------------------------------------------------------------- -my_env = os.environ -my_env["LDFLAGS"] = LDFLAGS - -#--- delete old file ------------------------------------------------------------------------------ -try: - os.remove(os.path.join(damaskEnv.relPath('lib/damask'),'core.so')) -except OSError, e: - print ("Error when deleting: %s - %s." % (e.filename,e.strerror)) - - -# The following command is used to compile the fortran files and make the functions defined -# in damask.core.pyf available for python in the module core.so -# It uses the fortran wrapper f2py that is included in the numpy package to construct the -# module core.so out of the fortran code in the f90 files -# For the generation of the pyf file use the following lines: -########################################################################### -#'f2py -h damask.core.pyf' +\ -#' --overwrite-signature --no-lower prec.f90 DAMASK_spectral_interface.f90 math.f90 mesh.f90,...' - ########################################################################### -os.chdir(codeDir) -cmd = 'f2py damask.core.pyf' +\ - ' -c --no-lower %s'%(compiler) +\ - compileOptions+\ - ' C_routines.c'+\ - ' system_routines.f90'+\ - ' prec.f90'+\ - ' spectral_interface.f90'+\ - ' IO.f90'+\ - ' libs.f90'+\ - ' numerics.f90'+\ - ' debug.f90'+\ - ' math.f90'+\ - ' FEsolving.f90'+\ - ' mesh.f90'+\ - ' core_quit.f90'+\ - ' -L%s/lib -lfftw3'%(options['FFTW_ROOT'])+\ - ' %s'%lib_lapack - -print('Executing: '+cmd) -try: - subprocess.call(shlex.split(cmd),env=my_env) -except subprocess.CalledProcessError: - print('build failed') -except OSError: - print ('f2py not found') - -try: - os.rename(os.path.join(codeDir,'core.so'),\ - os.path.join(damaskEnv.relPath('lib/damask'),'core.so')) -except: - pass - -modules = glob.glob('*.mod') -for module in modules: - print 'removing', module - os.remove(module) - -#--- check if compilation of core module was successful ------------------------------------------- -try: - with open(damaskEnv.relPath('lib/damask/core.so')) as f: pass -except IOError as e: - print '*********\n* core.so not found, compilation of core modules was not successful\n*********' From ddb292e3602c84c1192df37776c443409c6167d8 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 29 Jun 2016 23:27:22 +0200 Subject: [PATCH 053/412] some simplifications --- code/crystallite.f90 | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/code/crystallite.f90 b/code/crystallite.f90 index 450da5685..2fc5b4083 100644 --- a/code/crystallite.f90 +++ b/code/crystallite.f90 @@ -145,7 +145,6 @@ subroutine crystallite_init debug_crystallite, & debug_levelBasic use numerics, only: & - worldrank, & usePingPong use math, only: & math_I3, & @@ -203,11 +202,9 @@ subroutine crystallite_init tag = '', & line= '' - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- crystallite init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- crystallite init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess cMax = homogenization_maxNgrains iMax = mesh_maxNips @@ -3578,9 +3575,8 @@ logical function crystallite_integrateStress(& #ifndef _OPENMP if (iand(debug_level(debug_crystallite), debug_levelExtensive) /= 0_pInt & .and. ((el == debug_e .and. ip == debug_i .and. ipc == debug_g) & - .or. .not. iand(debug_level(debug_crystallite), debug_levelSelective) /= 0_pInt)) then + .or. .not. iand(debug_level(debug_crystallite), debug_levelSelective) /= 0_pInt)) & write(6,'(a,i8,1x,i2,1x,i3)') '<< CRYST >> integrateStress at el ip ipc ',el,ip,ipc - endif #endif @@ -3686,9 +3682,8 @@ logical function crystallite_integrateStress(& !* calculate plastic velocity gradient and its tangent from constitutive law - if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then + if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) & call system_clock(count=tick,count_rate=tickrate,count_max=maxticks) - endif call constitutive_LpAndItsTangent(Lp_constitutive, dLp_dT3333, dLp_dFi3333, & Tstar_v, Fi_new, ipc, ip, el) @@ -3785,12 +3780,11 @@ logical function crystallite_integrateStress(& enddo LpLoop - if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then + if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) & !$OMP CRITICAL (distributionStress) debug_StressLoopLpDistribution(NiterationStressLp,numerics_integrationMode) = & debug_StressLoopLpDistribution(NiterationStressLp,numerics_integrationMode) + 1_pInt !$OMP END CRITICAL (distributionStress) - endif !* calculate intermediate velocity gradient and its tangent from constitutive law @@ -3872,12 +3866,11 @@ logical function crystallite_integrateStress(& Liguess = Liguess + steplengthLi * deltaLi enddo LiLoop - if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then + if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) & !$OMP CRITICAL (distributionStress) debug_StressLoopLiDistribution(NiterationStressLi,numerics_integrationMode) = & debug_StressLoopLiDistribution(NiterationStressLi,numerics_integrationMode) + 1_pInt !$OMP END CRITICAL (distributionStress) - endif !* calculate new plastic and elastic deformation gradient From bfcad397286ccc9a743049fe6ef125e211fb2f10 Mon Sep 17 00:00:00 2001 From: Test User Date: Thu, 30 Jun 2016 04:32:36 +0200 Subject: [PATCH 054/412] updated version information after successful test of v2.0.0-302-g2c8427e --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 38c2a636c..285f9d261 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.0-297-ga27aba1 +v2.0.0-302-g2c8427e From e97f3a788d0bc42f5579f8fdbcef6677a6684eae Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 30 Jun 2016 10:30:40 +0200 Subject: [PATCH 055/412] added special function for often used comparison to 0 --- code/prec.f90 | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/code/prec.f90 b/code/prec.f90 index bf9ac7124..1ab87e6ac 100644 --- a/code/prec.f90 +++ b/code/prec.f90 @@ -199,6 +199,39 @@ logical elemental pure function dNeq(a,b,tol) dNeq = merge(.False., .True.,abs(a-b) <= merge(tol,eps,present(tol))*maxval(abs([a,b]))) end function dNeq + +!-------------------------------------------------------------------------------------------------- +!> @brief equality to 0comparison for float with double precision +! replaces "==0" but for certain (relative) tolerance. Counterpart to dNeq0 +! http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm +!-------------------------------------------------------------------------------------------------- +logical elemental pure function dEq0(a,tol) + + implicit none + real(pReal), intent(in) :: a + real(pReal), intent(in), optional :: tol + real(pReal), parameter :: eps = 2.220446049250313E-16 ! DBL_EPSILON in C + + dEq0 = merge(.True., .False.,abs(a) <= merge(tol,eps,present(tol))*abs(a)) +end function dEq0 + + +!-------------------------------------------------------------------------------------------------- +!> @brief inequality comparison to 0 for float with double precision +! replaces "!=0" but for certain (relative) tolerance. Counterpart to dEq0 +! http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm +!-------------------------------------------------------------------------------------------------- +logical elemental pure function dNeq0(a,tol) + + implicit none + real(pReal), intent(in) :: a + real(pReal), intent(in), optional :: tol + real(pReal), parameter :: eps = 2.220446049250313E-16 ! DBL_EPSILON in C + + dNeq0 = merge(.False., .True.,abs(a) <= merge(tol,eps,present(tol))*abs(a)) +end function dNeq0 + + !-------------------------------------------------------------------------------------------------- !> @brief equality comparison for complex with double precision ! replaces "==" but for certain (relative) tolerance. Counterpart to cNeq From ffcc9300c57e1ec2919db4effbd7bc985e65ef59 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 30 Jun 2016 11:11:35 +0200 Subject: [PATCH 056/412] using norm2 function and newly introduced dNeq0/dEq0 --- code/math.f90 | 36 ++++++++++++++++++------------------ code/prec.f90 | 2 ++ 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/code/math.f90 b/code/math.f90 index 12803ba3d..9876fe701 100644 --- a/code/math.f90 +++ b/code/math.f90 @@ -724,7 +724,7 @@ end function math_transpose33 !-------------------------------------------------------------------------------------------------- pure function math_inv33(A) use prec, only: & - dNeq + dNeq0 implicit none real(pReal),dimension(3,3),intent(in) :: A @@ -737,7 +737,7 @@ pure function math_inv33(A) DetA = A(1,1) * math_inv33(1,1) + A(1,2) * math_inv33(2,1) + A(1,3) * math_inv33(3,1) - if (dNeq(DetA,0.0_pReal)) then + if (dNeq0(DetA)) then math_inv33(1,2) = -A(1,2) * A(3,3) + A(1,3) * A(3,2) math_inv33(2,2) = A(1,1) * A(3,3) - A(1,3) * A(3,1) math_inv33(3,2) = -A(1,1) * A(3,2) + A(1,2) * A(3,1) @@ -762,7 +762,7 @@ end function math_inv33 !-------------------------------------------------------------------------------------------------- pure subroutine math_invert33(A, InvA, DetA, error) use prec, only: & - dEq + dEq0 implicit none logical, intent(out) :: error @@ -776,7 +776,7 @@ pure subroutine math_invert33(A, InvA, DetA, error) DetA = A(1,1) * InvA(1,1) + A(1,2) * InvA(2,1) + A(1,3) * InvA(3,1) - if (dEq(DetA,0.0_pReal)) then + if (dEq0(DetA)) then InvA = 0.0_pReal error = .true. else @@ -1100,7 +1100,7 @@ pure function math_Plain99to3333(m99) integer(pInt) :: i,j forall (i=1_pInt:9_pInt,j=1_pInt:9_pInt) math_Plain99to3333(mapPlain(1,i),mapPlain(2,i),& - mapPlain(1,j),mapPlain(2,j)) = m99(i,j) + mapPlain(1,j),mapPlain(2,j)) = m99(i,j) end function math_Plain99to3333 @@ -1212,10 +1212,10 @@ function math_qRand() real(pReal), dimension(3) :: rnd call halton(3_pInt,rnd) - math_qRand(1) = cos(2.0_pReal*PI*rnd(1))*sqrt(rnd(3)) - math_qRand(2) = sin(2.0_pReal*PI*rnd(2))*sqrt(1.0_pReal-rnd(3)) - math_qRand(3) = cos(2.0_pReal*PI*rnd(2))*sqrt(1.0_pReal-rnd(3)) - math_qRand(4) = sin(2.0_pReal*PI*rnd(1))*sqrt(rnd(3)) + math_qRand = [cos(2.0_pReal*PI*rnd(1))*sqrt(rnd(3)), + sin(2.0_pReal*PI*rnd(2))*sqrt(1.0_pReal-rnd(3)), + cos(2.0_pReal*PI*rnd(2))*sqrt(1.0_pReal-rnd(3)), + sin(2.0_pReal*PI*rnd(1))*sqrt(rnd(3))] end function math_qRand @@ -1282,7 +1282,7 @@ end function math_qNorm !-------------------------------------------------------------------------------------------------- pure function math_qInv(Q) use prec, only: & - dNeq + dNeq0 implicit none real(pReal), dimension(4), intent(in) :: Q @@ -1292,7 +1292,7 @@ pure function math_qInv(Q) math_qInv = 0.0_pReal squareNorm = math_qDot(Q,Q) - if (dNeq(squareNorm,0.0_pReal)) math_qInv = math_qConj(Q) / squareNorm + if (dNeq0(squareNorm)) math_qInv = math_qConj(Q) / squareNorm end function math_qInv @@ -1493,7 +1493,7 @@ pure function math_axisAngleToR(axis,omega) real(pReal), dimension(3) :: axisNrm real(pReal) :: norm,s,c,c1 - norm = sqrt(math_mul3x3(axis,axis)) + norm = norm2(axis) if (norm > 1.0e-8_pReal) then ! non-zero rotation axisNrm = axis/norm ! normalize axis to be sure @@ -1599,7 +1599,7 @@ pure function math_qToR(q) S = reshape( [0.0_pReal, -q(4), q(3), & q(4), 0.0_pReal, -q(2), & - -q(3), q(2), 0.0_pReal],[3,3]) ! notation is transposed + -q(3), q(2), 0.0_pReal],[3,3]) ! notation is transposed math_qToR = (2.0_pReal * q(1)*q(1) - 1.0_pReal) * math_I3 & + 2.0_pReal * T - 2.0_pReal * q(1) * S @@ -1623,17 +1623,17 @@ pure function math_qToEuler(qPassive) q = math_qConj(qPassive) ! convert to active rotation, since formulas are defined for active rotations - math_qToEuler(2) = acos(1.0_pReal-2.0_pReal*(q(2)*q(2)+q(3)*q(3))) + math_qToEuler(2) = acos(1.0_pReal-2.0_pReal*(q(2)**2+q(3)**2)) if (abs(math_qToEuler(2)) < 1.0e-6_pReal) then math_qToEuler(1) = sign(2.0_pReal*acos(math_limit(q(1),-1.0_pReal, 1.0_pReal)),q(4)) math_qToEuler(3) = 0.0_pReal else - math_qToEuler(1) = atan2(q(1)*q(3)+q(2)*q(4), q(1)*q(2)-q(3)*q(4)) + math_qToEuler(1) = atan2(+q(1)*q(3)+q(2)*q(4), q(1)*q(2)-q(3)*q(4)) math_qToEuler(3) = atan2(-q(1)*q(3)+q(2)*q(4), q(1)*q(2)+q(3)*q(4)) endif - math_qToEuler = merge(math_qToEuler + [2.0_pReal*PI, PI, 2.0_pReal*PI], & ! ensure correct range + math_qToEuler = merge(math_qToEuler + [2.0_pReal*PI, PI, 2.0_pReal*PI], & ! ensure correct range math_qToEuler, math_qToEuler<0.0_pReal) end function math_qToEuler @@ -2097,7 +2097,7 @@ end function math_eigenvectorBasisSym33 !-------------------------------------------------------------------------------------------------- function math_rotationalPart33(m) use prec, only: & - dEq + dEq0 use IO, only: & IO_warning @@ -2109,7 +2109,7 @@ function math_rotationalPart33(m) U = math_eigenvectorBasisSym33(math_mul33x33(transpose(m),m)) Uinv = math_inv33(U) - inversionFailed: if (all(dEq(Uinv,0.0_pReal))) then + inversionFailed: if (all(dEq0(Uinv))) then math_rotationalPart33 = math_I3 call IO_warning(650_pInt) else inversionFailed diff --git a/code/prec.f90 b/code/prec.f90 index 1ab87e6ac..0ded23528 100644 --- a/code/prec.f90 +++ b/code/prec.f90 @@ -115,8 +115,10 @@ module prec prec_init, & prec_isNaN, & dEq, & + dEq0, & cEq, & dNeq, & + dNeq0, & cNeq contains From 755501da694a750452507e3655ab94b91f6d5e8f Mon Sep 17 00:00:00 2001 From: Test User Date: Thu, 30 Jun 2016 16:31:41 +0200 Subject: [PATCH 057/412] updated version information after successful test of v2.0.0-310-ge99784d --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 285f9d261..bc924dc1e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.0-302-g2c8427e +v2.0.0-310-ge99784d From 7445aa0b32ebd4dc8e118fec8d75622af2d96a7a Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 1 Jul 2016 15:00:56 +0200 Subject: [PATCH 058/412] conflict due to line ending changes --- DAMASK_env.bat | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 DAMASK_env.bat diff --git a/DAMASK_env.bat b/DAMASK_env.bat new file mode 100644 index 000000000..751237800 --- /dev/null +++ b/DAMASK_env.bat @@ -0,0 +1,19 @@ +:: sets up an environment for DAMASK on Windows +:: usage: call DAMASK_env.bat +@echo off +set LOCATION=%~dp0 +set DAMASK_ROOT=%LOCATION%\DAMASK +set DAMASK_NUM_THREADS=2 +chcp 1252 +Title Düsseldorf Advanced Materials Simulation Kit - DAMASK, MPIE Düsseldorf +echo. +echo Düsseldorf Advanced Materials Simulation Kit - DAMASK +echo Max-Planck-Institut für Eisenforschung, Düsseldorf +echo http://damask.mpie.de +echo. +echo Preparing environment ... +echo DAMASK_ROOT=%DAMASK_ROOT% +echo DAMASK_NUM_THREADS=%DAMASK_NUM_THREADS% +set DAMASK_BIN=%DAMASK_ROOT%\bin +set PATH=%PATH%;%DAMASK_BIN% +set PYTHONPATH=%PYTHONPATH%;%DAMASK_ROOT%\lib From fa13aa30b03eed860a46e981cae2f02d1bad5e4c Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 29 Jun 2016 20:49:01 +0200 Subject: [PATCH 059/412] python 3 at least imports the damask module now --- lib/damask/colormaps.py | 1 + lib/damask/solver/abaqus.py | 2 +- lib/damask/util.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/damask/colormaps.py b/lib/damask/colormaps.py index 45c88e8d5..b0063d76e 100644 --- a/lib/damask/colormaps.py +++ b/lib/damask/colormaps.py @@ -15,6 +15,7 @@ class Color(): __slots__ = [ 'model', 'color', + '__dict__', ] diff --git a/lib/damask/solver/abaqus.py b/lib/damask/solver/abaqus.py index 0a872bc7a..ffb01ac51 100644 --- a/lib/damask/solver/abaqus.py +++ b/lib/damask/solver/abaqus.py @@ -13,7 +13,7 @@ class Abaqus(Solver): import subprocess process = subprocess.Popen(['abaqus', 'information=release'],stdout = subprocess.PIPE,stderr = subprocess.PIPE) self.version = process.stdout.readlines()[1].split()[1] - print self.version + print(self.version) else: self.version = version diff --git a/lib/damask/util.py b/lib/damask/util.py index 620920531..14410f2ea 100644 --- a/lib/damask/util.py +++ b/lib/damask/util.py @@ -415,7 +415,7 @@ def leastsqBound(func, x0, args=(), bounds=None, Dfun=None, full_output=0, try: cov_x = inv(np.dot(np.transpose(R), R)) except LinAlgError as inverror: - print inverror + print(inverror) pass return (x, cov_x) + retval[1:-1] + (mesg, info) else: From a317636e8b1824b1b92e9a5c71103c86e396ad06 Mon Sep 17 00:00:00 2001 From: Test User Date: Sun, 3 Jul 2016 02:24:55 +0200 Subject: [PATCH 060/412] updated version information after successful test of v2.0.0-341-gaf4307e --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index bc924dc1e..c6344d639 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.0-310-ge99784d +v2.0.0-341-gaf4307e From 759126b906f7e9e165fe4757893eff64ea2d6e83 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 2 Jul 2016 13:28:32 +0200 Subject: [PATCH 061/412] compatible to python3 --- lib/damask/__init__.py | 2 +- lib/damask/asciitable.py | 40 ++++++++++++++++++++------------- lib/damask/colormaps.py | 24 ++++++++++---------- lib/damask/config/material.py | 10 ++++----- lib/damask/environment.py | 2 +- lib/damask/geometry/geometry.py | 2 +- lib/damask/solver/marc.py | 4 ++-- lib/damask/solver/solver.py | 2 +- 8 files changed, 47 insertions(+), 39 deletions(-) diff --git a/lib/damask/__init__.py b/lib/damask/__init__.py index 3edaa9efa..e84cbaa17 100644 --- a/lib/damask/__init__.py +++ b/lib/damask/__init__.py @@ -12,7 +12,7 @@ from .config import Material # noqa from .colormaps import Colormap, Color # noqa try: from .corientation import Quaternion, Rodrigues, Symmetry, Orientation # noqa - print "Import Cython version of Orientation module" + print("Import Cython version of Orientation module") except: from .orientation import Quaternion, Rodrigues, Symmetry, Orientation # noqa #from .block import Block # only one class diff --git a/lib/damask/asciitable.py b/lib/damask/asciitable.py index 4fe4f9156..210d596ec 100644 --- a/lib/damask/asciitable.py +++ b/lib/damask/asciitable.py @@ -3,6 +3,14 @@ import os,sys import numpy as np +# ------------------------------------------------------------------ +# python 3 has no unicode object, this ensures that the code works on Python 2&3 +try: + test=isinstance('test', unicode) +except(NameError): + unicode=str + +# ------------------------------------------------------------------ class ASCIItable(): """Read and write to ASCII tables""" @@ -158,12 +166,12 @@ class ASCIItable(): if self.__IO__['labeled']: # table features labels - self.info = [self.__IO__['in'].readline().strip() for i in xrange(1,int(m.group(1)))] + self.info = [self.__IO__['in'].readline().strip() for i in range(1,int(m.group(1)))] self.tags = shlex.split(self.__IO__['in'].readline()) # store tags found in last line else: - self.info = [self.__IO__['in'].readline().strip() for i in xrange(0,int(m.group(1)))] # all header is info ... + self.info = [self.__IO__['in'].readline().strip() for i in range(0,int(m.group(1)))] # all header is info ... else: # other table format try: @@ -224,11 +232,11 @@ class ASCIItable(): extra_header = [] for header in self.info: - headitems = map(str.lower,header.split()) + headitems = list(map(str.lower,header.split())) if len(headitems) == 0: continue # skip blank lines - if headitems[0] in mappings.keys(): - if headitems[0] in identifiers.keys(): - for i in xrange(len(identifiers[headitems[0]])): + if headitems[0] in list(mappings.keys()): + if headitems[0] in list(identifiers.keys()): + for i in range(len(identifiers[headitems[0]])): info[headitems[0]][i] = \ mappings[headitems[0]](headitems[headitems.index(identifiers[headitems[0]][i])+1]) else: @@ -415,9 +423,9 @@ class ASCIItable(): start = self.label_index(labels) dim = self.label_dimension(labels) - return np.hstack(map(lambda c: xrange(c[0],c[0]+c[1]), zip(start,dim))) \ + return np.hstack([range(c[0],c[0]+c[1]) for c in zip(start,dim)]) \ if isinstance(labels, Iterable) and not isinstance(labels, str) \ - else xrange(start,start+dim) + else range(start,start+dim) # ------------------------------------------------------------------ def info_append(self, @@ -447,7 +455,7 @@ class ASCIItable(): def data_skipLines(self, count): """wind forward by count number of lines""" - for i in xrange(count): + for i in range(count): alive = self.data_read() return alive @@ -501,9 +509,9 @@ class ASCIItable(): columns = [] for i,(c,d) in enumerate(zip(indices[present],dimensions[present])): # for all valid labels ... # ... transparently add all components unless column referenced by number or with explicit dimension - columns += range(c,c + \ + columns += list(range(c,c + \ (d if str(c) != str(labels[present[i]]) else \ - 1)) + 1))) use = np.array(columns) self.tags = list(np.array(self.tags)[use]) # update labels with valid subset @@ -530,7 +538,7 @@ class ASCIItable(): """write whole numpy array data""" for row in self.data: try: - output = [fmt % value for value in row] if fmt else map(repr,row) + output = [fmt % value for value in row] if fmt else list(map(repr,row)) except: output = [fmt % row] if fmt else [repr(row)] @@ -555,7 +563,7 @@ class ASCIItable(): try: idx = self.label_index(where) if len(self.data) <= idx: - self.data_append(['n/a' for i in xrange(idx+1-len(self.data))]) # grow data if too short + self.data_append(['n/a' for i in range(idx+1-len(self.data))]) # grow data if too short self.data[idx] = str(what) except(ValueError): pass @@ -568,7 +576,7 @@ class ASCIItable(): # ------------------------------------------------------------------ def data_asFloat(self): - return map(self._transliterateToFloat,self.data) + return list(map(self._transliterateToFloat,self.data)) @@ -590,8 +598,8 @@ class ASCIItable(): if len(items) > 2: if items[1].lower() == 'of': items = np.ones(datatype(items[0]))*datatype(items[2]) elif items[1].lower() == 'to': items = np.arange(datatype(items[0]),1+datatype(items[2])) - else: items = map(datatype,items) - else: items = map(datatype,items) + else: items = list(map(datatype,items)) + else: items = list(map(datatype,items)) s = min(len(items), N-i) # prevent overflow of microstructure array microstructure[i:i+s] = items[:s] diff --git a/lib/damask/colormaps.py b/lib/damask/colormaps.py index b0063d76e..6e33613e0 100644 --- a/lib/damask/colormaps.py +++ b/lib/damask/colormaps.py @@ -33,7 +33,7 @@ class Color(): } model = model.upper() - if model not in self.__transforms__.keys(): model = 'RGB' + if model not in list(self.__transforms__.keys()): model = 'RGB' if model == 'RGB' and max(color) > 1.0: # are we RGB255 ? for i in range(3): color[i] /= 255.0 # rescale to RGB @@ -62,7 +62,7 @@ class Color(): # ------------------------------------------------------------------ def convertTo(self,toModel = 'RGB'): toModel = toModel.upper() - if toModel not in self.__transforms__.keys(): return + if toModel not in list(self.__transforms__.keys()): return sourcePos = self.__transforms__[self.model]['index'] targetPos = self.__transforms__[toModel]['index'] @@ -139,7 +139,7 @@ class Color(): HSL[0] = HSL[0]*60.0 # scaling to 360 might be dangerous for small values if (HSL[0] < 0.0): HSL[0] = HSL[0] + 360.0 - for i in xrange(2): + for i in range(2): HSL[i+1] = min(HSL[i+1],1.0) HSL[i+1] = max(HSL[i+1],0.0) @@ -164,11 +164,11 @@ class Color(): [0.212671,0.715160,0.072169], [0.019334,0.119193,0.950227]]) - for i in xrange(3): + for i in range(3): if (self.color[i] > 0.04045): RGB_lin[i] = ((self.color[i]+0.0555)/1.0555)**2.4 else: RGB_lin[i] = self.color[i] /12.92 XYZ = np.dot(convert,RGB_lin) - for i in xrange(3): + for i in range(3): XYZ[i] = max(XYZ[i],0.0) @@ -193,10 +193,10 @@ class Color(): RGB_lin = np.dot(convert,self.color) RGB = np.zeros(3,'d') - for i in xrange(3): + for i in range(3): if (RGB_lin[i] > 0.0031308): RGB[i] = ((RGB_lin[i])**(1.0/2.4))*1.0555-0.0555 else: RGB[i] = RGB_lin[i] *12.92 - for i in xrange(3): + for i in range(3): RGB[i] = min(RGB[i],1.0) RGB[i] = max(RGB[i],0.0) @@ -225,7 +225,7 @@ class Color(): XYZ[0] = XYZ[1] + self.color[1]/ 500.0 XYZ[2] = XYZ[1] - self.color[2]/ 200.0 - for i in xrange(len(XYZ)): + for i in range(len(XYZ)): if (XYZ[i] > 6./29. ): XYZ[i] = XYZ[i]**3. else: XYZ[i] = 108./841. * (XYZ[i] - 4./29.) @@ -245,7 +245,7 @@ class Color(): ref_white = np.array([.95047, 1.00000, 1.08883],'d') # Observer = 2, Illuminant = D65 XYZ = self.color/ref_white - for i in xrange(len(XYZ)): + for i in range(len(XYZ)): if (XYZ[i] > 216./24389 ): XYZ[i] = XYZ[i]**(1.0/3.0) else: XYZ[i] = (841./108. * XYZ[i]) + 16.0/116.0 @@ -451,7 +451,7 @@ class Colormap(): """ format = format.lower() # consistent comparison basis frac = 0.5*(np.array(crop) + 1.0) # rescale crop range to fractions - colors = [self.color(float(i)/(steps-1)*(frac[1]-frac[0])+frac[0]).expressAs(model).color for i in xrange(steps)] + colors = [self.color(float(i)/(steps-1)*(frac[1]-frac[0])+frac[0]).expressAs(model).color for i in range(steps)] if format == 'paraview': colormap = ['[\n {{\n "ColorSpace" : "RGB", "Name" : "{}",\n "RGBPoints" : ['.format(name)] \ + [' {:4d},{:8.6f},{:8.6f},{:8.6f},'.format(i,color[0],color[1],color[2],) @@ -461,7 +461,7 @@ class Colormap(): elif format == 'gmsh': colormap = ['View.ColorTable = {'] \ - + [',\n'.join(['{%s}'%(','.join(map(lambda x:str(x*255.0),color))) for color in colors])] \ + + [',\n'.join(['{%s}'%(','.join([str(x*255.0) for x in color])) for color in colors])] \ + ['}'] elif format == 'gom': @@ -469,7 +469,7 @@ class Colormap(): + ' 9 ' + str(name) \ + ' 0 1 0 3 0 0 -1 9 \ 0 0 0 255 255 255 0 0 255 ' \ + '30 NO_UNIT 1 1 64 64 64 255 1 0 0 0 0 0 0 3 0 ' + str(len(colors)) \ - + ' '.join([' 0 %s 255 1'%(' '.join(map(lambda x:str(int(x*255.0)),color))) for color in reversed(colors)])] + + ' '.join([' 0 %s 255 1'%(' '.join([str(int(x*255.0)) for x in color])) for color in reversed(colors)])] elif format == 'raw': colormap = ['\t'.join(map(str,color)) for color in colors] diff --git a/lib/damask/config/material.py b/lib/damask/config/material.py index c1c3ad6b4..f586ee098 100644 --- a/lib/damask/config/material.py +++ b/lib/damask/config/material.py @@ -19,7 +19,7 @@ class Section(): self.parameters[key] = data[key] if '__order__' not in self.parameters: - self.parameters['__order__'] = self.parameters.keys() + self.parameters['__order__'] = list(self.parameters.keys()) if part.lower() in classes: self.__class__ = classes[part.lower()] self.__init__(data) @@ -61,11 +61,11 @@ class Texture(Section): def add_component(self,theType,properties): - if 'scatter' not in map(str.lower,properties.keys()): + if 'scatter' not in list(map(str.lower,list(properties.keys()))): scatter = 0.0 else: scatter = properties['scatter'] - if 'fraction' not in map(str.lower,properties.keys()): + if 'fraction' not in list(map(str.lower,list(properties.keys()))): fraction = 1.0 else: fraction = properties['fraction'] @@ -224,10 +224,10 @@ class Material(): def add_microstructure(self, section='', components={}, # dict of phase,texture, and fraction lists ): - """Experimental! Needs expansion to multi-constituent microstructures...""" + """Experimental! Needs expansion to multi-constituent microstructures...""" microstructure = Microstructure() # make keys lower case (http://stackoverflow.com/questions/764235/dictionary-to-lowercase-in-python) - components=dict((k.lower(), v) for k,v in components.iteritems()) + components=dict((k.lower(), v) for k,v in components.items()) for key in ['phase','texture','fraction','crystallite']: if type(components[key]) is not list: diff --git a/lib/damask/environment.py b/lib/damask/environment.py index 8ceb093dd..850cf3da6 100644 --- a/lib/damask/environment.py +++ b/lib/damask/environment.py @@ -41,7 +41,7 @@ class Environment(): try: cmd = """ ssh mulicense2 "/Stat_Flexlm | grep 'Users of %s: ' | cut -d' ' -f7,13" """%software process = subprocess.Popen(shlex.split(cmd),stdout = subprocess.PIPE,stderr = subprocess.PIPE) - licenses = map(int, process.stdout.readline().split()) + licenses = list(map(int, process.stdout.readline().split())) try: if licenses[0]-licenses[1] >= Nneeded: return 0 diff --git a/lib/damask/geometry/geometry.py b/lib/damask/geometry/geometry.py index cfefa51aa..0976299e3 100644 --- a/lib/damask/geometry/geometry.py +++ b/lib/damask/geometry/geometry.py @@ -15,7 +15,7 @@ class Geometry(): 'spectral': damask.geometry.Spectral, 'marc': damask.geometry.Marc, } - if solver.lower() in solverClass.keys(): + if solver.lower() in list(solverClass.keys()): self.__class__=solverClass[solver.lower()] self.__init__() diff --git a/lib/damask/solver/marc.py b/lib/damask/solver/marc.py index e693783f6..693bc8d87 100644 --- a/lib/damask/solver/marc.py +++ b/lib/damask/solver/marc.py @@ -25,7 +25,7 @@ class Marc(Solver): MSCpath = damask.environment.Environment(rootRelation).options['MSC_ROOT'] - for release,subdirs in sorted(self.releases.items(),reverse=True): + for release,subdirs in sorted(list(self.releases.items()),reverse=True): for subdir in subdirs: path = '%s/mentat%s/shlib/%s'%(MSCpath,release,subdir) if os.path.exists(path): return release @@ -40,7 +40,7 @@ class Marc(Solver): MSCpath = damask.environment.Environment(rootRelation).options['MSC_ROOT'] - if len(releases) == 0: releases = self.releases.keys() + if len(releases) == 0: releases = list(self.releases.keys()) if type(releases) is not list: releases = [releases] for release in sorted(releases,reverse=True): if release not in self.releases: continue diff --git a/lib/damask/solver/solver.py b/lib/damask/solver/solver.py index 175a86cd6..d210595b5 100644 --- a/lib/damask/solver/solver.py +++ b/lib/damask/solver/solver.py @@ -15,7 +15,7 @@ class Solver(): 'spectral': damask.solver.Spectral, 'marc': damask.solver.Marc, } - if solver.lower() in solverClass.keys(): + if solver.lower() in list(solverClass.keys()): self.__class__=solverClass[solver.lower()] self.__init__() From be02300d382778a1b3b0525a6434839e39a4f704 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 4 Jul 2016 21:44:59 +0200 Subject: [PATCH 062/412] print statement disturbs shell piping --- lib/damask/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/damask/__init__.py b/lib/damask/__init__.py index 3edaa9efa..fb305cc8c 100644 --- a/lib/damask/__init__.py +++ b/lib/damask/__init__.py @@ -12,7 +12,6 @@ from .config import Material # noqa from .colormaps import Colormap, Color # noqa try: from .corientation import Quaternion, Rodrigues, Symmetry, Orientation # noqa - print "Import Cython version of Orientation module" except: from .orientation import Quaternion, Rodrigues, Symmetry, Orientation # noqa #from .block import Block # only one class From b4c7287a93f6b5be085826a6c14dc02ac46d6335 Mon Sep 17 00:00:00 2001 From: Test User Date: Tue, 5 Jul 2016 04:16:33 +0200 Subject: [PATCH 063/412] updated version information after successful test of v2.0.0-347-gbe02300 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index c6344d639..114695582 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.0-341-gaf4307e +v2.0.0-347-gbe02300 From 963e058140288eb6c2abb6b52429e5e6aa1a06fb Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 5 Jul 2016 17:02:07 +0200 Subject: [PATCH 064/412] came back due to line ending conflict, not used --- DAMASK_env.bat | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 DAMASK_env.bat diff --git a/DAMASK_env.bat b/DAMASK_env.bat deleted file mode 100644 index 751237800..000000000 --- a/DAMASK_env.bat +++ /dev/null @@ -1,19 +0,0 @@ -:: sets up an environment for DAMASK on Windows -:: usage: call DAMASK_env.bat -@echo off -set LOCATION=%~dp0 -set DAMASK_ROOT=%LOCATION%\DAMASK -set DAMASK_NUM_THREADS=2 -chcp 1252 -Title Düsseldorf Advanced Materials Simulation Kit - DAMASK, MPIE Düsseldorf -echo. -echo Düsseldorf Advanced Materials Simulation Kit - DAMASK -echo Max-Planck-Institut für Eisenforschung, Düsseldorf -echo http://damask.mpie.de -echo. -echo Preparing environment ... -echo DAMASK_ROOT=%DAMASK_ROOT% -echo DAMASK_NUM_THREADS=%DAMASK_NUM_THREADS% -set DAMASK_BIN=%DAMASK_ROOT%\bin -set PATH=%PATH%;%DAMASK_BIN% -set PYTHONPATH=%PYTHONPATH%;%DAMASK_ROOT%\lib From e5abb08acd981c71bf7b22b4d67a38b194a24761 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 5 Jul 2016 17:05:10 +0200 Subject: [PATCH 065/412] not needed anymore --- configure | 138 ------------------------------------------------------ 1 file changed, 138 deletions(-) delete mode 100755 configure diff --git a/configure b/configure deleted file mode 100755 index 4841dcf1a..000000000 --- a/configure +++ /dev/null @@ -1,138 +0,0 @@ -#!/usr/bin/env python -import os,re,sys,string,subprocess,shutil - -from optparse import OptionParser, Option - -# ----------------------------- -class extendableOption(Option): -# ----------------------------- -# used for definition of new option parser action 'extend', which enables to take multiple option arguments -# taken from online tutorial http://docs.python.org/library/optparse.html - - ACTIONS = Option.ACTIONS + ("extend",) - STORE_ACTIONS = Option.STORE_ACTIONS + ("extend",) - TYPED_ACTIONS = Option.TYPED_ACTIONS + ("extend",) - ALWAYS_TYPED_ACTIONS = Option.ALWAYS_TYPED_ACTIONS + ("extend",) - - def take_action(self, action, dest, opt, value, values, parser): - if action == "extend": - lvalue = value.split(",") - values.ensure_value(dest, []).extend(lvalue) - else: - Option.take_action(self, action, dest, opt, value, values, parser) - - -######################################################## -# MAIN -######################################################## - -parser = OptionParser(option_class=extendableOption, usage='%prog options', description = """ -Configures the compilation and installation of DAMASK - -""") -defaults={'DAMASK_BIN':'depending on access rights', - 'FFTW_ROOT':'/usr', - 'MSC_ROOT' :'/msc', - 'DAMASK_NUM_THREADS':4, - 'MARC_VERSION':'2015', - 'spectralOptions':{}, - } - -#--- if local config file exists, read, otherwise assume global config file ------------------------ -configFile = os.path.join(os.getenv('HOME'),'.damask/damask.conf') \ - if os.path.isfile(os.path.join(os.getenv('HOME'),'.damask/damask.conf')) \ - else '/etc/damask.conf' - -#--- set default values according to read in values ------------------------------------------------ -try: - with open(configFile,'r') as f: - print('\n<<<<< reading default values from %s\n'%configFile) - for line in f: - line = line.strip() - if line.startswith('#') or line == '': - pass - - [key,value] = (re.split('[= ]',line)+[None,None])[:2] - - if key == 'DAMASK_NUM_THREADS': - defaults['DAMASK_NUM_THREADS'] = int(value) - if key == 'DAMASK_BIN': - defaults['DAMASK_BIN'] = value -except IOError: - pass - -parser.add_option('--prefix', dest='prefix', metavar='string', - help='location of (links to) DAMASK executables [%default]') -parser.add_option('--with-OMP-threads','--with-omp-threads', - dest='threads', type='int', metavar='int', - help='number of openMP threads [%default]') -parser.add_option('--with-spectral-options', dest='spectraloptions', action='extend', metavar='', - help='options for compilation of spectral solver') - -parser.set_defaults(prefix = defaults['DAMASK_BIN']) -parser.set_defaults(mscRoot = defaults['MSC_ROOT']) -parser.set_defaults(marcVersion = defaults['MARC_VERSION']) -parser.set_defaults(threads = defaults['DAMASK_NUM_THREADS']) -parser.set_defaults(spectraloptions = []) - -(options,filenames) = parser.parse_args() - - -#--- read config file if present to keep comments and order --------------------------------------- -output = [] -try: - with open(configFile,'r') as f: - for line in f: - line = line.strip() - items = re.split('[= ]',line) - - if (not line or items[0].startswith('#')): - pass - if items[0] == 'DAMASK_BIN': - line = '%s=%s'%(items[0],options.prefix) - options.prefix ='depending on access rights' - if items[0] == 'MSC_ROOT': - line = '%s=%s'%(items[0],options.mscRoot) - options.mscRoot ='' - if items[0] == 'MARC_VERSION': - line = '%s=%s'%(items[0],options.marcVersion) - options.marcVersion ='' - if items[0] == 'DAMASK_NUM_THREADS': - line = '%s=%s'%(items[0],options.threads) - options.threads ='' - for spectralOption in options.spectraloptions: - [key,value] = re.split('[= ]',spectralOption)[0:2] - if key == items[0]: - line = '%s=%s'%(items[0],value) - options.spectraloptions.remove(spectralOption) - output.append(line) -except IOError: - pass - -#--- write remaining options -------------------------------------------------------------------------- -for opt, value in options.__dict__.items(): - if opt == 'prefix' and value != 'depending on access rights': - output.append('DAMASK_BIN=%s'%value) - if opt == 'mscRoot' and value != '': - output.append('MSC_ROOT=%s'%value) - if opt == 'marcVersion' and value != '': - output.append('MARC_VERSION=%s'%value) - if opt == 'threads' and value != '': - output.append('DAMASK_NUM_THREADS=%s'%value) - -for spectralOption in options.spectraloptions: - output.append(spectralOption) - -#--- decide where do save the data ------------------------------------------------------------------- -configDir = '/etc' if os.access('/etc/', os.W_OK) \ - else os.path.join(os.getenv('HOME'),'.damask') # use system-wide config if possible -configFileNew = os.path.join(configDir,'damask.conf') - -if not os.path.isdir(configDir): - os.mkdir(configDir) - -print('\n>>>>> writing values to %s\n'%configFileNew) -with open(configFileNew,'w') as f: - for line in output: - print(line) - f.write(line+'\n') From 9e8adf731b02686255177d63b31655db5aa3fa4e Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Thu, 7 Jul 2016 15:22:06 -0400 Subject: [PATCH 066/412] fixed buggy a.all() call removed squaring of Laguerre weights (no clue why we considered this a good idea in the first place) --- processing/pre/geom_fromVoronoiTessellation.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/processing/pre/geom_fromVoronoiTessellation.py b/processing/pre/geom_fromVoronoiTessellation.py index 903124385..71bf9929f 100755 --- a/processing/pre/geom_fromVoronoiTessellation.py +++ b/processing/pre/geom_fromVoronoiTessellation.py @@ -73,18 +73,18 @@ def laguerreTessellation(undeformed, coords, weights, grains, nonperiodic = Fals [ 1, 1, 1 ], ]).astype(float)*info['size'] - squaredweights = np.power(np.tile(weights,len(copies)),2) # Laguerre weights (squared, size N*n) - - for i,vec in enumerate(copies): # periodic copies of seed points (size N*n) - try: seeds = np.append(seeds, coords+vec, axis=0) + repeatweights = np.repeat(weights,len(copies),axis=1).flatten(order='F') # Laguerre weights (1,2,3,1,2,3,...,1,2,3) + + for i,vec in enumerate(copies): # periodic copies of seed points ... + try: seeds = np.append(seeds, coords+vec, axis=0) # ... (1+a,2+a,3+a,...,1+z,2+z,3+z) except NameError: seeds = coords+vec - if all(squaredweights == 0.0): # standard Voronoi (no weights, KD tree) + if (repeatweights == 0.0).all(): # standard Voronoi (no weights, KD tree) myKDTree = spatial.cKDTree(seeds) devNull,closestSeeds = myKDTree.query(undeformed) else: damask.util.croak('...using {} cpu{}'.format(options.cpus, 's' if options.cpus > 1 else '')) - arguments = [[arg] + [seeds,squaredweights] for arg in list(undeformed)] + arguments = [[arg] + [seeds,repeatweights] for arg in list(undeformed)] if cpus > 1: # use multithreading pool = multiprocessing.Pool(processes = cpus) # initialize workers From bc8ecc5437a3185af7f03a6a6859f577bd98932c Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 8 Jul 2016 22:12:02 +0200 Subject: [PATCH 067/412] polishing --- code/math.f90 | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/code/math.f90 b/code/math.f90 index 5cdef7d54..8273b1820 100644 --- a/code/math.f90 +++ b/code/math.f90 @@ -193,11 +193,9 @@ subroutine math_init ! comment the first random_seed call out, set randSize to 1, and use ifort character(len=64) :: error_msg - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- math init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- math init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess call random_seed(size=randSize) if (allocated(randInit)) deallocate(randInit) @@ -216,13 +214,11 @@ subroutine math_init call random_number(randTest(i)) enddo - mainProcess2: if (worldrank == 0) then - write(6,*) 'size of random seed: ', randSize - do i =1, randSize - write(6,*) 'value of random seed: ', i, randInit(i) - enddo - write(6,'(a,4(/,26x,f17.14),/)') ' start of random sequence: ', randTest - endif mainProcess2 + write(6,'(a,I)') 'size of random seed: ', randSize + do i =1, randSize + write(6,'(a,I,I)') 'value of random seed: ', i, randInit(i) + enddo + write(6,'(a,4(/,26x,f17.14),/)') ' start of random sequence: ', randTest call random_seed(put = randInit) From 091b72c3ff21f78c814b73c84383257724db73c2 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 13 Jul 2016 16:25:27 +0200 Subject: [PATCH 068/412] commenting --- code/Makefile | 2 +- code/material.f90 | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/code/Makefile b/code/Makefile index a0f419ce0..7e5a130b1 100644 --- a/code/Makefile +++ b/code/Makefile @@ -7,7 +7,7 @@ SHELL = /bin/sh # OPTIONS = standard (alternative): meaning #------------------------------------------------------------- # F90 = ifort (gfortran): compiler type, choose Intel or GNU -# FCOMPILERNAME = name of the compiler executable (if not the same as the ype), e.g. using mpich-g90 instead of ifort +# FCOMPILERNAME = name of the compiler executable (if not the same as the type), e.g. using mpich-g90 instead of ifort # PORTABLE = TRUE (FALSE): decision, if executable is optimized for the machine on which it was built. # OPTIMIZATION = DEFENSIVE (OFF,AGGRESSIVE,ULTRA): Optimization mode: O2, O0, O3 + further options for most files, O3 + further options for all files # OPENMP = TRUE (FALSE): OpenMP multiprocessor support diff --git a/code/material.f90 b/code/material.f90 index 37d5741dd..e1a48bc1c 100644 --- a/code/material.f90 +++ b/code/material.f90 @@ -499,12 +499,12 @@ subroutine material_init() allocate(HomogenizationPosition(material_Nhomogenization),source=0_pInt) allocate(CrystallitePosition (material_Nphase), source=0_pInt) - ElemLoop:do e = 1_pInt,mesh_NcpElems ! loop over elements + ElemLoop:do e = 1_pInt,mesh_NcpElems myHomog = mesh_element(3,e) - IPloop:do i = 1_pInt,FE_Nips(FE_geomtype(mesh_element(2,e))) ! loop over IPs + IPloop:do i = 1_pInt,FE_Nips(FE_geomtype(mesh_element(2,e))) HomogenizationPosition(myHomog) = HomogenizationPosition(myHomog) + 1_pInt mappingHomogenization(1:2,i,e) = [HomogenizationPosition(myHomog),myHomog] - GrainLoop:do g = 1_pInt,homogenization_Ngrains(mesh_element(3,e)) ! loop over grains + GrainLoop:do g = 1_pInt,homogenization_Ngrains(mesh_element(3,e)) phase = material_phase(g,i,e) ConstitutivePosition(phase) = ConstitutivePosition(phase)+1_pInt ! not distinguishing between instances of same phase phaseAt(g,i,e) = phase @@ -1344,10 +1344,10 @@ subroutine material_populateGrains write(6,'(a32,1x,a32,1x,a6)') 'homogenization_name','microstructure_name','grain#' !$OMP END CRITICAL (write2out) endif - do homog = 1_pInt,material_Nhomogenization ! loop over homogenizations + homogenizationLoop: do homog = 1_pInt,material_Nhomogenization dGrains = homogenization_Ngrains(homog) ! grain number per material point - do micro = 1_pInt,material_Nmicrostructure ! all pairs of homog and micro - if (Ngrains(homog,micro) > 0_pInt) then ! an active pair of homog and micro + microstructureLoop: do micro = 1_pInt,material_Nmicrostructure ! all pairs of homog and micro + activePair: if (Ngrains(homog,micro) > 0_pInt) then myNgrains = Ngrains(homog,micro) ! assign short name for total number of grains to populate myNconstituents = microstructure_Nconstituents(micro) ! assign short name for number of constituents if (iand(myDebug,debug_levelBasic) /= 0_pInt) then @@ -1578,9 +1578,9 @@ subroutine material_populateGrains enddo enddo - endif ! active homog,micro pair - enddo - enddo + endif activePair + enddo microstructureLoop + enddo homogenizationLoop deallocate(volumeOfGrain) deallocate(phaseOfGrain) From 0fbb56a6ef013fe62cfc2a779155c677b4bc8cb5 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 13 Jul 2016 22:31:38 +0200 Subject: [PATCH 069/412] python env reads from $DAMASK_ROOT/CONFIG --- CONFIG | 8 ++++++++ lib/damask/environment.py | 10 +++------- 2 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 CONFIG diff --git a/CONFIG b/CONFIG new file mode 100644 index 000000000..e3955baca --- /dev/null +++ b/CONFIG @@ -0,0 +1,8 @@ +MSC_ROOT=/opt/MSC +MARC_VERSION=2015 + +DAMASK_NUM_THREADS=4 + +ABAQUS_VERSION=6.14-5 +#Set DAMASK_BIN if not $DAMASK_ROOT/bin +#DAMASK_BIN diff --git a/lib/damask/environment.py b/lib/damask/environment.py index 8ceb093dd..d9c59a22d 100644 --- a/lib/damask/environment.py +++ b/lib/damask/environment.py @@ -21,14 +21,10 @@ class Environment(): return os.path.normpath(os.path.join(os.path.realpath(__file__),'../../../')) def get_options(self): - if os.path.isfile(os.path.join(os.getenv('HOME'),'.damask/damask.conf')): - configFile = os.path.join(os.getenv('HOME'),'.damask/damask.conf') - else: - configFile = '/etc/damask.conf' - with open(self.relPath(configFile)) as file: - for line in file: + with open(self.relPath(self.rootDir()+'/CONFIG')) as configFile: + for line in configFile: l = line.strip() - if not (l.startswith('#') or l == ''): + if l and not l.startswith('#'): items = l.split('=') + ['',''] if items[1] != '': # nothing specified self.options[items[0].upper()] = items[1] From 83e1970f71ad31d336285206136999d07d0d4848 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 14 Jul 2016 12:24:55 +0200 Subject: [PATCH 070/412] now working with tcsh --- CONFIG | 10 ++++++---- lib/damask/environment.py | 8 ++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CONFIG b/CONFIG index e3955baca..3a28c2b96 100644 --- a/CONFIG +++ b/CONFIG @@ -1,8 +1,10 @@ -MSC_ROOT=/opt/MSC -MARC_VERSION=2015 +# "set syntax" needed only for tcsh (but works with bash etc) -DAMASK_NUM_THREADS=4 +set MSC_ROOT=/opt/MSC +set MARC_VERSION=2015 -ABAQUS_VERSION=6.14-5 +set DAMASK_NUM_THREADS=4 + +set ABAQUS_VERSION=6.14-5 #Set DAMASK_BIN if not $DAMASK_ROOT/bin #DAMASK_BIN diff --git a/lib/damask/environment.py b/lib/damask/environment.py index d9c59a22d..b0256e05d 100644 --- a/lib/damask/environment.py +++ b/lib/damask/environment.py @@ -1,7 +1,7 @@ # -*- coding: UTF-8 no BOM -*- -import os,subprocess,shlex +import os,subprocess,shlex,re class Environment(): __slots__ = [ \ @@ -23,10 +23,10 @@ class Environment(): def get_options(self): with open(self.relPath(self.rootDir()+'/CONFIG')) as configFile: for line in configFile: - l = line.strip() + l = re.sub('^set ', '', line).strip() if l and not l.startswith('#'): - items = l.split('=') + ['',''] - if items[1] != '': # nothing specified + items = l.split('=') + if len(items) == 2: self.options[items[0].upper()] = items[1] def isAvailable(self,software,Nneeded =-1): From 72d60039c1e61cd376a8ea0abdd81e94eccf5e36 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 14 Jul 2016 13:46:08 +0200 Subject: [PATCH 071/412] general improvements and adoptions to be compatible with csh --- CONFIG | 7 +++---- DAMASK_env.sh | 20 +++++++++++++++----- DAMASK_env.zsh | 27 +++++++++++++++++++-------- 3 files changed, 37 insertions(+), 17 deletions(-) diff --git a/CONFIG b/CONFIG index 3a28c2b96..17561c9cd 100644 --- a/CONFIG +++ b/CONFIG @@ -1,10 +1,9 @@ -# "set syntax" needed only for tcsh (but works with bash etc) +# "set"-syntax needed only for tcsh (but works with bash and zsh) set MSC_ROOT=/opt/MSC set MARC_VERSION=2015 -set DAMASK_NUM_THREADS=4 +set DAMASK_NUM_THREADS = 4 set ABAQUS_VERSION=6.14-5 -#Set DAMASK_BIN if not $DAMASK_ROOT/bin -#DAMASK_BIN +set DAMASK_BIN=${DAMASK_ROOT}/lib diff --git a/DAMASK_env.sh b/DAMASK_env.sh index 535708ed4..760ee056a 100644 --- a/DAMASK_env.sh +++ b/DAMASK_env.sh @@ -1,15 +1,20 @@ # sets up an environment for DAMASK on bash # usage: source DAMASK_env.sh + if [ "$OSTYPE" == "linux-gnu" ] || [ "$OSTYPE" == 'linux' ]; then - DAMASK_ROOT=$(python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" "`dirname $BASH_SOURCE`") + DAMASK_ROOT=$(python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" "$(dirname $BASH_SOURCE)") else [[ "${BASH_SOURCE::1}" == "/" ]] && BASE="" || BASE="`pwd`/" STAT=$(stat "`dirname $BASE$BASH_SOURCE`") DAMASK_ROOT=${STAT##* } fi -[[ -f $HOME/.damask/damask.conf ]] && source $HOME/.damask/damask.conf || source /etc/damask.conf +# allows to source the same file for tcsh and bash, with and without space around = +set() { + export $1$2$3 + } +source $DAMASK_ROOT/CONFIG # if DAMASK_BIN is present and not in $PATH, add it if [[ "x$DAMASK_BIN" != "x" && ! `echo ":$PATH:" | grep $DAMASK_BIN:` ]]; then @@ -24,6 +29,9 @@ PROCESSING=`which postResults 2>/dev/null` if [ "x$PROCESSING" == "x" ]; then PROCESSING='Not found!' fi +if [ "x$DAMASK_NUM_THREADS" == "x" ]; then + DAMASK_NUM_THREADS=1 +fi # according to http://software.intel.com/en-us/forums/topic/501500 # this seems to make sense for the stack size @@ -68,10 +76,12 @@ fi export DAMASK_NUM_THREADS export PYTHONPATH=$DAMASK_ROOT/lib:$PYTHONPATH -for var in BASE STAT SOLVER PROCESSING FREE; do +for var in BASE STAT SOLVER PROCESSING FREE DAMASK_BIN; do unset "${var}" done -for var in DAMASK IMKL ACML LAPACK MSC FFTW HDF5; do +for var in DAMASK MSC; do unset "${var}_ROOT" done - +for var in ABAQUS MARC; do + unset "${var}_VERSION" +done diff --git a/DAMASK_env.zsh b/DAMASK_env.zsh index b4b2d6953..b3666b34b 100644 --- a/DAMASK_env.zsh +++ b/DAMASK_env.zsh @@ -1,5 +1,6 @@ -# sets up an environment for DAMASK on bash -# usage: source DAMASK_env.sh +# sets up an environment for DAMASK on zsh +# usage: source DAMASK_env.zsh + if [ "$OSTYPE" = "linux-gnu" ] || [ "$OSTYPE" = 'linux' ]; then DAMASK_ROOT=$(readlink -f "`dirname ${(%):-%N}`") @@ -7,12 +8,17 @@ else print 'Not done yet' fi -[[ -f $HOME/.damask/damask.conf ]] && source $HOME/.damask/damask.conf || source /etc/damask.conf +# allows to source the same file for tcsh and zsh, with and without space around = +set() { + export $1$2$3 + } +source $DAMASK_ROOT/CONFIG # if DAMASK_BIN is present and not in $PATH, add it -#if [[ [[ "x$DAMASK_BIN" != "x" ]] && ! `echo ":$PATH:" | grep $DAMASK_BIN:` ]]; then +MATCH=`echo ":$PATH:" | grep $DAMASK_BIN:` +if [[ ( "x$DAMASK_BIN" != "x" ) && ( "x$MATCH" = "x" ) ]]; then export PATH=$DAMASK_BIN:$PATH -#fi +fi SOLVER=`which DAMASK_spectral 2>/dev/null` if [ "x$SOLVER" = "x" ]; then @@ -22,6 +28,9 @@ PROCESSING=`which postResults 2>/dev/null` if [ "x$PROCESSING" = "x" ]; then export PROCESSING='Not found!' fi +if [ "x$DAMASK_NUM_THREADS" = "x" ]; then + DAMASK_NUM_THREADS=1 +fi # according to http://software.intel.com/en-us/forums/topic/501500 # this seems to make sense for the stack size @@ -65,10 +74,12 @@ fi export DAMASK_NUM_THREADS export PYTHONPATH=$DAMASK_ROOT/lib:$PYTHONPATH -for var in BASE STAT SOLVER PROCESSING FREE; do +for var in BASE STAT SOLVER PROCESSING FREE DAMASK_BIN MATCH; do unset "${var}" done -for var in DAMASK IMKL ACML LAPACK MSC FFTW HDF5; do +for var in DAMASK MSC; do unset "${var}_ROOT" done - +for var in ABAQUS MARC; do + unset "${var}_VERSION" +done From 3314e5f0514401a29c5e9596bd1e9e6f5796fdd3 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 14 Jul 2016 15:09:25 +0200 Subject: [PATCH 072/412] updated symlinking, removed unused "rootRelation" --- .gitignore | 1 + CONFIG | 9 +++++---- installation/symlink_Code.py | 23 ++++++++++------------- installation/symlink_Processing.py | 15 ++++----------- lib/damask/environment.py | 11 +++++------ 5 files changed, 25 insertions(+), 34 deletions(-) diff --git a/.gitignore b/.gitignore index ea92bb425..d195179bb 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ *.exe *.bak *~ +bin PRIVATE diff --git a/CONFIG b/CONFIG index 17561c9cd..ee7e4fae2 100644 --- a/CONFIG +++ b/CONFIG @@ -1,9 +1,10 @@ # "set"-syntax needed only for tcsh (but works with bash and zsh) +# DAMASK_ROOT will be expanded +set DAMASK_BIN=${DAMASK_ROOT}/bin + +set DAMASK_NUM_THREADS = 4 set MSC_ROOT=/opt/MSC set MARC_VERSION=2015 -set DAMASK_NUM_THREADS = 4 - -set ABAQUS_VERSION=6.14-5 -set DAMASK_BIN=${DAMASK_ROOT}/lib +set ABAQUS_VERSION=5.14-5 diff --git a/installation/symlink_Code.py b/installation/symlink_Code.py index f0fea41e3..5d4518ddd 100755 --- a/installation/symlink_Code.py +++ b/installation/symlink_Code.py @@ -13,16 +13,9 @@ bin_link = { \ MarcReleases =[2011,2012,2013,2013.1,2014,2014.2,2015] -baseDir = damask.Environment('../../').relPath('code/') - -try: - binDir = damask.Environment().options['DAMASK_BIN'] -except: - root=os.access('/usr/local/bin', os.W_OK) - if root: - binDir = '/usr/local/bin' - else: - binDir = os.path.join(os.getenv('HOME'),'bin') +damaskEnv = damask.Environment() +baseDir = damaskEnv.relPath('code/') +binDir = damaskEnv.options['DAMASK_BIN'] if not os.path.isdir(binDir): os.mkdir(binDir) @@ -43,7 +36,11 @@ for version in MarcReleases: src = os.path.abspath(os.path.join(baseDir,'DAMASK_marc.f90')) if os.path.exists(src): sym_link = os.path.abspath(os.path.join(baseDir,'DAMASK_marc'+str(version)+'.f90')) - if os.path.lexists(sym_link): os.remove(sym_link) - os.symlink(os.path.relpath(src,baseDir),sym_link) - sys.stdout.write(sym_link+' -> '+src+'\n') + if os.path.lexists(sym_link): + os.remove(sym_link) + sys.stdout.write(sym_link) + else: + sys.stdout.write(damask.util.bcolors.BOLD + sym_link + damask.util.bcolors.ENDC) + os.symlink(src,sym_link) + sys.stdout.write(' -> '+src+'\n') diff --git a/installation/symlink_Processing.py b/installation/symlink_Processing.py index 0ca4f8ba4..3f00e95c6 100755 --- a/installation/symlink_Processing.py +++ b/installation/symlink_Processing.py @@ -3,18 +3,11 @@ # Makes postprocessing routines acessible from everywhere. import os,sys -from damask import Environment +import damask -BOLD = '\033[1m' -ENDC = '\033[0m' - -damaskEnv = Environment() +damaskEnv = damask.Environment() baseDir = damaskEnv.relPath('processing/') -codeDir = damaskEnv.relPath('code/') -try: - binDir = damaskEnv.options['DAMASK_BIN'] -except: - binDir = '/usr/local/bin' if os.access('/usr/local/bin', os.W_OK) else os.path.join(os.getenv('HOME'),'bin') +binDir = damaskEnv.options['DAMASK_BIN'] if not os.path.isdir(binDir): os.mkdir(binDir) @@ -36,7 +29,7 @@ for subDir in processing_subDirs: os.remove(sym_link) sys.stdout.write(sym_link) else: - sys.stdout.write(BOLD + sym_link + ENDC) + sys.stdout.write(damask.util.bcolors.BOLD + sym_link + damask.util.bcolors.ENDC) os.symlink(src,sym_link) sys.stdout.write(' -> '+src+'\n') diff --git a/lib/damask/environment.py b/lib/damask/environment.py index b0256e05d..4d24c6c6e 100644 --- a/lib/damask/environment.py +++ b/lib/damask/environment.py @@ -5,12 +5,10 @@ import os,subprocess,shlex,re class Environment(): __slots__ = [ \ - 'rootRelation', 'options', ] - def __init__(self,rootRelation = '.'): - self.rootRelation = rootRelation + def __init__(self): self.options = {} self.get_options() @@ -23,11 +21,12 @@ class Environment(): def get_options(self): with open(self.relPath(self.rootDir()+'/CONFIG')) as configFile: for line in configFile: - l = re.sub('^set ', '', line).strip() + l = re.sub('^set ', '', line).strip() # remove "set" (tcsh) when setting variables if l and not l.startswith('#'): items = l.split('=') - if len(items) == 2: - self.options[items[0].upper()] = items[1] + if len(items) == 2: + self.options[items[0].upper()] = \ + re.sub('\$\{*DAMASK_ROOT\}*',self.rootDir(),os.path.expandvars(items[1])) # expand all shell variables and DAMASK_ROOT def isAvailable(self,software,Nneeded =-1): licensesNeeded = {'abaqus' :5, From 13ee927606227428d47677c70d187a7284b7c250 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 14 Jul 2016 15:12:16 +0200 Subject: [PATCH 073/412] Cython was not always working --- Makefile | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/Makefile b/Makefile index 6c63d01f6..68ffb7033 100755 --- a/Makefile +++ b/Makefile @@ -17,16 +17,6 @@ FEM: marc: @./installation/mods_MarcMentat/apply_DAMASK_modifications.sh ${MAKEFLAGS} -.PHONY: processing -processing: - @if hash cython 2>/dev/null; then \ - cd ./lib/damask; \ - ln -s orientation.py corientation.pyx; \ - CC=gcc python setup_corientation.py build_ext --inplace; \ - rm -rv build; \ - rm *.c; \ - fi - .PHONY: tidy tidy: @$(MAKE) tidy -C code >/dev/null From 630b89c25a2998f8baf7186d45319188c920a4ad Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 14 Jul 2016 15:29:53 +0200 Subject: [PATCH 074/412] bugfixes (did not compile) --- code/crystallite.f90 | 7 +++++-- code/math.f90 | 10 +++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/code/crystallite.f90 b/code/crystallite.f90 index 2fc5b4083..7abd737f3 100644 --- a/code/crystallite.f90 +++ b/code/crystallite.f90 @@ -145,6 +145,7 @@ subroutine crystallite_init debug_crystallite, & debug_levelBasic use numerics, only: & + worldrank, & usePingPong use math, only: & math_I3, & @@ -3780,11 +3781,12 @@ logical function crystallite_integrateStress(& enddo LpLoop - if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) & + if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then !$OMP CRITICAL (distributionStress) debug_StressLoopLpDistribution(NiterationStressLp,numerics_integrationMode) = & debug_StressLoopLpDistribution(NiterationStressLp,numerics_integrationMode) + 1_pInt !$OMP END CRITICAL (distributionStress) + endif !* calculate intermediate velocity gradient and its tangent from constitutive law @@ -3866,11 +3868,12 @@ logical function crystallite_integrateStress(& Liguess = Liguess + steplengthLi * deltaLi enddo LiLoop - if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) & + if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then !$OMP CRITICAL (distributionStress) debug_StressLoopLiDistribution(NiterationStressLi,numerics_integrationMode) = & debug_StressLoopLiDistribution(NiterationStressLi,numerics_integrationMode) + 1_pInt !$OMP END CRITICAL (distributionStress) + endif !* calculate new plastic and elastic deformation gradient diff --git a/code/math.f90 b/code/math.f90 index 8273b1820..8694e30ee 100644 --- a/code/math.f90 +++ b/code/math.f90 @@ -214,9 +214,9 @@ subroutine math_init call random_number(randTest(i)) enddo - write(6,'(a,I)') 'size of random seed: ', randSize + write(6,'(a,I2)') ' size of random seed: ', randSize do i =1, randSize - write(6,'(a,I,I)') 'value of random seed: ', i, randInit(i) + write(6,'(a,I2,I14)') ' value of random seed: ', i, randInit(i) enddo write(6,'(a,4(/,26x,f17.14),/)') ' start of random sequence: ', randTest @@ -1189,9 +1189,9 @@ function math_qRand() real(pReal), dimension(3) :: rnd call halton(3_pInt,rnd) - math_qRand = [cos(2.0_pReal*PI*rnd(1))*sqrt(rnd(3)), - sin(2.0_pReal*PI*rnd(2))*sqrt(1.0_pReal-rnd(3)), - cos(2.0_pReal*PI*rnd(2))*sqrt(1.0_pReal-rnd(3)), + math_qRand = [cos(2.0_pReal*PI*rnd(1))*sqrt(rnd(3)), & + sin(2.0_pReal*PI*rnd(2))*sqrt(1.0_pReal-rnd(3)), & + cos(2.0_pReal*PI*rnd(2))*sqrt(1.0_pReal-rnd(3)), & sin(2.0_pReal*PI*rnd(1))*sqrt(rnd(3))] end function math_qRand From 25fcfcd16938d59cde9b0313309ca23a56da9b02 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 14 Jul 2016 15:50:39 +0200 Subject: [PATCH 075/412] set to correct Abaqus version --- CONFIG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONFIG b/CONFIG index ee7e4fae2..b701ec3c7 100644 --- a/CONFIG +++ b/CONFIG @@ -7,4 +7,4 @@ set DAMASK_NUM_THREADS = 4 set MSC_ROOT=/opt/MSC set MARC_VERSION=2015 -set ABAQUS_VERSION=5.14-5 +set ABAQUS_VERSION=6.14-5 From 9e3f4b1ec4ed86df9c2681ffca434b2429500e30 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 14 Jul 2016 16:09:04 +0200 Subject: [PATCH 076/412] unicode string caused trouble with Abaqus' IronPython --- lib/damask/orientation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/damask/orientation.py b/lib/damask/orientation.py index 886cd5a36..1607c220b 100644 --- a/lib/damask/orientation.py +++ b/lib/damask/orientation.py @@ -338,7 +338,7 @@ class Quaternion: type = "bunge", degrees = False, standardRange = False): - u""" + """ Orientation as Bunge-Euler angles conversion of ACTIVE rotation to Euler angles taken from: From 787a8da1c385ef29e266653b164af28d4421a8de Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 14 Jul 2016 16:10:59 +0200 Subject: [PATCH 077/412] removed remainders of Corientation compilation --- lib/damask/__init__.py | 6 ++---- lib/damask/setup_corientation.py | 17 ----------------- 2 files changed, 2 insertions(+), 21 deletions(-) delete mode 100755 lib/damask/setup_corientation.py diff --git a/lib/damask/__init__.py b/lib/damask/__init__.py index fb305cc8c..a1c08ea18 100644 --- a/lib/damask/__init__.py +++ b/lib/damask/__init__.py @@ -10,10 +10,8 @@ from .environment import Environment # noqa from .asciitable import ASCIItable # noqa from .config import Material # noqa from .colormaps import Colormap, Color # noqa -try: - from .corientation import Quaternion, Rodrigues, Symmetry, Orientation # noqa -except: - from .orientation import Quaternion, Rodrigues, Symmetry, Orientation # noqa +from .orientation import Quaternion, Rodrigues, Symmetry, Orientation # noqa + #from .block import Block # only one class from .result import Result # noqa from .geometry import Geometry # noqa diff --git a/lib/damask/setup_corientation.py b/lib/damask/setup_corientation.py deleted file mode 100755 index 2cf0be196..000000000 --- a/lib/damask/setup_corientation.py +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env python2 -# -*- coding: UTF-8 no BOM -*- - -from distutils.core import setup -from distutils.extension import Extension -from Cython.Distutils import build_ext -import numpy as np - -ext = [Extension("corientation", ["corientation.pyx"], - include_dirs=[np.get_include()])] - -setup( - name="corientation", - include_dirs=[np.get_include()], - cmdclass = {'build_ext': build_ext}, - ext_modules=ext -) \ No newline at end of file From ade6db3f9cd22479ea4549b5dc25e2c90254c2ec Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 14 Jul 2016 16:12:05 +0200 Subject: [PATCH 078/412] uses version string from CONFIG file --- lib/damask/solver/abaqus.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/damask/solver/abaqus.py b/lib/damask/solver/abaqus.py index ffb01ac51..19ec6b91f 100644 --- a/lib/damask/solver/abaqus.py +++ b/lib/damask/solver/abaqus.py @@ -6,14 +6,10 @@ from .solver import Solver class Abaqus(Solver): - def __init__(self,version='',solver=''): # example version string: 6.12-2, solver: std or exp self.solver='Abaqus' if version =='': - import subprocess - process = subprocess.Popen(['abaqus', 'information=release'],stdout = subprocess.PIPE,stderr = subprocess.PIPE) - self.version = process.stdout.readlines()[1].split()[1] - print(self.version) + version = damask.Environment().options['ABAQUS_VERSION'] else: self.version = version @@ -40,6 +36,3 @@ class Abaqus(Solver): if self.version != detectedVersion: raise Exception('found Abaqus version %s, but requested %s'%(detectedVersion,self.version)) return '%s -job %s -user %s/code/DAMASK_abaqus_%s interactive'%(cmd,model,env.rootDir(),self.solver) - - - From 38bf357e7c1372a26fa5a147bede1483f4fee218 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 14 Jul 2016 16:18:27 +0200 Subject: [PATCH 079/412] removed obsolote information on lapack and (always outdated) version information --- installation/mods_MarcMentat/installation.txt | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/installation/mods_MarcMentat/installation.txt b/installation/mods_MarcMentat/installation.txt index 2b9f5d9b4..d463387af 100644 --- a/installation/mods_MarcMentat/installation.txt +++ b/installation/mods_MarcMentat/installation.txt @@ -1,21 +1,13 @@ -Install MPIE modifications to use DAMASK_marc2010/11/12/13/14 +Install DAMASK modifications to use DAMASK_marc +This is for the Linux64 version of Marc/Mentat Refer to http://damask.mpie.de for complete installation instructions. Usually you will need to be root for this to work! -This is for the Linux64 version of Marc/Mentat2011/12/13(.1)/14(.2). See Marc and Mentat Release Guide for List of Build and Supported Platforms! -The Intel Fortran compiler needs to be installed. Marc/Mentat as well as DAMASK rely on Intel Fortran 12.0 or above! Make sure that ifort (the compiler executable) is in the PATH and that LD_LIBRARY_PATH is set correctly, refer to the Intel installation guide for instructions on how to do this. - -The AMD Core Math Library or an other BLAS implementation (currently IMKL and LAPACK are supported) needs to be installed! -Add acml path to LD_LIBRARY_PATH, to do so either use the script setup_shellrc.py in the installation folder or for a system wide setup edit /etc/csh.cshrc.local and/or /etc/bash.bashrc.local. -Assuming ACML is installed in path ACMLDIR the path should read: /ACMLDIR/ifort64_mp/lib (this is the version using paralllization, ie openmp): - for bash: LD_LIBRARY_PATH="/ACMLDIR/ifort64_mp/lib:${LD_LIBRARY_PATH}"; export LD_LIBRARY_PATH - for csh: setenv LD_LIBRARY_PATH /ACMLDIR/ifort64_mp/lib:${LD_LIBRARY_PATH} - -As the apply_DAMASK_modifications script has to fix the path for the BLAS it needs to be installed in a place that can be accessed by all users of the system. In addition you have to specify the respective locations in DAMASK_ROOT/lib/pathInfo. +The Intel Fortran compiler needs to be installed. 1) Install Marc, Mentat and Documentation as usual Run the test example including subroutines to confirm that the installation of both Marc/Mentat and the Intel Fortran Compiler is ok! From 46cf0394ec151291cf2eb4d539a149385ee43f88 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 14 Jul 2016 17:07:08 +0200 Subject: [PATCH 080/412] cleaned, exeption not needed (SOLVER and PROCESSING are always defined) --- DAMASK_env.sh | 6 +++--- DAMASK_env.zsh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/DAMASK_env.sh b/DAMASK_env.sh index 760ee056a..d17412a2f 100644 --- a/DAMASK_env.sh +++ b/DAMASK_env.sh @@ -10,7 +10,7 @@ else DAMASK_ROOT=${STAT##* } fi -# allows to source the same file for tcsh and bash, with and without space around = +# defining set() allows to source the same file for tcsh and bash, with and without space around = set() { export $1$2$3 } @@ -58,8 +58,8 @@ if [ ! -z "$PS1" ]; then echo echo Using environment with ... echo "DAMASK $DAMASK_ROOT" - [[ "x$SOLVER" != "x" ]] && echo "Spectral Solver $SOLVER" - [[ "x$PROCESSING" != "x" ]] && echo "Post Processing $PROCESSING" + echo "Spectral Solver $SOLVER" + echo "Post Processing $PROCESSING" echo "Multithreading DAMASK_NUM_THREADS=$DAMASK_NUM_THREADS" if [ "x$PETSC_DIR" != "x" ]; then echo "PETSc location $PETSC_DIR" diff --git a/DAMASK_env.zsh b/DAMASK_env.zsh index b3666b34b..d23b00f80 100644 --- a/DAMASK_env.zsh +++ b/DAMASK_env.zsh @@ -8,7 +8,7 @@ else print 'Not done yet' fi -# allows to source the same file for tcsh and zsh, with and without space around = +# defining set() allows to source the same file for tcsh and zsh, with and without space around = set() { export $1$2$3 } @@ -57,8 +57,8 @@ if [ ! -z "$PS1" ]; then echo echo Using environment with ... echo "DAMASK $DAMASK_ROOT" - [[ "x$SOLVER" != "x" ]] && echo "Spectral Solver $SOLVER" - [[ "x$PROCESSING" != "x" ]] && echo "Post Processing $PROCESSING" + echo "Spectral Solver $SOLVER" + echo "Post Processing $PROCESSING" echo "Multithreading DAMASK_NUM_THREADS=$DAMASK_NUM_THREADS" if [ "x$PETSC_DIR" != "x" ]; then echo "PETSc location $PETSC_DIR" From cd36e752e8657c8f445b9a2a37c67327e8713004 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 14 Jul 2016 17:21:44 +0200 Subject: [PATCH 081/412] adopted csh script --- DAMASK_env.csh | 77 ++++++++++++++++++++++++++++++++++++++------------ DAMASK_env.sh | 2 +- DAMASK_env.zsh | 2 +- 3 files changed, 61 insertions(+), 20 deletions(-) diff --git a/DAMASK_env.csh b/DAMASK_env.csh index 584f3f127..7e3bf128d 100644 --- a/DAMASK_env.csh +++ b/DAMASK_env.csh @@ -1,26 +1,67 @@ # sets up an environment for DAMASK on tcsh # usage: source DAMASK_env.csh -set MAGIG=($_) -set FILENAME=`readlink -f $called[2]` -set LOCATION = `dirname $FILENAME` -setenv DAMASK_ROOT ${LOCATION} -setenv DAMASK_NUM_THREADS 2 + +set CALLED=($_) +set DIRNAME=`dirname $CALLED[2]` +set DAMASK_ROOT=`python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" $DIRNAME` + +source $DAMASK_ROOT/CONFIG + +# if DAMASK_BIN is present and not in $PATH, add it +if ( $?DAMASK_BIN) then + set MATCH=`echo :${PATH}: | grep ${DAMASK_BIN}:` + if ( "x$MATCH" == "x" ) then + set PATH=${DAMASK_BIN}:${PATH} + endif +endif + +set SOLVER=`which DAMASK_spectral` +set PROCESSING=`which postResults` +if ( "x$DAMASK_NUM_THREADS" == "x" ) then + set DAMASK_NUM_THREADS=1 +endif + +# according to http://software.intel.com/en-us/forums/topic/501500 +# this seems to make sense for the stack size +set FREE=`which free` +set FREE='' +if ( "x$FREE" != "x" ) then + set freeMem=`free -k | grep -E '(Mem|Speicher):' | awk '{print $4;}'` + set heap=`expr $freeMem / 2` + set stack=`expr $freeMem / $DAMASK_NUM_THREADS / 2` + # http://superuser.com/questions/220059/what-parameters-has-ulimit + limit stacksize $stack # maximum stack size (kB) + limit datasize $heap # maximum heap size (kB) +endif +limit coredumpsize 2000 # core file size (512-byte blocks) +limit vmemoryuse unlimited # maximum virtual memory size +limit memoryuse unlimited # maximum physical memory size + # disable output in case of scp if($?prompt) then - echo + echo '' echo Düsseldorf Advanced Materials Simulation Kit - DAMASK echo Max-Planck-Institut für Eisenforschung, Düsseldorf - echo http://damask.mpie.de + echo https://damask.mpie.de echo - echo Preparing environment ... - echo "DAMASK_ROOT=$DAMASK_ROOT" - echo "DAMASK_NUM_THREADS=$DAMASK_NUM_THREADS" + echo Using environment with ... + echo "DAMASK $DAMASK_ROOT" + echo "Spectral Solver $SOLVER" + echo "Post Processing $PROCESSING" + echo "Multithreading DAMASK_NUM_THREADS=$DAMASK_NUM_THREADS" + if ( $?PETSC_DIR) then + echo "PETSc location $PETSC_DIR" + endif + if ( $?PETSC_ARCH) then + echo "PETSc architecture $PETSC_ARCH" + endif + if ( $?MSC_ROOT) then + echo "MSC.Marc/Mentat $MSC_ROOT" + endif + echo + echo `limit stacksize` + echo `limit datasize` endif -ulimit -s unlimited -ulimit -c 0 -ulimit -v unlimited -ulimit -m unlimited -setenv DAMASK_BIN ${DAMASK_ROOT}/bin -setenv PATH ${PATH}:${DAMASK_BIN} -setenv PYTHONPATH ${PYTHONPATH}:${DAMASK_ROOT}/lib -setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH} + +setenv DAMASK_NUM_THREADS $DAMASK_NUM_THREADS +setenv PYTHONPATH $DAMASK_ROOT/lib:$PYTHONPATH diff --git a/DAMASK_env.sh b/DAMASK_env.sh index d17412a2f..f217a7d63 100644 --- a/DAMASK_env.sh +++ b/DAMASK_env.sh @@ -54,7 +54,7 @@ if [ ! -z "$PS1" ]; then echo echo Düsseldorf Advanced Materials Simulation Kit - DAMASK echo Max-Planck-Institut für Eisenforschung, Düsseldorf - echo http://damask.mpie.de + echo https://damask.mpie.de echo echo Using environment with ... echo "DAMASK $DAMASK_ROOT" diff --git a/DAMASK_env.zsh b/DAMASK_env.zsh index d23b00f80..dcb93dc4a 100644 --- a/DAMASK_env.zsh +++ b/DAMASK_env.zsh @@ -53,7 +53,7 @@ if [ ! -z "$PS1" ]; then echo echo Düsseldorf Advanced Materials Simulation Kit - DAMASK echo Max-Planck-Institut für Eisenforschung, Düsseldorf - echo http://damask.mpie.de + echo https://damask.mpie.de echo echo Using environment with ... echo "DAMASK $DAMASK_ROOT" From 7d84b9971091c0ef8a6fd52b2a1b901064516b0a Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 15 Jul 2016 10:34:17 +0200 Subject: [PATCH 082/412] bugfix: axis out of bounds for np.repeat, np.tile seems to be ok @Philip: pls check. autodoc friendly help --- processing/pre/geom_fromVoronoiTessellation.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/processing/pre/geom_fromVoronoiTessellation.py b/processing/pre/geom_fromVoronoiTessellation.py index 71bf9929f..c727afee7 100755 --- a/processing/pre/geom_fromVoronoiTessellation.py +++ b/processing/pre/geom_fromVoronoiTessellation.py @@ -73,8 +73,7 @@ def laguerreTessellation(undeformed, coords, weights, grains, nonperiodic = Fals [ 1, 1, 1 ], ]).astype(float)*info['size'] - repeatweights = np.repeat(weights,len(copies),axis=1).flatten(order='F') # Laguerre weights (1,2,3,1,2,3,...,1,2,3) - + repeatweights = np.tile(weights,len(copies)).flatten(order='F') # Laguerre weights (1,2,3,1,2,3,...,1,2,3) for i,vec in enumerate(copies): # periodic copies of seed points ... try: seeds = np.append(seeds, coords+vec, axis=0) # ... (1+a,2+a,3+a,...,1+z,2+z,3+z) except NameError: seeds = coords+vec @@ -134,12 +133,12 @@ group.add_option('-g', '--grid', dest = 'grid', type = 'int', nargs = 3, metavar = ' '.join(['int']*3), - help = 'a,b,c grid of hexahedral box [auto]') + help = 'a,b,c grid of hexahedral box') group.add_option('-s', '--size', dest = 'size', type = 'float', nargs = 3, metavar=' '.join(['float']*3), - help = 'x,y,z size of hexahedral box [auto]') + help = 'x,y,z size of hexahedral box') group.add_option('-o', '--origin', dest = 'origin', From 2a7f772d085b803daef8f35fa638b64ebe5fae45 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 15 Jul 2016 10:54:28 +0200 Subject: [PATCH 083/412] adopted to new installation config file --- .../apply_DAMASK_modifications.sh | 83 ++++++++++--------- 1 file changed, 44 insertions(+), 39 deletions(-) diff --git a/installation/mods_MarcMentat/apply_DAMASK_modifications.sh b/installation/mods_MarcMentat/apply_DAMASK_modifications.sh index 348c24565..f52b70e36 100755 --- a/installation/mods_MarcMentat/apply_DAMASK_modifications.sh +++ b/installation/mods_MarcMentat/apply_DAMASK_modifications.sh @@ -1,21 +1,24 @@ #!/usr/bin/env bash -DEFAULT_VERSION='2015' - -WORKINGDIR="$( cd "$( dirname "$0" )" && pwd )" - -if [ -f $HOME/.damask/damask.conf ]; then - source $HOME/.damask/damask.conf -else - source /etc/damask.conf -fi +SCRIPTLOCATION="$( cd "$( dirname "$0" )" && pwd )" +DAMASK_ROOT=$SCRIPTLOCATION/../../ +# defining set() allows to source the same file for tcsh and bash, with and without space around = +set() { + export $1$2$3 + } +source $DAMASK_ROOT/CONFIG if [ "x$MSC_ROOT" != "x" ]; then DEFAULT_DIR=$MSC_ROOT fi +if [ "x$MARC_VERSION" != "x" ]; then + DEFAULT_VERSION=$MARC_VERSION +fi +if [ "x$DAMASK_BIN" != "x" ]; then + BIN_DIR=$DAMASK_BIN +fi - -while [ ! -d "$WORKINGDIR/$VERSION" ] || [ -z "$VERSION" ] +while [ ! -d "$SCRIPTLOCATION/$VERSION" ] || [ -z "$VERSION" ] do echo "Input version of MARC/MENTAT installation: [${DEFAULT_VERSION}]" read VERSION @@ -66,7 +69,7 @@ for filename in 'comp_damask' \ 'run_damask_lmp' \ 'run_damask_hmp' \ 'include_linux64'; do - cp $WORKINGDIR/$VERSION/Marc_tools/$filename $theDIR + cp $SCRIPTLOCATION/$VERSION/Marc_tools/$filename $theDIR echo $theDIR/$filename | xargs perl -pi -e "s:%INSTALLDIR%:${INSTALLDIR}:g" echo $theDIR/$filename | xargs perl -pi -e "s:%VERSION%:${VERSION}:g" echo $filename @@ -89,7 +92,7 @@ for filename in 'edit_window' \ 'kill7' \ 'kill8' \ 'kill9'; do - cp $WORKINGDIR/$VERSION/Mentat_bin/$filename $theDIR + cp $SCRIPTLOCATION/$VERSION/Mentat_bin/$filename $theDIR echo $theDIR/$filename | xargs perl -pi -e "s:%INSTALLDIR%:${INSTALLDIR}:g" echo $theDIR/$filename | xargs perl -pi -e "s:%VERSION%:${VERSION}:g" echo $theDIR/$filename | xargs perl -pi -e "s:%EDITOR%:${EDITOR}:g" @@ -101,7 +104,7 @@ echo '' echo 'copying Mentat menus...' theDIR=$INSTALLDIR/mentat$VERSION/menus for filename in 'job_run.ms'; do - cp $WORKINGDIR/$VERSION/Mentat_menus/$filename $theDIR + cp $SCRIPTLOCATION/$VERSION/Mentat_menus/$filename $theDIR echo $theDIR/$filename | xargs perl -pi -e "s:%INSTALLDIR%:${INSTALLDIR}:g" echo $theDIR/$filename | xargs perl -pi -e "s:%VERSION%:${VERSION}:g" echo $filename @@ -121,31 +124,33 @@ chmod 755 $INSTALLDIR/mentat$VERSION/bin/submit{4..9} chmod 755 $INSTALLDIR/mentat$VERSION/bin/kill{4..9} #creating symlinks for run_damask_scripts in /usr/local/bin -BIN_DIR=/usr/local/bin -echo '' -echo "Do you want to create symlinks for run_damask scripts in ${BIN_DIR} [YES/no] ?" -read YESNO - if [ -z "$YESNO" ]; then - YESNO=yes - fi -case $YESNO in - y* | Y* ) - echo'' - echo 'creating symlinks ...' - echo'' - theDIR=$INSTALLDIR/marc$VERSION/tools - for filename in 'run_damask' \ - 'run_damask_l' \ - 'run_damask_h' \ - 'run_damask_mp' \ - 'run_damask_lmp' \ - 'run_damask_hmp'; do - echo ${filename:4}$VERSION - [ -f $BIN_DIR/${filename:4}$VERSION ] && rm $BIN_DIR/${filename:4}$VERSION - ln -s $theDIR/$filename $BIN_DIR/${filename:4}$VERSION - done - ;; -esac + +if [ -d "$BIN_DIR" ]; then + echo '' + echo "Do you want to create symlinks for run_damask scripts in ${BIN_DIR} [YES/no] ?" + read YESNO + if [ -z "$YESNO" ]; then + YESNO=yes + fi + case $YESNO in + y* | Y* ) + echo'' + echo 'creating symlinks ...' + echo'' + theDIR=$INSTALLDIR/marc$VERSION/tools + for filename in 'run_damask' \ + 'run_damask_l' \ + 'run_damask_h' \ + 'run_damask_mp' \ + 'run_damask_lmp' \ + 'run_damask_hmp'; do + echo ${filename:4}$VERSION + [ -f $BIN_DIR/${filename:4}$VERSION ] && rm $BIN_DIR/${filename:4}$VERSION + ln -s $theDIR/$filename $BIN_DIR/${filename:4}$VERSION + done + ;; + esac +fi echo '' echo 'done.' From c792b73b4e87efc860bd7ce7222092391c8c88bc Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 15 Jul 2016 14:52:48 +0200 Subject: [PATCH 084/412] simplified --- processing/pre/geom_fromVoronoiTessellation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/processing/pre/geom_fromVoronoiTessellation.py b/processing/pre/geom_fromVoronoiTessellation.py index c727afee7..5bf6141e1 100755 --- a/processing/pre/geom_fromVoronoiTessellation.py +++ b/processing/pre/geom_fromVoronoiTessellation.py @@ -83,7 +83,7 @@ def laguerreTessellation(undeformed, coords, weights, grains, nonperiodic = Fals devNull,closestSeeds = myKDTree.query(undeformed) else: damask.util.croak('...using {} cpu{}'.format(options.cpus, 's' if options.cpus > 1 else '')) - arguments = [[arg] + [seeds,repeatweights] for arg in list(undeformed)] + arguments = [[arg,seeds,repeatweights] for arg in list(undeformed)] if cpus > 1: # use multithreading pool = multiprocessing.Pool(processes = cpus) # initialize workers From e8153ad196dfc55fc4324fdbcd398f1912e890ce Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 15 Jul 2016 15:48:53 +0200 Subject: [PATCH 085/412] corrected name --- processing/pre/geom_fromVoronoiTessellation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/processing/pre/geom_fromVoronoiTessellation.py b/processing/pre/geom_fromVoronoiTessellation.py index 5bf6141e1..fd334620f 100755 --- a/processing/pre/geom_fromVoronoiTessellation.py +++ b/processing/pre/geom_fromVoronoiTessellation.py @@ -31,9 +31,9 @@ def meshgrid2(*arrs): return tuple(ans) def findClosestSeed(fargs): - point, seeds, weightssquared = fargs + point, seeds, myWeights = fargs tmp = np.repeat(point.reshape(3,1), len(seeds), axis=1).T - dist = np.sum((tmp - seeds)*(tmp - seeds),axis=1) - weightssquared + dist = np.sum((tmp - seeds)**2,axis=1) -myWeights return np.argmin(dist) # seed point closest to point From 260ca270dfa6367f4e04ada1eff5fe8640e5cf9d Mon Sep 17 00:00:00 2001 From: Test User Date: Fri, 15 Jul 2016 16:20:55 +0200 Subject: [PATCH 086/412] updated version information after successful test of v2.0.0-350-g7d84b99 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 114695582..e7c04b3f7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.0-347-gbe02300 +v2.0.0-350-g7d84b99 From 0b145826a639aa989ae8e5d4c116ee86118986dd Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 15 Jul 2016 16:51:49 +0200 Subject: [PATCH 087/412] =?UTF-8?q?unicode=20docstring=20does=20not=20work?= =?UTF-8?q?=20for=20abaqus,=20but=20if=20using=20=C3=B6=20pyflakes=20wants?= =?UTF-8?q?=20to=20have=20a=20unicode=20docstring?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/damask/orientation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/damask/orientation.py b/lib/damask/orientation.py index 1607c220b..414db52a1 100644 --- a/lib/damask/orientation.py +++ b/lib/damask/orientation.py @@ -342,7 +342,7 @@ class Quaternion: Orientation as Bunge-Euler angles conversion of ACTIVE rotation to Euler angles taken from: - Melcher, A.; Unser, A.; Reichhardt, M.; Nestler, B.; Pötschke, M.; Selzer, M. + Melcher, A.; Unser, A.; Reichhardt, M.; Nestler, B.; Poetschke, M.; Selzer, M. Conversion of EBSD data by a quaternion based algorithm to be used for grain structure simulations Technische Mechanik 30 (2010) pp 401--413 """ From 7f67ff05fdc0249cecaf4eedd75afa5e3c00bac0 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 15 Jul 2016 16:53:57 +0200 Subject: [PATCH 088/412] used in both functions --- lib/damask/solver/abaqus.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/damask/solver/abaqus.py b/lib/damask/solver/abaqus.py index 19ec6b91f..c1777b4bf 100644 --- a/lib/damask/solver/abaqus.py +++ b/lib/damask/solver/abaqus.py @@ -1,8 +1,7 @@ # -*- coding: UTF-8 no BOM -*- - from .solver import Solver - +import damask class Abaqus(Solver): @@ -23,7 +22,6 @@ class Abaqus(Solver): def return_run_command(self,model): import subprocess import re - import damask env=damask.Environment() shortVersion = re.sub('[\.,-]', '',self.version) try: From ce7cd36bf5af278fe1645f9bbd9b943982068375 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 15 Jul 2016 20:23:20 +0200 Subject: [PATCH 089/412] better be done with load case rotation --- processing/misc/calculateAnisotropy.py | 236 ------------------------- 1 file changed, 236 deletions(-) delete mode 100755 processing/misc/calculateAnisotropy.py diff --git a/processing/misc/calculateAnisotropy.py b/processing/misc/calculateAnisotropy.py deleted file mode 100755 index a88b39b74..000000000 --- a/processing/misc/calculateAnisotropy.py +++ /dev/null @@ -1,236 +0,0 @@ -# -*- coding: UTF-8 no BOM -*- - -import threading,os,string -import numpy as np -from optparse import OptionParser -from shutil import copy2 -from re import split -import damask - -scriptName = os.path.splitext(os.path.basename(__file__))[0] -scriptID = ' '.join([scriptName,damask.version]) - -def list_split(option, opt, value, parser): - setattr(parser.values, option.dest, value.split(',')) - -#--------------------------------------------------------------------------------------------------- -class myThread (threading.Thread): - """Runner""" - - def __init__(self, threadID): - threading.Thread.__init__(self) - self.threadID = threadID - def run(self): - s.acquire() - conv=isFinished() - s.release() - while conv: - doSim(4.,self.name) - s.acquire() - conv=isFinished() - s.release() - -def doSim(delay,thread): - global dirCurrent - s.acquire() - delta_angle = offsetPhi() - if len(str(delta_angle)) > 5: - file_angle = str(delta_angle)[:5] - else: - file_angle = str(delta_angle) - dire = dirCurrent+'/'+file_angle - - if not os.path.isdir(dire): - os.mkdir(dire,0755) - for file in [options.geometry+'.geom',options.load+'.load','numerics.config']: - copy2(dirCurrent+'/'+file, dire) - newMaterialConfig(dirCurrent,delta_angle) - - os.chdir(dire) - if not os.path.isfile('%s_%s.spectralOut'%(options.geometry,options.load)): - print('starting uniaxial tension in direction of angle %s from %s'%(file_angle,thread)) - s.release() - damask.util.execute('DAMASK_spectral -g %s -l %s'%(options.geometry,options.load)) - else: s.release() - - s.acquire() - if not os.path.isfile('./%s/%s_%s.txt'%('Rvalues',options.geometry,options.load)): - print('starting post processing for angle %s from %s'%(file_angle,thread)) - s.release() - damask.util.execute('postResults --cr f,p -d %s %s_%s.spectralOut'%('Rvalues',options.geometry,options.load)) - damask.util.execute('addCauchy ./%s/%s_%s.txt'%('Rvalues',options.geometry,options.load)) - damask.util.execute('addStrainTensors -l -v ./%s/%s_%s.txt'%('Rvalues',options.geometry,options.load)) - print('post processing for angle %s from %s is finished'%(file_angle,thread)) - - else: - s.release() - os.chdir(dirCurrent) - -def isFinished(): - global N_simulations - - if N_simulations < options.number: - return True - else: - return False - -def offsetPhi(): - global N_simulations #, N_tensile - N_simulations+=1 - return np.linspace(0,90,options.number)[N_simulations-1] - -def newMaterialConfig(dire,angle): - filename = '/material.config' - if len(str(angle)) > 5: - file_angle = str(angle)[:5] - else: - file_angle = str(angle) - f = open(dire+'/'+file_angle+filename,'w') - data = open(dire+filename, 'r').readlines() - - for line in data: - if '(gauss)' in line: - linesplit = split(r'[;,\s,\t]\s*',line) - index = linesplit.index('phi1') - phi = float(linesplit[index+1]) - angle - if phi > 360. : - phi = phi-360.0 - elif phi < 0.0: - phi = phi+360.0 - index2 = line.index(linesplit[index+1]) - line2 = line[:index2]+str(phi)+line[index2+len(str(float(linesplit[index+1]))):] - else: - line2 = line - f.write(line2) - f.close() - -# -------------------------------------------------------------------- -# MAIN -# -------------------------------------------------------------------- - -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ -Calculate the deformation anisotropic coefficients (r values) and -strength anisotropic coefficients (normalized yield stress) - -""", version=string.replace(scriptID,'\n','\\n') -) - -parser.add_option('-l','--load' , - dest='load', type='string', - help='name of the load file [%default]', metavar='string') -parser.add_option('-g','--geometry', - dest='geometry', type='string', - help='name of the geometry file [%default]', metavar='string') -parser.add_option('-s', '--strain', - dest='strain', type='string', action='callback', callback=list_split, - help='threshold strains, using comma to seperate multiple strains [%default]', metavar='string') -parser.add_option('-t','--threads', - dest='threads', type='int', - help='number of parallel executions [%default]', metavar='int') -parser.add_option('-n','--number', - dest='number', type='int', - help='Number of uni-axial tensile tests [%default]', metavar='int') - -parser.set_defaults(geometry = '20grains16x16x16') -parser.set_defaults(load = 'tensionX') -parser.set_defaults(threads = 1) -parser.set_defaults(number = 7) -parser.set_defaults(strain = ('0.0025','0.025')) - -options = parser.parse_args()[0] - -if not os.path.isfile(options.geometry+'.geom'): - parser.error('geometry file %s.geom not found'%options.geometry) -if not os.path.isfile('material.config'): - parser.error('material.config file not found') - -thresStrain = [float(i) for i in options.strain] - -if not os.path.isfile(options.load+'.load'): - maxstrain = max(thresStrain) - f11 = str(1.2*maxstrain + 1.0) - if maxstrain < 0.05: - maxincs = '60'; maxtime = '30' - else: - maxincs = str(int(maxstrain*3000)); maxtime = str(maxstrain*600) - - f=open('tensionX.load','w') - uniaxial_load = 'f ' +f11+ ' 0 0 0 * 0 0 0 * ' + \ - 'stress ' +'* * * * 0 * * * 0 ' + \ - 'time '+ maxtime + ' incs ' + maxincs + ' freq 3' - f.write(uniaxial_load) - f.close() - -N_simulations=0 -s=threading.Semaphore(1) -threads=[] -dirCurrent = os.getcwd() -for i in range(options.threads): - threads.append(myThread(i)) - threads[i].start() - -for i in range(options.threads): - threads[i].join() - -anisotropy = {} -for i,delta_angle in enumerate(np.linspace(0,90,options.number)): - if len(str(delta_angle)) > 5: - file_angle = str(delta_angle)[:5] - else: - file_angle = str(delta_angle) - refFile = dirCurrent+'/'+file_angle+'/Rvalues/%s_%s.txt'%(options.geometry,options.load) - if not os.path.isfile(refFile): - print('post processing file is not found for the angle %s'%file_angle) - else: - File = open(refFile) - table = damask.ASCIItable(File) - table.head_read() - if not set(['1_ln(V)','5_ln(V)','9_ln(V)','1_Cauchy']).issubset(set(table.labels)): - print 'data missing in direction %s'%str(delta_angle) - table.data_readArray(['%i_Cauchy'%(i+1) for i in xrange(9)]+['%i_ln(V)'%(i+1) for i in xrange(9)]) - line, lines = 0, np.shape(table.data)[0] - aniso_thres = {} - for threshold in thresStrain: - while line < lines: - if abs(table.data[line,9])>= threshold: # 1_ln(V), e_xx - upper,lower = abs(table.data[line,9]),abs(table.data[line-1,9]) # values for linear interpolation - interplate = lambda x_d, x_u : x_d * (upper-threshold)/(upper-lower) + x_u * (threshold-lower)/(upper-lower) - e_yy = interplate (table.data[line-1,13], table.data[line,13]) - e_zz = interplate (table.data[line-1,17], table.data[line,17]) - s_xx = interplate (table.data[line-1,0 ], table.data[line,0 ]) - aniso_thres[str(threshold)] = [e_yy/e_zz, s_xx] - break - else: - line+=1 - anisotropy[file_angle] = aniso_thres - -f = open('./anisotropy.txt','w') -f.write('4 header \n') -f.write('#the first row mean the threshold strain e_xx \n#the first column means loading directions \n') -f.write('#none means the data is unavailable\n# \n') -title = ['*R values (Lankford coefficients) \n', '# \n*Normalized yield stress \n'] -for i in xrange(2): - f.write(title[i]) - f.write(' '*10+len(thresStrain)*'%-12.4f'%tuple(thresStrain)+'\n') - for j,delta_angle in enumerate(np.linspace(0,90,options.number)): - if len(str(delta_angle)) > 5: - file_angle = str(delta_angle)[:5] - else: - file_angle = str(delta_angle) - - if file_angle in anisotropy.keys(): - aniso_dic_ang = anisotropy[file_angle] - aniso_list_ang_strain = []; writeformat = '' - for threshold in thresStrain: - if str(threshold) in aniso_dic_ang.keys(): - if i == 1: # extract the normalized stress - aniso = aniso_dic_ang[str(threshold)][i]/anisotropy['0.0'][str(threshold)][i] - else: # extract r value - aniso = aniso_dic_ang[str(threshold)][i] - aniso_list_ang_strain.append(aniso) - writeformat = writeformat+'%-12.6f' - else: - aniso_list_ang_strain.append('none') - writeformat = writeformat+'%-12s' - f.write('%-10s'%file_angle + writeformat%(tuple(aniso_list_ang_strain))+'\n') -f.close() From 40414c767cc213ee0bbd44930bb6256a427a51c0 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 15 Jul 2016 20:24:43 +0200 Subject: [PATCH 090/412] like ang_toTable (not sure if both are needed anyway) --- .../table_fromOIMgrainFile.py => misc/OIMgrainFile_toTable.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename processing/{pre/table_fromOIMgrainFile.py => misc/OIMgrainFile_toTable.py} (100%) diff --git a/processing/pre/table_fromOIMgrainFile.py b/processing/misc/OIMgrainFile_toTable.py similarity index 100% rename from processing/pre/table_fromOIMgrainFile.py rename to processing/misc/OIMgrainFile_toTable.py From c5dba6065420b972bd399f95648eb263f5c11ab2 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 15 Jul 2016 21:03:34 +0200 Subject: [PATCH 091/412] need to unset "set" (seems to be a common function) --- DAMASK_env.sh | 1 + DAMASK_env.zsh | 1 + 2 files changed, 2 insertions(+) diff --git a/DAMASK_env.sh b/DAMASK_env.sh index f217a7d63..8536a36ca 100644 --- a/DAMASK_env.sh +++ b/DAMASK_env.sh @@ -15,6 +15,7 @@ set() { export $1$2$3 } source $DAMASK_ROOT/CONFIG +unset -f set # if DAMASK_BIN is present and not in $PATH, add it if [[ "x$DAMASK_BIN" != "x" && ! `echo ":$PATH:" | grep $DAMASK_BIN:` ]]; then diff --git a/DAMASK_env.zsh b/DAMASK_env.zsh index dcb93dc4a..e434a97cf 100644 --- a/DAMASK_env.zsh +++ b/DAMASK_env.zsh @@ -13,6 +13,7 @@ set() { export $1$2$3 } source $DAMASK_ROOT/CONFIG +unset -f set # if DAMASK_BIN is present and not in $PATH, add it MATCH=`echo ":$PATH:" | grep $DAMASK_BIN:` From 9441ee732651fe98358c7c86641be9f929dc28c2 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 16 Jul 2016 09:36:15 +0200 Subject: [PATCH 092/412] removed obsolete root relation --- lib/damask/solver/marc.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/lib/damask/solver/marc.py b/lib/damask/solver/marc.py index e693783f6..a3e75ca01 100644 --- a/lib/damask/solver/marc.py +++ b/lib/damask/solver/marc.py @@ -20,10 +20,10 @@ class Marc(Solver): #-------------------------- - def version(self,rootRelation = ''): + def version(self): import os,damask.environment - MSCpath = damask.environment.Environment(rootRelation).options['MSC_ROOT'] + MSCpath = damask.environment.Environment().options['MSC_ROOT'] for release,subdirs in sorted(self.releases.items(),reverse=True): for subdir in subdirs: @@ -35,10 +35,10 @@ class Marc(Solver): #-------------------------- - def libraryPath(self,rootRelation = '',releases = []): + def libraryPath(self,releases = []): import os,damask.environment - MSCpath = damask.environment.Environment(rootRelation).options['MSC_ROOT'] + MSCpath = damask.environment.Environment().options['MSC_ROOT'] if len(releases) == 0: releases = self.releases.keys() if type(releases) is not list: releases = [releases] @@ -53,12 +53,12 @@ class Marc(Solver): #-------------------------- - def toolsPath(self,rootRelation = '',release = ''): + def toolsPath(self,release = ''): import os,damask.environment - MSCpath = damask.environment.Environment(rootRelation).options['MSC_ROOT'] + MSCpath = damask.environment.Environment().options['MSC_ROOT'] - if len(release) == 0: release = self.version(rootRelation) + if len(release) == 0: release = self.version() path = '%s/marc%s/tools'%(MSCpath,release) if os.path.exists(path): return path else: return '' @@ -66,7 +66,6 @@ class Marc(Solver): #-------------------------- def submit_job(self, - rootRelation = '', release = '', model = 'model', job = 'job1', @@ -79,13 +78,13 @@ class Marc(Solver): import os,damask.environment import subprocess,shlex - if len(release) == 0: release = self.version(rootRelation) + if len(release) == 0: release = self.version() if release not in self.releases: raise Exception("Unknown MSC.Marc Version %s"%release) - damaskEnv = damask.environment.Environment(rootRelation) + damaskEnv = damask.environment.Environment() user = os.path.join(damaskEnv.relPath('code/'),'DAMASK_marc') # might be updated if special version (symlink) is found if compile: @@ -99,7 +98,7 @@ class Marc(Solver): script = 'run_damask%s'%({False:'',True:'_'}[optimization!='' or openMP]) script = script+'%s%s'%({False:'',True:optimization}[optimization!=''],{False:'',True:'mp'}[openMP]) - cmd = os.path.join(self.toolsPath(rootRelation,release),script) + \ + cmd = os.path.join(self.toolsPath(release),script) + \ ' -jid ' + model + '_' + job + \ ' -nprocd 1 -autorst 0 -ci n -cr n -dcoup 0 -b no -v no' From 0c2b7782d4659808c043fb3acfae924fd384b72d Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 17 Jul 2016 18:18:57 +0200 Subject: [PATCH 093/412] reporting correct ID --- processing/post/postResults.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/processing/post/postResults.py b/processing/post/postResults.py index 28a2b40ac..cfbd50aa0 100755 --- a/processing/post/postResults.py +++ b/processing/post/postResults.py @@ -1060,8 +1060,7 @@ for incCount,position in enumerate(locations): # walk through locations file = open(outFilename,'w') fileOpen = True file.write('2\theader\n') - file.write(string.replace('$Id$','\n','\\n')+ - '\t' + ' '.join(sys.argv[1:]) + '\n') + file.write(scriptID + '\t' + ' '.join(sys.argv[1:])) headerWritten = False file.flush() From 1b30b186f44e7e4d082bc494924fe91d14b70ad7 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 18 Jul 2016 06:17:22 +0200 Subject: [PATCH 094/412] rootRelation keyword was still used --- processing/post/mentat_colorMap.py | 2 +- processing/post/postResults.py | 2 +- processing/pre/mentat_pbcOnBoxMesh.py | 2 +- processing/pre/mentat_spectralBox.py | 2 +- processing/pre/patchFromReconstructedBoundaries.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/processing/post/mentat_colorMap.py b/processing/post/mentat_colorMap.py index 79ea35a39..b72f48afe 100755 --- a/processing/post/mentat_colorMap.py +++ b/processing/post/mentat_colorMap.py @@ -126,7 +126,7 @@ elif options.palette: for theColor in theMap.export(format='list',steps=options.colorcount): print '\t'.join(map(lambda x: str(int(255*x)),theColor)) else: # connect to Mentat and change colorMap - sys.path.append(damask.solver.Marc().libraryPath('../../')) + sys.path.append(damask.solver.Marc().libraryPath()) try: import py_mentat print 'waiting to connect...' diff --git a/processing/post/postResults.py b/processing/post/postResults.py index 28a2b40ac..df32398f7 100755 --- a/processing/post/postResults.py +++ b/processing/post/postResults.py @@ -765,7 +765,7 @@ if options.filetype not in ['marc','spectral']: parser.error('file type "%s" not supported...'%options.filetype) if options.filetype == 'marc': - sys.path.append(damask.solver.Marc().libraryPath('../../')) + sys.path.append(damask.solver.Marc().libraryPath()) try: from py_post import post_open diff --git a/processing/pre/mentat_pbcOnBoxMesh.py b/processing/pre/mentat_pbcOnBoxMesh.py index d355639e2..b35d9ab62 100755 --- a/processing/pre/mentat_pbcOnBoxMesh.py +++ b/processing/pre/mentat_pbcOnBoxMesh.py @@ -9,7 +9,7 @@ import damask scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptID = ' '.join([scriptName,damask.version]) -sys.path.append(damask.solver.Marc().libraryPath('../../')) +sys.path.append(damask.solver.Marc().libraryPath()) active=[True,True,True] # directions on which to add PBC def outMentat(cmd,locals): diff --git a/processing/pre/mentat_spectralBox.py b/processing/pre/mentat_spectralBox.py index 770db1279..6ff6e51d7 100755 --- a/processing/pre/mentat_spectralBox.py +++ b/processing/pre/mentat_spectralBox.py @@ -8,7 +8,7 @@ import damask scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptID = ' '.join([scriptName,damask.version]) -sys.path.append(damask.solver.Marc().libraryPath('../../')) +sys.path.append(damask.solver.Marc().libraryPath()) #------------------------------------------------------------------------------------------------- def outMentat(cmd,locals): diff --git a/processing/pre/patchFromReconstructedBoundaries.py b/processing/pre/patchFromReconstructedBoundaries.py index f0c68b5f7..9167c7398 100755 --- a/processing/pre/patchFromReconstructedBoundaries.py +++ b/processing/pre/patchFromReconstructedBoundaries.py @@ -15,7 +15,7 @@ try: # check for Python Image Lib except: ImageCapability = False -sys.path.append(damask.solver.Marc().libraryPath('../../')) +sys.path.append(damask.solver.Marc().libraryPath()) try: # check for MSC.Mentat Python interface import py_mentat From 95182dac796f8809bd739521af229d6aee1ad035 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 18 Jul 2016 11:20:23 +0200 Subject: [PATCH 095/412] avoid windows name conflict + and (hopefully) more descriptive name and location --- {config => examples/ConfigFiles}/Crystallite_All.config | 0 {config => examples/ConfigFiles}/Crystallite_None.config | 0 .../ConfigFiles}/Crystallite_aLittleSomething.config | 0 .../ConfigFiles}/Homogenization_Damage_NonLocal.config | 0 .../ConfigFiles}/Homogenization_HydrogenFlux_CahnHilliard.config | 0 .../ConfigFiles}/Homogenization_Isostrain_Parallel3.config | 0 .../ConfigFiles}/Homogenization_Isostrain_SX.config | 0 .../ConfigFiles}/Homogenization_Isostrain_Taylor2.config | 0 {config => examples/ConfigFiles}/Homogenization_None_Dummy.config | 0 .../ConfigFiles}/Homogenization_Porosity_PhaseField.config | 0 .../ConfigFiles}/Homogenization_RGC_8Grains.config | 0 .../ConfigFiles}/Homogenization_Thermal_Conduction.config | 0 .../ConfigFiles}/Homogenization_VacancyFlux_CahnHilliard.config | 0 {config => examples/ConfigFiles}/Homogenization_multiField.config | 0 .../ConfigFiles}/Kinematics_Hydrogen_Strain.config | 0 .../ConfigFiles}/Kinematics_Thermal_Expansion.config | 0 {config => examples/ConfigFiles}/Kinematics_Vacancy_Strain.config | 0 {config => examples/ConfigFiles}/Microstructure_DP_Steel.config | 0 .../ConfigFiles}/Microstructure_ElementHomogeneous.config | 0 {config => examples/ConfigFiles}/Phase_Damage.config | 0 {config => examples/ConfigFiles}/Phase_DisloUCLA_Tungsten.config | 0 .../ConfigFiles}/Phase_Dislotwin_TWIP-Steel-FeMnC.config | 0 {config => examples/ConfigFiles}/Phase_Dislotwin_Tungsten.config | 0 {config => examples/ConfigFiles}/Phase_Hydrogen.config | 0 .../ConfigFiles}/Phase_Isotropic_AluminumIsotropic.config | 0 .../ConfigFiles}/Phase_None_IsotropicVolumePreservation.config | 0 {config => examples/ConfigFiles}/Phase_None_Orthorombic.config | 0 {config => examples/ConfigFiles}/Phase_Nonlocal_Aluminum.config | 0 .../ConfigFiles}/Phase_Phenopowerlaw_Aluminum.config | 0 .../ConfigFiles}/Phase_Phenopowerlaw_BCC-Ferrite.config | 0 .../ConfigFiles}/Phase_Phenopowerlaw_BCC-Martensite.config | 0 {config => examples/ConfigFiles}/Phase_Phenopowerlaw_Gold.config | 0 .../ConfigFiles}/Phase_Phenopowerlaw_Magnesium.config | 0 .../ConfigFiles}/Phase_Phenopowerlaw_cpTi-alpha.config | 0 .../ConfigFiles}/Phase_Phenopowerlaw_multiField.config | 0 {config => examples/ConfigFiles}/Phase_Porosity.config | 0 {config => examples/ConfigFiles}/Phase_Thermal.config | 0 {config => examples/ConfigFiles}/Phase_Vacancy.config | 0 {config => examples/ConfigFiles}/Source_Damage_IsoBrittle.config | 0 .../ConfigFiles}/Source_Thermal_Dissipation.config | 0 .../ConfigFiles}/Source_Vacancy_Irradiation.config | 0 .../ConfigFiles}/Source_Vacancy_PhenoPlasticity.config | 0 {config => examples/ConfigFiles}/Texture_FiberExample.config | 0 {config => examples/ConfigFiles}/Texture_Gauss_001.config | 0 {config => examples/ConfigFiles}/Texture_Gauss_101.config | 0 {config => examples/ConfigFiles}/Texture_Gauss_111.config | 0 {config => examples/ConfigFiles}/Texture_Gauss_123.config | 0 .../ConfigFiles}/Texture_RandomSingleCrystals.config | 0 {config => examples/ConfigFiles}/Texture_Rolling.config | 0 {config => examples/ConfigFiles}/debug.config | 0 {config => examples/ConfigFiles}/material.config | 0 {config => examples/ConfigFiles}/numerics.config | 0 {config => examples/ConfigFiles}/rollingTexture.linearODF | 0 53 files changed, 0 insertions(+), 0 deletions(-) rename {config => examples/ConfigFiles}/Crystallite_All.config (100%) rename {config => examples/ConfigFiles}/Crystallite_None.config (100%) rename {config => examples/ConfigFiles}/Crystallite_aLittleSomething.config (100%) rename {config => examples/ConfigFiles}/Homogenization_Damage_NonLocal.config (100%) rename {config => examples/ConfigFiles}/Homogenization_HydrogenFlux_CahnHilliard.config (100%) rename {config => examples/ConfigFiles}/Homogenization_Isostrain_Parallel3.config (100%) rename {config => examples/ConfigFiles}/Homogenization_Isostrain_SX.config (100%) rename {config => examples/ConfigFiles}/Homogenization_Isostrain_Taylor2.config (100%) rename {config => examples/ConfigFiles}/Homogenization_None_Dummy.config (100%) rename {config => examples/ConfigFiles}/Homogenization_Porosity_PhaseField.config (100%) rename {config => examples/ConfigFiles}/Homogenization_RGC_8Grains.config (100%) rename {config => examples/ConfigFiles}/Homogenization_Thermal_Conduction.config (100%) rename {config => examples/ConfigFiles}/Homogenization_VacancyFlux_CahnHilliard.config (100%) rename {config => examples/ConfigFiles}/Homogenization_multiField.config (100%) rename {config => examples/ConfigFiles}/Kinematics_Hydrogen_Strain.config (100%) rename {config => examples/ConfigFiles}/Kinematics_Thermal_Expansion.config (100%) rename {config => examples/ConfigFiles}/Kinematics_Vacancy_Strain.config (100%) rename {config => examples/ConfigFiles}/Microstructure_DP_Steel.config (100%) rename {config => examples/ConfigFiles}/Microstructure_ElementHomogeneous.config (100%) rename {config => examples/ConfigFiles}/Phase_Damage.config (100%) rename {config => examples/ConfigFiles}/Phase_DisloUCLA_Tungsten.config (100%) rename {config => examples/ConfigFiles}/Phase_Dislotwin_TWIP-Steel-FeMnC.config (100%) rename {config => examples/ConfigFiles}/Phase_Dislotwin_Tungsten.config (100%) rename {config => examples/ConfigFiles}/Phase_Hydrogen.config (100%) rename {config => examples/ConfigFiles}/Phase_Isotropic_AluminumIsotropic.config (100%) rename {config => examples/ConfigFiles}/Phase_None_IsotropicVolumePreservation.config (100%) rename {config => examples/ConfigFiles}/Phase_None_Orthorombic.config (100%) rename {config => examples/ConfigFiles}/Phase_Nonlocal_Aluminum.config (100%) rename {config => examples/ConfigFiles}/Phase_Phenopowerlaw_Aluminum.config (100%) rename {config => examples/ConfigFiles}/Phase_Phenopowerlaw_BCC-Ferrite.config (100%) rename {config => examples/ConfigFiles}/Phase_Phenopowerlaw_BCC-Martensite.config (100%) rename {config => examples/ConfigFiles}/Phase_Phenopowerlaw_Gold.config (100%) rename {config => examples/ConfigFiles}/Phase_Phenopowerlaw_Magnesium.config (100%) rename {config => examples/ConfigFiles}/Phase_Phenopowerlaw_cpTi-alpha.config (100%) rename {config => examples/ConfigFiles}/Phase_Phenopowerlaw_multiField.config (100%) rename {config => examples/ConfigFiles}/Phase_Porosity.config (100%) rename {config => examples/ConfigFiles}/Phase_Thermal.config (100%) rename {config => examples/ConfigFiles}/Phase_Vacancy.config (100%) rename {config => examples/ConfigFiles}/Source_Damage_IsoBrittle.config (100%) rename {config => examples/ConfigFiles}/Source_Thermal_Dissipation.config (100%) rename {config => examples/ConfigFiles}/Source_Vacancy_Irradiation.config (100%) rename {config => examples/ConfigFiles}/Source_Vacancy_PhenoPlasticity.config (100%) rename {config => examples/ConfigFiles}/Texture_FiberExample.config (100%) rename {config => examples/ConfigFiles}/Texture_Gauss_001.config (100%) rename {config => examples/ConfigFiles}/Texture_Gauss_101.config (100%) rename {config => examples/ConfigFiles}/Texture_Gauss_111.config (100%) rename {config => examples/ConfigFiles}/Texture_Gauss_123.config (100%) rename {config => examples/ConfigFiles}/Texture_RandomSingleCrystals.config (100%) rename {config => examples/ConfigFiles}/Texture_Rolling.config (100%) rename {config => examples/ConfigFiles}/debug.config (100%) rename {config => examples/ConfigFiles}/material.config (100%) rename {config => examples/ConfigFiles}/numerics.config (100%) rename {config => examples/ConfigFiles}/rollingTexture.linearODF (100%) diff --git a/config/Crystallite_All.config b/examples/ConfigFiles/Crystallite_All.config similarity index 100% rename from config/Crystallite_All.config rename to examples/ConfigFiles/Crystallite_All.config diff --git a/config/Crystallite_None.config b/examples/ConfigFiles/Crystallite_None.config similarity index 100% rename from config/Crystallite_None.config rename to examples/ConfigFiles/Crystallite_None.config diff --git a/config/Crystallite_aLittleSomething.config b/examples/ConfigFiles/Crystallite_aLittleSomething.config similarity index 100% rename from config/Crystallite_aLittleSomething.config rename to examples/ConfigFiles/Crystallite_aLittleSomething.config diff --git a/config/Homogenization_Damage_NonLocal.config b/examples/ConfigFiles/Homogenization_Damage_NonLocal.config similarity index 100% rename from config/Homogenization_Damage_NonLocal.config rename to examples/ConfigFiles/Homogenization_Damage_NonLocal.config diff --git a/config/Homogenization_HydrogenFlux_CahnHilliard.config b/examples/ConfigFiles/Homogenization_HydrogenFlux_CahnHilliard.config similarity index 100% rename from config/Homogenization_HydrogenFlux_CahnHilliard.config rename to examples/ConfigFiles/Homogenization_HydrogenFlux_CahnHilliard.config diff --git a/config/Homogenization_Isostrain_Parallel3.config b/examples/ConfigFiles/Homogenization_Isostrain_Parallel3.config similarity index 100% rename from config/Homogenization_Isostrain_Parallel3.config rename to examples/ConfigFiles/Homogenization_Isostrain_Parallel3.config diff --git a/config/Homogenization_Isostrain_SX.config b/examples/ConfigFiles/Homogenization_Isostrain_SX.config similarity index 100% rename from config/Homogenization_Isostrain_SX.config rename to examples/ConfigFiles/Homogenization_Isostrain_SX.config diff --git a/config/Homogenization_Isostrain_Taylor2.config b/examples/ConfigFiles/Homogenization_Isostrain_Taylor2.config similarity index 100% rename from config/Homogenization_Isostrain_Taylor2.config rename to examples/ConfigFiles/Homogenization_Isostrain_Taylor2.config diff --git a/config/Homogenization_None_Dummy.config b/examples/ConfigFiles/Homogenization_None_Dummy.config similarity index 100% rename from config/Homogenization_None_Dummy.config rename to examples/ConfigFiles/Homogenization_None_Dummy.config diff --git a/config/Homogenization_Porosity_PhaseField.config b/examples/ConfigFiles/Homogenization_Porosity_PhaseField.config similarity index 100% rename from config/Homogenization_Porosity_PhaseField.config rename to examples/ConfigFiles/Homogenization_Porosity_PhaseField.config diff --git a/config/Homogenization_RGC_8Grains.config b/examples/ConfigFiles/Homogenization_RGC_8Grains.config similarity index 100% rename from config/Homogenization_RGC_8Grains.config rename to examples/ConfigFiles/Homogenization_RGC_8Grains.config diff --git a/config/Homogenization_Thermal_Conduction.config b/examples/ConfigFiles/Homogenization_Thermal_Conduction.config similarity index 100% rename from config/Homogenization_Thermal_Conduction.config rename to examples/ConfigFiles/Homogenization_Thermal_Conduction.config diff --git a/config/Homogenization_VacancyFlux_CahnHilliard.config b/examples/ConfigFiles/Homogenization_VacancyFlux_CahnHilliard.config similarity index 100% rename from config/Homogenization_VacancyFlux_CahnHilliard.config rename to examples/ConfigFiles/Homogenization_VacancyFlux_CahnHilliard.config diff --git a/config/Homogenization_multiField.config b/examples/ConfigFiles/Homogenization_multiField.config similarity index 100% rename from config/Homogenization_multiField.config rename to examples/ConfigFiles/Homogenization_multiField.config diff --git a/config/Kinematics_Hydrogen_Strain.config b/examples/ConfigFiles/Kinematics_Hydrogen_Strain.config similarity index 100% rename from config/Kinematics_Hydrogen_Strain.config rename to examples/ConfigFiles/Kinematics_Hydrogen_Strain.config diff --git a/config/Kinematics_Thermal_Expansion.config b/examples/ConfigFiles/Kinematics_Thermal_Expansion.config similarity index 100% rename from config/Kinematics_Thermal_Expansion.config rename to examples/ConfigFiles/Kinematics_Thermal_Expansion.config diff --git a/config/Kinematics_Vacancy_Strain.config b/examples/ConfigFiles/Kinematics_Vacancy_Strain.config similarity index 100% rename from config/Kinematics_Vacancy_Strain.config rename to examples/ConfigFiles/Kinematics_Vacancy_Strain.config diff --git a/config/Microstructure_DP_Steel.config b/examples/ConfigFiles/Microstructure_DP_Steel.config similarity index 100% rename from config/Microstructure_DP_Steel.config rename to examples/ConfigFiles/Microstructure_DP_Steel.config diff --git a/config/Microstructure_ElementHomogeneous.config b/examples/ConfigFiles/Microstructure_ElementHomogeneous.config similarity index 100% rename from config/Microstructure_ElementHomogeneous.config rename to examples/ConfigFiles/Microstructure_ElementHomogeneous.config diff --git a/config/Phase_Damage.config b/examples/ConfigFiles/Phase_Damage.config similarity index 100% rename from config/Phase_Damage.config rename to examples/ConfigFiles/Phase_Damage.config diff --git a/config/Phase_DisloUCLA_Tungsten.config b/examples/ConfigFiles/Phase_DisloUCLA_Tungsten.config similarity index 100% rename from config/Phase_DisloUCLA_Tungsten.config rename to examples/ConfigFiles/Phase_DisloUCLA_Tungsten.config diff --git a/config/Phase_Dislotwin_TWIP-Steel-FeMnC.config b/examples/ConfigFiles/Phase_Dislotwin_TWIP-Steel-FeMnC.config similarity index 100% rename from config/Phase_Dislotwin_TWIP-Steel-FeMnC.config rename to examples/ConfigFiles/Phase_Dislotwin_TWIP-Steel-FeMnC.config diff --git a/config/Phase_Dislotwin_Tungsten.config b/examples/ConfigFiles/Phase_Dislotwin_Tungsten.config similarity index 100% rename from config/Phase_Dislotwin_Tungsten.config rename to examples/ConfigFiles/Phase_Dislotwin_Tungsten.config diff --git a/config/Phase_Hydrogen.config b/examples/ConfigFiles/Phase_Hydrogen.config similarity index 100% rename from config/Phase_Hydrogen.config rename to examples/ConfigFiles/Phase_Hydrogen.config diff --git a/config/Phase_Isotropic_AluminumIsotropic.config b/examples/ConfigFiles/Phase_Isotropic_AluminumIsotropic.config similarity index 100% rename from config/Phase_Isotropic_AluminumIsotropic.config rename to examples/ConfigFiles/Phase_Isotropic_AluminumIsotropic.config diff --git a/config/Phase_None_IsotropicVolumePreservation.config b/examples/ConfigFiles/Phase_None_IsotropicVolumePreservation.config similarity index 100% rename from config/Phase_None_IsotropicVolumePreservation.config rename to examples/ConfigFiles/Phase_None_IsotropicVolumePreservation.config diff --git a/config/Phase_None_Orthorombic.config b/examples/ConfigFiles/Phase_None_Orthorombic.config similarity index 100% rename from config/Phase_None_Orthorombic.config rename to examples/ConfigFiles/Phase_None_Orthorombic.config diff --git a/config/Phase_Nonlocal_Aluminum.config b/examples/ConfigFiles/Phase_Nonlocal_Aluminum.config similarity index 100% rename from config/Phase_Nonlocal_Aluminum.config rename to examples/ConfigFiles/Phase_Nonlocal_Aluminum.config diff --git a/config/Phase_Phenopowerlaw_Aluminum.config b/examples/ConfigFiles/Phase_Phenopowerlaw_Aluminum.config similarity index 100% rename from config/Phase_Phenopowerlaw_Aluminum.config rename to examples/ConfigFiles/Phase_Phenopowerlaw_Aluminum.config diff --git a/config/Phase_Phenopowerlaw_BCC-Ferrite.config b/examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Ferrite.config similarity index 100% rename from config/Phase_Phenopowerlaw_BCC-Ferrite.config rename to examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Ferrite.config diff --git a/config/Phase_Phenopowerlaw_BCC-Martensite.config b/examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Martensite.config similarity index 100% rename from config/Phase_Phenopowerlaw_BCC-Martensite.config rename to examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Martensite.config diff --git a/config/Phase_Phenopowerlaw_Gold.config b/examples/ConfigFiles/Phase_Phenopowerlaw_Gold.config similarity index 100% rename from config/Phase_Phenopowerlaw_Gold.config rename to examples/ConfigFiles/Phase_Phenopowerlaw_Gold.config diff --git a/config/Phase_Phenopowerlaw_Magnesium.config b/examples/ConfigFiles/Phase_Phenopowerlaw_Magnesium.config similarity index 100% rename from config/Phase_Phenopowerlaw_Magnesium.config rename to examples/ConfigFiles/Phase_Phenopowerlaw_Magnesium.config diff --git a/config/Phase_Phenopowerlaw_cpTi-alpha.config b/examples/ConfigFiles/Phase_Phenopowerlaw_cpTi-alpha.config similarity index 100% rename from config/Phase_Phenopowerlaw_cpTi-alpha.config rename to examples/ConfigFiles/Phase_Phenopowerlaw_cpTi-alpha.config diff --git a/config/Phase_Phenopowerlaw_multiField.config b/examples/ConfigFiles/Phase_Phenopowerlaw_multiField.config similarity index 100% rename from config/Phase_Phenopowerlaw_multiField.config rename to examples/ConfigFiles/Phase_Phenopowerlaw_multiField.config diff --git a/config/Phase_Porosity.config b/examples/ConfigFiles/Phase_Porosity.config similarity index 100% rename from config/Phase_Porosity.config rename to examples/ConfigFiles/Phase_Porosity.config diff --git a/config/Phase_Thermal.config b/examples/ConfigFiles/Phase_Thermal.config similarity index 100% rename from config/Phase_Thermal.config rename to examples/ConfigFiles/Phase_Thermal.config diff --git a/config/Phase_Vacancy.config b/examples/ConfigFiles/Phase_Vacancy.config similarity index 100% rename from config/Phase_Vacancy.config rename to examples/ConfigFiles/Phase_Vacancy.config diff --git a/config/Source_Damage_IsoBrittle.config b/examples/ConfigFiles/Source_Damage_IsoBrittle.config similarity index 100% rename from config/Source_Damage_IsoBrittle.config rename to examples/ConfigFiles/Source_Damage_IsoBrittle.config diff --git a/config/Source_Thermal_Dissipation.config b/examples/ConfigFiles/Source_Thermal_Dissipation.config similarity index 100% rename from config/Source_Thermal_Dissipation.config rename to examples/ConfigFiles/Source_Thermal_Dissipation.config diff --git a/config/Source_Vacancy_Irradiation.config b/examples/ConfigFiles/Source_Vacancy_Irradiation.config similarity index 100% rename from config/Source_Vacancy_Irradiation.config rename to examples/ConfigFiles/Source_Vacancy_Irradiation.config diff --git a/config/Source_Vacancy_PhenoPlasticity.config b/examples/ConfigFiles/Source_Vacancy_PhenoPlasticity.config similarity index 100% rename from config/Source_Vacancy_PhenoPlasticity.config rename to examples/ConfigFiles/Source_Vacancy_PhenoPlasticity.config diff --git a/config/Texture_FiberExample.config b/examples/ConfigFiles/Texture_FiberExample.config similarity index 100% rename from config/Texture_FiberExample.config rename to examples/ConfigFiles/Texture_FiberExample.config diff --git a/config/Texture_Gauss_001.config b/examples/ConfigFiles/Texture_Gauss_001.config similarity index 100% rename from config/Texture_Gauss_001.config rename to examples/ConfigFiles/Texture_Gauss_001.config diff --git a/config/Texture_Gauss_101.config b/examples/ConfigFiles/Texture_Gauss_101.config similarity index 100% rename from config/Texture_Gauss_101.config rename to examples/ConfigFiles/Texture_Gauss_101.config diff --git a/config/Texture_Gauss_111.config b/examples/ConfigFiles/Texture_Gauss_111.config similarity index 100% rename from config/Texture_Gauss_111.config rename to examples/ConfigFiles/Texture_Gauss_111.config diff --git a/config/Texture_Gauss_123.config b/examples/ConfigFiles/Texture_Gauss_123.config similarity index 100% rename from config/Texture_Gauss_123.config rename to examples/ConfigFiles/Texture_Gauss_123.config diff --git a/config/Texture_RandomSingleCrystals.config b/examples/ConfigFiles/Texture_RandomSingleCrystals.config similarity index 100% rename from config/Texture_RandomSingleCrystals.config rename to examples/ConfigFiles/Texture_RandomSingleCrystals.config diff --git a/config/Texture_Rolling.config b/examples/ConfigFiles/Texture_Rolling.config similarity index 100% rename from config/Texture_Rolling.config rename to examples/ConfigFiles/Texture_Rolling.config diff --git a/config/debug.config b/examples/ConfigFiles/debug.config similarity index 100% rename from config/debug.config rename to examples/ConfigFiles/debug.config diff --git a/config/material.config b/examples/ConfigFiles/material.config similarity index 100% rename from config/material.config rename to examples/ConfigFiles/material.config diff --git a/config/numerics.config b/examples/ConfigFiles/numerics.config similarity index 100% rename from config/numerics.config rename to examples/ConfigFiles/numerics.config diff --git a/config/rollingTexture.linearODF b/examples/ConfigFiles/rollingTexture.linearODF similarity index 100% rename from config/rollingTexture.linearODF rename to examples/ConfigFiles/rollingTexture.linearODF From 325e153d3dbb9e724f0179c14142dd87f6f5bcc3 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 18 Jul 2016 11:22:53 +0200 Subject: [PATCH 096/412] import of string not needed --- processing/post/postResults.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/processing/post/postResults.py b/processing/post/postResults.py index 076d9526e..c81f561d5 100755 --- a/processing/post/postResults.py +++ b/processing/post/postResults.py @@ -1,7 +1,7 @@ #!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- -import os,sys,math,re,time,struct,string +import os,sys,math,re,time,struct import damask from optparse import OptionParser, OptionGroup From 3305cae220aa7909ac1296cb054365a5debe8d0d Mon Sep 17 00:00:00 2001 From: Franz Roters Date: Mon, 18 Jul 2016 13:03:23 +0200 Subject: [PATCH 097/412] now also corrected calculation of gamma_dot in postresults --- code/plastic_phenopowerlaw.f90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/plastic_phenopowerlaw.f90 b/code/plastic_phenopowerlaw.f90 index 28a8946c8..12debbb23 100644 --- a/code/plastic_phenopowerlaw.f90 +++ b/code/plastic_phenopowerlaw.f90 @@ -1160,9 +1160,9 @@ function plastic_phenopowerlaw_postResults(Tstar_v,ipc,ip,el) enddo plastic_phenopowerlaw_postResults(c+j) = plastic_phenopowerlaw_gdot0_slip(instance)*0.5_pReal* & ((abs(tau_slip_pos)/plasticState(ph)%state(j,of))**plastic_phenopowerlaw_n_slip(instance) & - +(abs(tau_slip_neg)/plasticState(ph)%state(j,of))**plastic_phenopowerlaw_n_slip(instance))& - *sign(1.0_pReal,tau_slip_pos) - + *sign(1.0_pReal,tau_slip_pos) & + +(abs(tau_slip_neg)/(plasticState(ph)%state(j,of)))**plastic_phenopowerlaw_n_slip(instance) & + *sign(1.0_pReal,tau_slip_neg)) enddo slipSystems1 enddo slipFamilies1 c = c + nSlip From bb5070b52fc968686f012fa83a139aa27cc575a3 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Mon, 18 Jul 2016 10:20:39 -0400 Subject: [PATCH 098/412] util.report without mandatory arguments reporting can now omit either "who" or "what". cleaner output in case of no "who"... --- lib/damask/util.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/damask/util.py b/lib/damask/util.py index ef2de48eb..cfc44f26c 100644 --- a/lib/damask/util.py +++ b/lib/damask/util.py @@ -49,9 +49,10 @@ def croak(what, newline = True): sys.stderr.flush() # ----------------------------- -def report(who,what): +def report(who = None, + what = None): """reports script and file name""" - croak( (emph(who) if who else '') + (': '+what if what else '') ) + croak( (emph(who)+': ' if who else '') + (what if what else '') ) # ----------------------------- From 0571ca4d66e23cc32132b496369212d0233177ae Mon Sep 17 00:00:00 2001 From: Test User Date: Mon, 18 Jul 2016 16:45:06 +0200 Subject: [PATCH 099/412] updated version information after successful test of v2.0.0-385-g1b30b18 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index e7c04b3f7..9b8617d3b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.0-350-g7d84b99 +v2.0.0-385-g1b30b18 From 0a2d5e4c2a0d2bd41101be2375632cf1e20c92c5 Mon Sep 17 00:00:00 2001 From: zhangc43 Date: Mon, 18 Jul 2016 12:29:12 -0400 Subject: [PATCH 100/412] add missing newline to header for postResult --- processing/post/postResults.py | 174 ++++++++++++++++----------------- 1 file changed, 87 insertions(+), 87 deletions(-) diff --git a/processing/post/postResults.py b/processing/post/postResults.py index c81f561d5..e01a27044 100755 --- a/processing/post/postResults.py +++ b/processing/post/postResults.py @@ -18,7 +18,7 @@ fileExtensions = { \ # ----------------------------- class vector: # mimic py_post node object x,y,z = [None,None,None] - + def __init__(self,coords): self.x = coords[0] self.y = coords[1] @@ -102,7 +102,7 @@ class MPIEspectral_result: # mimic py_post result object self._frequencies = self._keyedPackedArray('frequencies:',count=self.N_loadcases,type='i') if all ( i is None for i in self._frequencies): self._frequencies = self._keyedPackedArray('frequencies',count=self.N_loadcases,type='i') - + self._increments = self._keyedPackedArray('increments:',count=self.N_loadcases,type='i') if all (i is None for i in self._increments): self._increments = self._keyedPackedArray('increments',count=self.N_loadcases,type='i') @@ -111,7 +111,7 @@ class MPIEspectral_result: # mimic py_post result object if self.startingIncrement is None: self.startingIncrement = self._keyedPackedArray('startingIncrement',count=1,type='i')[0] - + self._times = self._keyedPackedArray('times:',count=self.N_loadcases,type='d') if all (i is None for i in self._times): self._times = self._keyedPackedArray('times',count=self.N_loadcases,type='d') @@ -119,15 +119,15 @@ class MPIEspectral_result: # mimic py_post result object self._logscales = self._keyedPackedArray('logscales:',count=self.N_loadcases,type='i') if all (i is None for i in self._logscales): self._logscales = self._keyedPackedArray('logscales',count=self.N_loadcases,type='i') - + self.size = self._keyedPackedArray('size:',count=3,type='d') if self.size == [None,None,None]: # no 'size' found, try legacy alias 'dimension' self.size = self._keyedPackedArray('dimension',count=3,type='d') - + self.grid = self._keyedPackedArray('grid:',count=3,type='i') if self.grid == [None,None,None]: # no 'grid' found, try legacy alias 'resolution' self.grid = self._keyedPackedArray('resolution',count=3,type='i') - + self.N_nodes = (self.grid[0]+1)*(self.grid[1]+1)*(self.grid[2]+1) self.N_elements = self.grid[0] * self.grid[1] * self.grid[2] @@ -139,7 +139,7 @@ class MPIEspectral_result: # mimic py_post result object self.N_increments = 1 # add zero'th entry for i in range(self.N_loadcases): self.N_increments += self._increments[i]//self._frequencies[i] - + # parameters for file handling depending on output format if options.legacy: @@ -176,17 +176,17 @@ class MPIEspectral_result: # mimic py_post result object name = '' filepos=0 # start at the beginning while name != identifier and filepos < self.dataOffset: # stop searching when found or when reached end of header - self.file.seek(filepos) + self.file.seek(filepos) # read the starting tag in front of the keyword (Fortran indicates start and end of writing by a 4 byte tag indicating the length of the following data) dataLen=struct.unpack('i',self.file.read(4))[0] name = self.file.read(len(identifier)) # anticipate identifier - start=filepos+(4+len(identifier)) # position of the values for the found key + start=filepos+(4+len(identifier)) # position of the values for the found key filepos=filepos+(4+dataLen+4) # forward to next keyword - + if name==identifier: # found the correct name key['pos'] = start # save position key['name'] = name - return key + return key def _keyedPackedArray(self,identifier,count = 3,type = 'd',default = None): bytecount = {'d': 8,'i': 4} @@ -251,10 +251,10 @@ class MPIEspectral_result: # mimic py_post result object def element_sequence(self,e): return e-1 - + def element_id(self,e): return e+1 - + def element(self,e): a = self.grid[0]+1 b = self.grid[1]+1 @@ -291,7 +291,7 @@ class MPIEspectral_result: # mimic py_post result object print 'seeking',incStart+where print 'e',e,'idx',idx sys.exit(1) - + else: self.fourByteLimit = 2**31 -1 -8 # header & footer + extra header and footer for 4 byte int range (Fortran) @@ -309,7 +309,7 @@ class MPIEspectral_result: # mimic py_post result object data += self.file.read(1) where += 1 value = struct.unpack('d',data)[0] - else: + else: self.file.seek(incStart+where+(where//self.fourByteLimit)*8+4) value = struct.unpack('d',self.file.read(8))[0] except: @@ -328,39 +328,39 @@ class MPIEspectral_result: # mimic py_post result object # ----------------------------- def ipCoords(elemType, nodalCoordinates): """returns IP coordinates for a given element""" - nodeWeightsPerNode = { - 7: [ [27.0, 9.0, 3.0, 9.0, 9.0, 3.0, 1.0, 3.0], - [ 9.0, 27.0, 9.0, 3.0, 3.0, 9.0, 3.0, 1.0], - [ 3.0, 9.0, 27.0, 9.0, 1.0, 3.0, 9.0, 3.0], - [ 9.0, 3.0, 9.0, 27.0, 3.0, 1.0, 3.0, 9.0], - [ 9.0, 3.0, 1.0, 3.0, 27.0, 9.0, 3.0, 9.0], - [ 3.0, 9.0, 3.0, 1.0, 9.0, 27.0, 9.0, 3.0], - [ 1.0, 3.0, 9.0, 3.0, 3.0, 9.0, 27.0, 9.0], - [ 3.0, 1.0, 3.0, 9.0, 9.0, 3.0, 9.0, 27.0] ], - 57: [ [27.0, 9.0, 3.0, 9.0, 9.0, 3.0, 1.0, 3.0], - [ 9.0, 27.0, 9.0, 3.0, 3.0, 9.0, 3.0, 1.0], - [ 3.0, 9.0, 27.0, 9.0, 1.0, 3.0, 9.0, 3.0], - [ 9.0, 3.0, 9.0, 27.0, 3.0, 1.0, 3.0, 9.0], - [ 9.0, 3.0, 1.0, 3.0, 27.0, 9.0, 3.0, 9.0], - [ 3.0, 9.0, 3.0, 1.0, 9.0, 27.0, 9.0, 3.0], - [ 1.0, 3.0, 9.0, 3.0, 3.0, 9.0, 27.0, 9.0], - [ 3.0, 1.0, 3.0, 9.0, 9.0, 3.0, 9.0, 27.0] ], - 117: [ [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] ], + nodeWeightsPerNode = { + 7: [ [27.0, 9.0, 3.0, 9.0, 9.0, 3.0, 1.0, 3.0], + [ 9.0, 27.0, 9.0, 3.0, 3.0, 9.0, 3.0, 1.0], + [ 3.0, 9.0, 27.0, 9.0, 1.0, 3.0, 9.0, 3.0], + [ 9.0, 3.0, 9.0, 27.0, 3.0, 1.0, 3.0, 9.0], + [ 9.0, 3.0, 1.0, 3.0, 27.0, 9.0, 3.0, 9.0], + [ 3.0, 9.0, 3.0, 1.0, 9.0, 27.0, 9.0, 3.0], + [ 1.0, 3.0, 9.0, 3.0, 3.0, 9.0, 27.0, 9.0], + [ 3.0, 1.0, 3.0, 9.0, 9.0, 3.0, 9.0, 27.0] ], + 57: [ [27.0, 9.0, 3.0, 9.0, 9.0, 3.0, 1.0, 3.0], + [ 9.0, 27.0, 9.0, 3.0, 3.0, 9.0, 3.0, 1.0], + [ 3.0, 9.0, 27.0, 9.0, 1.0, 3.0, 9.0, 3.0], + [ 9.0, 3.0, 9.0, 27.0, 3.0, 1.0, 3.0, 9.0], + [ 9.0, 3.0, 1.0, 3.0, 27.0, 9.0, 3.0, 9.0], + [ 3.0, 9.0, 3.0, 1.0, 9.0, 27.0, 9.0, 3.0], + [ 1.0, 3.0, 9.0, 3.0, 3.0, 9.0, 27.0, 9.0], + [ 3.0, 1.0, 3.0, 9.0, 9.0, 3.0, 9.0, 27.0] ], + 117: [ [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0] ], 125: [ [ 3.0, 0.0, 0.0, 4.0, 1.0, 4.0], [ 0.0, 3.0, 0.0, 4.0, 4.0, 1.0], - [ 0.0, 0.0, 3.0, 1.0, 4.0, 4.0],], + [ 0.0, 0.0, 3.0, 1.0, 4.0, 4.0],], 127: [ [ 45.0, 17.0, 17.0, 17.0], [ 17.0, 45.0, 17.0, 17.0], [ 17.0, 17.0, 45.0, 17.0], - [ 17.0, 17.0, 17.0, 45.0],], - 136: [ [42.0, 15.0, 15.0, 14.0, 5.0, 5.0], - [15.0, 42.0, 15.0, 5.0, 14.0, 5.0], - [15.0, 15.0, 42.0, 5.0, 5.0, 14.0], - [14.0, 5.0, 5.0, 42.0, 15.0, 15.0], - [ 5.0, 14.0, 5.0, 15.0, 42.0, 15.0], - [ 5.0, 5.0, 14.0, 15.0, 15.0, 42.0] ], + [ 17.0, 17.0, 17.0, 45.0],], + 136: [ [42.0, 15.0, 15.0, 14.0, 5.0, 5.0], + [15.0, 42.0, 15.0, 5.0, 14.0, 5.0], + [15.0, 15.0, 42.0, 5.0, 5.0, 14.0], + [14.0, 5.0, 5.0, 42.0, 15.0, 15.0], + [ 5.0, 14.0, 5.0, 15.0, 42.0, 15.0], + [ 5.0, 5.0, 14.0, 15.0, 15.0, 42.0] ], } - + Nips = len(nodeWeightsPerNode[elemType]) ipCoordinates = [[0.0,0.0,0.0] for i in range(Nips)] for ip in range(Nips): @@ -369,7 +369,7 @@ def ipCoords(elemType, nodalCoordinates): ipCoordinates[ip][i] += nodeWeightsPerNode[elemType][ip][node] * nodalCoordinates[node][i] for i in range(3): ipCoordinates[ip][i] /= sum(nodeWeightsPerNode[elemType][ip]) - + return ipCoordinates @@ -377,15 +377,15 @@ def ipCoords(elemType, nodalCoordinates): # ----------------------------- def ipIDs(elemType): """returns IP numbers for given element type""" - ipPerNode = { - 7: [ 1, 2, 4, 3, 5, 6, 8, 7 ], - 57: [ 1, 2, 4, 3, 5, 6, 8, 7 ], + ipPerNode = { + 7: [ 1, 2, 4, 3, 5, 6, 8, 7 ], + 57: [ 1, 2, 4, 3, 5, 6, 8, 7 ], 117: [ 1 ], - 125: [ 1, 2, 3 ], - 127: [ 1, 2, 3, 4 ], - 136: [ 1, 2, 3, 4, 5, 6 ], + 125: [ 1, 2, 3 ], + 127: [ 1, 2, 3, 4 ], + 136: [ 1, 2, 3, 4, 5, 6 ], } - + return ipPerNode[elemType] @@ -457,7 +457,7 @@ def OpenPostfile(name,type,nodal = False): }[type](name) p.extrapolation({True:'linear',False:'translate'}[nodal]) p.moveto(1) - + return p @@ -475,9 +475,9 @@ def ParseOutputFormat(filename,what,me): break except: pass - + if content == []: return format # nothing found... - + tag = '' tagID = 0 for line in content: @@ -527,7 +527,7 @@ def ParsePostfile(p,filename, outputFormat): 'LabelOfElementalTensor': [None]*p.element_tensors(), \ } -# --- find labels +# --- find labels for labelIndex in range(stat['NumberOfNodalScalars']): label = p.node_scalar_label(labelIndex) @@ -543,17 +543,17 @@ def ParsePostfile(p,filename, outputFormat): label = p.element_tensor_label(labelIndex) stat['IndexOfLabel'][label] = labelIndex stat['LabelOfElementalTensor'][labelIndex] = label - + if 'User Defined Variable 1' in stat['IndexOfLabel']: # output format without dedicated names? stat['IndexOfLabel']['HomogenizationCount'] = stat['IndexOfLabel']['User Defined Variable 1'] # adjust first named entry - + if 'HomogenizationCount' in stat['IndexOfLabel']: # does the result file contain relevant user defined output at all? startIndex = stat['IndexOfLabel']['HomogenizationCount'] stat['LabelOfElementalScalar'][startIndex] = 'HomogenizationCount' - + # We now have to find a mapping for each output label as defined in the .output* files to the output position in the post file # Since we know where the user defined outputs start ("startIndex"), we can simply assign increasing indices to the labels -# given in the .output* file +# given in the .output* file offset = 1 for (name,N) in outputFormat['Homogenization']['outputs']: @@ -595,7 +595,7 @@ def ParsePostfile(p,filename, outputFormat): print 'trying to assign %s at position %i+%i'%(label,startIndex,offset) sys.exit(1) offset += 1 - + return stat @@ -614,7 +614,7 @@ def SummarizePostfile(stat,where=sys.stdout,format='marc'): + '\n '.join(stat['LabelOfElementalScalar']) + '\n\n') where.write('elemental tensors:\t%i'%stat['NumberOfElementalTensors'] + '\n\n '\ + '\n '.join(stat['LabelOfElementalTensor']) + '\n\n') - + return True @@ -625,9 +625,9 @@ def SummarizePostfile(stat,where=sys.stdout,format='marc'): # --- input parsing parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ -Extract data from a .t16 (MSC.Marc) or .spectralOut results file. +Extract data from a .t16 (MSC.Marc) or .spectralOut results file. -List of output variables is given by options '--ns','--es','--et','--ho','--cr','--co'. +List of output variables is given by options '--ns','--es','--et','--ho','--cr','--co'. Filters and separations use 'elem','node','ip','grain', and 'x','y','z' as key words. Example: @@ -751,12 +751,12 @@ if options.filetype is None: if ext in fileExtensions[theType]: options.filetype = theType break - + if options.filetype is not None: options.filetype = options.filetype.lower() if options.filetype == 'marc': offset_pos = 1 else: offset_pos = 0 - + # --- more sanity checks @@ -766,7 +766,7 @@ if options.filetype not in ['marc','spectral']: if options.filetype == 'marc': sys.path.append(damask.solver.Marc().libraryPath()) - + try: from py_post import post_open except: @@ -810,7 +810,7 @@ else: extension = os.path.splitext(files[0])[1] outputFormat = {} -me = { +me = { 'Homogenization': options.homog, 'Crystallite': options.cryst, 'Constitutive': options.phase, @@ -823,7 +823,7 @@ for what in me: if '_id' not in outputFormat[what]['specials']: print "\nsection '%s' not found in <%s>"%(me[what], what) print '\n'.join(map(lambda x:' [%s]'%x, outputFormat[what]['specials']['brothers'])) - + bg.set_message('opening result file...') p = OpenPostfile(filename+extension,options.filetype,options.nodal) bg.set_message('parsing result file...') @@ -834,7 +834,7 @@ if options.filetype == 'marc': # --- sanity check for output variables # for mentat variables (nodalScalar,elemScalar,elemTensor) we simply have to check whether the label # is found in the stat[indexOfLabel] dictionary for user defined variables (homogenizationResult, -# crystalliteResult,constitutiveResult) we have to check the corresponding outputFormat, since the +# crystalliteResult,constitutiveResult) we have to check the corresponding outputFormat, since the # namescheme in stat['IndexOfLabel'] is different for opt in ['nodalScalar','elemScalar','elemTensor','homogenizationResult','crystalliteResult','constitutiveResult']: @@ -856,13 +856,13 @@ if options.info: print '\n\n',p SummarizePostfile(stat) - + print '\nUser Defined Outputs' for what in me: print '\n ',what,':' for output in outputFormat[what]['outputs']: print ' ',output - + sys.exit(0) @@ -900,12 +900,12 @@ if options.nodalScalar: myElemID = 0 myIpID = 0 myGrainID = 0 - + # generate an expression that is only true for the locations specified by options.filter filter = substituteLocation(options.filter, [myElemID,myNodeID,myIpID,myGrainID], myNodeCoordinates) if filter != '' and not eval(filter): # for all filter expressions that are not true:... continue # ... ignore this data point and continue with next - + # --- group data locations # generate a unique key for a group of separated data based on the separation criterium for the location grp = substituteLocation('#'.join(options.sep), [myElemID,myNodeID,myIpID,myGrainID], myNodeCoordinates) @@ -925,7 +925,7 @@ if options.nodalScalar: myNodeCoordinates) # incrementally update average location groups[index[grp]].append([myElemID,myNodeID,myIpID,myGrainID,0]) # append a new list defining each group member memberCount += 1 - + else: for e in xrange(stat['NumberOfElements']): if e%1000 == 0: @@ -943,22 +943,22 @@ else: and int(p.element_scalar(e, stat['IndexOfLabel']['GrainCount'])[0].value))\ or 1): myGrainID = g + 1 - + # --- filter valid locations # generates an expression that is only true for the locations specified by options.filter - filter = substituteLocation(options.filter, [myElemID,myNodeID,myIpID,myGrainID], myIpCoordinates[n]) + filter = substituteLocation(options.filter, [myElemID,myNodeID,myIpID,myGrainID], myIpCoordinates[n]) if filter != '' and not eval(filter): # for all filter expressions that are not true:... continue # ... ignore this data point and continue with next - + # --- group data locations # generates a unique key for a group of separated data based on the separation criterium for the location - grp = substituteLocation('#'.join(options.sep), [myElemID,myNodeID,myIpID,myGrainID], myIpCoordinates[n]) - + grp = substituteLocation('#'.join(options.sep), [myElemID,myNodeID,myIpID,myGrainID], myIpCoordinates[n]) + if grp not in index: # create a new group if not yet present index[grp] = groupCount groups.append([[0,0,0,0,0.0,0.0,0.0]]) # initialize with avg location groupCount += 1 - + groups[index[grp]][0][:4] = mapIncremental('','unique', len(groups[index[grp]])-1, groups[index[grp]][0][:4], @@ -1055,12 +1055,12 @@ for incCount,position in enumerate(locations): # walk through locations +'"%(dirname + os.sep + options.prefix + os.path.split(filename)[1],increments[incCount],options.suffix)') else: outFilename = '%s.txt'%(dirname + os.sep + options.prefix + os.path.split(filename)[1] + options.suffix) - + if not fileOpen: file = open(outFilename,'w') fileOpen = True file.write('2\theader\n') - file.write(scriptID + '\t' + ' '.join(sys.argv[1:])) + file.write(scriptID + '\t' + ' '.join(sys.argv[1:]) + '\n') headerWritten = False file.flush() @@ -1097,7 +1097,7 @@ for incCount,position in enumerate(locations): # walk through locations if options.elemScalar: for label in options.elemScalar: - if assembleHeader: + if assembleHeader: header += [''.join( label.split() )] newby.append({'label':label, 'len':1, @@ -1105,17 +1105,17 @@ for incCount,position in enumerate(locations): # walk through locations if options.elemTensor: for label in options.elemTensor: - if assembleHeader: + if assembleHeader: header += heading('.',[[''.join( label.split() ),component] for component in ['intensity','t11','t22','t33','t12','t23','t13']]) myTensor = p.element_tensor(p.element_sequence(e),stat['IndexOfLabel'][label])[n_local] newby.append({'label':label, 'len':7, - 'content':[ myTensor.intensity, + 'content':[ myTensor.intensity, myTensor.t11, myTensor.t22, myTensor.t33, myTensor.t12, myTensor.t23, myTensor.t13, ]}) - + if options.homogenizationResult or \ options.crystalliteResult or \ options.constitutiveResult: @@ -1135,7 +1135,7 @@ for incCount,position in enumerate(locations): # walk through locations try: newby.append({'label':label, 'len':length, - 'content':[ p.element_scalar(p.element_sequence(e),stat['IndexOfLabel'][head])[n_local].value + 'content':[ p.element_scalar(p.element_sequence(e),stat['IndexOfLabel'][head])[n_local].value for head in thisHead ]}) except KeyError: print '\nDAMASK outputs seem missing from "post" section of the *.dat file!' @@ -1165,7 +1165,7 @@ for incCount,position in enumerate(locations): # walk through locations group[0] + \ mappedResult) ) + '\n') - + if fileOpen: file.close() From e7a174abc194001056d9fac77c0ebfbf413fe887 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 18 Jul 2016 19:19:51 +0200 Subject: [PATCH 101/412] cleaner code --- installation/symlink_Code.py | 2 +- installation/symlink_Processing.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/installation/symlink_Code.py b/installation/symlink_Code.py index 5d4518ddd..82b68c2a8 100755 --- a/installation/symlink_Code.py +++ b/installation/symlink_Code.py @@ -40,7 +40,7 @@ for version in MarcReleases: os.remove(sym_link) sys.stdout.write(sym_link) else: - sys.stdout.write(damask.util.bcolors.BOLD + sym_link + damask.util.bcolors.ENDC) + sys.stdout.write(damask.util.emph(sym_link)) os.symlink(src,sym_link) sys.stdout.write(' -> '+src+'\n') diff --git a/installation/symlink_Processing.py b/installation/symlink_Processing.py index 3f00e95c6..56f4d73e3 100755 --- a/installation/symlink_Processing.py +++ b/installation/symlink_Processing.py @@ -29,7 +29,7 @@ for subDir in processing_subDirs: os.remove(sym_link) sys.stdout.write(sym_link) else: - sys.stdout.write(damask.util.bcolors.BOLD + sym_link + damask.util.bcolors.ENDC) + sys.stdout.write(damask.util.emph(sym_link)) os.symlink(src,sym_link) sys.stdout.write(' -> '+src+'\n') From cd63a927333b93061ef90b3511cf0b20f4777b9c Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 18 Jul 2016 19:35:35 +0200 Subject: [PATCH 102/412] using python 2.7 has shebang will also work on mac without symlink unless someone uses the 6 year old python 2.6, this should be save --- installation/symlink_Code.py | 2 +- installation/symlink_Processing.py | 2 +- processing/misc/OIMgrainFile_toTable.py | 2 +- processing/misc/ang_toTable.py | 2 +- processing/misc/gwyddion_filter.py | 2 +- processing/misc/vtk_fromGwyddion.py | 2 +- processing/misc/yieldSurface.py | 2 +- processing/post/addAPS34IDEstrainCoords.py | 2 +- processing/post/addCalculation.py | 2 +- processing/post/addCauchy.py | 2 +- processing/post/addCompatibilityMismatch.py | 2 +- processing/post/addCumulative.py | 2 +- processing/post/addCurl.py | 2 +- processing/post/addDeterminant.py | 2 +- processing/post/addDeviator.py | 2 +- processing/post/addDisplacement.py | 2 +- processing/post/addDivergence.py | 2 +- processing/post/addEhkl.py | 2 +- processing/post/addEuclideanDistance.py | 2 +- processing/post/addGradient.py | 2 +- processing/post/addGrainID.py | 2 +- processing/post/addIPFcolor.py | 2 +- processing/post/addInfo.py | 2 +- processing/post/addMapped.py | 2 +- processing/post/addMises.py | 2 +- processing/post/addNorm.py | 2 +- processing/post/addOrientations.py | 2 +- processing/post/addPK2.py | 2 +- processing/post/addPole.py | 2 +- processing/post/addSchmidfactors.py | 2 +- processing/post/addSpectralDecomposition.py | 2 +- processing/post/addStrainTensors.py | 2 +- processing/post/addTable.py | 2 +- processing/post/averageDown.py | 2 +- processing/post/averageTable.py | 2 +- processing/post/binXY.py | 2 +- processing/post/blowUp.py | 2 +- processing/post/filterTable.py | 2 +- processing/post/histogram.py | 2 +- processing/post/imageData.py | 2 +- processing/post/imageDataDeformed.py | 2 +- processing/post/imageDataRGB.py | 2 +- processing/post/mentat_colorMap.py | 2 +- processing/post/perceptualUniformColorMap.py | 2 +- processing/post/permuteData.py | 2 +- processing/post/postResults.py | 2 +- processing/post/reLabel.py | 2 +- processing/post/rotateData.py | 2 +- processing/post/scaleData.py | 2 +- processing/post/shiftData.py | 2 +- processing/post/showTable.py | 2 +- processing/post/sortTable.py | 2 +- processing/post/vtk2ang.py | 2 +- processing/post/vtk_addPointcloudData.py | 2 +- processing/post/vtk_addRectilinearGridData.py | 2 +- processing/post/vtk_pointcloud.py | 2 +- processing/post/vtk_rectilinearGrid.py | 2 +- processing/pre/OIMlinear2linearODF.py | 2 +- processing/pre/abq_addUserOutput.py | 2 +- processing/pre/geom_addPrimitive.py | 2 +- processing/pre/geom_canvas.py | 2 +- processing/pre/geom_clean.py | 2 +- processing/pre/geom_fromMinimalSurface.py | 2 +- processing/pre/geom_fromOsteonGeometry.py | 2 +- processing/pre/geom_fromTable.py | 2 +- processing/pre/geom_fromVPSC.py | 2 +- processing/pre/geom_fromVoronoiTessellation.py | 2 +- processing/pre/geom_grainGrowth.py | 2 +- processing/pre/geom_pack.py | 2 +- processing/pre/geom_rescale.py | 2 +- processing/pre/geom_rotate.py | 2 +- processing/pre/geom_toTable.py | 2 +- processing/pre/geom_translate.py | 2 +- processing/pre/geom_unpack.py | 2 +- processing/pre/geom_vicinityOffset.py | 2 +- processing/pre/gmsh_identifySurfaces.py | 2 +- processing/pre/hybridIA_linODFsampling.py | 2 +- processing/pre/marc_addUserOutput.py | 2 +- processing/pre/mentat_pbcOnBoxMesh.py | 2 +- processing/pre/mentat_spectralBox.py | 2 +- processing/pre/patchFromReconstructedBoundaries.py | 2 +- processing/pre/seeds_fromDistribution.py | 2 +- processing/pre/seeds_fromGeom.py | 2 +- processing/pre/seeds_fromPokes.py | 2 +- processing/pre/seeds_fromRandom.py | 2 +- 85 files changed, 85 insertions(+), 85 deletions(-) diff --git a/installation/symlink_Code.py b/installation/symlink_Code.py index 82b68c2a8..1e67c8a7b 100755 --- a/installation/symlink_Code.py +++ b/installation/symlink_Code.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/installation/symlink_Processing.py b/installation/symlink_Processing.py index 56f4d73e3..6cb8f9135 100755 --- a/installation/symlink_Processing.py +++ b/installation/symlink_Processing.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- # Makes postprocessing routines acessible from everywhere. diff --git a/processing/misc/OIMgrainFile_toTable.py b/processing/misc/OIMgrainFile_toTable.py index 30cfee2f4..74d5d1819 100755 --- a/processing/misc/OIMgrainFile_toTable.py +++ b/processing/misc/OIMgrainFile_toTable.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/misc/ang_toTable.py b/processing/misc/ang_toTable.py index 110ea6ddf..177955f17 100755 --- a/processing/misc/ang_toTable.py +++ b/processing/misc/ang_toTable.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os diff --git a/processing/misc/gwyddion_filter.py b/processing/misc/gwyddion_filter.py index fd4df19a0..d5b1e39f0 100755 --- a/processing/misc/gwyddion_filter.py +++ b/processing/misc/gwyddion_filter.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,string,scipy diff --git a/processing/misc/vtk_fromGwyddion.py b/processing/misc/vtk_fromGwyddion.py index 8fa206074..e64bf4393 100755 --- a/processing/misc/vtk_fromGwyddion.py +++ b/processing/misc/vtk_fromGwyddion.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,string,vtk diff --git a/processing/misc/yieldSurface.py b/processing/misc/yieldSurface.py index d636c37f3..15f97113a 100755 --- a/processing/misc/yieldSurface.py +++ b/processing/misc/yieldSurface.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import threading,time,os diff --git a/processing/post/addAPS34IDEstrainCoords.py b/processing/post/addAPS34IDEstrainCoords.py index 7ba976478..a630a476b 100755 --- a/processing/post/addAPS34IDEstrainCoords.py +++ b/processing/post/addAPS34IDEstrainCoords.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/addCalculation.py b/processing/post/addCalculation.py index 8b5dd1d33..5e8c155b1 100755 --- a/processing/post/addCalculation.py +++ b/processing/post/addCalculation.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,re,sys diff --git a/processing/post/addCauchy.py b/processing/post/addCauchy.py index beebb0422..2f69cb043 100755 --- a/processing/post/addCauchy.py +++ b/processing/post/addCauchy.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/addCompatibilityMismatch.py b/processing/post/addCompatibilityMismatch.py index d311c286b..107d5d3d1 100755 --- a/processing/post/addCompatibilityMismatch.py +++ b/processing/post/addCompatibilityMismatch.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os diff --git a/processing/post/addCumulative.py b/processing/post/addCumulative.py index a577b68fe..37bd7b5de 100755 --- a/processing/post/addCumulative.py +++ b/processing/post/addCumulative.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/addCurl.py b/processing/post/addCurl.py index 79bb5f848..fab704325 100755 --- a/processing/post/addCurl.py +++ b/processing/post/addCurl.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/post/addDeterminant.py b/processing/post/addDeterminant.py index dc04dd8ff..1f721c27e 100755 --- a/processing/post/addDeterminant.py +++ b/processing/post/addDeterminant.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/addDeviator.py b/processing/post/addDeviator.py index d96564d4c..1cf301161 100755 --- a/processing/post/addDeviator.py +++ b/processing/post/addDeviator.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/addDisplacement.py b/processing/post/addDisplacement.py index a1a476185..2be5dcc21 100755 --- a/processing/post/addDisplacement.py +++ b/processing/post/addDisplacement.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/post/addDivergence.py b/processing/post/addDivergence.py index 4c24eea3c..ebd9e70d3 100755 --- a/processing/post/addDivergence.py +++ b/processing/post/addDivergence.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/post/addEhkl.py b/processing/post/addEhkl.py index 7b745526a..f7a143466 100755 --- a/processing/post/addEhkl.py +++ b/processing/post/addEhkl.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/addEuclideanDistance.py b/processing/post/addEuclideanDistance.py index 8cb6c3b83..dad334beb 100755 --- a/processing/post/addEuclideanDistance.py +++ b/processing/post/addEuclideanDistance.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys,itertools diff --git a/processing/post/addGradient.py b/processing/post/addGradient.py index 5ded3fc90..b77af853e 100755 --- a/processing/post/addGradient.py +++ b/processing/post/addGradient.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/post/addGrainID.py b/processing/post/addGrainID.py index 232790580..c39d67983 100755 --- a/processing/post/addGrainID.py +++ b/processing/post/addGrainID.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys,time,copy diff --git a/processing/post/addIPFcolor.py b/processing/post/addIPFcolor.py index 6a9e39e18..cedd075c1 100755 --- a/processing/post/addIPFcolor.py +++ b/processing/post/addIPFcolor.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/post/addInfo.py b/processing/post/addInfo.py index 2c8749d0c..50f003d6b 100755 --- a/processing/post/addInfo.py +++ b/processing/post/addInfo.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os diff --git a/processing/post/addMapped.py b/processing/post/addMapped.py index da36097d4..c57e62d8b 100755 --- a/processing/post/addMapped.py +++ b/processing/post/addMapped.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/addMises.py b/processing/post/addMises.py index 9d6a9f9db..2ce350dbd 100755 --- a/processing/post/addMises.py +++ b/processing/post/addMises.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/post/addNorm.py b/processing/post/addNorm.py index 0911e5784..68249379a 100755 --- a/processing/post/addNorm.py +++ b/processing/post/addNorm.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/post/addOrientations.py b/processing/post/addOrientations.py index 2f88107df..3c1f6dabc 100755 --- a/processing/post/addOrientations.py +++ b/processing/post/addOrientations.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/post/addPK2.py b/processing/post/addPK2.py index 59084a88c..80f5843ec 100755 --- a/processing/post/addPK2.py +++ b/processing/post/addPK2.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/addPole.py b/processing/post/addPole.py index 6cbd26880..291c5a712 100755 --- a/processing/post/addPole.py +++ b/processing/post/addPole.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/post/addSchmidfactors.py b/processing/post/addSchmidfactors.py index 828132471..0bc529034 100755 --- a/processing/post/addSchmidfactors.py +++ b/processing/post/addSchmidfactors.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/post/addSpectralDecomposition.py b/processing/post/addSpectralDecomposition.py index 2f8f32fd7..aa87e6f3c 100755 --- a/processing/post/addSpectralDecomposition.py +++ b/processing/post/addSpectralDecomposition.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/addStrainTensors.py b/processing/post/addStrainTensors.py index 654d7583a..ee760a65b 100755 --- a/processing/post/addStrainTensors.py +++ b/processing/post/addStrainTensors.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/addTable.py b/processing/post/addTable.py index 53774b5d7..82799b4f5 100755 --- a/processing/post/addTable.py +++ b/processing/post/addTable.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/averageDown.py b/processing/post/averageDown.py index ec8e6e8ed..9ad1b7d0b 100755 --- a/processing/post/averageDown.py +++ b/processing/post/averageDown.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/averageTable.py b/processing/post/averageTable.py index b059404c9..25c09625c 100755 --- a/processing/post/averageTable.py +++ b/processing/post/averageTable.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/binXY.py b/processing/post/binXY.py index 693b71e59..4fd635120 100755 --- a/processing/post/binXY.py +++ b/processing/post/binXY.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/blowUp.py b/processing/post/blowUp.py index 430a4f388..49156c8f4 100755 --- a/processing/post/blowUp.py +++ b/processing/post/blowUp.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/filterTable.py b/processing/post/filterTable.py index 41a0634f3..231c52960 100755 --- a/processing/post/filterTable.py +++ b/processing/post/filterTable.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,re,sys,fnmatch diff --git a/processing/post/histogram.py b/processing/post/histogram.py index ea67aa770..0f7d73fdc 100755 --- a/processing/post/histogram.py +++ b/processing/post/histogram.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/imageData.py b/processing/post/imageData.py index b1afcb3de..41996a3c6 100755 --- a/processing/post/imageData.py +++ b/processing/post/imageData.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/imageDataDeformed.py b/processing/post/imageDataDeformed.py index a15839b22..14c4df7c2 100755 --- a/processing/post/imageDataDeformed.py +++ b/processing/post/imageDataDeformed.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/imageDataRGB.py b/processing/post/imageDataRGB.py index 4d4aa1f8d..4f124507e 100755 --- a/processing/post/imageDataRGB.py +++ b/processing/post/imageDataRGB.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/mentat_colorMap.py b/processing/post/mentat_colorMap.py index b72f48afe..d412890b6 100755 --- a/processing/post/mentat_colorMap.py +++ b/processing/post/mentat_colorMap.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/perceptualUniformColorMap.py b/processing/post/perceptualUniformColorMap.py index 0bf655f2a..85acd073b 100755 --- a/processing/post/perceptualUniformColorMap.py +++ b/processing/post/perceptualUniformColorMap.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import sys,os diff --git a/processing/post/permuteData.py b/processing/post/permuteData.py index 54a18576f..0cbf6039a 100755 --- a/processing/post/permuteData.py +++ b/processing/post/permuteData.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/postResults.py b/processing/post/postResults.py index c81f561d5..7e23b7278 100755 --- a/processing/post/postResults.py +++ b/processing/post/postResults.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys,math,re,time,struct diff --git a/processing/post/reLabel.py b/processing/post/reLabel.py index b704a2ee5..e5979122e 100755 --- a/processing/post/reLabel.py +++ b/processing/post/reLabel.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys,re diff --git a/processing/post/rotateData.py b/processing/post/rotateData.py index 32eaaad13..08958cc86 100755 --- a/processing/post/rotateData.py +++ b/processing/post/rotateData.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/post/scaleData.py b/processing/post/scaleData.py index 18883eb0b..d33efa268 100755 --- a/processing/post/scaleData.py +++ b/processing/post/scaleData.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/shiftData.py b/processing/post/shiftData.py index 4052d83d9..cac0e54f0 100755 --- a/processing/post/shiftData.py +++ b/processing/post/shiftData.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/showTable.py b/processing/post/showTable.py index c65b4519f..918256af9 100755 --- a/processing/post/showTable.py +++ b/processing/post/showTable.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os diff --git a/processing/post/sortTable.py b/processing/post/sortTable.py index f1298af86..92fa81672 100755 --- a/processing/post/sortTable.py +++ b/processing/post/sortTable.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/post/vtk2ang.py b/processing/post/vtk2ang.py index bc8e23097..c315902ef 100755 --- a/processing/post/vtk2ang.py +++ b/processing/post/vtk2ang.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,string,math,sys diff --git a/processing/post/vtk_addPointcloudData.py b/processing/post/vtk_addPointcloudData.py index 3590a436e..340ef700e 100755 --- a/processing/post/vtk_addPointcloudData.py +++ b/processing/post/vtk_addPointcloudData.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,vtk diff --git a/processing/post/vtk_addRectilinearGridData.py b/processing/post/vtk_addRectilinearGridData.py index 76eed6aec..63e0bf783 100755 --- a/processing/post/vtk_addRectilinearGridData.py +++ b/processing/post/vtk_addRectilinearGridData.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,vtk diff --git a/processing/post/vtk_pointcloud.py b/processing/post/vtk_pointcloud.py index 995f5a216..339ff2c17 100755 --- a/processing/post/vtk_pointcloud.py +++ b/processing/post/vtk_pointcloud.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys,vtk diff --git a/processing/post/vtk_rectilinearGrid.py b/processing/post/vtk_rectilinearGrid.py index 32ea2c11c..73a64c4aa 100755 --- a/processing/post/vtk_rectilinearGrid.py +++ b/processing/post/vtk_rectilinearGrid.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys,vtk diff --git a/processing/pre/OIMlinear2linearODF.py b/processing/pre/OIMlinear2linearODF.py index cbcbcc7ec..d50c07a37 100755 --- a/processing/pre/OIMlinear2linearODF.py +++ b/processing/pre/OIMlinear2linearODF.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/pre/abq_addUserOutput.py b/processing/pre/abq_addUserOutput.py index 4528537d9..fea8d57b4 100755 --- a/processing/pre/abq_addUserOutput.py +++ b/processing/pre/abq_addUserOutput.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import sys,os,re diff --git a/processing/pre/geom_addPrimitive.py b/processing/pre/geom_addPrimitive.py index 8976a9e3d..952ba0c4b 100755 --- a/processing/pre/geom_addPrimitive.py +++ b/processing/pre/geom_addPrimitive.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/pre/geom_canvas.py b/processing/pre/geom_canvas.py index 4b482d641..831a2b251 100755 --- a/processing/pre/geom_canvas.py +++ b/processing/pre/geom_canvas.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/pre/geom_clean.py b/processing/pre/geom_clean.py index 1409a1366..c61cf5ef9 100755 --- a/processing/pre/geom_clean.py +++ b/processing/pre/geom_clean.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/pre/geom_fromMinimalSurface.py b/processing/pre/geom_fromMinimalSurface.py index 1c4fc2eaa..a346aa11d 100755 --- a/processing/pre/geom_fromMinimalSurface.py +++ b/processing/pre/geom_fromMinimalSurface.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/pre/geom_fromOsteonGeometry.py b/processing/pre/geom_fromOsteonGeometry.py index 9a24b3e2d..9f85f99aa 100755 --- a/processing/pre/geom_fromOsteonGeometry.py +++ b/processing/pre/geom_fromOsteonGeometry.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/pre/geom_fromTable.py b/processing/pre/geom_fromTable.py index 91b4c2670..4f786af9e 100755 --- a/processing/pre/geom_fromTable.py +++ b/processing/pre/geom_fromTable.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys,math,types,time diff --git a/processing/pre/geom_fromVPSC.py b/processing/pre/geom_fromVPSC.py index 3f76ffe2e..a1208170b 100755 --- a/processing/pre/geom_fromVPSC.py +++ b/processing/pre/geom_fromVPSC.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/pre/geom_fromVoronoiTessellation.py b/processing/pre/geom_fromVoronoiTessellation.py index fd334620f..d18e38b9c 100755 --- a/processing/pre/geom_fromVoronoiTessellation.py +++ b/processing/pre/geom_fromVoronoiTessellation.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/pre/geom_grainGrowth.py b/processing/pre/geom_grainGrowth.py index 9184bd226..43e2e49d9 100755 --- a/processing/pre/geom_grainGrowth.py +++ b/processing/pre/geom_grainGrowth.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/pre/geom_pack.py b/processing/pre/geom_pack.py index 168cfe1d6..cfa329698 100755 --- a/processing/pre/geom_pack.py +++ b/processing/pre/geom_pack.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/pre/geom_rescale.py b/processing/pre/geom_rescale.py index 2c779f3d3..f2d9966d6 100755 --- a/processing/pre/geom_rescale.py +++ b/processing/pre/geom_rescale.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/pre/geom_rotate.py b/processing/pre/geom_rotate.py index bb6acd35c..1e570ca70 100755 --- a/processing/pre/geom_rotate.py +++ b/processing/pre/geom_rotate.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/pre/geom_toTable.py b/processing/pre/geom_toTable.py index 680b218cf..d34d101e0 100755 --- a/processing/pre/geom_toTable.py +++ b/processing/pre/geom_toTable.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/pre/geom_translate.py b/processing/pre/geom_translate.py index 6c5eb5391..83c71aa8d 100755 --- a/processing/pre/geom_translate.py +++ b/processing/pre/geom_translate.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/pre/geom_unpack.py b/processing/pre/geom_unpack.py index 508946d4e..530d3889e 100755 --- a/processing/pre/geom_unpack.py +++ b/processing/pre/geom_unpack.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/pre/geom_vicinityOffset.py b/processing/pre/geom_vicinityOffset.py index 8ef96608e..06cb482c6 100755 --- a/processing/pre/geom_vicinityOffset.py +++ b/processing/pre/geom_vicinityOffset.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys,math diff --git a/processing/pre/gmsh_identifySurfaces.py b/processing/pre/gmsh_identifySurfaces.py index e42e352c8..642b0a71e 100755 --- a/processing/pre/gmsh_identifySurfaces.py +++ b/processing/pre/gmsh_identifySurfaces.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,re diff --git a/processing/pre/hybridIA_linODFsampling.py b/processing/pre/hybridIA_linODFsampling.py index 9ee4470b9..a04b28e38 100755 --- a/processing/pre/hybridIA_linODFsampling.py +++ b/processing/pre/hybridIA_linODFsampling.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- from optparse import OptionParser diff --git a/processing/pre/marc_addUserOutput.py b/processing/pre/marc_addUserOutput.py index 6f61b2d26..9bc336fd6 100755 --- a/processing/pre/marc_addUserOutput.py +++ b/processing/pre/marc_addUserOutput.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- """ diff --git a/processing/pre/mentat_pbcOnBoxMesh.py b/processing/pre/mentat_pbcOnBoxMesh.py index b35d9ab62..07f8e4b70 100755 --- a/processing/pre/mentat_pbcOnBoxMesh.py +++ b/processing/pre/mentat_pbcOnBoxMesh.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import sys,os diff --git a/processing/pre/mentat_spectralBox.py b/processing/pre/mentat_spectralBox.py index 6ff6e51d7..681aca724 100755 --- a/processing/pre/mentat_spectralBox.py +++ b/processing/pre/mentat_spectralBox.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/pre/patchFromReconstructedBoundaries.py b/processing/pre/patchFromReconstructedBoundaries.py index 9167c7398..ada92b09d 100755 --- a/processing/pre/patchFromReconstructedBoundaries.py +++ b/processing/pre/patchFromReconstructedBoundaries.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import sys,os,math,re diff --git a/processing/pre/seeds_fromDistribution.py b/processing/pre/seeds_fromDistribution.py index 096fbdfd8..18b2712e7 100755 --- a/processing/pre/seeds_fromDistribution.py +++ b/processing/pre/seeds_fromDistribution.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import threading,time,os,sys,random diff --git a/processing/pre/seeds_fromGeom.py b/processing/pre/seeds_fromGeom.py index 1f1c2aeed..6a249065b 100755 --- a/processing/pre/seeds_fromGeom.py +++ b/processing/pre/seeds_fromGeom.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys diff --git a/processing/pre/seeds_fromPokes.py b/processing/pre/seeds_fromPokes.py index bf26591c1..5d2cc212f 100755 --- a/processing/pre/seeds_fromPokes.py +++ b/processing/pre/seeds_fromPokes.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,math,sys diff --git a/processing/pre/seeds_fromRandom.py b/processing/pre/seeds_fromRandom.py index cf3db1b36..038690df4 100755 --- a/processing/pre/seeds_fromRandom.py +++ b/processing/pre/seeds_fromRandom.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,sys,math,random From ef2c8479a7098d66f3bc438880dea03b7d24c58b Mon Sep 17 00:00:00 2001 From: Test User Date: Tue, 19 Jul 2016 04:19:09 +0200 Subject: [PATCH 103/412] updated version information after successful test of v2.0.0-396-g03bb0b8 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 9b8617d3b..355497657 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.0-385-g1b30b18 +v2.0.0-396-g03bb0b8 From 6f527b2af831b0c3bba613d0aee4e5ee5e3b8d77 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Sun, 24 Jul 2016 19:18:48 -0400 Subject: [PATCH 104/412] fixed upperCase typo in vtk_addPointcloudData call --- processing/pre/seeds_check.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/processing/pre/seeds_check.sh b/processing/pre/seeds_check.sh index a7d7f76ce..f24cd1c64 100755 --- a/processing/pre/seeds_check.sh +++ b/processing/pre/seeds_check.sh @@ -4,7 +4,7 @@ for seeds in "$@" do vtk_pointcloud $seeds - vtk_addPointCloudData $seeds \ + vtk_addPointcloudData $seeds \ --scalar microstructure,weight \ --inplace \ --vtk ${seeds%.*}.vtp \ From 4d01e826c5888a602daf8541425136d260dddc38 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Mon, 25 Jul 2016 00:46:11 -0400 Subject: [PATCH 105/412] fixed typo in usage msg --- examples/SpectralMethod/Makefile | 12 ++++++++++++ processing/post/addDisplacement.py | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 examples/SpectralMethod/Makefile diff --git a/examples/SpectralMethod/Makefile b/examples/SpectralMethod/Makefile new file mode 100644 index 000000000..3abb88f89 --- /dev/null +++ b/examples/SpectralMethod/Makefile @@ -0,0 +1,12 @@ +include ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/variables +include ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/rules + + +run16x16x16: + -@${MPIEXEC} -n 2 DAMASK_spectral -l tensionX.load -g 20grains16x16x16.geom + +run32x32x32: + -@${MPIEXEC} -n 4 DAMASK_spectral -l tensionX.load -g 20grains32x32x32.geom + +run64x64x64: + -@${MPIEXEC} -n 8 DAMASK_spectral -l tensionX.load -g 20grains64x64x64.geom diff --git a/processing/post/addDisplacement.py b/processing/post/addDisplacement.py index 2be5dcc21..a791a0e84 100755 --- a/processing/post/addDisplacement.py +++ b/processing/post/addDisplacement.py @@ -107,7 +107,7 @@ parser.add_option('-p', parser.add_option('--nodal', dest = 'nodal', action = 'store_true', - help = 'output nodal (instad of cell-centered) displacements') + help = 'output nodal (instead of cell-centered) displacements') parser.set_defaults(defgrad = 'f', pos = 'pos', From 9b6b32692d14536a2a9cac2ea8a1ddc6c6b0478e Mon Sep 17 00:00:00 2001 From: Test User Date: Mon, 25 Jul 2016 14:26:39 +0200 Subject: [PATCH 106/412] updated version information after successful test of v2.0.0-401-g4d01e82 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 355497657..dd087b4dd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.0-396-g03bb0b8 +v2.0.0-401-g4d01e82 From 8235bf34227040b1e0f9a346f658b96904377667 Mon Sep 17 00:00:00 2001 From: Franz Roters Date: Mon, 25 Jul 2016 15:54:48 +0200 Subject: [PATCH 107/412] updated version to 2.0.1 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index dd087b4dd..0ac852dde 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.0-401-g4d01e82 +v2.0.1 From 1195593233c565c39ba61af79bfb1ea30686ef2a Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 25 Jul 2016 19:39:09 +0200 Subject: [PATCH 108/412] some casting was needed, corrected header --- processing/pre/geom_clean.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/processing/pre/geom_clean.py b/processing/pre/geom_clean.py index c61cf5ef9..408178c32 100755 --- a/processing/pre/geom_clean.py +++ b/processing/pre/geom_clean.py @@ -11,7 +11,7 @@ scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptID = ' '.join([scriptName,damask.version]) def mostFrequent(arr): - return np.argmax(np.bincount(arr)) + return np.argmax(np.bincount(arr.astype('int'))) #-------------------------------------------------------------------------------------------------- @@ -72,7 +72,13 @@ for name in filenames: # --- do work ------------------------------------------------------------------------------------ - microstructure = ndimage.filters.generic_filter(microstructure,mostFrequent,size=(options.stencil,)*3) + microstructure = ndimage.filters.generic_filter(microstructure,mostFrequent,size=(options.stencil,)*3).astype('int_') + newInfo = {'microstructures': microstructure.max()} + +# --- report --------------------------------------------------------------------------------------- + if ( newInfo['microstructures'] != info['microstructures']): + damask.util.croak('--> microstructures: %i'%newInfo['microstructures']) + info['microstructures'] == newInfo['microstructures'] # --- write header --------------------------------------------------------------------------------- From e4c590699f6ca9743b47e131e4a4f0bcb27b2799 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 25 Jul 2016 20:07:12 +0200 Subject: [PATCH 109/412] removed numerical perturbation calculation --- code/crystallite.f90 | 468 +++++++++---------------------------------- 1 file changed, 97 insertions(+), 371 deletions(-) diff --git a/code/crystallite.f90 b/code/crystallite.f90 index 7abd737f3..399e63b0e 100644 --- a/code/crystallite.f90 +++ b/code/crystallite.f90 @@ -518,8 +518,7 @@ subroutine crystallite_stressAndItsTangent(updateJaco) nCryst, & numerics_integrator, & numerics_integrationMode, & - numerics_timeSyncing, & - analyticJaco + numerics_timeSyncing use debug, only: & debug_level, & debug_crystallite, & @@ -582,23 +581,6 @@ subroutine crystallite_stressAndItsTangent(updateJaco) invFp, & ! inverse of the plastic deformation gradient Fe_guess, & ! guess for elastic deformation gradient Tstar ! 2nd Piola-Kirchhoff stress tensor - real(pReal), allocatable, dimension(:,:,:,:,:,:,:) :: & - dPdF_perturbation1, & - dPdF_perturbation2 - real(pReal), allocatable, dimension(:,:,:,:,:) :: & - F_backup, & - Fp_backup, & - InvFp_backup, & - Fi_backup, & - InvFi_backup, & - Fe_backup, & - Lp_backup, & - Li_backup, & - P_backup - real(pReal), allocatable, dimension(:,:,:,:) :: & - Tstar_v_backup - logical, allocatable, dimension(:,:,:) :: & - convergenceFlag_backup integer(pInt) :: & NiterationCrystallite, & ! number of iterations in crystallite loop c, & !< counter in integration point component loop @@ -1137,371 +1119,115 @@ subroutine crystallite_stressAndItsTangent(updateJaco) ! --+>> STIFFNESS CALCULATION <<+-- computeJacobian: if(updateJaco) then - jacobianMethod: if (analyticJaco) then + !$OMP PARALLEL DO PRIVATE(dSdF,dSdFe,dSdFi,dLpdS,dLpdFi,dFpinvdF,dLidS,dLidFi,dFidS,& + !$OMP rhs_3333,lhs_3333,temp_99,temp_33,temp_3333,myNcomponents,error) + elementLooping6: do e = FEsolving_execElem(1),FEsolving_execElem(2) + myNcomponents = homogenization_Ngrains(mesh_element(3,e)) + do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e) ! iterate over IPs of this element to be processed + do c = 1_pInt,myNcomponents + call constitutive_TandItsTangent(temp_33,dSdFe,dSdFi,crystallite_Fe(1:3,1:3,c,i,e), & + crystallite_Fi(1:3,1:3,c,i,e),c,i,e) ! call constitutive law to calculate elastic stress tangent - ! --- ANALYTIC JACOBIAN --- + call constitutive_LiAndItsTangent(temp_33,dLidS,dLidFi,crystallite_Tstar_v(1:6,c,i,e), & + crystallite_Fi(1:3,1:3,c,i,e), & + c,i,e) ! call constitutive law to calculate Li tangent in lattice configuration + if (sum(abs(dLidS)) < tol_math_check) then + dFidS = 0.0_pReal + else + temp_33 = math_inv33(crystallite_subFi0(1:3,1:3,c,i,e)) + lhs_3333 = 0.0_pReal; rhs_3333 = 0.0_pReal + do o=1_pInt,3_pInt; do p=1_pInt,3_pInt + lhs_3333(1:3,1:3,o,p) = lhs_3333(1:3,1:3,o,p) + & + crystallite_subdt(c,i,e)*math_mul33x33(temp_33,dLidFi(1:3,1:3,o,p)) + lhs_3333(1:3,o,1:3,p) = lhs_3333(1:3,o,1:3,p) + & + crystallite_invFi(1:3,1:3,c,i,e)*crystallite_invFi(p,o,c,i,e) + rhs_3333(1:3,1:3,o,p) = rhs_3333(1:3,1:3,o,p) - & + crystallite_subdt(c,i,e)*math_mul33x33(temp_33,dLidS(1:3,1:3,o,p)) + enddo; enddo + call math_invert(9_pInt,math_Plain3333to99(lhs_3333),temp_99,error) + if (error) then + call IO_warning(warning_ID=600_pInt,el=e,ip=i,g=c, & + ext_msg='inversion error in analytic tangent calculation') + dFidS = 0.0_pReal + else + dFidS = math_mul3333xx3333(math_Plain99to3333(temp_99),rhs_3333) + endif + dLidS = math_mul3333xx3333(dLidFi,dFidS) + dLidS + endif - !$OMP PARALLEL DO PRIVATE(dSdF,dSdFe,dSdFi,dLpdS,dLpdFi,dFpinvdF,dLidS,dLidFi,dFidS,& - !$OMP rhs_3333,lhs_3333,temp_99,temp_33,temp_3333,myNcomponents,error) - elementLooping6: do e = FEsolving_execElem(1),FEsolving_execElem(2) - myNcomponents = homogenization_Ngrains(mesh_element(3,e)) - do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e) ! iterate over IPs of this element to be processed - do c = 1_pInt,myNcomponents - call constitutive_TandItsTangent(temp_33,dSdFe,dSdFi,crystallite_Fe(1:3,1:3,c,i,e), & - crystallite_Fi(1:3,1:3,c,i,e),c,i,e) ! call constitutive law to calculate elastic stress tangent + call constitutive_LpAndItsTangent(temp_33,dLpdS,dLpdFi,crystallite_Tstar_v(1:6,c,i,e), & + crystallite_Fi(1:3,1:3,c,i,e),c,i,e) ! call constitutive law to calculate Lp tangent in lattice configuration + dLpdS = math_mul3333xx3333(dLpdFi,dFidS) + dLpdS - call constitutive_LiAndItsTangent(temp_33,dLidS,dLidFi,crystallite_Tstar_v(1:6,c,i,e), & - crystallite_Fi(1:3,1:3,c,i,e), & - c,i,e) ! call constitutive law to calculate Li tangent in lattice configuration - if (sum(abs(dLidS)) < tol_math_check) then - dFidS = 0.0_pReal - else - temp_33 = math_inv33(crystallite_subFi0(1:3,1:3,c,i,e)) - lhs_3333 = 0.0_pReal; rhs_3333 = 0.0_pReal - do o=1_pInt,3_pInt; do p=1_pInt,3_pInt - lhs_3333(1:3,1:3,o,p) = lhs_3333(1:3,1:3,o,p) + & - crystallite_subdt(c,i,e)*math_mul33x33(temp_33,dLidFi(1:3,1:3,o,p)) - lhs_3333(1:3,o,1:3,p) = lhs_3333(1:3,o,1:3,p) + & - crystallite_invFi(1:3,1:3,c,i,e)*crystallite_invFi(p,o,c,i,e) - rhs_3333(1:3,1:3,o,p) = rhs_3333(1:3,1:3,o,p) - & - crystallite_subdt(c,i,e)*math_mul33x33(temp_33,dLidS(1:3,1:3,o,p)) - enddo; enddo - call math_invert(9_pInt,math_Plain3333to99(lhs_3333),temp_99,error) - if (error) then - call IO_warning(warning_ID=600_pInt,el=e,ip=i,g=c, & - ext_msg='inversion error in analytic tangent calculation') - dFidS = 0.0_pReal - else - dFidS = math_mul3333xx3333(math_Plain99to3333(temp_99),rhs_3333) - endif - dLidS = math_mul3333xx3333(dLidFi,dFidS) + dLidS - endif + temp_33 = math_transpose33(math_mul33x33(crystallite_invFp(1:3,1:3,c,i,e), & + crystallite_invFi(1:3,1:3,c,i,e))) + rhs_3333 = 0.0_pReal + forall(p=1_pInt:3_pInt, o=1_pInt:3_pInt) & + rhs_3333(p,o,1:3,1:3) = math_mul33x33(dSdFe(p,o,1:3,1:3),temp_33) - call constitutive_LpAndItsTangent(temp_33,dLpdS,dLpdFi,crystallite_Tstar_v(1:6,c,i,e), & - crystallite_Fi(1:3,1:3,c,i,e),c,i,e) ! call constitutive law to calculate Lp tangent in lattice configuration - dLpdS = math_mul3333xx3333(dLpdFi,dFidS) + dLpdS + temp_3333 = 0.0_pReal + temp_33 = math_mul33x33(crystallite_subF(1:3,1:3,c,i,e), & + math_inv33(crystallite_subFp0(1:3,1:3,c,i,e))) + forall(p=1_pInt:3_pInt, o=1_pInt:3_pInt) & + temp_3333(1:3,1:3,p,o) = math_mul33x33(math_mul33x33(temp_33,dLpdS(1:3,1:3,p,o)), & + crystallite_invFi(1:3,1:3,c,i,e)) - temp_33 = math_transpose33(math_mul33x33(crystallite_invFp(1:3,1:3,c,i,e), & - crystallite_invFi(1:3,1:3,c,i,e))) - rhs_3333 = 0.0_pReal - forall(p=1_pInt:3_pInt, o=1_pInt:3_pInt) & - rhs_3333(p,o,1:3,1:3) = math_mul33x33(dSdFe(p,o,1:3,1:3),temp_33) + temp_33 = math_mul33x33(math_mul33x33(crystallite_subF(1:3,1:3,c,i,e), & + crystallite_invFp(1:3,1:3,c,i,e)), & + math_inv33(crystallite_subFi0(1:3,1:3,c,i,e))) + forall(p=1_pInt:3_pInt, o=1_pInt:3_pInt) & + temp_3333(1:3,1:3,p,o) = temp_3333(1:3,1:3,p,o) + math_mul33x33(temp_33,dLidS(1:3,1:3,p,o)) - temp_3333 = 0.0_pReal - temp_33 = math_mul33x33(crystallite_subF(1:3,1:3,c,i,e), & - math_inv33(crystallite_subFp0(1:3,1:3,c,i,e))) - forall(p=1_pInt:3_pInt, o=1_pInt:3_pInt) & - temp_3333(1:3,1:3,p,o) = math_mul33x33(math_mul33x33(temp_33,dLpdS(1:3,1:3,p,o)), & - crystallite_invFi(1:3,1:3,c,i,e)) + lhs_3333 = crystallite_subdt(c,i,e)*math_mul3333xx3333(dSdFe,temp_3333) + & + math_mul3333xx3333(dSdFi,dFidS) - temp_33 = math_mul33x33(math_mul33x33(crystallite_subF(1:3,1:3,c,i,e), & - crystallite_invFp(1:3,1:3,c,i,e)), & - math_inv33(crystallite_subFi0(1:3,1:3,c,i,e))) - forall(p=1_pInt:3_pInt, o=1_pInt:3_pInt) & - temp_3333(1:3,1:3,p,o) = temp_3333(1:3,1:3,p,o) + math_mul33x33(temp_33,dLidS(1:3,1:3,p,o)) + call math_invert(9_pInt,math_identity2nd(9_pInt)+math_Plain3333to99(lhs_3333),temp_99,error) + if (error) then + call IO_warning(warning_ID=600_pInt,el=e,ip=i,g=c, & + ext_msg='inversion error in analytic tangent calculation') + dSdF = rhs_3333 + else + dSdF = math_mul3333xx3333(math_Plain99to3333(temp_99),rhs_3333) + endif - lhs_3333 = crystallite_subdt(c,i,e)*math_mul3333xx3333(dSdFe,temp_3333) + & - math_mul3333xx3333(dSdFi,dFidS) + dFpinvdF = 0.0_pReal + temp_3333 = math_mul3333xx3333(dLpdS,dSdF) + forall(p=1_pInt:3_pInt, o=1_pInt:3_pInt) & + dFpinvdF(1:3,1:3,p,o) = -crystallite_subdt(c,i,e)* & + math_mul33x33(math_inv33(crystallite_subFp0(1:3,1:3,c,i,e)), & + math_mul33x33(temp_3333(1:3,1:3,p,o), & + crystallite_invFi(1:3,1:3,c,i,e))) - call math_invert(9_pInt,math_identity2nd(9_pInt)+math_Plain3333to99(lhs_3333),temp_99,error) - if (error) then - call IO_warning(warning_ID=600_pInt,el=e,ip=i,g=c, & - ext_msg='inversion error in analytic tangent calculation') - dSdF = rhs_3333 - else - dSdF = math_mul3333xx3333(math_Plain99to3333(temp_99),rhs_3333) - endif + crystallite_dPdF(1:3,1:3,1:3,1:3,c,i,e) = 0.0_pReal + temp_33 = math_mul33x33(crystallite_invFp(1:3,1:3,c,i,e), & + math_mul33x33(math_Mandel6to33(crystallite_Tstar_v(1:6,c,i,e)), & + math_transpose33(crystallite_invFp(1:3,1:3,c,i,e)))) + forall(p=1_pInt:3_pInt) & + crystallite_dPdF(p,1:3,p,1:3,c,i,e) = math_transpose33(temp_33) - dFpinvdF = 0.0_pReal - temp_3333 = math_mul3333xx3333(dLpdS,dSdF) - forall(p=1_pInt:3_pInt, o=1_pInt:3_pInt) & - dFpinvdF(1:3,1:3,p,o) = -crystallite_subdt(c,i,e)* & - math_mul33x33(math_inv33(crystallite_subFp0(1:3,1:3,c,i,e)), & - math_mul33x33(temp_3333(1:3,1:3,p,o), & - crystallite_invFi(1:3,1:3,c,i,e))) + temp_33 = math_mul33x33(math_Mandel6to33(crystallite_Tstar_v(1:6,c,i,e)), & + math_transpose33(crystallite_invFp(1:3,1:3,c,i,e))) + forall(p=1_pInt:3_pInt, o=1_pInt:3_pInt) & + crystallite_dPdF(1:3,1:3,p,o,c,i,e) = crystallite_dPdF(1:3,1:3,p,o,c,i,e) + & + math_mul33x33(math_mul33x33(crystallite_subF(1:3,1:3,c,i,e),dFpinvdF(1:3,1:3,p,o)),temp_33) - crystallite_dPdF(1:3,1:3,1:3,1:3,c,i,e) = 0.0_pReal - temp_33 = math_mul33x33(crystallite_invFp(1:3,1:3,c,i,e), & - math_mul33x33(math_Mandel6to33(crystallite_Tstar_v(1:6,c,i,e)), & - math_transpose33(crystallite_invFp(1:3,1:3,c,i,e)))) - forall(p=1_pInt:3_pInt) & - crystallite_dPdF(p,1:3,p,1:3,c,i,e) = math_transpose33(temp_33) + temp_33 = math_mul33x33(crystallite_subF(1:3,1:3,c,i,e), & + crystallite_invFp(1:3,1:3,c,i,e)) + forall(p=1_pInt:3_pInt, o=1_pInt:3_pInt) & + crystallite_dPdF(1:3,1:3,p,o,c,i,e) = crystallite_dPdF(1:3,1:3,p,o,c,i,e) + & + math_mul33x33(math_mul33x33(temp_33,dSdF(1:3,1:3,p,o)), & + math_transpose33(crystallite_invFp(1:3,1:3,c,i,e))) - temp_33 = math_mul33x33(math_Mandel6to33(crystallite_Tstar_v(1:6,c,i,e)), & - math_transpose33(crystallite_invFp(1:3,1:3,c,i,e))) - forall(p=1_pInt:3_pInt, o=1_pInt:3_pInt) & - crystallite_dPdF(1:3,1:3,p,o,c,i,e) = crystallite_dPdF(1:3,1:3,p,o,c,i,e) + & - math_mul33x33(math_mul33x33(crystallite_subF(1:3,1:3,c,i,e),dFpinvdF(1:3,1:3,p,o)),temp_33) + temp_33 = math_mul33x33(math_mul33x33(crystallite_subF(1:3,1:3,c,i,e), & + crystallite_invFp(1:3,1:3,c,i,e)), & + math_Mandel6to33(crystallite_Tstar_v(1:6,c,i,e))) + forall(p=1_pInt:3_pInt, o=1_pInt:3_pInt) & + crystallite_dPdF(1:3,1:3,p,o,c,i,e) = crystallite_dPdF(1:3,1:3,p,o,c,i,e) + & + math_mul33x33(temp_33,math_transpose33(dFpinvdF(1:3,1:3,p,o))) - temp_33 = math_mul33x33(crystallite_subF(1:3,1:3,c,i,e), & - crystallite_invFp(1:3,1:3,c,i,e)) - forall(p=1_pInt:3_pInt, o=1_pInt:3_pInt) & - crystallite_dPdF(1:3,1:3,p,o,c,i,e) = crystallite_dPdF(1:3,1:3,p,o,c,i,e) + & - math_mul33x33(math_mul33x33(temp_33,dSdF(1:3,1:3,p,o)), & - math_transpose33(crystallite_invFp(1:3,1:3,c,i,e))) - - temp_33 = math_mul33x33(math_mul33x33(crystallite_subF(1:3,1:3,c,i,e), & - crystallite_invFp(1:3,1:3,c,i,e)), & - math_Mandel6to33(crystallite_Tstar_v(1:6,c,i,e))) - forall(p=1_pInt:3_pInt, o=1_pInt:3_pInt) & - crystallite_dPdF(1:3,1:3,p,o,c,i,e) = crystallite_dPdF(1:3,1:3,p,o,c,i,e) + & - math_mul33x33(temp_33,math_transpose33(dFpinvdF(1:3,1:3,p,o))) - - enddo; enddo - enddo elementLooping6 - !$OMP END PARALLEL DO - - else jacobianMethod - - ! --- STANDARD (PERTURBATION METHOD) FOR JACOBIAN --- - - numerics_integrationMode = 2_pInt - - ! --- BACKUP --- - allocate(dPdF_perturbation1(3,3,3,3,homogenization_maxNgrains,mesh_maxNips,mesh_NcpElems), source = 0.0_pReal) - allocate(dPdF_perturbation2(3,3,3,3,homogenization_maxNgrains,mesh_maxNips,mesh_NcpElems), source = 0.0_pReal) - allocate(F_backup (3,3, homogenization_maxNgrains,mesh_maxNips,mesh_NcpElems), source = 0.0_pReal) - allocate(Fp_backup (3,3, homogenization_maxNgrains,mesh_maxNips,mesh_NcpElems), source = 0.0_pReal) - allocate(InvFp_backup (3,3, homogenization_maxNgrains,mesh_maxNips,mesh_NcpElems), source = 0.0_pReal) - allocate(Fi_backup (3,3, homogenization_maxNgrains,mesh_maxNips,mesh_NcpElems), source = 0.0_pReal) - allocate(InvFi_backup (3,3, homogenization_maxNgrains,mesh_maxNips,mesh_NcpElems), source = 0.0_pReal) - allocate(Fe_backup (3,3, homogenization_maxNgrains,mesh_maxNips,mesh_NcpElems), source = 0.0_pReal) - allocate(Lp_backup (3,3, homogenization_maxNgrains,mesh_maxNips,mesh_NcpElems), source = 0.0_pReal) - allocate(Li_backup (3,3, homogenization_maxNgrains,mesh_maxNips,mesh_NcpElems), source = 0.0_pReal) - allocate(P_backup (3,3, homogenization_maxNgrains,mesh_maxNips,mesh_NcpElems), source = 0.0_pReal) - allocate(Tstar_v_backup (6, homogenization_maxNgrains,mesh_maxNips,mesh_NcpElems), source = 0.0_pReal) - allocate(convergenceFlag_backup (homogenization_maxNgrains,mesh_maxNips,mesh_NcpElems), source = .false.) - - !$OMP PARALLEL DO PRIVATE(myNcomponents) - elementLooping7: do e = FEsolving_execElem(1),FEsolving_execElem(2) - myNcomponents = homogenization_Ngrains(mesh_element(3,e)) - do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e); do c = 1,myNcomponents - - plasticState (phaseAt(c,i,e))%state_backup(:,phasememberAt(c,i,e)) = & - plasticState (phaseAt(c,i,e))%state( :,phasememberAt(c,i,e)) - do mySource = 1_pInt, phase_Nsources(phaseAt(c,i,e)) - sourceState(phaseAt(c,i,e))%p(mySource)%state_backup(:,phasememberAt(c,i,e)) = & - sourceState(phaseAt(c,i,e))%p(mySource)%state( :,phasememberAt(c,i,e)) - enddo - - plasticState (phaseAt(c,i,e))%dotState_backup(:,phasememberAt(c,i,e)) = & - plasticState (phaseAt(c,i,e))%dotState( :,phasememberAt(c,i,e)) - do mySource = 1_pInt, phase_Nsources(phaseAt(c,i,e)) - sourceState(phaseAt(c,i,e))%p(mySource)%dotState_backup(:,phasememberAt(c,i,e)) = & - sourceState(phaseAt(c,i,e))%p(mySource)%dotState( :,phasememberAt(c,i,e)) - enddo - - F_backup(1:3,1:3,c,i,e) = crystallite_subF(1:3,1:3,c,i,e) ! ... and kinematics - Fp_backup(1:3,1:3,c,i,e) = crystallite_Fp(1:3,1:3,c,i,e) - InvFp_backup(1:3,1:3,c,i,e) = crystallite_invFp(1:3,1:3,c,i,e) - Fi_backup(1:3,1:3,c,i,e) = crystallite_Fi(1:3,1:3,c,i,e) - InvFi_backup(1:3,1:3,c,i,e) = crystallite_invFi(1:3,1:3,c,i,e) - Fe_backup(1:3,1:3,c,i,e) = crystallite_Fe(1:3,1:3,c,i,e) - Lp_backup(1:3,1:3,c,i,e) = crystallite_Lp(1:3,1:3,c,i,e) - Li_backup(1:3,1:3,c,i,e) = crystallite_Li(1:3,1:3,c,i,e) - Tstar_v_backup(1:6,c,i,e) = crystallite_Tstar_v(1:6,c,i,e) - P_backup(1:3,1:3,c,i,e) = crystallite_P(1:3,1:3,c,i,e) - convergenceFlag_backup(c,i,e) = crystallite_converged(c,i,e) - enddo; enddo - enddo elementLooping7 - !$END PARALLEL DO - ! --- CALCULATE STATE AND STRESS FOR PERTURBATION --- - - dPdF_perturbation1 = crystallite_dPdF0 ! initialize stiffness with known good values from last increment - dPdF_perturbation2 = crystallite_dPdF0 ! initialize stiffness with known good values from last increment - pertubationLoop: do perturbation = 1,2 ! forward and backward perturbation - if (iand(pert_method,perturbation) > 0_pInt) then ! mask for desired direction - myPert = -pert_Fg * (-1.0_pReal)**perturbation ! set perturbation step - do k = 1,3; do l = 1,3 ! ...alter individual components - if (iand(debug_level(debug_crystallite), debug_levelExtensive) /= 0_pInt & - .and. ((e == debug_e .and. i == debug_i .and. c == debug_g) & - .or. .not. iand(debug_level(debug_crystallite),debug_levelSelective) /= 0_pInt)) & - write(6,'(a,2(1x,i1),1x,a,/)') '<< CRYST >> [[[[[[ Stiffness perturbation',k,l,']]]]]]' - ! --- INITIALIZE UNPERTURBED STATE --- - - select case(numerics_integrator(numerics_integrationMode)) - case(1_pInt) -!why not OMP? ! Fix-point method: restore to last converged state at end of subinc, since this is probably closest to perturbed state - do e = FEsolving_execElem(1),FEsolving_execElem(2) - myNcomponents = homogenization_Ngrains(mesh_element(3,e)) - do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e); do c = 1,myNcomponents - - plasticState (phaseAt(c,i,e))%state( :,phasememberAt(c,i,e)) = & - plasticState (phaseAt(c,i,e))%state_backup(:,phasememberAt(c,i,e)) - do mySource = 1_pInt, phase_Nsources(phaseAt(c,i,e)) - sourceState(phaseAt(c,i,e))%p(mySource)%state( :,phasememberAt(c,i,e)) = & - sourceState(phaseAt(c,i,e))%p(mySource)%state_backup(:,phasememberAt(c,i,e)) - enddo - - plasticState (phaseAt(c,i,e))%dotState( :,phasememberAt(c,i,e)) = & - plasticState (phaseAt(c,i,e))%dotState_backup(:,phasememberAt(c,i,e)) - do mySource = 1_pInt, phase_Nsources(phaseAt(c,i,e)) - sourceState(phaseAt(c,i,e))%p(mySource)%dotState( :,phasememberAt(c,i,e)) = & - sourceState(phaseAt(c,i,e))%p(mySource)%dotState_backup(:,phasememberAt(c,i,e)) - enddo - - crystallite_Fp(1:3,1:3,c,i,e) = Fp_backup(1:3,1:3,c,i,e) - crystallite_invFp(1:3,1:3,c,i,e) = InvFp_backup(1:3,1:3,c,i,e) - crystallite_Fi(1:3,1:3,c,i,e) = Fi_backup(1:3,1:3,c,i,e) - crystallite_invFi(1:3,1:3,c,i,e) = InvFi_backup(1:3,1:3,c,i,e) - crystallite_Fe(1:3,1:3,c,i,e) = Fe_backup(1:3,1:3,c,i,e) - crystallite_Lp(1:3,1:3,c,i,e) = Lp_backup(1:3,1:3,c,i,e) - crystallite_Li(1:3,1:3,c,i,e) = Li_backup(1:3,1:3,c,i,e) - crystallite_Tstar_v(1:6,c,i,e) = Tstar_v_backup(1:6,c,i,e) - enddo; enddo - enddo - case(2_pInt,3_pInt) ! explicit Euler methods: nothing to restore (except for F), since we are only doing a stress integration step - case(4_pInt,5_pInt) -!why not OMP? ! explicit Runge-Kutta methods: restore to start of subinc, since we are doing a full integration of state and stress - do e = FEsolving_execElem(1),FEsolving_execElem(2) - myNcomponents = homogenization_Ngrains(mesh_element(3,e)) - do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e); do c = 1,myNcomponents - - plasticState (phaseAt(c,i,e))%state( :,phasememberAt(c,i,e)) = & - plasticState (phaseAt(c,i,e))%subState0(:,phasememberAt(c,i,e)) - do mySource = 1_pInt, phase_Nsources(phaseAt(c,i,e)) - sourceState(phaseAt(c,i,e))%p(mySource)%state( :,phasememberAt(c,i,e)) = & - sourceState(phaseAt(c,i,e))%p(mySource)%subState0(:,phasememberAt(c,i,e)) - enddo - - plasticState (phaseAt(c,i,e))%dotState( :,phasememberAt(c,i,e)) = & - plasticState (phaseAt(c,i,e))%dotState_backup(:,phasememberAt(c,i,e)) - do mySource = 1_pInt, phase_Nsources(phaseAt(c,i,e)) - sourceState(phaseAt(c,i,e))%p(mySource)%dotState( :,phasememberAt(c,i,e)) = & - sourceState(phaseAt(c,i,e))%p(mySource)%dotState_backup(:,phasememberAt(c,i,e)) - enddo - - crystallite_Fp(1:3,1:3,c,i,e) = crystallite_subFp0(1:3,1:3,c,i,e) - crystallite_Fi(1:3,1:3,c,i,e) = crystallite_subFi0(1:3,1:3,c,i,e) - crystallite_Fe(1:3,1:3,c,i,e) = crystallite_subFe0(1:3,1:3,c,i,e) - crystallite_Lp(1:3,1:3,c,i,e) = crystallite_subLp0(1:3,1:3,c,i,e) - crystallite_Li(1:3,1:3,c,i,e) = crystallite_subLi0(1:3,1:3,c,i,e) - crystallite_Tstar_v(1:6,c,i,e) = crystallite_subTstar0_v(1:6,c,i,e) - enddo; enddo - enddo - end select - - ! --- PERTURB EITHER FORWARD OR BACKWARD --- -!why not OMP? - do e = FEsolving_execElem(1),FEsolving_execElem(2) - myNcomponents = homogenization_Ngrains(mesh_element(3,e)) - do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e) - do c = 1,myNcomponents - crystallite_subF(1:3,1:3,c,i,e) = F_backup(1:3,1:3,c,i,e) - crystallite_subF(k,l,c,i,e) = crystallite_subF(k,l,c,i,e) + myPert - crystallite_todo(c,i,e) = crystallite_requested(c,i,e) & - .and. convergenceFlag_backup(c,i,e) - if (crystallite_todo(c,i,e)) crystallite_converged(c,i,e) = .false. ! start out non-converged - enddo; enddo; enddo - - - select case(numerics_integrator(numerics_integrationMode)) - case(1_pInt) - call crystallite_integrateStateFPI() - case(2_pInt) - call crystallite_integrateStateEuler() - case(3_pInt) - call crystallite_integrateStateAdaptiveEuler() - case(4_pInt) - call crystallite_integrateStateRK4() - case(5_pInt) - call crystallite_integrateStateRKCK45() - end select - !why not OMP? - elementLooping8: do e = FEsolving_execElem(1),FEsolving_execElem(2) - myNcomponents = homogenization_Ngrains(mesh_element(3,e)) - select case(perturbation) - case(1_pInt) - forall (i = FEsolving_execIP(1,e):FEsolving_execIP(2,e), c = 1:myNcomponents, & - crystallite_requested(c,i,e) .and. crystallite_converged(c,i,e)) & ! converged state warrants stiffness update - dPdF_perturbation1(1:3,1:3,k,l,c,i,e) = & - (crystallite_P(1:3,1:3,c,i,e) - P_backup(1:3,1:3,c,i,e)) / myPert ! tangent dP_ij/dFg_kl - case(2_pInt) - forall (i = FEsolving_execIP(1,e):FEsolving_execIP(2,e), c = 1:myNcomponents, & - crystallite_requested(c,i,e) .and. crystallite_converged(c,i,e)) & ! converged state warrants stiffness update - dPdF_perturbation2(1:3,1:3,k,l,c,i,e) = & - (crystallite_P(1:3,1:3,c,i,e) - P_backup(1:3,1:3,c,i,e)) / myPert ! tangent dP_ij/dFg_kl - end select - enddo elementLooping8 - - enddo; enddo ! k,l component perturbation loop - - endif - enddo pertubationLoop - - ! --- STIFFNESS ACCORDING TO PERTURBATION METHOD AND CONVERGENCE --- - - elementLooping9: do e = FEsolving_execElem(1),FEsolving_execElem(2) - myNcomponents = homogenization_Ngrains(mesh_element(3,e)) - select case(pert_method) - case(1_pInt) - forall (i = FEsolving_execIP(1,e):FEsolving_execIP(2,e), c = 1:myNcomponents, & - crystallite_requested(c,i,e) .and. convergenceFlag_backup(c,i,e)) & ! perturbation mode 1: central solution converged - crystallite_dPdF(1:3,1:3,1:3,1:3,c,i,e) = dPdF_perturbation1(1:3,1:3,1:3,1:3,c,i,e) - case(2_pInt) - forall (i = FEsolving_execIP(1,e):FEsolving_execIP(2,e), c = 1:myNcomponents, & - crystallite_requested(c,i,e) .and. convergenceFlag_backup(c,i,e)) & ! perturbation mode 2: central solution converged - crystallite_dPdF(1:3,1:3,1:3,1:3,c,i,e) = dPdF_perturbation2(1:3,1:3,1:3,1:3,c,i,e) - case(3_pInt) - forall (i = FEsolving_execIP(1,e):FEsolving_execIP(2,e), c = 1:myNcomponents, & - crystallite_requested(c,i,e) .and. convergenceFlag_backup(c,i,e)) & ! perturbation mode 3: central solution converged - crystallite_dPdF(1:3,1:3,1:3,1:3,c,i,e) = 0.5_pReal* ( dPdF_perturbation1(1:3,1:3,1:3,1:3,c,i,e) & - + dPdF_perturbation2(1:3,1:3,1:3,1:3,c,i,e)) - end select - forall (i = FEsolving_execIP(1,e):FEsolving_execIP(2,e), c = 1:myNcomponents, & - crystallite_requested(c,i,e) .and. .not. convergenceFlag_backup(c,i,e)) & ! for any pertubation mode: if central solution did not converge... - crystallite_dPdF(1:3,1:3,1:3,1:3,c,i,e) = crystallite_fallbackdPdF(1:3,1:3,1:3,1:3,c,i,e) ! ...use (elastic) fallback - enddo elementLooping9 - - ! --- RESTORE --- -!why not OMP? - elementLooping10: do e = FEsolving_execElem(1),FEsolving_execElem(2) - myNcomponents = homogenization_Ngrains(mesh_element(3,e)) - do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e); do c = 1,myNcomponents - - plasticState (phaseAt(c,i,e))%state( :,phasememberAt(c,i,e)) = & - plasticState (phaseAt(c,i,e))%state_backup(:,phasememberAt(c,i,e)) - do mySource = 1_pInt, phase_Nsources(phaseAt(c,i,e)) - sourceState(phaseAt(c,i,e))%p(mySource)%state( :,phasememberAt(c,i,e)) = & - sourceState(phaseAt(c,i,e))%p(mySource)%state_backup(:,phasememberAt(c,i,e)) - enddo - - plasticState (phaseAt(c,i,e))%dotState( :,phasememberAt(c,i,e)) = & - plasticState (phaseAt(c,i,e))%dotState_backup(:,phasememberAt(c,i,e)) - do mySource = 1_pInt, phase_Nsources(phaseAt(c,i,e)) - sourceState(phaseAt(c,i,e))%p(mySource)%dotState( :,phasememberAt(c,i,e)) = & - sourceState(phaseAt(c,i,e))%p(mySource)%dotState_backup(:,phasememberAt(c,i,e)) - enddo - - crystallite_subF(1:3,1:3,c,i,e) = F_backup(1:3,1:3,c,i,e) - crystallite_Fp(1:3,1:3,c,i,e) = Fp_backup(1:3,1:3,c,i,e) - crystallite_invFp(1:3,1:3,c,i,e) = InvFp_backup(1:3,1:3,c,i,e) - crystallite_Fi(1:3,1:3,c,i,e) = Fi_backup(1:3,1:3,c,i,e) - crystallite_invFi(1:3,1:3,c,i,e) = InvFi_backup(1:3,1:3,c,i,e) - crystallite_Fe(1:3,1:3,c,i,e) = Fe_backup(1:3,1:3,c,i,e) - crystallite_Lp(1:3,1:3,c,i,e) = Lp_backup(1:3,1:3,c,i,e) - crystallite_Li(1:3,1:3,c,i,e) = Li_backup(1:3,1:3,c,i,e) - crystallite_Tstar_v(1:6,c,i,e) = Tstar_v_backup(1:6,c,i,e) - crystallite_P(1:3,1:3,c,i,e) = P_backup(1:3,1:3,c,i,e) - crystallite_converged(c,i,e) = convergenceFlag_backup(c,i,e) - enddo; enddo - enddo elementLooping10 - - deallocate(dPdF_perturbation1) - deallocate(dPdF_perturbation2) - deallocate(F_backup ) - deallocate(Fp_backup ) - deallocate(InvFp_backup ) - deallocate(Fi_backup ) - deallocate(InvFi_backup ) - deallocate(Fe_backup ) - deallocate(Lp_backup ) - deallocate(Li_backup ) - deallocate(P_backup ) - deallocate(Tstar_v_backup ) - deallocate(convergenceFlag_backup) - - endif jacobianMethod + enddo; enddo + enddo elementLooping6 + !$OMP END PARALLEL DO endif computeJacobian !why not OMP? From faf44c07540739357a264b49f601df743e16051b Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 25 Jul 2016 20:12:00 +0200 Subject: [PATCH 110/412] removed allocation for (dot)state backup, simplified screen output handling for MPI --- code/plastic_disloUCLA.f90 | 12 ++---------- code/plastic_dislotwin.f90 | 12 ++---------- code/plastic_isotropic.f90 | 12 ++---------- code/plastic_none.f90 | 7 ++----- code/plastic_nonlocal.f90 | 12 ++---------- code/plastic_phenoplus.f90 | 12 ++---------- code/plastic_phenopowerlaw.f90 | 12 ++---------- code/plastic_titanmod.f90 | 12 ++---------- code/source_damage_anisoBrittle.f90 | 12 ++---------- code/source_damage_anisoDuctile.f90 | 12 ++---------- code/source_damage_isoBrittle.f90 | 12 ++---------- code/source_damage_isoDuctile.f90 | 12 ++---------- code/source_thermal_dissipation.f90 | 12 ++---------- code/source_thermal_externalheat.f90 | 12 ++---------- code/source_vacancy_irradiation.f90 | 12 ++---------- code/source_vacancy_phenoplasticity.f90 | 12 ++---------- code/source_vacancy_thermalfluc.f90 | 12 ++---------- 17 files changed, 34 insertions(+), 165 deletions(-) diff --git a/code/plastic_disloUCLA.f90 b/code/plastic_disloUCLA.f90 index 0e7105c70..e91883173 100644 --- a/code/plastic_disloUCLA.f90 +++ b/code/plastic_disloUCLA.f90 @@ -152,8 +152,6 @@ subroutine plastic_disloUCLA_init(fileUnit) MATERIAL_partPhase use lattice use numerics,only: & - analyticJaco, & - worldrank, & numerics_integrator implicit none @@ -173,11 +171,9 @@ subroutine plastic_disloUCLA_init(fileUnit) line = '' real(pReal), dimension(:), allocatable :: tempPerSlip - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_DISLOUCLA_label//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_DISLOUCLA_label//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess maxNinstance = int(count(phase_plasticity == PLASTICITY_DISLOUCLA_ID),pInt) if (maxNinstance == 0_pInt) return @@ -498,10 +494,6 @@ subroutine plastic_disloUCLA_init(fileUnit) allocate(plasticState(phase)%dotState (sizeDotState,NofMyPhase), source=0.0_pReal) allocate(plasticState(phase)%deltaState (sizeDeltaState,NofMyPhase), source=0.0_pReal) - if (.not. analyticJaco) then - allocate(plasticState(phase)%state_backup (sizeState,NofMyPhase), source=0.0_pReal) - allocate(plasticState(phase)%dotState_backup (sizeDotState,NofMyPhase), source=0.0_pReal) - endif if (any(numerics_integrator == 1_pInt)) then allocate(plasticState(phase)%previousDotState (sizeDotState,NofMyPhase), source=0.0_pReal) allocate(plasticState(phase)%previousDotState2 (sizeDotState,NofMyPhase), source=0.0_pReal) diff --git a/code/plastic_dislotwin.f90 b/code/plastic_dislotwin.f90 index 0902ecad6..e205f5abb 100644 --- a/code/plastic_dislotwin.f90 +++ b/code/plastic_dislotwin.f90 @@ -238,8 +238,6 @@ subroutine plastic_dislotwin_init(fileUnit) MATERIAL_partPhase use lattice use numerics,only: & - analyticJaco, & - worldrank, & numerics_integrator implicit none @@ -261,11 +259,9 @@ subroutine plastic_dislotwin_init(fileUnit) line = '' real(pReal), dimension(:), allocatable :: tempPerSlip, tempPerTwin, tempPerTrans - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_DISLOTWIN_label//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_DISLOTWIN_label//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess maxNinstance = int(count(phase_plasticity == PLASTICITY_DISLOTWIN_ID),pInt) if (maxNinstance == 0_pInt) return @@ -930,10 +926,6 @@ subroutine plastic_dislotwin_init(fileUnit) allocate(plasticState(phase)%dotState (sizeDotState,NofMyPhase), source=0.0_pReal) allocate(plasticState(phase)%deltaState (sizeDeltaState,NofMyPhase), source=0.0_pReal) - if (.not. analyticJaco) then - allocate(plasticState(phase)%state_backup (sizeState,NofMyPhase), source=0.0_pReal) - allocate(plasticState(phase)%dotState_backup (sizeDotState,NofMyPhase), source=0.0_pReal) - endif if (any(numerics_integrator == 1_pInt)) then allocate(plasticState(phase)%previousDotState (sizeDotState,NofMyPhase), source=0.0_pReal) allocate(plasticState(phase)%previousDotState2 (sizeDotState,NofMyPhase), source=0.0_pReal) diff --git a/code/plastic_isotropic.f90 b/code/plastic_isotropic.f90 index 7d3e1aa7c..9f8129fac 100644 --- a/code/plastic_isotropic.f90 +++ b/code/plastic_isotropic.f90 @@ -94,8 +94,6 @@ subroutine plastic_isotropic_init(fileUnit) debug_constitutive, & debug_levelBasic use numerics, only: & - analyticJaco, & - worldrank, & numerics_integrator use math, only: & math_Mandel3333to66, & @@ -145,11 +143,9 @@ subroutine plastic_isotropic_init(fileUnit) outputtag = '' integer(pInt) :: NipcMyPhase - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_ISOTROPIC_label//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_ISOTROPIC_label//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess maxNinstance = int(count(phase_plasticity == PLASTICITY_ISOTROPIC_ID),pInt) if (maxNinstance == 0_pInt) return @@ -316,10 +312,6 @@ subroutine plastic_isotropic_init(fileUnit) allocate(plasticState(phase)%state ( sizeState,NipcMyPhase),source=0.0_pReal) allocate(plasticState(phase)%dotState (sizeDotState,NipcMyPhase),source=0.0_pReal) allocate(plasticState(phase)%deltaState (sizeDeltaState,NipcMyPhase),source=0.0_pReal) - if (.not. analyticJaco) then - allocate(plasticState(phase)%state_backup ( sizeState,NipcMyPhase),source=0.0_pReal) - allocate(plasticState(phase)%dotState_backup (sizeDotState,NipcMyPhase),source=0.0_pReal) - endif if (any(numerics_integrator == 1_pInt)) then allocate(plasticState(phase)%previousDotState (sizeDotState,NipcMyPhase),source=0.0_pReal) allocate(plasticState(phase)%previousDotState2(sizeDotState,NipcMyPhase),source=0.0_pReal) diff --git a/code/plastic_none.f90 b/code/plastic_none.f90 index a9007667f..34570ceab 100644 --- a/code/plastic_none.f90 +++ b/code/plastic_none.f90 @@ -34,7 +34,6 @@ subroutine plastic_none_init use IO, only: & IO_timeStamp use numerics, only: & - worldrank, & numerics_integrator use material, only: & phase_plasticity, & @@ -53,11 +52,9 @@ subroutine plastic_none_init sizeDotState, & sizeDeltaState - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_NONE_label//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_NONE_label//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess maxNinstance = int(count(phase_plasticity == PLASTICITY_none_ID),pInt) if (maxNinstance == 0_pInt) return diff --git a/code/plastic_nonlocal.f90 b/code/plastic_nonlocal.f90 index a6c7acad1..cb2b31772 100644 --- a/code/plastic_nonlocal.f90 +++ b/code/plastic_nonlocal.f90 @@ -295,8 +295,6 @@ use material, only: phase_plasticity, & material_phase use lattice use numerics,only: & - analyticJaco, & - worldrank, & numerics_integrator @@ -332,11 +330,9 @@ integer(pInt) :: phase, & integer(pInt) :: NofMyPhase - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_NONLOCAL_label//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_NONLOCAL_label//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess maxNinstances = int(count(phase_plasticity == PLASTICITY_NONLOCAL_ID),pInt) if (maxNinstances == 0) return ! we don't have to do anything if there's no instance for this constitutive law @@ -1310,10 +1306,6 @@ allocate(nonSchmidProjection(3,3,4,maxTotalNslip,maxNinstances), allocate(plasticState(phase)%dotState (sizeDotState,NofMyPhase), source=0.0_pReal) allocate(plasticState(phase)%deltaState (sizeDeltaState,NofMyPhase), source=0.0_pReal) - if (.not. analyticJaco) then - allocate(plasticState(phase)%state_backup (sizeState,NofMyPhase), source=0.0_pReal) - allocate(plasticState(phase)%dotState_backup (sizeDotState,NofMyPhase), source=0.0_pReal) - endif if (any(numerics_integrator == 1_pInt)) then allocate(plasticState(phase)%previousDotState (sizeDotState,NofMyPhase), source=0.0_pReal) allocate(plasticState(phase)%previousDotState2 (sizeDotState,NofMyPhase), source=0.0_pReal) diff --git a/code/plastic_phenoplus.f90 b/code/plastic_phenoplus.f90 index 5df3d490b..b9d09fb3d 100644 --- a/code/plastic_phenoplus.f90 +++ b/code/plastic_phenoplus.f90 @@ -145,8 +145,6 @@ subroutine plastic_phenoplus_init(fileUnit) MATERIAL_partPhase use lattice use numerics,only: & - analyticJaco, & - worldrank, & numerics_integrator implicit none @@ -168,11 +166,9 @@ subroutine plastic_phenoplus_init(fileUnit) line = '' real(pReal), dimension(:), allocatable :: tempPerSlip - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_PHENOPLUS_label//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_PHENOPLUS_label//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess maxNinstance = int(count(phase_plasticity == PLASTICITY_PHENOPLUS_ID),pInt) if (maxNinstance == 0_pInt) return @@ -589,10 +585,6 @@ subroutine plastic_phenoplus_init(fileUnit) allocate(plasticState(phase)%state ( sizeState,NipcMyPhase), source=0.0_pReal) allocate(plasticState(phase)%dotState (sizeDotState,NipcMyPhase), source=0.0_pReal) allocate(plasticState(phase)%deltaState (sizeDeltaState,NipcMyPhase), source=0.0_pReal) - if (.not. analyticJaco) then - allocate(plasticState(phase)%state_backup ( sizeState,NipcMyPhase),source=0.0_pReal) - allocate(plasticState(phase)%dotState_backup (sizeDotState,NipcMyPhase),source=0.0_pReal) - endif if (any(numerics_integrator == 1_pInt)) then allocate(plasticState(phase)%previousDotState (sizeDotState,NipcMyPhase),source=0.0_pReal) allocate(plasticState(phase)%previousDotState2(sizeDotState,NipcMyPhase),source=0.0_pReal) diff --git a/code/plastic_phenopowerlaw.f90 b/code/plastic_phenopowerlaw.f90 index 12debbb23..0db6a6072 100644 --- a/code/plastic_phenopowerlaw.f90 +++ b/code/plastic_phenopowerlaw.f90 @@ -157,8 +157,6 @@ subroutine plastic_phenopowerlaw_init(fileUnit) MATERIAL_partPhase use lattice use numerics,only: & - analyticJaco, & - worldrank, & numerics_integrator implicit none @@ -181,11 +179,9 @@ subroutine plastic_phenopowerlaw_init(fileUnit) line = '' real(pReal), dimension(:), allocatable :: tempPerSlip - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_PHENOPOWERLAW_label//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_PHENOPOWERLAW_label//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess maxNinstance = int(count(phase_plasticity == PLASTICITY_PHENOPOWERLAW_ID),pInt) if (maxNinstance == 0_pInt) return @@ -587,10 +583,6 @@ subroutine plastic_phenopowerlaw_init(fileUnit) allocate(plasticState(phase)%state ( sizeState,NipcMyPhase), source=0.0_pReal) allocate(plasticState(phase)%dotState (sizeDotState,NipcMyPhase), source=0.0_pReal) allocate(plasticState(phase)%deltaState (sizeDeltaState,NipcMyPhase), source=0.0_pReal) - if (.not. analyticJaco) then - allocate(plasticState(phase)%state_backup ( sizeState,NipcMyPhase),source=0.0_pReal) - allocate(plasticState(phase)%dotState_backup (sizeDotState,NipcMyPhase),source=0.0_pReal) - endif if (any(numerics_integrator == 1_pInt)) then allocate(plasticState(phase)%previousDotState (sizeDotState,NipcMyPhase),source=0.0_pReal) allocate(plasticState(phase)%previousDotState2(sizeDotState,NipcMyPhase),source=0.0_pReal) diff --git a/code/plastic_titanmod.f90 b/code/plastic_titanmod.f90 index 24bf543b7..ac80af82b 100644 --- a/code/plastic_titanmod.f90 +++ b/code/plastic_titanmod.f90 @@ -216,8 +216,6 @@ subroutine plastic_titanmod_init(fileUnit) MATERIAL_partPhase use lattice use numerics,only: & - analyticJaco, & - worldrank, & numerics_integrator implicit none @@ -241,11 +239,9 @@ subroutine plastic_titanmod_init(fileUnit) tag = '', & line = '' - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_TITANMOD_label//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_TITANMOD_label//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess maxNinstance = int(count(phase_plasticity == PLASTICITY_TITANMOD_ID),pInt) if (maxNinstance == 0_pInt) return @@ -859,10 +855,6 @@ subroutine plastic_titanmod_init(fileUnit) allocate(plasticState(phase)%dotState (sizeDotState,NofMyPhase), source=0.0_pReal) allocate(plasticState(phase)%deltaState (sizeDeltaState,NofMyPhase), source=0.0_pReal) - if (.not. analyticJaco) then - allocate(plasticState(phase)%state_backup (sizeState,NofMyPhase), source=0.0_pReal) - allocate(plasticState(phase)%dotState_backup (sizeDotState,NofMyPhase), source=0.0_pReal) - endif if (any(numerics_integrator == 1_pInt)) then allocate(plasticState(phase)%previousDotState (sizeDotState,NofMyPhase), source=0.0_pReal) allocate(plasticState(phase)%previousDotState2 (sizeDotState,NofMyPhase), source=0.0_pReal) diff --git a/code/source_damage_anisoBrittle.f90 b/code/source_damage_anisoBrittle.f90 index efd76091e..53cc411af 100644 --- a/code/source_damage_anisoBrittle.f90 +++ b/code/source_damage_anisoBrittle.f90 @@ -92,8 +92,6 @@ subroutine source_damage_anisoBrittle_init(fileUnit) sourceState, & MATERIAL_partPhase use numerics,only: & - analyticJaco, & - worldrank, & numerics_integrator use lattice, only: & lattice_maxNcleavageFamily, & @@ -111,11 +109,9 @@ subroutine source_damage_anisoBrittle_init(fileUnit) tag = '', & line = '' - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- source_'//SOURCE_damage_anisoBrittle_LABEL//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- source_'//SOURCE_damage_anisoBrittle_LABEL//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess maxNinstance = int(count(phase_source == SOURCE_damage_anisoBrittle_ID),pInt) if (maxNinstance == 0_pInt) return @@ -268,10 +264,6 @@ subroutine source_damage_anisoBrittle_init(fileUnit) allocate(sourceState(phase)%p(sourceOffset)%dotState (sizeDotState,NofMyPhase), source=0.0_pReal) allocate(sourceState(phase)%p(sourceOffset)%deltaState (sizeDeltaState,NofMyPhase), source=0.0_pReal) - if (.not. analyticJaco) then - allocate(sourceState(phase)%p(sourceOffset)%state_backup (sizeState,NofMyPhase), source=0.0_pReal) - allocate(sourceState(phase)%p(sourceOffset)%dotState_backup (sizeDotState,NofMyPhase), source=0.0_pReal) - endif if (any(numerics_integrator == 1_pInt)) then allocate(sourceState(phase)%p(sourceOffset)%previousDotState (sizeDotState,NofMyPhase), source=0.0_pReal) allocate(sourceState(phase)%p(sourceOffset)%previousDotState2 (sizeDotState,NofMyPhase), source=0.0_pReal) diff --git a/code/source_damage_anisoDuctile.f90 b/code/source_damage_anisoDuctile.f90 index 72480382a..1a79e3b34 100644 --- a/code/source_damage_anisoDuctile.f90 +++ b/code/source_damage_anisoDuctile.f90 @@ -96,8 +96,6 @@ subroutine source_damage_anisoDuctile_init(fileUnit) sourceState, & MATERIAL_partPhase use numerics,only: & - analyticJaco, & - worldrank, & numerics_integrator use lattice, only: & lattice_maxNslipFamily, & @@ -115,11 +113,9 @@ subroutine source_damage_anisoDuctile_init(fileUnit) tag = '', & line = '' - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- source_'//SOURCE_damage_anisoDuctile_LABEL//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- source_'//SOURCE_damage_anisoDuctile_LABEL//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess maxNinstance = int(count(phase_source == SOURCE_damage_anisoDuctile_ID),pInt) if (maxNinstance == 0_pInt) return @@ -270,10 +266,6 @@ subroutine source_damage_anisoDuctile_init(fileUnit) allocate(sourceState(phase)%p(sourceOffset)%dotState (sizeDotState,NofMyPhase), source=0.0_pReal) allocate(sourceState(phase)%p(sourceOffset)%deltaState (sizeDeltaState,NofMyPhase), source=0.0_pReal) - if (.not. analyticJaco) then - allocate(sourceState(phase)%p(sourceOffset)%state_backup (sizeState,NofMyPhase), source=0.0_pReal) - allocate(sourceState(phase)%p(sourceOffset)%dotState_backup (sizeDotState,NofMyPhase), source=0.0_pReal) - endif if (any(numerics_integrator == 1_pInt)) then allocate(sourceState(phase)%p(sourceOffset)%previousDotState (sizeDotState,NofMyPhase), source=0.0_pReal) allocate(sourceState(phase)%p(sourceOffset)%previousDotState2 (sizeDotState,NofMyPhase), source=0.0_pReal) diff --git a/code/source_damage_isoBrittle.f90 b/code/source_damage_isoBrittle.f90 index 1603ecf48..18194618e 100644 --- a/code/source_damage_isoBrittle.f90 +++ b/code/source_damage_isoBrittle.f90 @@ -82,8 +82,6 @@ subroutine source_damage_isoBrittle_init(fileUnit) sourceState, & MATERIAL_partPhase use numerics,only: & - analyticJaco, & - worldrank, & numerics_integrator implicit none @@ -97,11 +95,9 @@ subroutine source_damage_isoBrittle_init(fileUnit) tag = '', & line = '' - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- source_'//SOURCE_damage_isoBrittle_label//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- source_'//SOURCE_damage_isoBrittle_label//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess maxNinstance = int(count(phase_source == SOURCE_damage_isoBrittle_ID),pInt) if (maxNinstance == 0_pInt) return @@ -222,10 +218,6 @@ subroutine source_damage_isoBrittle_init(fileUnit) allocate(sourceState(phase)%p(sourceOffset)%dotState (sizeDotState,NofMyPhase), source=0.0_pReal) allocate(sourceState(phase)%p(sourceOffset)%deltaState (sizeDeltaState,NofMyPhase), source=0.0_pReal) - if (.not. analyticJaco) then - allocate(sourceState(phase)%p(sourceOffset)%state_backup (sizeState,NofMyPhase), source=0.0_pReal) - allocate(sourceState(phase)%p(sourceOffset)%dotState_backup (sizeDotState,NofMyPhase), source=0.0_pReal) - endif if (any(numerics_integrator == 1_pInt)) then allocate(sourceState(phase)%p(sourceOffset)%previousDotState (sizeDotState,NofMyPhase), source=0.0_pReal) allocate(sourceState(phase)%p(sourceOffset)%previousDotState2 (sizeDotState,NofMyPhase), source=0.0_pReal) diff --git a/code/source_damage_isoDuctile.f90 b/code/source_damage_isoDuctile.f90 index 3a85bab24..f30f9a72e 100644 --- a/code/source_damage_isoDuctile.f90 +++ b/code/source_damage_isoDuctile.f90 @@ -82,8 +82,6 @@ subroutine source_damage_isoDuctile_init(fileUnit) sourceState, & MATERIAL_partPhase use numerics,only: & - analyticJaco, & - worldrank, & numerics_integrator implicit none @@ -97,11 +95,9 @@ subroutine source_damage_isoDuctile_init(fileUnit) tag = '', & line = '' - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- source_'//SOURCE_damage_isoDuctile_label//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- source_'//SOURCE_damage_isoDuctile_label//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess maxNinstance = int(count(phase_source == SOURCE_damage_isoDuctile_ID),pInt) if (maxNinstance == 0_pInt) return @@ -222,10 +218,6 @@ subroutine source_damage_isoDuctile_init(fileUnit) allocate(sourceState(phase)%p(sourceOffset)%dotState (sizeDotState,NofMyPhase), source=0.0_pReal) allocate(sourceState(phase)%p(sourceOffset)%deltaState (sizeDeltaState,NofMyPhase), source=0.0_pReal) - if (.not. analyticJaco) then - allocate(sourceState(phase)%p(sourceOffset)%state_backup (sizeState,NofMyPhase), source=0.0_pReal) - allocate(sourceState(phase)%p(sourceOffset)%dotState_backup (sizeDotState,NofMyPhase), source=0.0_pReal) - endif if (any(numerics_integrator == 1_pInt)) then allocate(sourceState(phase)%p(sourceOffset)%previousDotState (sizeDotState,NofMyPhase), source=0.0_pReal) allocate(sourceState(phase)%p(sourceOffset)%previousDotState2 (sizeDotState,NofMyPhase), source=0.0_pReal) diff --git a/code/source_thermal_dissipation.f90 b/code/source_thermal_dissipation.f90 index dd6453db0..d649549ad 100644 --- a/code/source_thermal_dissipation.f90 +++ b/code/source_thermal_dissipation.f90 @@ -68,8 +68,6 @@ subroutine source_thermal_dissipation_init(fileUnit) sourceState, & MATERIAL_partPhase use numerics,only: & - analyticJaco, & - worldrank, & numerics_integrator implicit none @@ -83,11 +81,9 @@ subroutine source_thermal_dissipation_init(fileUnit) tag = '', & line = '' - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- source_'//SOURCE_thermal_dissipation_label//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- source_'//SOURCE_thermal_dissipation_label//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess maxNinstance = int(count(phase_source == SOURCE_thermal_dissipation_ID),pInt) if (maxNinstance == 0_pInt) return @@ -163,10 +159,6 @@ subroutine source_thermal_dissipation_init(fileUnit) allocate(sourceState(phase)%p(sourceOffset)%dotState (sizeDotState,NofMyPhase), source=0.0_pReal) allocate(sourceState(phase)%p(sourceOffset)%deltaState (sizeDeltaState,NofMyPhase), source=0.0_pReal) - if (.not. analyticJaco) then - allocate(sourceState(phase)%p(sourceOffset)%state_backup (sizeState,NofMyPhase), source=0.0_pReal) - allocate(sourceState(phase)%p(sourceOffset)%dotState_backup (sizeDotState,NofMyPhase), source=0.0_pReal) - endif if (any(numerics_integrator == 1_pInt)) then allocate(sourceState(phase)%p(sourceOffset)%previousDotState (sizeDotState,NofMyPhase), source=0.0_pReal) allocate(sourceState(phase)%p(sourceOffset)%previousDotState2 (sizeDotState,NofMyPhase), source=0.0_pReal) diff --git a/code/source_thermal_externalheat.f90 b/code/source_thermal_externalheat.f90 index 203826205..e2b14d45d 100644 --- a/code/source_thermal_externalheat.f90 +++ b/code/source_thermal_externalheat.f90 @@ -73,8 +73,6 @@ subroutine source_thermal_externalheat_init(fileUnit) sourceState, & MATERIAL_partPhase use numerics,only: & - analyticJaco, & - worldrank, & numerics_integrator implicit none @@ -89,11 +87,9 @@ subroutine source_thermal_externalheat_init(fileUnit) line = '' real(pReal), allocatable, dimension(:,:) :: temp_time, temp_rate - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- source_'//SOURCE_thermal_externalheat_label//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- source_'//SOURCE_thermal_externalheat_label//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess maxNinstance = int(count(phase_source == SOURCE_thermal_externalheat_ID),pInt) if (maxNinstance == 0_pInt) return @@ -189,10 +185,6 @@ subroutine source_thermal_externalheat_init(fileUnit) allocate(sourceState(phase)%p(sourceOffset)%dotState (sizeDotState,NofMyPhase), source=0.0_pReal) allocate(sourceState(phase)%p(sourceOffset)%deltaState (sizeDeltaState,NofMyPhase), source=0.0_pReal) - if (.not. analyticJaco) then - allocate(sourceState(phase)%p(sourceOffset)%state_backup (sizeState,NofMyPhase), source=0.0_pReal) - allocate(sourceState(phase)%p(sourceOffset)%dotState_backup (sizeDotState,NofMyPhase), source=0.0_pReal) - endif if (any(numerics_integrator == 1_pInt)) then allocate(sourceState(phase)%p(sourceOffset)%previousDotState (sizeDotState,NofMyPhase), source=0.0_pReal) allocate(sourceState(phase)%p(sourceOffset)%previousDotState2 (sizeDotState,NofMyPhase), source=0.0_pReal) diff --git a/code/source_vacancy_irradiation.f90 b/code/source_vacancy_irradiation.f90 index fd7220020..986c229ff 100644 --- a/code/source_vacancy_irradiation.f90 +++ b/code/source_vacancy_irradiation.f90 @@ -70,8 +70,6 @@ subroutine source_vacancy_irradiation_init(fileUnit) sourceState, & MATERIAL_partPhase use numerics,only: & - analyticJaco, & - worldrank, & numerics_integrator implicit none @@ -85,11 +83,9 @@ subroutine source_vacancy_irradiation_init(fileUnit) tag = '', & line = '' - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- source_'//SOURCE_vacancy_irradiation_label//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- source_'//SOURCE_vacancy_irradiation_label//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess maxNinstance = int(count(phase_source == SOURCE_vacancy_irradiation_ID),pInt) if (maxNinstance == 0_pInt) return @@ -169,10 +165,6 @@ subroutine source_vacancy_irradiation_init(fileUnit) allocate(sourceState(phase)%p(sourceOffset)%dotState (sizeDotState,NofMyPhase), source=0.0_pReal) allocate(sourceState(phase)%p(sourceOffset)%deltaState (sizeDeltaState,NofMyPhase), source=0.0_pReal) - if (.not. analyticJaco) then - allocate(sourceState(phase)%p(sourceOffset)%state_backup (sizeState,NofMyPhase), source=0.0_pReal) - allocate(sourceState(phase)%p(sourceOffset)%dotState_backup (sizeDotState,NofMyPhase), source=0.0_pReal) - endif if (any(numerics_integrator == 1_pInt)) then allocate(sourceState(phase)%p(sourceOffset)%previousDotState (sizeDotState,NofMyPhase), source=0.0_pReal) allocate(sourceState(phase)%p(sourceOffset)%previousDotState2 (sizeDotState,NofMyPhase), source=0.0_pReal) diff --git a/code/source_vacancy_phenoplasticity.f90 b/code/source_vacancy_phenoplasticity.f90 index 2690cf691..924490637 100644 --- a/code/source_vacancy_phenoplasticity.f90 +++ b/code/source_vacancy_phenoplasticity.f90 @@ -68,8 +68,6 @@ subroutine source_vacancy_phenoplasticity_init(fileUnit) sourceState, & MATERIAL_partPhase use numerics,only: & - analyticJaco, & - worldrank, & numerics_integrator implicit none @@ -83,11 +81,9 @@ subroutine source_vacancy_phenoplasticity_init(fileUnit) tag = '', & line = '' - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- source_'//SOURCE_vacancy_phenoplasticity_label//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- source_'//SOURCE_vacancy_phenoplasticity_label//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess maxNinstance = int(count(phase_source == SOURCE_vacancy_phenoplasticity_ID),pInt) if (maxNinstance == 0_pInt) return @@ -163,10 +159,6 @@ subroutine source_vacancy_phenoplasticity_init(fileUnit) allocate(sourceState(phase)%p(sourceOffset)%dotState (sizeDotState,NofMyPhase), source=0.0_pReal) allocate(sourceState(phase)%p(sourceOffset)%deltaState (sizeDeltaState,NofMyPhase), source=0.0_pReal) - if (.not. analyticJaco) then - allocate(sourceState(phase)%p(sourceOffset)%state_backup (sizeState,NofMyPhase), source=0.0_pReal) - allocate(sourceState(phase)%p(sourceOffset)%dotState_backup (sizeDotState,NofMyPhase), source=0.0_pReal) - endif if (any(numerics_integrator == 1_pInt)) then allocate(sourceState(phase)%p(sourceOffset)%previousDotState (sizeDotState,NofMyPhase), source=0.0_pReal) allocate(sourceState(phase)%p(sourceOffset)%previousDotState2 (sizeDotState,NofMyPhase), source=0.0_pReal) diff --git a/code/source_vacancy_thermalfluc.f90 b/code/source_vacancy_thermalfluc.f90 index 5891ff764..b835e8bce 100644 --- a/code/source_vacancy_thermalfluc.f90 +++ b/code/source_vacancy_thermalfluc.f90 @@ -72,8 +72,6 @@ subroutine source_vacancy_thermalfluc_init(fileUnit) sourceState, & MATERIAL_partPhase use numerics,only: & - analyticJaco, & - worldrank, & numerics_integrator implicit none @@ -87,11 +85,9 @@ subroutine source_vacancy_thermalfluc_init(fileUnit) tag = '', & line = '' - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- source_'//SOURCE_vacancy_thermalfluc_label//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- source_'//SOURCE_vacancy_thermalfluc_label//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess maxNinstance = int(count(phase_source == SOURCE_vacancy_thermalfluc_ID),pInt) if (maxNinstance == 0_pInt) return @@ -170,10 +166,6 @@ subroutine source_vacancy_thermalfluc_init(fileUnit) allocate(sourceState(phase)%p(sourceOffset)%dotState (sizeDotState,NofMyPhase), source=0.0_pReal) allocate(sourceState(phase)%p(sourceOffset)%deltaState (sizeDeltaState,NofMyPhase), source=0.0_pReal) - if (.not. analyticJaco) then - allocate(sourceState(phase)%p(sourceOffset)%state_backup (sizeState,NofMyPhase), source=0.0_pReal) - allocate(sourceState(phase)%p(sourceOffset)%dotState_backup (sizeDotState,NofMyPhase), source=0.0_pReal) - endif if (any(numerics_integrator == 1_pInt)) then allocate(sourceState(phase)%p(sourceOffset)%previousDotState (sizeDotState,NofMyPhase), source=0.0_pReal) allocate(sourceState(phase)%p(sourceOffset)%previousDotState2 (sizeDotState,NofMyPhase), source=0.0_pReal) From d1b777a47c4c54f92260d20a97620945a957610c Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 25 Jul 2016 20:12:56 +0200 Subject: [PATCH 111/412] flag for analytic tangent not needed anymore --- code/numerics.f90 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/code/numerics.f90 b/code/numerics.f90 index 9b3449e95..9840630db 100644 --- a/code/numerics.f90 +++ b/code/numerics.f90 @@ -64,7 +64,6 @@ module numerics charLength = 1.0_pReal, & !< characteristic length scale for gradient problems residualStiffness = 1.0e-6_pReal !< non-zero residual damage logical, protected, public :: & - analyticJaco = .true., & !< use analytic Jacobian or perturbation, Default for Spectral solver .true.: usePingPong = .true., & numerics_timeSyncing = .false. !< flag indicating if time synchronization in crystallite is used for nonlocal plasticity @@ -315,8 +314,6 @@ subroutine numerics_init numerics_integrator(1) = IO_intValue(line,chunkPos,2_pInt) case ('integratorstiffness') numerics_integrator(2) = IO_intValue(line,chunkPos,2_pInt) - case ('analyticjaco') - analyticJaco = IO_intValue(line,chunkPos,2_pInt) > 0_pInt case ('usepingpong') usepingpong = IO_intValue(line,chunkPos,2_pInt) > 0_pInt case ('timesyncing') @@ -528,7 +525,6 @@ subroutine numerics_init write(6,'(a24,1x,es8.1)') ' aTol_crystalliteStress: ',aTol_crystalliteStress write(6,'(a24,2(1x,i8))') ' integrator: ',numerics_integrator write(6,'(a24,1x,L8)') ' timeSyncing: ',numerics_timeSyncing - write(6,'(a24,1x,L8)') ' analytic Jacobian: ',analyticJaco write(6,'(a24,1x,L8)') ' use ping pong scheme: ',usepingpong write(6,'(a24,1x,es8.1,/)')' unitlength: ',numerics_unitlength From d0544a69dd88b5bce04c334ea30b83a27ac5b627 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 25 Jul 2016 20:16:27 +0200 Subject: [PATCH 112/412] removed some remainders of state perturbation --- code/plastic_none.f90 | 2 -- code/prec.f90 | 2 -- 2 files changed, 4 deletions(-) diff --git a/code/plastic_none.f90 b/code/plastic_none.f90 index 34570ceab..7a7589774 100644 --- a/code/plastic_none.f90 +++ b/code/plastic_none.f90 @@ -81,11 +81,9 @@ subroutine plastic_none_init allocate(plasticState(phase)%partionedState0 (sizeState,NofMyPhase)) allocate(plasticState(phase)%subState0 (sizeState,NofMyPhase)) allocate(plasticState(phase)%state (sizeState,NofMyPhase)) - allocate(plasticState(phase)%state_backup (sizeState,NofMyPhase)) allocate(plasticState(phase)%dotState (sizeDotState,NofMyPhase)) allocate(plasticState(phase)%deltaState (sizeDeltaState,NofMyPhase)) - allocate(plasticState(phase)%dotState_backup (sizeDotState,NofMyPhase)) if (any(numerics_integrator == 1_pInt)) then allocate(plasticState(phase)%previousDotState (sizeDotState,NofMyPhase)) allocate(plasticState(phase)%previousDotState2(sizeDotState,NofMyPhase)) diff --git a/code/prec.f90 b/code/prec.f90 index 0ded23528..190aca02b 100644 --- a/code/prec.f90 +++ b/code/prec.f90 @@ -67,11 +67,9 @@ module prec real(pReal), allocatable, dimension(:,:) :: & partionedState0, & subState0, & - state_backup, & deltaState, & previousDotState, & !< state rate of previous xxxx previousDotState2, & !< state rate two xxxx ago - dotState_backup, & !< backup of state rate RK4dotState real(pReal), allocatable, dimension(:,:,:) :: & RKCK45dotState From 23541a713db1844c839d4a4f1345bbb3140f2f73 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 25 Jul 2016 22:26:18 +0200 Subject: [PATCH 113/412] material parameters from paper --- .../ConfigFiles/Phase_Nonlocal_Nickel.config | 146 ++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100755 examples/ConfigFiles/Phase_Nonlocal_Nickel.config diff --git a/examples/ConfigFiles/Phase_Nonlocal_Nickel.config b/examples/ConfigFiles/Phase_Nonlocal_Nickel.config new file mode 100755 index 000000000..1e9ce28fa --- /dev/null +++ b/examples/ConfigFiles/Phase_Nonlocal_Nickel.config @@ -0,0 +1,146 @@ +##################### +# $Id: material.config 477 2009-12-15 10:22:17Z MPIE\c.kords $ +##################### + +##################### + +[SX] +type isostrain +Ngrains 1 + + + +##################### + +##################### + +[Cu_nonlocal] +crystallite 1 +(constituent) phase 1 texture 1 fraction 1.0 + + +##################### + +##################### + +[ori] +(output) eulerangles +(output) grainrotation +(output) grainrotationX +(output) grainrotationY +(output) grainrotationZ +(output) f +(output) fe +(output) p +(output) ee # elastic strain as Green-Lagrange tensor + + +##################### + +##################### + +/echo/ + +[Ni_nonlocal] + +elasticity hooke +plasticity nonlocal +/nonlocal/ + +(output) rho +(output) rho_sgl_mobile +(output) rho_sgl_immobile +(output) rho_sgl_edge_pos +(output) rho_sgl_edge_neg +(output) rho_sgl_screw_pos +(output) rho_sgl_screw_neg +(output) rho_dip_edge +(output) rho_dip_screw +(output) rho_forest +(output) excess_rho_edge +(output) excess_rho_screw +(output) accumulatedshear +(output) shearrate +(output) resolvedstress +(output) resistance +(output) velocity_edge_pos +(output) rho_dot_gen +(output) rho_dot_sgl2dip_edge +(output) rho_dot_sgl2dip_screw +(output) rho_dot_ann_ath +(output) rho_dot_ann_the_edge +(output) rho_dot_ann_the_screw +(output) rho_dot_edgejogs +(output) rho_dot_flux_edge +(output) rho_dot_flux_screw +(output) slipdirection.x +(output) slipdirection.y +(output) slipdirection.z +(output) slipnormal.x +(output) slipnormal.y +(output) slipnormal.z +(output) fluxdensity_edge_pos.x +(output) fluxdensity_edge_pos.y +(output) fluxdensity_edge_pos.z +(output) fluxdensity_edge_neg.x +(output) fluxdensity_edge_neg.y +(output) fluxdensity_edge_neg.z +(output) fluxdensity_screw_pos.x +(output) fluxdensity_screw_pos.y +(output) fluxdensity_screw_pos.z +(output) fluxdensity_screw_neg.x +(output) fluxdensity_screw_neg.y +(output) fluxdensity_screw_neg.z + +lattice_structure fcc +Nslip 12 # number of slip systems per family +c11 246.5e9 +c12 147.3e9 +c44 124.7e9 +burgers 2.48e-10 0 0 0 # Burgers vector in m +rhoSglEdgePos0 6e10 # Initial positive edge single dislocation density in m/m**3 +rhoSglEdgeNeg0 6e10 # Initial negative edge single dislocation density in m/m**3 +rhoSglScrewPos0 6e10 # Initial positive screw single dislocation density in m/m**3 +rhoSglScrewNeg0 6e10 # Initial negative screw single dislocation density in m/m**3 +rhoDipEdge0 0 # Initial edge dipole dislocation density in m/m**3 +rhoDipScrew0 0 # Initial screw dipole dislocation density in m/m**3 +rhoSglScatter 0 +minimumDipoleHeightEdge 2.6e-9 # 3.0e-9 # minimum distance for stable edge dipoles in m +minimumDipoleHeightScrew 12.0e-9 # 50e-9 # minimum distance for stable screw dipoles in m +lambda0 45 # 33 # prefactor for mean free path +edgeMultiplication 0.1 +randomMultiplication 0 +atomicVolume 1.2e-29 +selfdiffusionPrefactor 1.9e-4 # Gottstein p.168 # prefactor for self-diffusion coefficient +selfdiffusionEnergy 5.1e-19 # Gottstein p.168 # activation energy self-diffusion +solidSolutionEnergy 1.8e-19 # activation energy of solid solution particles in J +solidSolutionConcentration 5e-7 # 1e-7 +solidSolutionSize 1.0 +peierlsStressEdge 1e5 # Peierls stress for edges in Pa (per slip family) +peierlsStressScrew 1e5 # Peierls stress for screws in Pa (per slip family) +doublekinkWidth 10 # width of double kinks in multiples of burgers vector length b +viscosity 1e-3 # viscosity for dislocation glide in Pa s +p 1 # exponent for thermal barrier profile +q 1 # exponent for thermal barrier profile +attackFrequency 50e9 # attack frequency in Hz +surfaceTransmissivity 1.0 # transmissivity of free surfaces for dislocation flux +grainBoundaryTransmissivity 0.0 +aTol_rho 1e100 # absolute tolerance for dislocation density in m/m**3 +aTol_shear 1e10 # absolute tolerance for dislocation density in m/m**3 +significantRho 1e8 # dislocation density considered relevant in m/m**3 +significantN 1 +shortRangeStressCorrection 0 +CFLfactor 1.1 # safety factor for CFL flux check (numerical parameter) +r 1 +interaction_SlipSlip 0 0 0.625 0.07 0.137 0.122 # Dislocation interaction coefficient +linetension 0.8 +edgejog 0.01 # 0.2 + + +##################### + +##################### + +[111] +(gauss) phi1 315 Phi 0 phi2 0 scatter 0.000 fraction 1.000 + From 10897bcaaeac3fad132a46457f1941b50d5615bb Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 27 Jul 2016 09:18:13 +0200 Subject: [PATCH 114/412] not needed anymore --- code/damask.core.pyf | 126 ------------------------------------------- 1 file changed, 126 deletions(-) delete mode 100644 code/damask.core.pyf diff --git a/code/damask.core.pyf b/code/damask.core.pyf deleted file mode 100644 index e6396ee1d..000000000 --- a/code/damask.core.pyf +++ /dev/null @@ -1,126 +0,0 @@ -! $Id$ -! -*- f90 -*- -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! Note: the syntax of this file is case sensitive. -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! This file was auto-generated with f2py (version:2_5972). -! See http://cens.ioc.ee/projects/f2py2e/ -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! The auto-generated file is quite heavily corrected -! For modifying, notice the following hints: -! - if the dimension of an array depend on a array that is itself an input, use the C-Syntax: (1) becomes [0] etc. -! - be sure that the precision defined is integer, real*8, and complex*16 -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -python module core ! in - interface ! in :core - - module prec - subroutine prec_init - end subroutine prec_init - end module prec - - module damask_interface ! in :damask_interface:DAMASK_spectral_interface.f90 - subroutine DAMASK_interface_init(loadcaseParameterIn,geometryParameterIn) ! in :damask_interface:DAMASK_spectral_interface.f90 - character(len=1024), intent(in) :: loadcaseParameterIn - character(len=1024), intent(in) :: geometryParameterIn - end subroutine DAMASK_interface_init - end module damask_interface - - module io - subroutine IO_init - end subroutine IO_init - end module io - - module numerics - subroutine numerics_init - end subroutine numerics_init - end module numerics - - module debug - subroutine debug_init - end subroutine debug_init - end module debug - - module math ! in :math:math.f90 - subroutine math_init - end subroutine math_init - - function math_tensorAvg(field) ! in :math:math.f90 - ! input variables - real*8 dimension(:,:,:,:,:), intent(in), :: field - ! function definition - real*8 dimension(3,3), :: math_tensorAvg - end function math_tensorAvg - - end module math - - module fesolving - subroutine FE_init - end subroutine FE_init - end module fesolving - - module mesh ! in :mesh:mesh.f90 - subroutine mesh_init(ip,element) - integer, parameter :: ip = 1 - integer, parameter :: element = 1 - end subroutine mesh_init - - function mesh_nodesAroundCentres(gDim,Favg,centres) ! in :mesh:mesh.f90 - real*8, dimension(:,:,:,:), intent(in) :: centres - real*8, dimension(3), intent(in) :: gDim - real*8, dimension(3,3), intent(in) :: Favg - real*8, dimension(3,size(centres,2)+1,size(centres,3)+1,size(centres,4)+1), depend(centres) :: mesh_nodesAroundCentres - real*8, dimension(3,size(centres,2)+1,size(centres,3)+1,size(centres,4)+1), depend(centres) :: wrappedCentres - end function mesh_nodesAroundCentres - - function mesh_deformedCoordsFFT(gDim,F,FavgIn,scalingIn) ! in :mesh:mesh.f90 - real*8, dimension(:,:,:,:,:), intent(in) :: F - real*8, dimension(3), intent(in) :: gDim - real*8, dimension(3,3), intent(in), optional :: FavgIn = -1.0 - real*8, dimension(3), intent(in), optional :: scalingIn = -1.0 - real*8, dimension(3,size(F,3),size(F,4),size(F,5)), depend(F) :: mesh_deformedCoordsFFT - end function mesh_deformedCoordsFFT - - function mesh_volumeMismatch(gDim,F,nodes) ! in :mesh:mesh.f90 - real*8, dimension(:,:,:,:,:), intent(in) :: F - real*8, dimension(:,:,:,:), intent(in) :: nodes - real*8, dimension(3), intent(in) :: gDim - real*8, dimension(size(F,3),size(F,4),size(F,5)), depend(F) :: mesh_volumeMismatch - end function mesh_volumeMismatch - - function mesh_shapeMismatch(gDim,F,nodes,centres) ! in :mesh:mesh.f90 - real*8, dimension(:,:,:,:,:), intent(in) :: F - real*8, dimension(:,:,:,:), intent(in) :: nodes - real*8, dimension(:,:,:,:), intent(in) :: centres - real*8, dimension(3), intent(in) :: gDim - real*8, dimension(size(F,3),size(F,4),size(F,5)), depend(F) :: mesh_shapeMismatch - end function mesh_shapeMismatch - - function mesh_init_postprocessing(filepath) ! in :mesh:mesh.f90 - character(len=*), intent(in) :: filepath - end function mesh_init_postprocessing - - function mesh_build_cellnodes(nodes,Ncellnodes) ! in :mesh:mesh.f90 - integer, intent(in) :: Ncellnodes - real*8, dimension(3,:), intent(in) :: nodes - real*8, dimension(3,Ncellnodes), depend(Ncellnodes) :: mesh_build_cellnodes - end function mesh_build_cellnodes - - function mesh_get_Ncellnodes() ! in :mesh:mesh.f90 - integer :: mesh_get_Ncellnodes - end function mesh_get_Ncellnodes - - function mesh_get_unitlength() ! in :mesh:mesh.f90 - real*8 :: mesh_get_unitlength - end function mesh_get_unitlength - - function mesh_get_nodeAtIP(elemtypeFE,ip) ! in :mesh:mesh.f90 - character(len=*), intent(in) :: elemtypeFE - integer, intent(in) :: ip - integer :: mesh_get_nodeAtIP - end function mesh_get_nodeAtIP - - end module mesh - end interface -end python module core - From 920cf2c849a1e5a1022f72fe3a51e4f834aa04d1 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 27 Jul 2016 09:20:06 +0200 Subject: [PATCH 115/412] removed non-phase parts --- .../ConfigFiles/Phase_Nonlocal_Nickel.config | 52 ------------------- 1 file changed, 52 deletions(-) diff --git a/examples/ConfigFiles/Phase_Nonlocal_Nickel.config b/examples/ConfigFiles/Phase_Nonlocal_Nickel.config index 1e9ce28fa..4d4c2d1df 100755 --- a/examples/ConfigFiles/Phase_Nonlocal_Nickel.config +++ b/examples/ConfigFiles/Phase_Nonlocal_Nickel.config @@ -1,46 +1,3 @@ -##################### -# $Id: material.config 477 2009-12-15 10:22:17Z MPIE\c.kords $ -##################### - -##################### - -[SX] -type isostrain -Ngrains 1 - - - -##################### - -##################### - -[Cu_nonlocal] -crystallite 1 -(constituent) phase 1 texture 1 fraction 1.0 - - -##################### - -##################### - -[ori] -(output) eulerangles -(output) grainrotation -(output) grainrotationX -(output) grainrotationY -(output) grainrotationZ -(output) f -(output) fe -(output) p -(output) ee # elastic strain as Green-Lagrange tensor - - -##################### - -##################### - -/echo/ - [Ni_nonlocal] elasticity hooke @@ -135,12 +92,3 @@ r 1 interaction_SlipSlip 0 0 0.625 0.07 0.137 0.122 # Dislocation interaction coefficient linetension 0.8 edgejog 0.01 # 0.2 - - -##################### - -##################### - -[111] -(gauss) phi1 315 Phi 0 phi2 0 scatter 0.000 fraction 1.000 - From f411405da65096fef951dd09d506311c3c3f9057 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 27 Jul 2016 14:29:16 +0200 Subject: [PATCH 116/412] wrong comment --- code/prec.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/prec.f90 b/code/prec.f90 index 0ded23528..778bd0b90 100644 --- a/code/prec.f90 +++ b/code/prec.f90 @@ -83,7 +83,7 @@ module prec nTwin = 0_pInt, & nTrans = 0_pInt logical :: & - nonlocal = .false. !< absolute tolerance for state integration + nonlocal = .false. real(pReal), pointer, dimension(:,:), contiguous :: & slipRate, & !< slip rate accumulatedSlip !< accumulated plastic slip From e68b06f1cb942fe5b23b4f1f4550e9a8eb3eb492 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 27 Jul 2016 14:32:03 +0200 Subject: [PATCH 117/412] might be helpful --- code/math.f90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/math.f90 b/code/math.f90 index 8694e30ee..87b232575 100644 --- a/code/math.f90 +++ b/code/math.f90 @@ -158,7 +158,8 @@ module math math_areaTriangle, & math_rotate_forward33, & math_rotate_backward33, & - math_rotate_forward3333 + math_rotate_forward3333, & + math_limit private :: & math_partition, & halton, & From 53b94ddf59ea4ce283f53931c631de53358b941a Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 27 Jul 2016 20:37:54 +0200 Subject: [PATCH 118/412] not needed (hides complexity) --- examples/SpectralMethod/Makefile | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 examples/SpectralMethod/Makefile diff --git a/examples/SpectralMethod/Makefile b/examples/SpectralMethod/Makefile deleted file mode 100644 index 3abb88f89..000000000 --- a/examples/SpectralMethod/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -include ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/variables -include ${PETSC_DIR}/${PETSC_ARCH}/lib/petsc/conf/rules - - -run16x16x16: - -@${MPIEXEC} -n 2 DAMASK_spectral -l tensionX.load -g 20grains16x16x16.geom - -run32x32x32: - -@${MPIEXEC} -n 4 DAMASK_spectral -l tensionX.load -g 20grains32x32x32.geom - -run64x64x64: - -@${MPIEXEC} -n 8 DAMASK_spectral -l tensionX.load -g 20grains64x64x64.geom From 360daf9394f7bdc891be664979d9aa218d1ed4d7 Mon Sep 17 00:00:00 2001 From: Test User Date: Thu, 28 Jul 2016 16:43:38 +0200 Subject: [PATCH 119/412] updated version information after successful test of v2.0.1-5-g920cf2c --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 0ac852dde..5af1fb958 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1 +v2.0.1-5-g920cf2c From 12d13fb2fa888529d2cfcae4ec54d0bee7dd9f7a Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 29 Jul 2016 16:27:27 +0200 Subject: [PATCH 120/412] giving unit --- code/spectral_thermal.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/spectral_thermal.f90 b/code/spectral_thermal.f90 index ab980e091..bb5747574 100644 --- a/code/spectral_thermal.f90 +++ b/code/spectral_thermal.f90 @@ -245,7 +245,7 @@ type(tSolutionState) function spectral_thermal_solution(guess,timeinc,timeinc_ol if (worldrank == 0) then if (spectral_thermal_solution%converged) & write(6,'(/,a)') ' ... thermal conduction converged ..................................' - write(6,'(/,a,f8.4,2x,f8.4,2x,f8.4,/)',advance='no') ' Minimum|Maximum|Delta Temperature = ',& + write(6,'(/,a,f8.4,2x,f8.4,2x,f8.4,/)',advance='no') ' Minimum|Maximum|Delta Temperature / K = ',& minTemperature, maxTemperature, stagNorm write(6,'(/,a)') ' ===========================================================================' flush(6) From a6ee4216d6f33d8ff907cc4fa68f8138d7ba523b Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 29 Jul 2016 16:34:51 +0200 Subject: [PATCH 121/412] commenting --- code/DAMASK_spectral.f90 | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/code/DAMASK_spectral.f90 b/code/DAMASK_spectral.f90 index 0be78083b..c363393d8 100644 --- a/code/DAMASK_spectral.f90 +++ b/code/DAMASK_spectral.f90 @@ -156,11 +156,9 @@ program DAMASK_spectral !-------------------------------------------------------------------------------------------------- ! init DAMASK (all modules) call CPFEM_initAll(el = 1_pInt, ip = 1_pInt) - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- DAMASK_spectral init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- DAMASK_spectral init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess !-------------------------------------------------------------------------------------------------- ! initialize field solver information @@ -199,14 +197,14 @@ program DAMASK_spectral allocate(loadCases(i)%ID(nActiveFields)) field = 1 loadCases(i)%ID(field) = FIELD_MECH_ID ! mechanical active by default - if (any(thermal_type == THERMAL_conduction_ID)) then ! thermal field active + thermalActive: if (any(thermal_type == THERMAL_conduction_ID)) then field = field + 1 loadCases(i)%ID(field) = FIELD_THERMAL_ID - endif - if (any(damage_type == DAMAGE_nonlocal_ID)) then ! damage field active + endif thermalActive + damageActive: if (any(damage_type == DAMAGE_nonlocal_ID)) then field = field + 1 loadCases(i)%ID(field) = FIELD_DAMAGE_ID - endif + endif damageActive enddo !-------------------------------------------------------------------------------------------------- From 0aadda4cc3c46db849a9e1e94bebe2558f02548b Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Fri, 29 Jul 2016 17:45:37 -0400 Subject: [PATCH 122/412] improved cross-platform robustness of DAMASK_env(s) --- DAMASK_env.csh | 28 ++++++++++++++++------------ DAMASK_env.sh | 46 +++++++++++++++++++++++++--------------------- DAMASK_env.zsh | 46 ++++++++++++++++++++-------------------------- 3 files changed, 61 insertions(+), 59 deletions(-) diff --git a/DAMASK_env.csh b/DAMASK_env.csh index 7e3bf128d..78f8922cd 100644 --- a/DAMASK_env.csh +++ b/DAMASK_env.csh @@ -23,25 +23,29 @@ endif # according to http://software.intel.com/en-us/forums/topic/501500 # this seems to make sense for the stack size -set FREE=`which free` -set FREE='' -if ( "x$FREE" != "x" ) then +if ( `which free` != "free: Command not found." ) then set freeMem=`free -k | grep -E '(Mem|Speicher):' | awk '{print $4;}'` - set heap=`expr $freeMem / 2` set stack=`expr $freeMem / $DAMASK_NUM_THREADS / 2` + set heap=` expr $freeMem / 2` # http://superuser.com/questions/220059/what-parameters-has-ulimit limit stacksize $stack # maximum stack size (kB) - limit datasize $heap # maximum heap size (kB) + limit datasize $heap # maximum heap size (kB) +endif +if ( `limit | grep coredumpsize` != "" ) then + limit coredumpsize 0 # prevent core dumping +endif +if ( `limit | grep memoryuse` != "" ) then + limit memoryuse unlimited # maximum physical memory size +endif +if ( `limit | grep vmemoryuse` != "" ) then + limit vmemoryuse unlimited # maximum virtual memory size endif -limit coredumpsize 2000 # core file size (512-byte blocks) -limit vmemoryuse unlimited # maximum virtual memory size -limit memoryuse unlimited # maximum physical memory size # disable output in case of scp -if($?prompt) then +if ( $?prompt ) then echo '' - echo Düsseldorf Advanced Materials Simulation Kit - DAMASK - echo Max-Planck-Institut für Eisenforschung, Düsseldorf + echo Düsseldorf Advanced Materials Simulation Kit --- DAMASK + echo Max-Planck-Institut für Eisenforschung GmbH, Düsseldorf echo https://damask.mpie.de echo echo Using environment with ... @@ -59,8 +63,8 @@ if($?prompt) then echo "MSC.Marc/Mentat $MSC_ROOT" endif echo - echo `limit stacksize` echo `limit datasize` + echo `limit stacksize` endif setenv DAMASK_NUM_THREADS $DAMASK_NUM_THREADS diff --git a/DAMASK_env.sh b/DAMASK_env.sh index 8536a36ca..d9b5b004f 100644 --- a/DAMASK_env.sh +++ b/DAMASK_env.sh @@ -5,8 +5,8 @@ if [ "$OSTYPE" == "linux-gnu" ] || [ "$OSTYPE" == 'linux' ]; then DAMASK_ROOT=$(python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" "$(dirname $BASH_SOURCE)") else - [[ "${BASH_SOURCE::1}" == "/" ]] && BASE="" || BASE="`pwd`/" - STAT=$(stat "`dirname $BASE$BASH_SOURCE`") + [[ "${BASH_SOURCE::1}" == "/" ]] && BASE="" || BASE="$(pwd)/" + STAT=$(stat "$(dirname $BASE$BASH_SOURCE)") DAMASK_ROOT=${STAT##* } fi @@ -17,16 +17,16 @@ set() { source $DAMASK_ROOT/CONFIG unset -f set -# if DAMASK_BIN is present and not in $PATH, add it -if [[ "x$DAMASK_BIN" != "x" && ! `echo ":$PATH:" | grep $DAMASK_BIN:` ]]; then +# add DAMASK_BIN if present but not yet in $PATH +if [[ "x$DAMASK_BIN" != "x" && ! $(echo ":$PATH:" | grep $DAMASK_BIN:) ]]; then export PATH=$DAMASK_BIN:$PATH fi -SOLVER=`which DAMASK_spectral 2>/dev/null` +SOLVER=$(which DAMASK_spectral 2>/dev/null) if [ "x$SOLVER" == "x" ]; then SOLVER='Not found!' fi -PROCESSING=`which postResults 2>/dev/null` +PROCESSING=$(which postResults 2>/dev/null) if [ "x$PROCESSING" == "x" ]; then PROCESSING='Not found!' fi @@ -36,25 +36,22 @@ fi # according to http://software.intel.com/en-us/forums/topic/501500 # this seems to make sense for the stack size -FREE=`which free 2>/dev/null` +FREE=$(which free 2>/dev/null) if [ "x$FREE" != "x" ]; then - freeMem=`free -k | grep -E '(Mem|Speicher):' | awk '{print $4;}'` - heap=`expr $freeMem / 2` - stack=`expr $freeMem / $DAMASK_NUM_THREADS / 2` - + freeMem=$(free -k | grep -E '(Mem|Speicher):' | awk '{print $4;}') # http://superuser.com/questions/220059/what-parameters-has-ulimit - ulimit -s $stack 2>/dev/null # maximum stack size (kB) - ulimit -d $heap 2>/dev/null # maximum heap size (kB) + ulimit -s $(expr $freeMem / $DAMASK_NUM_THREADS / 2) 2>/dev/null # maximum stack size (kB) + ulimit -d $(expr $freeMem / 2) 2>/dev/null # maximum heap size (kB) fi -ulimit -c 2000 2>/dev/null # core file size (512-byte blocks) +ulimit -c 0 2>/dev/null # core file size (512-byte blocks) ulimit -v unlimited 2>/dev/null # maximum virtual memory size ulimit -m unlimited 2>/dev/null # maximum physical memory size # disable output in case of scp if [ ! -z "$PS1" ]; then echo - echo Düsseldorf Advanced Materials Simulation Kit - DAMASK - echo Max-Planck-Institut für Eisenforschung, Düsseldorf + echo Düsseldorf Advanced Materials Simulation Kit --- DAMASK + echo Max-Planck-Institut für Eisenforschung GmbH, Düsseldorf echo https://damask.mpie.de echo echo Using environment with ... @@ -64,14 +61,21 @@ if [ ! -z "$PS1" ]; then echo "Multithreading DAMASK_NUM_THREADS=$DAMASK_NUM_THREADS" if [ "x$PETSC_DIR" != "x" ]; then echo "PETSc location $PETSC_DIR" - [[ `python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" "$PETSC_DIR"` == $PETSC_DIR ]] \ - || echo " ~~> "`python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" "$PETSC_DIR"` + [[ $(python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" "$PETSC_DIR") == $PETSC_DIR ]] \ + || echo " ~~> "$(python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" "$PETSC_DIR") fi - [[ "x$PETSC_ARCH" != "x" ]] && echo "PETSc architecture $PETSC_ARCH" + [[ "x$PETSC_ARCH" == "x" ]] \ + || echo "PETSc architecture $PETSC_ARCH" echo "MSC.Marc/Mentat $MSC_ROOT" echo - echo -n "heap size/MiB "; echo "`ulimit -d`/1024" | bc - echo -n "stack size/MiB "; echo "`ulimit -s`/1024" | bc + echo -n "heap size " + [[ "$(ulimit -d)" == "unlimited" ]] \ + && echo "unlimited" \ + || echo $(python -c "import math; size=$(( 1024*$(ulimit -d) )); print '{:.4g} {}'.format(size / (1 << ((int(math.log(size,2) / 10) if size else 0) * 10)), ['bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'EiB', 'ZiB'][int(math.log(size,2) / 10) if size else 0])") + echo -n "stack size " + [[ "$(ulimit -s)" == "unlimited" ]] \ + && echo "unlimited" \ + || echo $(python -c "import math; size=$(( 1024*$(ulimit -s) )); print '{:.4g} {}'.format(size / (1 << ((int(math.log(size,2) / 10) if size else 0) * 10)), ['bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'EiB', 'ZiB'][int(math.log(size,2) / 10) if size else 0])") fi export DAMASK_NUM_THREADS diff --git a/DAMASK_env.zsh b/DAMASK_env.zsh index e434a97cf..082fa8007 100644 --- a/DAMASK_env.zsh +++ b/DAMASK_env.zsh @@ -1,12 +1,7 @@ # sets up an environment for DAMASK on zsh # usage: source DAMASK_env.zsh - -if [ "$OSTYPE" = "linux-gnu" ] || [ "$OSTYPE" = 'linux' ]; then - DAMASK_ROOT=$(readlink -f "`dirname ${(%):-%N}`") -else - print 'Not done yet' -fi +DAMASK_ROOT=${0:a:h} # defining set() allows to source the same file for tcsh and zsh, with and without space around = set() { @@ -15,45 +10,36 @@ set() { source $DAMASK_ROOT/CONFIG unset -f set -# if DAMASK_BIN is present and not in $PATH, add it +# add DAMASK_BIN if present but not yet in $PATH MATCH=`echo ":$PATH:" | grep $DAMASK_BIN:` if [[ ( "x$DAMASK_BIN" != "x" ) && ( "x$MATCH" = "x" ) ]]; then export PATH=$DAMASK_BIN:$PATH fi SOLVER=`which DAMASK_spectral 2>/dev/null` -if [ "x$SOLVER" = "x" ]; then - export SOLVER='Not found!' -fi PROCESSING=`which postResults 2>/dev/null` -if [ "x$PROCESSING" = "x" ]; then - export PROCESSING='Not found!' -fi if [ "x$DAMASK_NUM_THREADS" = "x" ]; then DAMASK_NUM_THREADS=1 fi # according to http://software.intel.com/en-us/forums/topic/501500 # this seems to make sense for the stack size -FREE=`which free 2>/dev/null` -if [ "x$FREE" != "x" ]; then +if [ "`which free 2>/dev/null`" != "free not found" ]; then freeMem=`free -k | grep -E '(Mem|Speicher):' | awk '{print $4;}'` - heap=`expr $freeMem / 2` - stack=`expr $freeMem / 2` # http://superuser.com/questions/220059/what-parameters-has-ulimit - ulimit -s $stack 2>/dev/null # maximum stack size (kB) - ulimit -d $heap 2>/dev/null # maximum heap size (kB) + ulimit -s `expr $freeMem / $DAMASK_NUM_THREADS / 2` 2>/dev/null # maximum stack size (kB) + ulimit -d `expr $freeMem / 2` 2>/dev/null # maximum heap size (kB) fi -ulimit -c 2000 2>/dev/null # core file size (512-byte blocks) +ulimit -c 0 2>/dev/null # core file size (512-byte blocks) ulimit -v unlimited 2>/dev/null # maximum virtual memory size ulimit -m unlimited 2>/dev/null # maximum physical memory size # disable output in case of scp if [ ! -z "$PS1" ]; then echo - echo Düsseldorf Advanced Materials Simulation Kit - DAMASK - echo Max-Planck-Institut für Eisenforschung, Düsseldorf + echo Düsseldorf Advanced Materials Simulation Kit --- DAMASK + echo Max-Planck-Institut für Eisenforschung GmbH, Düsseldorf echo https://damask.mpie.de echo echo Using environment with ... @@ -63,13 +49,21 @@ if [ ! -z "$PS1" ]; then echo "Multithreading DAMASK_NUM_THREADS=$DAMASK_NUM_THREADS" if [ "x$PETSC_DIR" != "x" ]; then echo "PETSc location $PETSC_DIR" - [[ `readlink -f $PETSC_DIR` == $PETSC_DIR ]] || echo " ~~> "`readlink -f $PETSC_DIR` + [[ $(python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" "$PETSC_DIR") == $PETSC_DIR ]] \ + || echo " ~~> "$(python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" "$PETSC_DIR") fi - [[ "x$PETSC_ARCH" != "x" ]] && echo "PETSc architecture $PETSC_ARCH" + [[ "x$PETSC_ARCH" == "x" ]] \ + || echo "PETSc architecture $PETSC_ARCH" echo "MSC.Marc/Mentat $MSC_ROOT" echo - echo -n "heap size/MiB "; echo "`ulimit -d`/1024" | bc - echo -n "stack size/MiB "; echo "`ulimit -s`/1024" | bc + echo -n "heap size " + [[ "$(ulimit -d)" == "unlimited" ]] \ + && echo "unlimited" \ + || echo $(python -c "import math; size=$(( 1024*$(ulimit -d) )); print '{:.4g} {}'.format(size / (1 << ((int(math.log(size,2) / 10) if size else 0) * 10)), ['bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'EiB', 'ZiB'][int(math.log(size,2) / 10) if size else 0])") + echo -n "stack size " + [[ "$(ulimit -s)" == "unlimited" ]] \ + && echo "unlimited" \ + || echo $(python -c "import math; size=$(( 1024*$(ulimit -s) )); print '{:.4g} {}'.format(size / (1 << ((int(math.log(size,2) / 10) if size else 0) * 10)), ['bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'EiB', 'ZiB'][int(math.log(size,2) / 10) if size else 0])") fi export DAMASK_NUM_THREADS From 5e1cac2e5e6456794149b3a9d62a7e6f036369ed Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Fri, 29 Jul 2016 17:46:22 -0400 Subject: [PATCH 123/412] pretty-printing of CONFIG --- CONFIG | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/CONFIG b/CONFIG index b701ec3c7..9be3a95fb 100644 --- a/CONFIG +++ b/CONFIG @@ -1,10 +1,11 @@ # "set"-syntax needed only for tcsh (but works with bash and zsh) # DAMASK_ROOT will be expanded -set DAMASK_BIN=${DAMASK_ROOT}/bin -set DAMASK_NUM_THREADS = 4 +set DAMASK_BIN = ${DAMASK_ROOT}/bin -set MSC_ROOT=/opt/MSC -set MARC_VERSION=2015 +set DAMASK_NUM_THREADS = 4 -set ABAQUS_VERSION=6.14-5 +set MSC_ROOT = /opt/MSC +set MARC_VERSION = 2015 + +set ABAQUS_VERSION = 6.14-5 From afff0b86143c534f480c34bd5c35081eca19629d Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Fri, 29 Jul 2016 17:48:40 -0400 Subject: [PATCH 124/412] fixed STDOUT error no files on command line translate to "filename" being empty list. Cannot test for filename[0] then... --- processing/post/perceptualUniformColorMap.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/processing/post/perceptualUniformColorMap.py b/processing/post/perceptualUniformColorMap.py index 85acd073b..96e676337 100755 --- a/processing/post/perceptualUniformColorMap.py +++ b/processing/post/perceptualUniformColorMap.py @@ -49,7 +49,7 @@ parser.set_defaults(right = (0.0,0.0,0.0)) (options,filename) = parser.parse_args() if options.format not in outtypes: - parser.error('invalid format: "%s" (can be %s).'%(options.format,', '.join(outtypes))) + parser.error('invalid format: "{}" (choices: {}).'.format(options.format,', '.join(outtypes))) if options.N < 2: parser.error('too few steps (need at least 2).') @@ -59,10 +59,9 @@ if options.trim[0] < -1.0 or \ options.trim[0] >= options.trim[1]: parser.error('invalid trim range (-1 +1).') - -name = options.format if filename[0] is None\ +name = options.format if filename == [] \ else filename[0] -output = sys.stdout if filename[0] is None\ +output = sys.stdout if filename == [] \ else open(os.path.basename(filename[0])+extensions[outtypes.index(options.format)],'w') colorLeft = damask.Color(options.colormodel.upper(), list(options.left)) From 0bbf54e0e46fbb021661b3b15ab4260dcf3cea39 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Fri, 29 Jul 2016 17:49:29 -0400 Subject: [PATCH 125/412] switched to string.format() method --- processing/post/addCauchy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/processing/post/addCauchy.py b/processing/post/addCauchy.py index 2f69cb043..2d366b198 100755 --- a/processing/post/addCauchy.py +++ b/processing/post/addCauchy.py @@ -68,7 +68,7 @@ for name in filenames: # ------------------------------------------ assemble header -------------------------------------- table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) - table.labels_append(['%i_Cauchy'%(i+1) for i in xrange(9)]) # extend ASCII header with new labels + table.labels_append(['{}_Cauchy'.format(i+1) for i in xrange(9)]) # extend ASCII header with new labels table.head_write() # ------------------------------------------ process data ------------------------------------------ From 1503cc19fdd346276caa2787e34c6c5ff41931d3 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Fri, 29 Jul 2016 20:40:40 -0400 Subject: [PATCH 126/412] fixed excessive line length --- DAMASK_env.sh | 12 ++++++++++-- DAMASK_env.zsh | 12 ++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/DAMASK_env.sh b/DAMASK_env.sh index d9b5b004f..da033afbe 100644 --- a/DAMASK_env.sh +++ b/DAMASK_env.sh @@ -71,11 +71,19 @@ if [ ! -z "$PS1" ]; then echo -n "heap size " [[ "$(ulimit -d)" == "unlimited" ]] \ && echo "unlimited" \ - || echo $(python -c "import math; size=$(( 1024*$(ulimit -d) )); print '{:.4g} {}'.format(size / (1 << ((int(math.log(size,2) / 10) if size else 0) * 10)), ['bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'EiB', 'ZiB'][int(math.log(size,2) / 10) if size else 0])") + || echo $(python -c \ + "import math; \ + size=$(( 1024*$(ulimit -d) )); \ + print '{:.4g} {}'.format(size / (1 << ((int(math.log(size,2) / 10) if size else 0) * 10)), \ + ['bytes','KiB','MiB','GiB','TiB','EiB','ZiB'][int(math.log(size,2) / 10) if size else 0])") echo -n "stack size " [[ "$(ulimit -s)" == "unlimited" ]] \ && echo "unlimited" \ - || echo $(python -c "import math; size=$(( 1024*$(ulimit -s) )); print '{:.4g} {}'.format(size / (1 << ((int(math.log(size,2) / 10) if size else 0) * 10)), ['bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'EiB', 'ZiB'][int(math.log(size,2) / 10) if size else 0])") + || echo $(python -c \ + "import math; \ + size=$(( 1024*$(ulimit -s) )); \ + print '{:.4g} {}'.format(size / (1 << ((int(math.log(size,2) / 10) if size else 0) * 10)), \ + ['bytes','KiB','MiB','GiB','TiB','EiB','ZiB'][int(math.log(size,2) / 10) if size else 0])") fi export DAMASK_NUM_THREADS diff --git a/DAMASK_env.zsh b/DAMASK_env.zsh index 082fa8007..fa9a33987 100644 --- a/DAMASK_env.zsh +++ b/DAMASK_env.zsh @@ -59,11 +59,19 @@ if [ ! -z "$PS1" ]; then echo -n "heap size " [[ "$(ulimit -d)" == "unlimited" ]] \ && echo "unlimited" \ - || echo $(python -c "import math; size=$(( 1024*$(ulimit -d) )); print '{:.4g} {}'.format(size / (1 << ((int(math.log(size,2) / 10) if size else 0) * 10)), ['bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'EiB', 'ZiB'][int(math.log(size,2) / 10) if size else 0])") + || echo $(python -c \ + "import math; \ + size=$(( 1024*$(ulimit -d) )); \ + print '{:.4g} {}'.format(size / (1 << ((int(math.log(size,2) / 10) if size else 0) * 10)), \ + ['bytes','KiB','MiB','GiB','TiB','EiB','ZiB'][int(math.log(size,2) / 10) if size else 0])") echo -n "stack size " [[ "$(ulimit -s)" == "unlimited" ]] \ && echo "unlimited" \ - || echo $(python -c "import math; size=$(( 1024*$(ulimit -s) )); print '{:.4g} {}'.format(size / (1 << ((int(math.log(size,2) / 10) if size else 0) * 10)), ['bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'EiB', 'ZiB'][int(math.log(size,2) / 10) if size else 0])") + || echo $(python -c \ + "import math; \ + size=$(( 1024*$(ulimit -s) )); \ + print '{:.4g} {}'.format(size / (1 << ((int(math.log(size,2) / 10) if size else 0) * 10)), \ + ['bytes','KiB','MiB','GiB','TiB','EiB','ZiB'][int(math.log(size,2) / 10) if size else 0])") fi export DAMASK_NUM_THREADS From 304fdf1ebe47da15eba1e85e46ee786eced6d194 Mon Sep 17 00:00:00 2001 From: Aritra Chakraborty Date: Fri, 29 Jul 2016 20:41:15 -0400 Subject: [PATCH 127/412] can deal with "veterans" and "newbies" meaning over ride existing with new --- processing/post/addCalculation.py | 80 ++++++++++++++----------------- 1 file changed, 37 insertions(+), 43 deletions(-) diff --git a/processing/post/addCalculation.py b/processing/post/addCalculation.py index 5e8c155b1..1d603e9fb 100755 --- a/processing/post/addCalculation.py +++ b/processing/post/addCalculation.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2.7 +#!/usr/bin/env python2 # -*- coding: UTF-8 no BOM -*- import os,re,sys @@ -6,10 +6,15 @@ import math import numpy as np from optparse import OptionParser import damask +import collections scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptID = ' '.join([scriptName,damask.version]) +def listify(x): + return (x if isinstance(x, collections.Iterable) else [x]) + + # -------------------------------------------------------------------- # MAIN # -------------------------------------------------------------------- @@ -55,13 +60,9 @@ for i in xrange(len(options.formulas)): if filenames == []: filenames = [None] for name in filenames: - try: - table = damask.ASCIItable(name = name, - buffered = False) - output = damask.ASCIItable(name = name, - buffered = False) - except: - continue + try: table = damask.ASCIItable(name = name, + buffered = False) + except: continue damask.util.report(scriptName,name) # ------------------------------------------ read header ------------------------------------------- @@ -129,53 +130,46 @@ for name in filenames: while outputAlive and table.data_read(): # read next data line of ASCII table specials['_row_'] += 1 # count row - output.data_clear() # ------------------------------------------ calculate one result to get length of labels --------- if firstLine: firstLine = False - labelDim = {} - for label in [x for x in options.labels]: - labelDim[label] = np.size(eval(evaluator[label])) - if labelDim[label] == 0: options.labels.remove(label) + resultDim = {} + for label in list(options.labels): # iterate over stable copy + resultDim[label] = np.size(eval(evaluator[label])) # get dimension of formula[label] + if resultDim[label] == 0: options.labels.remove(label) # remove label if invalid result + + veterans = list(set(options.labels)&set(table.labels(raw=False)+table.labels(raw=True)) ) # intersection of requested and existing + newbies = list(set(options.labels)-set(table.labels(raw=False)+table.labels(raw=True)) ) # requested but not existing + + for veteran in list(veterans): + if resultDim[veteran] != table.label_dimension(veteran): + damask.util.croak('{} is ignored due to inconsistent dimension...'.format(veteran)) + veterans.remove(veteran) # ignore culprit + for newby in newbies: + table.labels_append(['{}_{}'.format(i+1,newby) for i in xrange(resultDim[newby])] + if resultDim[newby] > 1 else newby) # ------------------------------------------ assemble header --------------------------------------- - output.labels_clear() - tabLabels = table.labels() - for label in tabLabels: - dim = labelDim[label] if label in options.labels \ - else table.label_dimension(label) - output.labels_append(['{}_{}'.format(i+1,label) for i in xrange(dim)] if dim > 1 else label) - - for label in options.labels: - if label in tabLabels: continue - output.labels_append(['{}_{}'.format(i+1,label) for i in xrange(labelDim[label])] - if labelDim[label] > 1 - else label) - - output.info = table.info - output.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) - output.head_write() + table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) + table.head_write() # ------------------------------------------ process data ------------------------------------------ - for label in output.labels(): - oldIndices = table.label_indexrange(label) - Nold = max(1,len(oldIndices)) # Nold could be zero for new columns - Nnew = len(output.label_indexrange(label)) - output.data_append(eval(evaluator[label]) if label in options.labels and - (options.condition is None or eval(eval(evaluator_condition))) - else np.tile([table.data[i] for i in oldIndices] - if label in tabLabels - else np.nan, - np.ceil(float(Nnew)/Nold))[:Nnew]) # spread formula result into given number of columns + if options.condition is None or eval(eval(evaluator_condition)): # condition for veteran replacement fulfilled + for veteran in veterans: # evaluate formulae that overwrite + table.data[table.label_index(veteran): + table.label_index(veteran)+table.label_dimension(veteran)] = \ + listify(eval(evaluator[veteran])) + + for newby in newbies: # evaluate formulae that append + table.data_append(listify(eval(evaluator[newby]))) - outputAlive = output.data_write() # output processed line + outputAlive = table.data_write() # output processed line # ------------------------------------------ output finalization ----------------------------------- - table.input_close() # close ASCII tables - output.close() # close ASCII tables - + table.close() # close ASCII table + From cc27b4ba59fe8b5c97994c26c860633aa9b2658e Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 30 Jul 2016 08:17:47 +0200 Subject: [PATCH 128/412] analytic tangent option not supported anymore --- examples/AbaqusStandard/numerics.config | 1 - examples/ConfigFiles/numerics.config | 1 - 2 files changed, 2 deletions(-) diff --git a/examples/AbaqusStandard/numerics.config b/examples/AbaqusStandard/numerics.config index 2b0b8a96e..47091bf7f 100644 --- a/examples/AbaqusStandard/numerics.config +++ b/examples/AbaqusStandard/numerics.config @@ -1,2 +1 @@ fixed_seed 1697667030 -analyticJaco 1 diff --git a/examples/ConfigFiles/numerics.config b/examples/ConfigFiles/numerics.config index 85e3592b4..580b58e57 100644 --- a/examples/ConfigFiles/numerics.config +++ b/examples/ConfigFiles/numerics.config @@ -8,7 +8,6 @@ pert_Fg 1.0e-7 # deformation gradient perturbation for g pert_method 1 # perturbation method (1 = forward, 2 = backward or 3 = central) integrator 1 # integration method (1 = Fixed Point Iteration, 2 = Euler, 3 = Adaptive Euler, 4 = classical 4th order Runge-Kutta, 5 = 5th order Runge-Kutta Cash-Karp) integratorStiffness 1 # integration method used for stiffness (1 = Fixed Point Iteration, 2 = Euler, 3 = Adaptive Euler, 4 = classical 4th order Runge-Kutta, 5 = 5th order Runge-Kutta Cash-Karp) -analyticJaco 1 # use analytic Jacobian or perturbation (0 = perturbations, 1 = analytic) unitlength 1 # physical length of one computational length unit usepingpong 1 # use the ping pong (collect <-> calc) scheme (always off for Abaqus exp, must be on for Spectral Solver) From c3650a1b00ac2396ea09de3cf4f12347d1b021be Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 30 Jul 2016 08:20:57 +0200 Subject: [PATCH 129/412] shebang got reverted --- processing/post/addCalculation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/processing/post/addCalculation.py b/processing/post/addCalculation.py index 1d603e9fb..3c219d480 100755 --- a/processing/post/addCalculation.py +++ b/processing/post/addCalculation.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- import os,re,sys From 25ee7781c562134c225d39318607b564dc0569e8 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 30 Jul 2016 08:49:11 +0200 Subject: [PATCH 130/412] DAMASK has no special requirement on core size, just keep the system configuration --- DAMASK_env.csh | 3 --- DAMASK_env.sh | 1 - DAMASK_env.zsh | 1 - 3 files changed, 5 deletions(-) diff --git a/DAMASK_env.csh b/DAMASK_env.csh index 78f8922cd..8c2d783d1 100644 --- a/DAMASK_env.csh +++ b/DAMASK_env.csh @@ -31,9 +31,6 @@ if ( `which free` != "free: Command not found." ) then limit stacksize $stack # maximum stack size (kB) limit datasize $heap # maximum heap size (kB) endif -if ( `limit | grep coredumpsize` != "" ) then - limit coredumpsize 0 # prevent core dumping -endif if ( `limit | grep memoryuse` != "" ) then limit memoryuse unlimited # maximum physical memory size endif diff --git a/DAMASK_env.sh b/DAMASK_env.sh index da033afbe..ffff7e7d8 100644 --- a/DAMASK_env.sh +++ b/DAMASK_env.sh @@ -43,7 +43,6 @@ if [ "x$FREE" != "x" ]; then ulimit -s $(expr $freeMem / $DAMASK_NUM_THREADS / 2) 2>/dev/null # maximum stack size (kB) ulimit -d $(expr $freeMem / 2) 2>/dev/null # maximum heap size (kB) fi -ulimit -c 0 2>/dev/null # core file size (512-byte blocks) ulimit -v unlimited 2>/dev/null # maximum virtual memory size ulimit -m unlimited 2>/dev/null # maximum physical memory size diff --git a/DAMASK_env.zsh b/DAMASK_env.zsh index fa9a33987..d0ac0e8f1 100644 --- a/DAMASK_env.zsh +++ b/DAMASK_env.zsh @@ -31,7 +31,6 @@ if [ "`which free 2>/dev/null`" != "free not found" ]; then ulimit -s `expr $freeMem / $DAMASK_NUM_THREADS / 2` 2>/dev/null # maximum stack size (kB) ulimit -d `expr $freeMem / 2` 2>/dev/null # maximum heap size (kB) fi -ulimit -c 0 2>/dev/null # core file size (512-byte blocks) ulimit -v unlimited 2>/dev/null # maximum virtual memory size ulimit -m unlimited 2>/dev/null # maximum physical memory size From 7de1899884133b3d2c8f9bda4153428c69ee69fc Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 30 Jul 2016 08:53:42 +0200 Subject: [PATCH 131/412] print statement not existing in python3, use print function --- DAMASK_env.sh | 8 ++++---- DAMASK_env.zsh | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/DAMASK_env.sh b/DAMASK_env.sh index ffff7e7d8..19d2c627d 100644 --- a/DAMASK_env.sh +++ b/DAMASK_env.sh @@ -73,16 +73,16 @@ if [ ! -z "$PS1" ]; then || echo $(python -c \ "import math; \ size=$(( 1024*$(ulimit -d) )); \ - print '{:.4g} {}'.format(size / (1 << ((int(math.log(size,2) / 10) if size else 0) * 10)), \ - ['bytes','KiB','MiB','GiB','TiB','EiB','ZiB'][int(math.log(size,2) / 10) if size else 0])") + print('{:.4g} {}'.format(size / (1 << ((int(math.log(size,2) / 10) if size else 0) * 10)), \ + ['bytes','KiB','MiB','GiB','TiB','EiB','ZiB'][int(math.log(size,2) / 10) if size else 0]))") echo -n "stack size " [[ "$(ulimit -s)" == "unlimited" ]] \ && echo "unlimited" \ || echo $(python -c \ "import math; \ size=$(( 1024*$(ulimit -s) )); \ - print '{:.4g} {}'.format(size / (1 << ((int(math.log(size,2) / 10) if size else 0) * 10)), \ - ['bytes','KiB','MiB','GiB','TiB','EiB','ZiB'][int(math.log(size,2) / 10) if size else 0])") + print('{:.4g} {}'.format(size / (1 << ((int(math.log(size,2) / 10) if size else 0) * 10)), \ + ['bytes','KiB','MiB','GiB','TiB','EiB','ZiB'][int(math.log(size,2) / 10) if size else 0]))") fi export DAMASK_NUM_THREADS diff --git a/DAMASK_env.zsh b/DAMASK_env.zsh index d0ac0e8f1..2ce2351cd 100644 --- a/DAMASK_env.zsh +++ b/DAMASK_env.zsh @@ -61,16 +61,16 @@ if [ ! -z "$PS1" ]; then || echo $(python -c \ "import math; \ size=$(( 1024*$(ulimit -d) )); \ - print '{:.4g} {}'.format(size / (1 << ((int(math.log(size,2) / 10) if size else 0) * 10)), \ - ['bytes','KiB','MiB','GiB','TiB','EiB','ZiB'][int(math.log(size,2) / 10) if size else 0])") + print('{:.4g} {}'.format(size / (1 << ((int(math.log(size,2) / 10) if size else 0) * 10)), \ + ['bytes','KiB','MiB','GiB','TiB','EiB','ZiB'][int(math.log(size,2) / 10) if size else 0]))") echo -n "stack size " [[ "$(ulimit -s)" == "unlimited" ]] \ && echo "unlimited" \ || echo $(python -c \ "import math; \ size=$(( 1024*$(ulimit -s) )); \ - print '{:.4g} {}'.format(size / (1 << ((int(math.log(size,2) / 10) if size else 0) * 10)), \ - ['bytes','KiB','MiB','GiB','TiB','EiB','ZiB'][int(math.log(size,2) / 10) if size else 0])") + print('{:.4g} {}'.format(size / (1 << ((int(math.log(size,2) / 10) if size else 0) * 10)), \ + ['bytes','KiB','MiB','GiB','TiB','EiB','ZiB'][int(math.log(size,2) / 10) if size else 0]))") fi export DAMASK_NUM_THREADS From ab3415d44e7049c0a93cd4b29df95a39380b5497 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Sat, 30 Jul 2016 12:46:00 -0400 Subject: [PATCH 132/412] polishing and rearrangement of code snippets --- processing/post/addCalculation.py | 49 ++++++++++++++++--------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/processing/post/addCalculation.py b/processing/post/addCalculation.py index 3c219d480..7e6b75d21 100755 --- a/processing/post/addCalculation.py +++ b/processing/post/addCalculation.py @@ -1,18 +1,16 @@ #!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- -import os,re,sys -import math # noqa +import os,re,sys,math,collections import numpy as np from optparse import OptionParser import damask -import collections scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptID = ' '.join([scriptName,damask.version]) def listify(x): - return (x if isinstance(x, collections.Iterable) else [x]) + return x if isinstance(x, collections.Iterable) else [x] # -------------------------------------------------------------------- @@ -22,10 +20,12 @@ def listify(x): parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ Add or alter column(s) with derived values according to user-defined arithmetic operation between column(s). Column labels are tagged by '#label#' in formulas. Use ';' for ',' in functions. -Numpy is available as np. +Numpy is available as 'np'. Special variables: #_row_# -- row index -Examples: (1) magnitude of vector -- "np.linalg.norm(#vec#)" (2) rounded root of row number -- "round(math.sqrt(#_row_#);3)" +Examples: +(1) magnitude of vector -- "np.linalg.norm(#vec#)" +(2) rounded root of row number -- "round(math.sqrt(#_row_#);3)" """, version = scriptID) @@ -55,7 +55,7 @@ if len(options.labels) != len(options.formulas): for i in xrange(len(options.formulas)): options.formulas[i] = options.formulas[i].replace(';',',') -# --- loop over input files ------------------------------------------------------------------------- +# ------------------------------------- loop over input files -------------------------------------- if filenames == []: filenames = [None] @@ -69,12 +69,12 @@ for name in filenames: table.head_read() -# ----------------------------------------------------------------------------------------------------- +# -------------------------------------------------------------------------------------------------- specials = { \ '_row_': 0, } -# ------------------------------------------ Evaluate condition --------------------------------------- +# --------------------------------------- evaluate condition --------------------------------------- if options.condition is not None: interpolator = [] condition = options.condition # copy per file, since might be altered inline @@ -99,7 +99,7 @@ for name in filenames: evaluator_condition = "'" + condition + "'.format(" + ','.join(interpolator) + ")" -# ------------------------------------------ build formulae ---------------------------------------- +# ------------------------------------------ build formulas ---------------------------------------- evaluator = {} @@ -122,6 +122,10 @@ for name in filenames: evaluator[label] = formula +# ---------------------------- separate requested labels into old and new -------------------------- + + veterans = list(set(options.labels)&set(table.labels(raw=False)+table.labels(raw=True)) ) # intersection of requested and existing + newbies = list(set(options.labels)-set(table.labels(raw=False)+table.labels(raw=True)) ) # requested but not existing # ------------------------------------------ process data ------------------------------------------ @@ -131,45 +135,44 @@ for name in filenames: while outputAlive and table.data_read(): # read next data line of ASCII table specials['_row_'] += 1 # count row -# ------------------------------------------ calculate one result to get length of labels --------- - if firstLine: firstLine = False + +# ---------------------------- line 1: determine dimension of formulas ----------------------------- + resultDim = {} for label in list(options.labels): # iterate over stable copy resultDim[label] = np.size(eval(evaluator[label])) # get dimension of formula[label] if resultDim[label] == 0: options.labels.remove(label) # remove label if invalid result - - veterans = list(set(options.labels)&set(table.labels(raw=False)+table.labels(raw=True)) ) # intersection of requested and existing - newbies = list(set(options.labels)-set(table.labels(raw=False)+table.labels(raw=True)) ) # requested but not existing for veteran in list(veterans): if resultDim[veteran] != table.label_dimension(veteran): - damask.util.croak('{} is ignored due to inconsistent dimension...'.format(veteran)) - veterans.remove(veteran) # ignore culprit + damask.util.croak('skipping {} due to inconsistent dimension...'.format(veteran)) + veterans.remove(veteran) # discard culprit + +# ----------------------------------- line 1: assemble header -------------------------------------- + for newby in newbies: table.labels_append(['{}_{}'.format(i+1,newby) for i in xrange(resultDim[newby])] if resultDim[newby] > 1 else newby) -# ------------------------------------------ assemble header --------------------------------------- - table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) table.head_write() -# ------------------------------------------ process data ------------------------------------------ +# -------------------------------------- evaluate formulas ----------------------------------------- if options.condition is None or eval(eval(evaluator_condition)): # condition for veteran replacement fulfilled - for veteran in veterans: # evaluate formulae that overwrite + for veteran in veterans: # evaluate formulas that overwrite table.data[table.label_index(veteran): table.label_index(veteran)+table.label_dimension(veteran)] = \ listify(eval(evaluator[veteran])) - for newby in newbies: # evaluate formulae that append + for newby in newbies: # evaluate formulas that append table.data_append(listify(eval(evaluator[newby]))) outputAlive = table.data_write() # output processed line -# ------------------------------------------ output finalization ----------------------------------- +# ------------------------------------- output finalization ---------------------------------------- table.close() # close ASCII table From 23a57ec78fb46af221431e45c5246bfe8dc10e44 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Sat, 30 Jul 2016 12:52:49 -0400 Subject: [PATCH 133/412] reinstalled "NOQA" keyword for "import math" --- processing/post/addCalculation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/processing/post/addCalculation.py b/processing/post/addCalculation.py index 7e6b75d21..2a728578b 100755 --- a/processing/post/addCalculation.py +++ b/processing/post/addCalculation.py @@ -1,7 +1,8 @@ #!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- -import os,re,sys,math,collections +import os,re,sys,collections +import math # noqa import numpy as np from optparse import OptionParser import damask From 79ff040426ef5d920daa1a3baa5995ce32fd69f9 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Sat, 30 Jul 2016 15:07:44 -0400 Subject: [PATCH 134/412] sorting and clarification of help, shortening of output labels --- processing/post/addOrientations.py | 36 ++++++++++++++---------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/processing/post/addOrientations.py b/processing/post/addOrientations.py index 3c1f6dabc..17f3d9da6 100755 --- a/processing/post/addOrientations.py +++ b/processing/post/addOrientations.py @@ -24,24 +24,23 @@ outputChoices = ['quaternion','rodrigues','eulers'] parser.add_option('-o', '--output', dest = 'output', action = 'extend', metavar = '', - help = 'output orientation formats {%s}'%(','.join(outputChoices))) -parser.add_option('-r', '--rotation', - dest='rotation', - type = 'float', nargs = 4, metavar = ' '.join(['float']*4), - help = 'angle and axis to (pre)rotate orientation') - + help = 'output orientation formats {{{}}}'.format(', '.join(outputChoices))) parser.add_option('-s', '--symmetry', dest = 'symmetry', type = 'choice', choices = damask.Symmetry.lattices[1:], metavar='string', help = 'crystal symmetry [%default] {{{}}} '.format(', '.join(damask.Symmetry.lattices[1:]))) +parser.add_option('-d', '--degrees', + dest = 'degrees', + action = 'store_true', + help = 'angles are given in degrees [%default]') +parser.add_option('-r', '--rotation', + dest='rotation', + type = 'float', nargs = 4, metavar = ' '.join(['float']*4), + help = 'angle and axis to (pre)rotate orientation') parser.add_option('-e', '--eulers', dest = 'eulers', type = 'string', metavar = 'string', help = 'Euler angles label') -parser.add_option('-d', '--degrees', - dest = 'degrees', - action = 'store_true', - help = 'Euler angles are given in degrees [%default]') parser.add_option('-m', '--matrix', dest = 'matrix', type = 'string', metavar = 'string', @@ -98,9 +97,8 @@ r = damask.Quaternion().fromAngleAxis(toRadians*options.rotation[0],options.rota if filenames == []: filenames = [None] for name in filenames: - try: - table = damask.ASCIItable(name = name, - buffered = False) + try: table = damask.ASCIItable(name = name, + buffered = False) except: continue damask.util.report(scriptName,name) @@ -126,9 +124,9 @@ for name in filenames: table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) for output in options.output: - if output == 'quaternion': table.labels_append(['{}_quat({})'.format( i+1,options.symmetry) for i in xrange(4)]) - if output == 'rodrigues': table.labels_append(['{}_rodrigues({})'.format(i+1,options.symmetry) for i in xrange(3)]) - if output == 'eulers': table.labels_append(['{}_eulers({})'.format( i+1,options.symmetry) for i in xrange(3)]) + if output == 'quaternion': table.labels_append(['{}_{}_{}({})'.format(i+1,'quat',options.symmetry,label) for i in xrange(4)]) + elif output == 'rodrigues': table.labels_append(['{}_{}_{}({})'.format(i+1,'rodr',options.symmetry,label) for i in xrange(3)]) + elif output == 'eulers': table.labels_append(['{}_{}_{}({})'.format(i+1,'eulr',options.symmetry,label) for i in xrange(3)]) table.head_write() # ------------------------------------------ process data ------------------------------------------ @@ -153,9 +151,9 @@ for name in filenames: o.quaternion = r*o.quaternion for output in options.output: - if output == 'quaternion': table.data_append(o.asQuaternion()) - if output == 'rodrigues': table.data_append(o.asRodrigues()) - if output == 'eulers': table.data_append(o.asEulers('Bunge', degrees=options.degrees)) + if output == 'quaternion': table.data_append(o.asQuaternion()) + elif output == 'rodrigues': table.data_append(o.asRodrigues()) + elif output == 'eulers': table.data_append(o.asEulers('Bunge', degrees=options.degrees)) outputAlive = table.data_write() # output processed line # ------------------------------------------ output finalization ----------------------------------- From b02bbc77d89d8d883108e58deb8322da96c64011 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 31 Jul 2016 15:20:44 +0200 Subject: [PATCH 135/412] correctly handling whitespace --- lib/damask/environment.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/damask/environment.py b/lib/damask/environment.py index 4d24c6c6e..d301a5498 100644 --- a/lib/damask/environment.py +++ b/lib/damask/environment.py @@ -1,7 +1,6 @@ # -*- coding: UTF-8 no BOM -*- - -import os,subprocess,shlex,re +import os,subprocess,shlex,re,string class Environment(): __slots__ = [ \ @@ -23,7 +22,7 @@ class Environment(): for line in configFile: l = re.sub('^set ', '', line).strip() # remove "set" (tcsh) when setting variables if l and not l.startswith('#'): - items = l.split('=') + items = map(string.strip,l.split('=')) if len(items) == 2: self.options[items[0].upper()] = \ re.sub('\$\{*DAMASK_ROOT\}*',self.rootDir(),os.path.expandvars(items[1])) # expand all shell variables and DAMASK_ROOT From 0d1dfc153e1d25fb878837715061fd56831156a1 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 31 Jul 2016 21:30:23 +0200 Subject: [PATCH 136/412] without ticks, zsh expands ... to ../.. for some strange reasons --- DAMASK_env.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DAMASK_env.zsh b/DAMASK_env.zsh index 2ce2351cd..3bbab82df 100644 --- a/DAMASK_env.zsh +++ b/DAMASK_env.zsh @@ -41,7 +41,7 @@ if [ ! -z "$PS1" ]; then echo Max-Planck-Institut für Eisenforschung GmbH, Düsseldorf echo https://damask.mpie.de echo - echo Using environment with ... + echo "Using environment with ..." echo "DAMASK $DAMASK_ROOT" echo "Spectral Solver $SOLVER" echo "Post Processing $PROCESSING" From 0056f05b9d0ee6d99cf7d2d6711df155b522c8ff Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Sun, 31 Jul 2016 19:33:26 -0400 Subject: [PATCH 137/412] all functions using angles now feature logical "degrees" --- lib/damask/orientation.py | 50 +++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/lib/damask/orientation.py b/lib/damask/orientation.py index 414db52a1..15a63fdec 100644 --- a/lib/damask/orientation.py +++ b/lib/damask/orientation.py @@ -413,11 +413,15 @@ class Quaternion: @classmethod - def fromAngleAxis(cls, angle, axis): + def fromAngleAxis(cls, + angle, + axis, + degrees = False): if not isinstance(axis, np.ndarray): axis = np.array(axis,dtype='d') axis = axis.astype(float)/np.linalg.norm(axis) - s = math.sin(angle / 2.0) - w = math.cos(angle / 2.0) + angle = np.radians(angle) if degrees else angle + s = math.sin(0.5 * angle) + w = math.cos(0.5 * angle) x = axis[0] * s y = axis[1] * s z = axis[2] * s @@ -425,27 +429,26 @@ class Quaternion: @classmethod - def fromEulers(cls, eulers, type = 'Bunge'): + def fromEulers(cls, + eulers, + type = 'Bunge', + degrees = False): + if not isinstance(eulers, np.ndarray): eulers = np.array(eulers,dtype='d') + eulers = np.radians(eulers) if degrees else eulers - eulers *= 0.5 # reduce to half angles - - c1 = math.cos(eulers[0]) - s1 = math.sin(eulers[0]) - c2 = math.cos(eulers[1]) - s2 = math.sin(eulers[1]) - c3 = math.cos(eulers[2]) - s3 = math.sin(eulers[2]) + c = np.cos(0.5 * eulers) + s = np.sin(0.5 * eulers) if type.lower() == 'bunge' or type.lower() == 'zxz': - w = c1 * c2 * c3 - s1 * c2 * s3 - x = c1 * s2 * c3 + s1 * s2 * s3 - y = - c1 * s2 * s3 + s1 * s2 * c3 - z = c1 * c2 * s3 + s1 * c2 * c3 + w = c[0] * c[1] * c[2] - s[0] * c[1] * s[2] + x = c[0] * s[1] * c[2] + s[0] * s[1] * s[2] + y = - c[0] * s[1] * s[2] + s[0] * s[1] * c[2] + z = c[0] * c[1] * s[2] + s[0] * c[1] * c[2] else: - w = c1 * c2 * c3 - s1 * s2 * s3 - x = s1 * s2 * c3 + c1 * c2 * s3 - y = s1 * c2 * c3 + c1 * s2 * s3 - z = c1 * s2 * c3 - s1 * c2 * s3 + w = c[0] * c[1] * c[2] - s[0] * s[1] * s[2] + x = s[0] * s[1] * c[2] + c[0] * c[1] * s[2] + y = s[0] * c[1] * c[2] + c[0] * s[1] * s[2] + z = c[0] * s[1] * c[2] - s[0] * c[1] * s[2] return cls([w,x,y,z]) @@ -819,6 +822,7 @@ class Orientation: Eulers = None, random = False, # integer to have a fixed seed or True for real random symmetry = None, + degrees = False, ): if random: # produce random orientation if isinstance(random, bool ): @@ -826,16 +830,16 @@ class Orientation: else: self.quaternion = Quaternion.fromRandom(randomSeed=random) elif isinstance(Eulers, np.ndarray) and Eulers.shape == (3,): # based on given Euler angles - self.quaternion = Quaternion.fromEulers(Eulers,'bunge') + self.quaternion = Quaternion.fromEulers(Eulers,type='bunge',degrees=degrees) elif isinstance(matrix, np.ndarray) : # based on given rotation matrix self.quaternion = Quaternion.fromMatrix(matrix) elif isinstance(angleAxis, np.ndarray) and angleAxis.shape == (4,): # based on given angle and rotation axis - self.quaternion = Quaternion.fromAngleAxis(angleAxis[0],angleAxis[1:4]) + self.quaternion = Quaternion.fromAngleAxis(angleAxis[0],angleAxis[1:4],degrees=degrees) elif isinstance(Rodrigues, np.ndarray) and Rodrigues.shape == (3,): # based on given Rodrigues vector self.quaternion = Quaternion.fromRodrigues(Rodrigues) elif isinstance(quaternion, Quaternion): # based on given quaternion self.quaternion = quaternion.homomorphed() - elif isinstance(quaternion, np.ndarray) and quaternion.shape == (4,): # based on given quaternion + elif isinstance(quaternion, np.ndarray) and quaternion.shape == (4,): # based on given quaternion-like array self.quaternion = Quaternion(quaternion).homomorphed() self.symmetry = Symmetry(symmetry) From fa3387486d4defe80535e4f5d6676b21ae54206c Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Sun, 31 Jul 2016 19:35:10 -0400 Subject: [PATCH 138/412] clarified meaning of possible (global) rotation (lab/crystal frame) --- processing/post/addOrientations.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/processing/post/addOrientations.py b/processing/post/addOrientations.py index 17f3d9da6..6a6219a5a 100755 --- a/processing/post/addOrientations.py +++ b/processing/post/addOrientations.py @@ -17,6 +17,7 @@ parser = OptionParser(option_class=damask.extendableOption, usage='%prog options Add quaternion and/or Bunge Euler angle representation of crystal lattice orientation. Orientation is given by quaternion, Euler angles, rotation matrix, or crystal frame coordinates (i.e. component vectors of rotation matrix). +Additional (globally fixed) rotations of the lab frame and/or crystal frame can be applied. """, version = scriptID) @@ -33,10 +34,14 @@ parser.add_option('-d', '--degrees', dest = 'degrees', action = 'store_true', help = 'angles are given in degrees [%default]') -parser.add_option('-r', '--rotation', - dest='rotation', +parser.add_option('-R', '--labrotation', + dest='labrotation', type = 'float', nargs = 4, metavar = ' '.join(['float']*4), - help = 'angle and axis to (pre)rotate orientation') + help = 'angle and axis of additional lab frame rotation') +parser.add_option('-r', '--crystalrotation', + dest='crystalrotation', + type = 'float', nargs = 4, metavar = ' '.join(['float']*4), + help = 'angle and axis of additional crystal frame rotation') parser.add_option('-e', '--eulers', dest = 'eulers', type = 'string', metavar = 'string', @@ -90,7 +95,8 @@ if np.sum(input) != 1: parser.error('needs exactly one input format.') (options.quaternion,4,'quaternion'), ][np.where(input)[0][0]] # select input label that was requested toRadians = math.pi/180.0 if options.degrees else 1.0 # rescale degrees to radians -r = damask.Quaternion().fromAngleAxis(toRadians*options.rotation[0],options.rotation[1:]) # pre-rotation +r = damask.Quaternion().fromAngleAxis(toRadians*options.crystalrotation[0],options.crystalrotation[1:]) # crystal frame rotation +R = damask.Quaternion().fromAngleAxis(toRadians*options. labrotation[0],options. labrotation[1:]) # lab frame rotation # --- loop over input files ------------------------------------------------------------------------ @@ -148,7 +154,7 @@ for name in filenames: o = damask.Orientation(quaternion = np.array(map(float,table.data[column:column+4])), symmetry = options.symmetry).reduced() - o.quaternion = r*o.quaternion + o.quaternion = r*o.quaternion*R # apply additional lab and crystal frame rotations for output in options.output: if output == 'quaternion': table.data_append(o.asQuaternion()) From 6c826417132f6b3a04b504198a9f184368e7fae3 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 1 Aug 2016 16:43:14 +0200 Subject: [PATCH 139/412] added defaults (bugfix) --- processing/post/addOrientations.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/processing/post/addOrientations.py b/processing/post/addOrientations.py index 6a6219a5a..c778e67b0 100755 --- a/processing/post/addOrientations.py +++ b/processing/post/addOrientations.py @@ -69,7 +69,8 @@ parser.add_option('-q', '--quaternion', parser.set_defaults(output = [], symmetry = damask.Symmetry.lattices[-1], - rotation = (0.,1.,1.,1.), # no rotation about 1,1,1 + labrotation = (0.,1.,1.,1.), # no rotation about 1,1,1 + crystalrotation = (0.,1.,1.,1.), # no rotation about 1,1,1 degrees = False, ) From 0219a5f0e3c53a3d239f2280ea4b65a842ce7f4c Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 1 Aug 2016 17:01:13 +0200 Subject: [PATCH 140/412] regex match --- lib/damask/environment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/damask/environment.py b/lib/damask/environment.py index d301a5498..fedc22e36 100644 --- a/lib/damask/environment.py +++ b/lib/damask/environment.py @@ -22,7 +22,7 @@ class Environment(): for line in configFile: l = re.sub('^set ', '', line).strip() # remove "set" (tcsh) when setting variables if l and not l.startswith('#'): - items = map(string.strip,l.split('=')) + items = re.split(r'\s*=\s*',l) if len(items) == 2: self.options[items[0].upper()] = \ re.sub('\$\{*DAMASK_ROOT\}*',self.rootDir(),os.path.expandvars(items[1])) # expand all shell variables and DAMASK_ROOT From 6b003c6ea81878a05000b4a896c0cd63cc3ed757 Mon Sep 17 00:00:00 2001 From: Test User Date: Tue, 2 Aug 2016 04:27:21 +0200 Subject: [PATCH 141/412] updated version information after successful test of v2.0.1-35-g6c82641 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 5af1fb958..1ec9fb2d4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-5-g920cf2c +v2.0.1-35-g6c82641 From ccc0ac35ac21583daf8d9c6e8d0d85a1079347f5 Mon Sep 17 00:00:00 2001 From: Jennifer Nastola Date: Tue, 2 Aug 2016 11:30:36 +0200 Subject: [PATCH 142/412] copied from ang_toTable --- processing/misc/DREAM3D_toTable.py | 72 ++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 processing/misc/DREAM3D_toTable.py diff --git a/processing/misc/DREAM3D_toTable.py b/processing/misc/DREAM3D_toTable.py new file mode 100644 index 000000000..7fa2c71b7 --- /dev/null +++ b/processing/misc/DREAM3D_toTable.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python2.7 +# -*- coding: UTF-8 no BOM -*- + +import os,h5py,sys +import numpy as np +from optparse import OptionParser +import damask + +scriptName = os.path.splitext(os.path.basename(__file__))[0] +scriptID = ' '.join([scriptName,damask.version]) + + +#-------------------------------------------------------------------------------------------------- +# MAIN +#-------------------------------------------------------------------------------------------------- + +parser = OptionParser(option_class=damask.extendableOption, usage='%prog [geomfile[s]]', description = """ +Convert DREAM3D file to ASCIItable + +""", version = scriptID) + +(options, filenames) = parser.parse_args() + +rootDir ='DataContainers/ImageDataContainer' + +# --- loop over input files ------------------------------------------------------------------------- + +if filenames == []: parser.error('no input file specified.') + +for name in filenames: + try: + table = damask.ASCIItable(outname = os.path.splitext(name)[0]+'.txt', + buffered = False + ) + except: continue + damask.util.report(scriptName,name) + + inFile = h5py.File(name, 'r') + + grid = inFile[rootDir+'/_SIMPL_GEOMETRY/DIMENSIONS'][...] + size = grid * inFile[rootDir+'/_SIMPL_GEOMETRY/SPACING'][...] + origin = inFile[rootDir+'/_SIMPL_GEOMETRY/ORIGIN'][...] + +# --- read comments -------------------------------------------------------------------------------- + dat = np.hstack( (inFile[rootDir+'/CellData/EulerAngles'][...].reshape(grid.prod(),3), + inFile[rootDir+'/CellData/Phases'][...].reshape(grid.prod(),1), + inFile[rootDir+'/CellData/Confidence Index'][...].reshape(grid.prod(),1), + inFile[rootDir+'/CellData/Fit'][...].reshape(grid.prod(),1), + inFile[rootDir+'/CellData/Image Quality'][...].reshape(grid.prod(),1))) + + print dat.shape + sys.exit() + table.labels_clear() + table.labels_append(['1_Euler','2_Euler','3_Euler', + '1_pos','2_pos', + 'IQ','CI','PhaseID','Intensity','Fit', + ], # OIM Analysis 7.2 Manual, p 403 (of 517) + reset = True) + +# ------------------------------------------ assemble header --------------------------------------- + + table.head_write() + +#--- write remainder of data file ------------------------------------------------------------------ + + outputAlive = True + while outputAlive and table.data_read(): + outputAlive = table.data_write() + +# ------------------------------------------ finalize output --------------------------------------- + + table.close() From a0567e8642cf943f5642b5a8e3557c213eeb0366 Mon Sep 17 00:00:00 2001 From: Jennifer Nastola Date: Thu, 4 Aug 2016 11:11:24 +0200 Subject: [PATCH 143/412] added FeatureID and right coordniates to table --- processing/misc/DREAM3D_toTable.py | 52 ++++++++++++++++-------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/processing/misc/DREAM3D_toTable.py b/processing/misc/DREAM3D_toTable.py index 7fa2c71b7..e42d09a31 100644 --- a/processing/misc/DREAM3D_toTable.py +++ b/processing/misc/DREAM3D_toTable.py @@ -38,35 +38,37 @@ for name in filenames: inFile = h5py.File(name, 'r') grid = inFile[rootDir+'/_SIMPL_GEOMETRY/DIMENSIONS'][...] - size = grid * inFile[rootDir+'/_SIMPL_GEOMETRY/SPACING'][...] - origin = inFile[rootDir+'/_SIMPL_GEOMETRY/ORIGIN'][...] + # --- read comments -------------------------------------------------------------------------------- - dat = np.hstack( (inFile[rootDir+'/CellData/EulerAngles'][...].reshape(grid.prod(),3), - inFile[rootDir+'/CellData/Phases'][...].reshape(grid.prod(),1), - inFile[rootDir+'/CellData/Confidence Index'][...].reshape(grid.prod(),1), - inFile[rootDir+'/CellData/Fit'][...].reshape(grid.prod(),1), - inFile[rootDir+'/CellData/Image Quality'][...].reshape(grid.prod(),1))) - - print dat.shape - sys.exit() - table.labels_clear() - table.labels_append(['1_Euler','2_Euler','3_Euler', - '1_pos','2_pos', - 'IQ','CI','PhaseID','Intensity','Fit', - ], # OIM Analysis 7.2 Manual, p 403 (of 517) - reset = True) + + coords = (np.mgrid[0:grid[2], 0:grid[1], 0: grid[0]]).reshape(3, -1).T + coords = (np.fliplr(coords)*inFile[rootDir+'/_SIMPL_GEOMETRY/SPACING'][...] + + inFile[rootDir+'/_SIMPL_GEOMETRY/ORIGIN'][...] + + inFile[rootDir+'/_SIMPL_GEOMETRY/SPACING'][...]*0.5) + table.data = np.hstack( (coords, + inFile[rootDir+'/CellData/EulerAngles'][...].reshape(grid.prod(),3), + inFile[rootDir+'/CellData/Phases'][...].reshape(grid.prod(),1), + inFile[rootDir+'/CellData/Confidence Index'][...].reshape(grid.prod(),1), + inFile[rootDir+'/CellData/Fit'][...].reshape(grid.prod(),1), + inFile[rootDir+'/CellData/Image Quality'][...].reshape(grid.prod(),1))) + + + labels = ['1_pos','2_pos','3_pos', + '1_Euler','2_Euler','3_Euler', + 'PhaseID','CI','Fit','IQ'] + try: + table.data = np.hstack((table.data, inFile[rootDir+'/CellData/FeatureIds'][...].reshape(grid.prod(),1))) + labels.append(['FeatureID']) + except Exception: + pass + # ------------------------------------------ assemble header --------------------------------------- - + table.labels_clear() + table.labels_append(labels,reset = True) table.head_write() - -#--- write remainder of data file ------------------------------------------------------------------ - - outputAlive = True - while outputAlive and table.data_read(): - outputAlive = table.data_write() - + # ------------------------------------------ finalize output --------------------------------------- - + table.data_writeArray() #(fmt='%e2.2') table.close() From 22d275b009b8b1f27f98ebbcdcdae504c877c4b6 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 8 Aug 2016 10:36:34 +0200 Subject: [PATCH 144/412] initialization also needed for "empty" phase to allocate state arrays seems to be safe --- code/plastic_nonlocal.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/plastic_nonlocal.f90 b/code/plastic_nonlocal.f90 index cb2b31772..f7b36897a 100644 --- a/code/plastic_nonlocal.f90 +++ b/code/plastic_nonlocal.f90 @@ -1115,7 +1115,7 @@ allocate(nonSchmidProjection(3,3,4,maxTotalNslip,maxNinstances), initializeInstances: do phase = 1_pInt, size(phase_plasticity) NofMyPhase=count(material_phase==phase) - myPhase2: if (phase_plasticity(phase) == PLASTICITY_NONLOCAL_ID .and. NofMyPhase/=0) then + myPhase2: if (phase_plasticity(phase) == PLASTICITY_NONLOCAL_ID) then instance = phase_plasticityInstance(phase) !*** Inverse lookup of my slip system family and the slip system in lattice From 535f8be76ac99c2ba68c955f9095e3269af2113f Mon Sep 17 00:00:00 2001 From: Test User Date: Mon, 8 Aug 2016 16:27:05 +0200 Subject: [PATCH 145/412] updated version information after successful test of v2.0.1-39-g22d275b --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 1ec9fb2d4..5a316242f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-35-g6c82641 +v2.0.1-39-g22d275b From d239cab3aea994a651033b5d6d807cc86679a13e Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 11 Aug 2016 13:48:15 +0200 Subject: [PATCH 146/412] corrected help --- processing/misc/OIMgrainFile_toTable.py | 2 +- processing/misc/ang_toTable.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/processing/misc/OIMgrainFile_toTable.py b/processing/misc/OIMgrainFile_toTable.py index 74d5d1819..c936d92e6 100755 --- a/processing/misc/OIMgrainFile_toTable.py +++ b/processing/misc/OIMgrainFile_toTable.py @@ -12,7 +12,7 @@ scriptID = ' '.join([scriptName,damask.version]) # MAIN #-------------------------------------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ +parser = OptionParser(option_class=damask.extendableOption, usage='%prog [file[s]]', description = """ Adds header to OIM grain file to make it accesible as ASCII table """, version = scriptID) diff --git a/processing/misc/ang_toTable.py b/processing/misc/ang_toTable.py index 177955f17..19fdcd55b 100755 --- a/processing/misc/ang_toTable.py +++ b/processing/misc/ang_toTable.py @@ -13,7 +13,7 @@ scriptID = ' '.join([scriptName,damask.version]) # MAIN #-------------------------------------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog [geomfile[s]]', description = """ +parser = OptionParser(option_class=damask.extendableOption, usage='%prog [angfile[s]]', description = """ Convert TSL/EDAX *.ang file to ASCIItable """, version = scriptID) @@ -30,7 +30,7 @@ for name in filenames: outname = os.path.splitext(name)[0]+'.txt' if name else name, buffered = False, labeled = False) except: continue - table.croak('\033[1m'+scriptName+'\033[0m'+(': '+name if name else '')) + damask.util.report(scriptName,name) # --- interpret header ----------------------------------------------------------------------------- From 6bdce9b3320fa3505c2d6e077a84f80ec9d526b0 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Thu, 11 Aug 2016 14:22:07 -0400 Subject: [PATCH 147/412] fixed error for completely empty label list in read_array --- lib/damask/asciitable.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/damask/asciitable.py b/lib/damask/asciitable.py index 4fe4f9156..145b87974 100644 --- a/lib/damask/asciitable.py +++ b/lib/damask/asciitable.py @@ -501,10 +501,10 @@ class ASCIItable(): columns = [] for i,(c,d) in enumerate(zip(indices[present],dimensions[present])): # for all valid labels ... # ... transparently add all components unless column referenced by number or with explicit dimension - columns += range(c,c + \ - (d if str(c) != str(labels[present[i]]) else \ + columns += range(c,c + + (d if str(c) != str(labels[present[i]]) else 1)) - use = np.array(columns) + use = np.array(columns) if len(columns) > 0 else None self.tags = list(np.array(self.tags)[use]) # update labels with valid subset From 600731b15ca2fd90ffedbb5c284114082589a5b0 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Thu, 11 Aug 2016 14:23:29 -0400 Subject: [PATCH 148/412] modernized, gracefully add NaN for out-of-bounds mapping --- processing/post/addMapped.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/processing/post/addMapped.py b/processing/post/addMapped.py index c57e62d8b..f67d88d15 100755 --- a/processing/post/addMapped.py +++ b/processing/post/addMapped.py @@ -2,6 +2,7 @@ # -*- coding: UTF-8 no BOM -*- import os,sys +import numpy as np from optparse import OptionParser import damask @@ -28,7 +29,7 @@ parser.add_option('-o','--offset', parser.add_option('-l','--label', dest = 'label', action = 'extend', metavar = '', - help='heading of column(s) to be mapped') + help='column label(s) to be mapped') parser.add_option('-a','--asciitable', dest = 'asciitable', type = 'string', metavar = 'string', @@ -49,12 +50,13 @@ if options.map is None: if options.asciitable is not None and os.path.isfile(options.asciitable): mappedTable = damask.ASCIItable(name = options.asciitable, - buffered = False, readonly = True) + buffered = False, + readonly = True) mappedTable.head_read() # read ASCII header info of mapped table missing_labels = mappedTable.data_readArray(options.label) if len(missing_labels) > 0: - mappedTable.croak('column{} {} not found...'.format('s' if len(missing_labels) > 1 else '',', '.join(missing_labels))) + damask.util.croak('column{} {} not found...'.format('s' if len(missing_labels) > 1 else '',', '.join(missing_labels))) else: parser.error('no mapped ASCIItable given.') @@ -64,9 +66,8 @@ else: if filenames == []: filenames = [None] for name in filenames: - try: - table = damask.ASCIItable(name = name, - buffered = False) + try: table = damask.ASCIItable(name = name, + buffered = False) except: continue damask.util.report(scriptName,name) @@ -96,7 +97,10 @@ for name in filenames: outputAlive = True while outputAlive and table.data_read(): # read next data line of ASCII table - table.data_append(mappedTable.data[int(round(float(table.data[mappedColumn])))+options.offset-1]) # add all mapped data types + try: + table.data_append(mappedTable.data[int(round(float(table.data[mappedColumn])))+options.offset-1]) # add all mapped data types + except IndexError: + table.data_append(np.nan*np.ones_like(mappedTable.data[0])) outputAlive = table.data_write() # output processed line # ------------------------------------------ output finalization ----------------------------------- From 64ac05fc26374c12b1dc46a35b82d842740eaf4f Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Thu, 11 Aug 2016 14:24:40 -0400 Subject: [PATCH 149/412] removed left-over debug output --- processing/post/addSchmidfactors.py | 1 - 1 file changed, 1 deletion(-) diff --git a/processing/post/addSchmidfactors.py b/processing/post/addSchmidfactors.py index 0bc529034..067c3036a 100755 --- a/processing/post/addSchmidfactors.py +++ b/processing/post/addSchmidfactors.py @@ -167,7 +167,6 @@ force = np.array(options.force) force /= np.linalg.norm(force) if options.normal: - damask.util.croak('got normal') normal = np.array(options.normal) normal /= np.linalg.norm(normal) if abs(np.dot(force,normal)) > 1e-3: From 49f94a1cb57e09ab23b6c0ff4abe08dc4784f62b Mon Sep 17 00:00:00 2001 From: Test User Date: Fri, 12 Aug 2016 04:27:00 +0200 Subject: [PATCH 150/412] updated version information after successful test of v2.0.1-43-g64ac05f --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 5a316242f..921b19cbd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-39-g22d275b +v2.0.1-43-g64ac05f From c28649d348395bd01c3284ec21fecafdcc04aea2 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 16 Aug 2016 13:30:11 +0200 Subject: [PATCH 151/412] error check for mpi parallelization --- code/mesh.f90 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/code/mesh.f90 b/code/mesh.f90 index 0562ab218..32f94d66b 100644 --- a/code/mesh.f90 +++ b/code/mesh.f90 @@ -481,6 +481,7 @@ subroutine mesh_init(ip,el) #endif #ifdef Spectral IO_open_file, & + IO_error, & #else IO_open_InputFile, & #endif @@ -507,7 +508,8 @@ subroutine mesh_init(ip,el) implicit none #ifdef Spectral - integer(C_INTPTR_T) :: gridMPI(3), alloc_local, local_K, local_K_offset + integer(C_INTPTR_T) :: devNull, local_K, local_K_offset + integer :: ierr, worldsize #endif integer(pInt), parameter :: FILEUNIT = 222_pInt integer(pInt), intent(in) :: el, ip @@ -547,10 +549,13 @@ subroutine mesh_init(ip,el) call IO_open_file(FILEUNIT,geometryFile) ! parse info from geometry file... if (myDebug) write(6,'(a)') ' Opened geometry file'; flush(6) grid = mesh_spectral_getGrid(fileUnit) + call MPI_comm_size(MPI_COMM_WORLD, worldsize, ierr) + if(ierr /=0_pInt) call IO_error(894_pInt, ext_msg='MPI_comm_size') + if(worldsize>grid(3)) call IO_error(894_pInt, ext_msg='number of processes exceeds grid(3)') + geomSize = mesh_spectral_getSize(fileUnit) - gridMPI = int(grid,C_INTPTR_T) - alloc_local = fftw_mpi_local_size_3d(gridMPI(3), gridMPI(2), gridMPI(1)/2 +1, & - MPI_COMM_WORLD, local_K, local_K_offset) + devNull = fftw_mpi_local_size_3d(int(grid(3),C_INTPTR_T),int(grid(2),C_INTPTR_T),& + int(grid(1),C_INTPTR_T)/2+1,MPI_COMM_WORLD,local_K,local_K_offset) grid3 = int(local_K,pInt) grid3Offset = int(local_K_offset,pInt) size3 = geomSize(3)*real(grid3,pReal) /real(grid(3),pReal) From 2738415b348a618fbbb7dde0111f2cef6fe6d4b8 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 20 Aug 2016 06:59:50 +0200 Subject: [PATCH 152/412] removed twinning parameters --- .../Phase_Phenopowerlaw_BCC-Ferrite.config | 26 ++++++------------- .../Phase_Phenopowerlaw_BCC-Martensite.config | 25 ++++++------------ 2 files changed, 16 insertions(+), 35 deletions(-) diff --git a/examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Ferrite.config b/examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Ferrite.config index 7344ef455..6efd84f65 100644 --- a/examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Ferrite.config +++ b/examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Ferrite.config @@ -1,35 +1,25 @@ # Tasan et.al. 2015 Acta Materalia # Tasan et.al. 2015 International Journal of Plasticity # Diehl et.al. 2015 Meccanica -[BCC_Ferrite] +[BCC-Ferrite] + elasticity hooke plasticity phenopowerlaw lattice_structure bcc -Nslip 12 12 # per family -Ntwin 0 # per family +Nslip 12 12 # per family +Ntwin 0 # per family c11 233.3e9 c12 135.5e9 c44 118.0e9 gdot0_slip 0.001 n_slip 20 -tau0_slip 95.e6 97.e6 0 0 # per family, optimization long simplex 109 -tausat_slip 222.e6 412.7e6 0 0 # per family, optimization long simplex 109 -gdot0_twin 0.001 -n_twin 20 -tau0_twin 31.0e6 # per family -s_pr 0 # push-up factor for slip saturation due to twinning -twin_b 0 -twin_c 0 -twin_d 0 -twin_e 0 -h0_slipslip 1000.0e6 # opti -h0_twinslip 0 -h0_twintwin 0 +tau0_slip 95.e6 97.e6 # per family, optimization long simplex 109 +tausat_slip 222.e6 412.7e6 # per family, optimization long simplex 109 +h0_slipslip 1000.0e6 interaction_slipslip 1 1 1.4 1.4 1.4 1.4 interaction_sliptwin 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 interaction_twinslip 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 interaction_twintwin 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -w0_slip 2.0 # opti -atol_resistance 1 +w0_slip 2.0 (output) totalshear diff --git a/examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Martensite.config b/examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Martensite.config index b9960d325..89ae0339b 100644 --- a/examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Martensite.config +++ b/examples/ConfigFiles/Phase_Phenopowerlaw_BCC-Martensite.config @@ -1,34 +1,25 @@ # Tasan et.al. 2015 Acta Materalia # Tasan et.al. 2015 International Journal of Plasticity # Diehl et.al. 2015 Meccanica -[BCC_Martensite] -plasticity phenopowerlaw +[BCC-Martensite] + elasticity hooke +plasticity phenopowerlaw + lattice_structure bcc -Nslip 12 12 # per family -Ntwin 0 # per family +Nslip 12 12 # per family +Ntwin 0 # per family c11 417.4e9 c12 242.4e9 c44 211.1e9 gdot0_slip 0.001 n_slip 20 -tau0_slip 405.8e6 456.7e6 0 0 # per family -tausat_slip 872.9e6 971.2e6 0 0 # per family -gdot0_twin 0.001 -n_twin 20 -tau0_twin 31.0e6 # per family -s_pr 0 # push-up factor for slip saturation due to twinning -twin_b 0 -twin_c 0 -twin_d 0 -twin_e 0 +tau0_slip 405.8e6 456.7e6 # per family +tausat_slip 872.9e6 971.2e6 # per family h0_slipslip 563.0e9 -h0_twinslip 0 -h0_twintwin 0 interaction_slipslip 1 1 1.4 1.4 1.4 1.4 interaction_sliptwin 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 interaction_twinslip 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 interaction_twintwin 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 w0_slip 2.0 -atol_resistance 1 (output) totalshear From 59e7a41aa2093da5a7bcd75d661f89ed60f4fbf6 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 20 Aug 2016 07:14:18 +0200 Subject: [PATCH 153/412] now longer write empty file if file given in {} not existing --- code/IO.f90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/IO.f90 b/code/IO.f90 index db0c056fe..22b56d819 100644 --- a/code/IO.f90 +++ b/code/IO.f90 @@ -129,6 +129,7 @@ recursive function IO_read(fileUnit,reset) result(line) !-------------------------------------------------------------------------------------------------- ! normal case if (input == '') return ! regular line + !-------------------------------------------------------------------------------------------------- ! recursion case if (stack >= 10_pInt) call IO_error(104_pInt,ext_msg=input) ! recursion limit reached @@ -141,7 +142,7 @@ recursive function IO_read(fileUnit,reset) result(line) pathOn(stack) = path(1:scan(path,SEP,.true.))//input ! glue include to current file's dir endif - open(newunit=unitOn(stack),iostat=myStat,file=pathOn(stack)) ! open included file + open(newunit=unitOn(stack),iostat=myStat,file=pathOn(stack),action=read) ! open included file if (myStat /= 0_pInt) call IO_error(100_pInt,el=myStat,ext_msg=pathOn(stack)) line = IO_read(fileUnit) From 4dfc8d0132e8155da1fa531a6c28e12b8c8017de Mon Sep 17 00:00:00 2001 From: zhangc43 Date: Mon, 22 Aug 2016 10:27:49 -0400 Subject: [PATCH 154/412] add MPI_finalize() following Martin & Philip suggestions; --- code/DAMASK_spectral.f90 | 118 ++++++++++++++++++++------------------- 1 file changed, 62 insertions(+), 56 deletions(-) diff --git a/code/DAMASK_spectral.f90 b/code/DAMASK_spectral.f90 index c363393d8..96b3c1451 100644 --- a/code/DAMASK_spectral.f90 +++ b/code/DAMASK_spectral.f90 @@ -81,7 +81,7 @@ program DAMASK_spectral use spectral_mech_Polarisation use spectral_damage use spectral_thermal - + implicit none @@ -93,9 +93,9 @@ program DAMASK_spectral logical, dimension(9) :: temp_maskVector = .false. !< temporarily from loadcase file when reading in tensors integer(pInt), parameter :: FILEUNIT = 234_pInt !< file unit, DAMASK IO does not support newunit feature integer(pInt), allocatable, dimension(:) :: chunkPos - + integer(pInt) :: & - N_t = 0_pInt, & !< # of time indicators found in load case file + N_t = 0_pInt, & !< # of time indicators found in load case file N_n = 0_pInt, & !< # of increment specifiers found in load case file N_def = 0_pInt !< # of rate of deformation specifiers found in load case file character(len=65536) :: & @@ -105,7 +105,7 @@ program DAMASK_spectral ! loop variables, convergence etc. real(pReal), dimension(3,3), parameter :: & ones = 1.0_pReal, & - zeros = 0.0_pReal + zeros = 0.0_pReal integer(pInt), parameter :: & subStepFactor = 2_pInt !< for each substep, divide the last time increment by 2.0 real(pReal) :: & @@ -150,6 +150,7 @@ program DAMASK_spectral MPI_file_get_position, & MPI_file_write, & MPI_abort, & + MPI_finalize, & MPI_allreduce, & PETScFinalize @@ -159,7 +160,7 @@ program DAMASK_spectral write(6,'(/,a)') ' <<<+- DAMASK_spectral init -+>>>' write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - + !-------------------------------------------------------------------------------------------------- ! initialize field solver information nActiveFields = 1 @@ -192,14 +193,14 @@ program DAMASK_spectral call IO_error(error_ID=837_pInt,ext_msg = trim(loadCaseFile)) ! error message for incomplete loadcase allocate (loadCases(N_n)) ! array of load cases loadCases%P%myType='p' - + do i = 1, size(loadCases) allocate(loadCases(i)%ID(nActiveFields)) field = 1 loadCases(i)%ID(field) = FIELD_MECH_ID ! mechanical active by default thermalActive: if (any(thermal_type == THERMAL_conduction_ID)) then field = field + 1 - loadCases(i)%ID(field) = FIELD_THERMAL_ID + loadCases(i)%ID(field) = FIELD_THERMAL_ID endif thermalActive damageActive: if (any(damage_type == DAMAGE_nonlocal_ID)) then field = field + 1 @@ -231,11 +232,11 @@ program DAMASK_spectral do j = 1_pInt, 9_pInt temp_maskVector(j) = IO_stringValue(line,chunkPos,i+j) /= '*' ! true if not a * enddo - do j = 1_pInt,9_pInt + do j = 1_pInt,9_pInt if (temp_maskVector(j)) temp_valueVector(j) = IO_floatValue(line,chunkPos,i+j) ! read value where applicable enddo loadCases(currentLoadCase)%deformation%maskLogical = & ! logical mask in 3x3 notation - transpose(reshape(temp_maskVector,[ 3,3])) + transpose(reshape(temp_maskVector,[ 3,3])) loadCases(currentLoadCase)%deformation%maskFloat = & ! float (1.0/0.0) mask in 3x3 notation merge(ones,zeros,loadCases(currentLoadCase)%deformation%maskLogical) loadCases(currentLoadCase)%deformation%values = math_plain9to33(temp_valueVector) ! values in 3x3 notation @@ -259,10 +260,10 @@ program DAMASK_spectral loadCases(currentLoadCase)%incs = IO_intValue(line,chunkPos,i+1_pInt) loadCases(currentLoadCase)%logscale = 1_pInt case('freq','frequency','outputfreq') ! frequency of result writings - loadCases(currentLoadCase)%outputfrequency = IO_intValue(line,chunkPos,i+1_pInt) + loadCases(currentLoadCase)%outputfrequency = IO_intValue(line,chunkPos,i+1_pInt) case('r','restart','restartwrite') ! frequency of writing restart information loadCases(currentLoadCase)%restartfrequency = & - max(0_pInt,IO_intValue(line,chunkPos,i+1_pInt)) + max(0_pInt,IO_intValue(line,chunkPos,i+1_pInt)) case('guessreset','dropguessing') loadCases(currentLoadCase)%followFormerTrajectory = .false. ! do not continue to predict deformation along former trajectory case('euler') ! rotation of currentLoadCase given in euler angles @@ -271,10 +272,10 @@ program DAMASK_spectral k = 1_pInt ! assuming keyword indicating degree/radians present select case (IO_lc(IO_stringValue(line,chunkPos,i+1_pInt))) case('deg','degree') - case('rad','radian') ! don't convert from degree to radian + case('rad','radian') ! don't convert from degree to radian l = 0_pInt - case default - k = 0_pInt + case default + k = 0_pInt end select do j = 1_pInt, 3_pInt temp_valueVector(j) = IO_floatValue(line,chunkPos,i+k+j) @@ -289,7 +290,7 @@ program DAMASK_spectral loadCases(currentLoadCase)%rotation = math_plain9to33(temp_valueVector) end select enddo; enddo - close(FILEUNIT) + close(FILEUNIT) !-------------------------------------------------------------------------------------------------- ! consistency checks and output of load case @@ -323,7 +324,7 @@ program DAMASK_spectral enddo if (any(loadCases(currentLoadCase)%P%maskLogical .eqv. & loadCases(currentLoadCase)%deformation%maskLogical)) errorID = 831_pInt ! exclusive or masking only - if (any(loadCases(currentLoadCase)%P%maskLogical .and. & + if (any(loadCases(currentLoadCase)%P%maskLogical .and. & transpose(loadCases(currentLoadCase)%P%maskLogical) .and. & reshape([ .false.,.true.,.true.,.true.,.false.,.true.,.true.,.true.,.false.],[ 3,3]))) & errorID = 838_pInt ! no rotation is allowed by stress BC @@ -358,7 +359,7 @@ program DAMASK_spectral endif !-------------------------------------------------------------------------------------------------- -! doing initialization depending on selected solver +! doing initialization depending on selected solver call Utilities_init() do field = 1, nActiveFields select case (loadCases(1)%ID(field)) @@ -370,26 +371,26 @@ program DAMASK_spectral if(iand(debug_level(debug_spectral),debug_levelBasic)/= 0 .and. worldrank == 0_pInt) & call IO_warning(42_pInt, ext_msg='debug Divergence') call AL_init - + case (DAMASK_spectral_SolverPolarisation_label) if(iand(debug_level(debug_spectral),debug_levelBasic)/= 0 .and. worldrank == 0_pInt) & call IO_warning(42_pInt, ext_msg='debug Divergence') call Polarisation_init - + case default call IO_error(error_ID = 891, ext_msg = trim(spectral_solver)) - - end select - + + end select + case(FIELD_THERMAL_ID) call spectral_thermal_init - + case(FIELD_DAMAGE_ID) call spectral_damage_init() end select enddo - + !-------------------------------------------------------------------------------------------------- ! write header of output file if (worldrank == 0) then @@ -408,7 +409,7 @@ program DAMASK_spectral write(resUnit) 'logscales:', loadCases%logscale write(resUnit) 'increments:', loadCases%incs ! one entry per LoadCase write(resUnit) 'startingIncrement:', restartInc - 1_pInt ! start with writing out the previous inc - write(resUnit) 'eoh' + write(resUnit) 'eoh' close(resUnit) ! end of header open(newunit=statUnit,file=trim(getSolverWorkingDirectoryName())//trim(getSolverJobName())//& '.sta',form='FORMATTED',status='REPLACE') @@ -458,7 +459,7 @@ program DAMASK_spectral !-------------------------------------------------------------------------------------------------- ! loopping over loadcases loadCaseLooping: do currentLoadCase = 1_pInt, size(loadCases) - time0 = time ! currentLoadCase start time + time0 = time ! currentLoadCase start time guess = loadCases(currentLoadCase)%followFormerTrajectory ! change of load case? homogeneous guess for the first inc !-------------------------------------------------------------------------------------------------- @@ -472,9 +473,9 @@ program DAMASK_spectral if (loadCases(currentLoadCase)%logscale == 0_pInt) then ! linear scale timeinc = loadCases(currentLoadCase)%time/real(loadCases(currentLoadCase)%incs,pReal) ! only valid for given linear time scale. will be overwritten later in case loglinear scale is used else - if (currentLoadCase == 1_pInt) then ! 1st currentLoadCase of logarithmic scale + if (currentLoadCase == 1_pInt) then ! 1st currentLoadCase of logarithmic scale if (inc == 1_pInt) then ! 1st inc of 1st currentLoadCase of logarithmic scale - timeinc = loadCases(1)%time*(2.0_pReal**real( 1_pInt-loadCases(1)%incs ,pReal)) ! assume 1st inc is equal to 2nd + timeinc = loadCases(1)%time*(2.0_pReal**real( 1_pInt-loadCases(1)%incs ,pReal)) ! assume 1st inc is equal to 2nd else ! not-1st inc of 1st currentLoadCase of logarithmic scale timeinc = loadCases(1)%time*(2.0_pReal**real(inc-1_pInt-loadCases(1)%incs ,pReal)) endif @@ -492,12 +493,12 @@ program DAMASK_spectral stepFraction = 0_pInt !-------------------------------------------------------------------------------------------------- -! loop over sub incs +! loop over sub incs subIncLooping: do while (stepFraction/subStepFactor**cutBackLevel <1_pInt) time = time + timeinc ! forward time - stepFraction = stepFraction + 1_pInt + stepFraction = stepFraction + 1_pInt remainingLoadCaseTime = time0 - time + loadCases(currentLoadCase)%time + timeInc - + !-------------------------------------------------------------------------------------------------- ! report begin of new increment if (worldrank == 0) then @@ -515,7 +516,7 @@ program DAMASK_spectral ',a,'//IO_intOut(stepFraction)//',a,'//IO_intOut(subStepFactor**cutBackLevel)//')') & 'Increment ',totalIncsCounter,'/',sum(loadCases%incs),& '-',stepFraction, '/', subStepFactor**cutBackLevel - endif + endif !-------------------------------------------------------------------------------------------------- ! forward fields @@ -541,18 +542,18 @@ program DAMASK_spectral F_BC = loadCases(currentLoadCase)%deformation, & P_BC = loadCases(currentLoadCase)%P, & rotation_BC = loadCases(currentLoadCase)%rotation) - end select - + end select + case(FIELD_THERMAL_ID) call spectral_thermal_forward (& guess,timeinc,timeIncOld,remainingLoadCaseTime) - + case(FIELD_DAMAGE_ID) call spectral_damage_forward (& guess,timeinc,timeIncOld,remainingLoadCaseTime) end select - enddo - + enddo + !-------------------------------------------------------------------------------------------------- ! solve fields stagIter = 0_pInt @@ -568,27 +569,27 @@ program DAMASK_spectral P_BC = loadCases(currentLoadCase)%P, & F_BC = loadCases(currentLoadCase)%deformation, & rotation_BC = loadCases(currentLoadCase)%rotation) - + case (DAMASK_spectral_SolverAL_label) solres(field) = AL_solution (& incInfo,guess,timeinc,timeIncOld,remainingLoadCaseTime, & P_BC = loadCases(currentLoadCase)%P, & F_BC = loadCases(currentLoadCase)%deformation, & rotation_BC = loadCases(currentLoadCase)%rotation) - + case (DAMASK_spectral_SolverPolarisation_label) solres(field) = Polarisation_solution (& incInfo,guess,timeinc,timeIncOld,remainingLoadCaseTime, & P_BC = loadCases(currentLoadCase)%P, & F_BC = loadCases(currentLoadCase)%deformation, & rotation_BC = loadCases(currentLoadCase)%rotation) - - end select - + + end select + case(FIELD_THERMAL_ID) solres(field) = spectral_thermal_solution (& guess,timeinc,timeIncOld,remainingLoadCaseTime) - + case(FIELD_DAMAGE_ID) solres(field) = spectral_damage_solution (& guess,timeinc,timeIncOld,remainingLoadCaseTime) @@ -600,11 +601,11 @@ program DAMASK_spectral stagIterate = stagIter < stagItMax .and. & all(solres(:)%converged) .and. & .not. all(solres(:)%stagConverged) - enddo + enddo !-------------------------------------------------------------------------------------------------- -! check solution - cutBack = .False. +! check solution + cutBack = .False. if(solres(1)%termIll .or. .not. all(solres(:)%converged .and. solres(:)%stagConverged)) then ! no solution found if (cutBackLevel < maxCutBack) then ! do cut back if (worldrank == 0) write(6,'(/,a)') ' cut back detected' @@ -617,8 +618,8 @@ program DAMASK_spectral call IO_warning(850_pInt) call quit(-1_pInt*(lastRestartWritten+1_pInt)) ! quit and provide information about last restart inc written elseif (continueCalculation == 1_pInt) then - guess = .true. ! accept non converged BVP solution - else ! default behavior, exit if spectral solver does not converge + guess = .true. ! accept non converged BVP solution + else ! default behavior, exit if spectral solver does not converge call IO_warning(850_pInt) call quit(-1_pInt*(lastRestartWritten+1_pInt)) ! quit and provide information about last restart inc written endif @@ -630,8 +631,8 @@ program DAMASK_spectral write(statUnit,*) totalIncsCounter, time, cutBackLevel, & solres%converged, solres%iterationsNeeded ! write statistics about accepted solution flush(statUnit) - endif - endif + endif + endif enddo subIncLooping cutBackLevel = max(0_pInt, cutBackLevel - 1_pInt) ! try half number of subincs next inc if(all(solres(:)%converged)) then ! report converged inc @@ -662,11 +663,11 @@ program DAMASK_spectral enddo fileOffset = fileOffset + sum(outputSize) ! forward to current file position endif - if( loadCases(currentLoadCase)%restartFrequency > 0_pInt .and. & ! at frequency of writing restart information set restart parameter for FEsolving - mod(inc,loadCases(currentLoadCase)%restartFrequency) == 0_pInt) then ! first call to CPFEM_general will write? + if( loadCases(currentLoadCase)%restartFrequency > 0_pInt .and. & ! at frequency of writing restart information set restart parameter for FEsolving + mod(inc,loadCases(currentLoadCase)%restartFrequency) == 0_pInt) then ! first call to CPFEM_general will write? restartWrite = .true. lastRestartWritten = inc - endif + endif else forwarding time = time + timeinc guess = .true. @@ -698,7 +699,7 @@ program DAMASK_spectral call AL_destroy() case (DAMASK_spectral_SolverPolarisation_label) call Polarisation_destroy() - end select + end select case(FIELD_THERMAL_ID) call spectral_thermal_destroy() case(FIELD_DAMAGE_ID) @@ -709,6 +710,11 @@ program DAMASK_spectral call PETScFinalize(ierr); CHKERRQ(ierr) + #ifdef _OPENMP + call MPI_finalize(i) + if (i /= 0_pInt) call IO_error(error_ID=894, el=i, ext_msg="Finalize()") + #endif + if (notConvergedCounter > 0_pInt) call quit(3_pInt) ! error if some are not converged call quit(0_pInt) ! no complains ;) @@ -719,7 +725,7 @@ end program DAMASK_spectral !> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH !> @brief quit subroutine to mimic behavior of FEM solvers !> @details exits the Spectral solver and reports time and duration. Exit code 0 signals -!> everything went fine. Exit code 1 signals an error, message according to IO_error. Exit code +!> everything went fine. Exit code 1 signals an error, message according to IO_error. Exit code !> 2 signals no converged solution and increment of last saved restart information is written to !> stderr. Exit code 3 signals no severe problems, but some increments did not converge !-------------------------------------------------------------------------------------------------- @@ -739,7 +745,7 @@ subroutine quit(stop_id) write(6,'(a,2(i2.2,a),i2.2)') 'Time: ',dateAndTime(5),':',& dateAndTime(6),':',& dateAndTime(7) - + if (stop_id == 0_pInt) stop 0 ! normal termination if (stop_id < 0_pInt) then ! terminally ill, restart might help write(0,'(a,i6)') 'restart information available at ', stop_id*(-1_pInt) From 3d0e19de0a3632daf1908652913abf02868466de Mon Sep 17 00:00:00 2001 From: zhangc43 Date: Mon, 22 Aug 2016 17:45:05 -0400 Subject: [PATCH 155/412] syntax polish for ifdef --- code/DAMASK_spectral.f90 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/DAMASK_spectral.f90 b/code/DAMASK_spectral.f90 index 96b3c1451..1d3a0a0cb 100644 --- a/code/DAMASK_spectral.f90 +++ b/code/DAMASK_spectral.f90 @@ -711,8 +711,10 @@ program DAMASK_spectral call PETScFinalize(ierr); CHKERRQ(ierr) #ifdef _OPENMP - call MPI_finalize(i) - if (i /= 0_pInt) call IO_error(error_ID=894, el=i, ext_msg="Finalize()") + call MPI_finalize(i) + if (i /= 0_pInt) then + call IO_error(error_ID=894, el=i, ext_msg="Finalize()") + endif #endif if (notConvergedCounter > 0_pInt) call quit(3_pInt) ! error if some are not converged From af10f920419506b97f7abf6d3c1119bfb5e8723b Mon Sep 17 00:00:00 2001 From: zhangc43 Date: Tue, 23 Aug 2016 08:29:42 -0400 Subject: [PATCH 156/412] remove space before preprocessor --- code/DAMASK_spectral.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/DAMASK_spectral.f90 b/code/DAMASK_spectral.f90 index 1d3a0a0cb..2793b502c 100644 --- a/code/DAMASK_spectral.f90 +++ b/code/DAMASK_spectral.f90 @@ -710,12 +710,12 @@ program DAMASK_spectral call PETScFinalize(ierr); CHKERRQ(ierr) - #ifdef _OPENMP +#ifdef _OPENMP call MPI_finalize(i) if (i /= 0_pInt) then call IO_error(error_ID=894, el=i, ext_msg="Finalize()") endif - #endif +#endif if (notConvergedCounter > 0_pInt) call quit(3_pInt) ! error if some are not converged call quit(0_pInt) ! no complains ;) From 7710f4d444556116f8da91c8189b763efab1c942 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 23 Aug 2016 17:21:17 +0200 Subject: [PATCH 157/412] hybridIA (stand alone script and DAMASK) need standard ASCII table export of TSL OIM is similar to standard ASCII table, simply add correct header including labels --- processing/pre/OIMlinear2linearODF.py | 106 -------------------------- 1 file changed, 106 deletions(-) delete mode 100755 processing/pre/OIMlinear2linearODF.py diff --git a/processing/pre/OIMlinear2linearODF.py b/processing/pre/OIMlinear2linearODF.py deleted file mode 100755 index d50c07a37..000000000 --- a/processing/pre/OIMlinear2linearODF.py +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/env python2.7 -# -*- coding: UTF-8 no BOM -*- - -import os,sys -from optparse import OptionParser -import numpy as np -import damask - -scriptName = os.path.splitext(os.path.basename(__file__))[0] -scriptID = ' '.join([scriptName,damask.version]) - -sampleSym = { 'Orthotropic' : (90,90,90), - 'Triclinic' : (360,180,360) - } - -# -------------------------------------------------------------------- -# MAIN -# -------------------------------------------------------------------- - -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ -Transform the binned texture data from "TSL OIM Analysis" into linear ODF data, - -""", version = scriptID) - -parser.add_option('-s', '--symmetry', dest='symmetry', choices=sampleSym.keys(), - metavar = 'string', - help='Sample symmetry {%s} [Triclinic]'%(' '.join(sampleSym.keys()))) - -parser.set_defaults(symmetry = 'Triclinic') - -(options,filenames) = parser.parse_args() - -#--- setup file handles --------------------------------------------------------------------------- -files = [] -if filenames == []: - files.append({'name':'STDIN', - 'input':sys.stdin, - 'output':sys.stdout, - 'croak':sys.stderr, - }) -else: - for name in filenames: - if os.path.exists(name): - files.append({'name':name, - 'input':open(name), - 'output':open(name+'_tmp','w'), - 'croak':sys.stdout, - }) - -#--- loop over input files ------------------------------------------------------------------------ -for file in files: - file['croak'].write('\033[1m' + scriptName + '\033[0m: ' + (file['name'] if file['name'] != 'STDIN' else '') + '\n') - - while True: # read header (forward and get bin Size) - line = file['input'].readline() - words = line.split() - if len(words)>=3: - if words[1]=='Bin' and words[2]=='Size:': binSize=float(words[3][:-1]) - if not line.startswith('#'): break - - delta = [sampleSym[options.symmetry][i]/binSize for i in xrange(3)] - - nPhi1,nPHI,nPhi2 = map(int,delta) - dPhi1,dPHI,dPhi2 = [sampleSym[options.symmetry][i]/delta[i] for i in xrange(3)] - - N = (nPhi1-1)*(nPHI-1)*(nPhi2-1) - - - ODF = [[[[None] for k in range(nPhi2)] for j in range(nPHI)] for i in range(nPhi1)] - linear = [None]*N - - ODF = np.empty([nPhi1,nPHI,nPhi2],'d') - - for iPhi1 in range(nPhi1): - for iPHI in range(nPHI): - for iPhi2 in range(nPhi2): - ODF[iPhi1,iPHI,iPhi2] = float(line.split()[3])*0.125 # extract intensity (in column 4) and weight by 1/8 - line = file['input'].readline() - - for iPhi1 in range(nPhi1-1): - for iPHI in range(nPHI-1): - for iPhi2 in range(nPhi2-1): - linear[iPhi1*(nPHI-1)*(nPhi2-1)+iPHI*(nPhi2-1)+iPhi2] =\ - ODF[iPhi1 ,iPHI ,iPhi2 ] +\ - ODF[iPhi1 ,iPHI ,iPhi2+1] +\ - ODF[iPhi1 ,iPHI+1,iPhi2 ] +\ - ODF[iPhi1 ,iPHI+1,iPhi2+1] +\ - ODF[iPhi1+1,iPHI ,iPhi2 ] +\ - ODF[iPhi1+1,iPHI ,iPhi2+1] +\ - ODF[iPhi1+1,iPHI+1,iPhi2 ] +\ - ODF[iPhi1+1,iPHI+1,iPhi2+1] - - - file['output'].write('4 header\n') - file['output'].write('limit phi1 %-6.2f Phi %-6.2f phi2 %-6.2f\n'%sampleSym[options.symmetry]) - file['output'].write('delta phi1 %-6.2f Phi %-6.2f phi2 %-6.2f\n'%(dPhi1,dPHI,dPhi2)) - file['output'].write('centration cell-centered\n') - file['output'].write('density\n') - - for i in range(N): - file['output'].write('%g\n'%(linear[i])) - -#--- output finalization -------------------------------------------------------------------------- - if file['name'] != 'STDIN': - file['output'].close() - os.rename(file['name']+'_tmp',os.path.splitext(file['name'])[0] +'.linearODF') From 5b6f41cb6b7c73976c5cf74922a17e31ed7833c1 Mon Sep 17 00:00:00 2001 From: Test User Date: Wed, 24 Aug 2016 04:27:41 +0200 Subject: [PATCH 158/412] updated version information after successful test of v2.0.1-47-gaf10f92 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 921b19cbd..a4ea1f3b9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-43-g64ac05f +v2.0.1-47-gaf10f92 From f984f1ebea85ff8dc502330684b628945aa95b62 Mon Sep 17 00:00:00 2001 From: Zhuowen Zhao Date: Wed, 24 Aug 2016 16:05:50 -0400 Subject: [PATCH 159/412] enable floating point data and corrected counting of microstructures --- processing/pre/geom_translate.py | 39 +++++++++++++++++++------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/processing/pre/geom_translate.py b/processing/pre/geom_translate.py index 83c71aa8d..f0d39e66f 100755 --- a/processing/pre/geom_translate.py +++ b/processing/pre/geom_translate.py @@ -30,30 +30,37 @@ parser.add_option('-s', '--substitute', dest = 'substitute', action = 'extend', metavar = '', help = 'substitutions of microstructure indices from,to,from,to,...') +parser.add_option('--float', + dest = 'real', + action = 'store_true', + help = 'use float input') parser.set_defaults(origin = (0.0,0.0,0.0), microstructure = 0, substitute = [], + real = False, ) (options, filenames) = parser.parse_args() +datatype = 'f' if options.real else 'i' + sub = {} -for i in xrange(len(options.substitute)/2): # split substitution list into "from" -> "to" +for i in xrange(len(options.substitute)/2): # split substitution list into "from" -> "to" sub[int(options.substitute[i*2])] = int(options.substitute[i*2+1]) -# --- loop over input files ------------------------------------------------------------------------- +# --- loop over input files ---------------------------------------------------------------------- if filenames == []: filenames = [None] for name in filenames: - try: - table = damask.ASCIItable(name = name, - buffered = False, labeled = False) + try: table = damask.ASCIItable(name = name, + buffered = False, + labeled = False) except: continue damask.util.report(scriptName,name) -# --- interpret header ---------------------------------------------------------------------------- +# --- interpret header --------------------------------------------------------------------------- table.head_read() info,extra_header = table.head_getGeom() @@ -73,9 +80,9 @@ for name in filenames: table.close(dismiss = True) continue -# --- read data ------------------------------------------------------------------------------------ +# --- read data ---------------------------------------------------------------------------------- - microstructure = table.microstructure_read(info['grid']) # read microstructure + microstructure = table.microstructure_read(info['grid'],datatype) # read microstructure # --- do work ------------------------------------------------------------------------------------ @@ -90,9 +97,9 @@ for name in filenames: substituted += options.microstructure # shift microstructure indices newInfo['origin'] = info['origin'] + options.origin - newInfo['microstructures'] = substituted.max() + newInfo['microstructures'] = len(np.unique(substituted)) -# --- report --------------------------------------------------------------------------------------- +# --- report ------------------------------------------------------------------------------------- remarks = [] if (any(newInfo['origin'] != info['origin'])): @@ -101,7 +108,7 @@ for name in filenames: remarks.append('--> microstructures: %i'%newInfo['microstructures']) if remarks != []: damask.util.croak(remarks) -# --- write header --------------------------------------------------------------------------------- +# --- write header ------------------------------------------------------------------------------- table.labels_clear() table.info_clear() @@ -116,12 +123,12 @@ for name in filenames: ]) table.head_write() -# --- write microstructure information ------------------------------------------------------------ +# --- write microstructure information ----------------------------------------------------------- - formatwidth = int(math.floor(math.log10(microstructure.max())+1)) + format = '%g' if options.real else '%{}i'.format(int(math.floor(math.log10(microstructure.max())+1))) table.data = substituted.reshape((info['grid'][0],info['grid'][1]*info['grid'][2]),order='F').transpose() - table.data_writeArray('%%%ii'%(formatwidth),delimiter = ' ') + table.data_writeArray(format,delimiter = ' ') -# --- output finalization -------------------------------------------------------------------------- +# --- output finalization ------------------------------------------------------------------------ - table.close() # close ASCII table + table.close() # close ASCII table From 64db098e2a0701589926278c81b7c998f87eadea Mon Sep 17 00:00:00 2001 From: Test User Date: Thu, 25 Aug 2016 04:27:12 +0200 Subject: [PATCH 160/412] updated version information after successful test of v2.0.1-49-gf984f1e --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index a4ea1f3b9..a0ee30953 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-47-gaf10f92 +v2.0.1-49-gf984f1e From 60765067389f77f21bbedcbfac0655fc71899c4f Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Thu, 25 Aug 2016 11:57:19 -0400 Subject: [PATCH 161/412] general polishing and removal of redundant do-loop --- code/DAMASK_spectral.f90 | 53 +++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/code/DAMASK_spectral.f90 b/code/DAMASK_spectral.f90 index 2793b502c..67e3f4042 100644 --- a/code/DAMASK_spectral.f90 +++ b/code/DAMASK_spectral.f90 @@ -231,8 +231,6 @@ program DAMASK_spectral endif do j = 1_pInt, 9_pInt temp_maskVector(j) = IO_stringValue(line,chunkPos,i+j) /= '*' ! true if not a * - enddo - do j = 1_pInt,9_pInt if (temp_maskVector(j)) temp_valueVector(j) = IO_floatValue(line,chunkPos,i+j) ! read value where applicable enddo loadCases(currentLoadCase)%deformation%maskLogical = & ! logical mask in 3x3 notation @@ -244,8 +242,6 @@ program DAMASK_spectral temp_valueVector = 0.0_pReal do j = 1_pInt, 9_pInt temp_maskVector(j) = IO_stringValue(line,chunkPos,i+j) /= '*' ! true if not an asterisk - enddo - do j = 1_pInt,9_pInt if (temp_maskVector(j)) temp_valueVector(j) = IO_floatValue(line,chunkPos,i+j) ! read value where applicable enddo loadCases(currentLoadCase)%P%maskLogical = transpose(reshape(temp_maskVector,[ 3,3])) @@ -302,14 +298,14 @@ program DAMASK_spectral write(6,'(1x,a,i6)') 'load case: ', currentLoadCase if (.not. loadCases(currentLoadCase)%followFormerTrajectory) & write(6,'(2x,a)') 'drop guessing along trajectory' - if (loadCases(currentLoadCase)%deformation%myType=='l') then + if (loadCases(currentLoadCase)%deformation%myType == 'l') then do j = 1_pInt, 3_pInt if (any(loadCases(currentLoadCase)%deformation%maskLogical(j,1:3) .eqv. .true.) .and. & any(loadCases(currentLoadCase)%deformation%maskLogical(j,1:3) .eqv. .false.)) & errorID = 832_pInt ! each row should be either fully or not at all defined enddo write(6,'(2x,a)') 'velocity gradient:' - else if (loadCases(currentLoadCase)%deformation%myType=='f') then + else if (loadCases(currentLoadCase)%deformation%myType == 'f') then write(6,'(2x,a)') 'deformation gradient at end of load case:' else write(6,'(2x,a)') 'deformation gradient rate:' @@ -318,13 +314,13 @@ program DAMASK_spectral if(loadCases(currentLoadCase)%deformation%maskLogical(i,j)) then write(6,'(2x,f12.7)',advance='no') loadCases(currentLoadCase)%deformation%values(i,j) else - write(6,'(2x,12a)',advance='no') ' * ' + write(6,'(2x,12a)',advance='no') ' * ' endif enddo; write(6,'(/)',advance='no') enddo if (any(loadCases(currentLoadCase)%P%maskLogical .eqv. & - loadCases(currentLoadCase)%deformation%maskLogical)) errorID = 831_pInt ! exclusive or masking only - if (any(loadCases(currentLoadCase)%P%maskLogical .and. & + loadCases(currentLoadCase)%deformation%maskLogical)) errorID = 831_pInt ! exclusive or masking only + if (any(loadCases(currentLoadCase)%P%maskLogical .and. & transpose(loadCases(currentLoadCase)%P%maskLogical) .and. & reshape([ .false.,.true.,.true.,.true.,.false.,.true.,.true.,.true.,.false.],[ 3,3]))) & errorID = 838_pInt ! no rotation is allowed by stress BC @@ -333,12 +329,12 @@ program DAMASK_spectral if(loadCases(currentLoadCase)%P%maskLogical(i,j)) then write(6,'(2x,f12.7)',advance='no') loadCases(currentLoadCase)%P%values(i,j)*1e-9_pReal else - write(6,'(2x,12a)',advance='no') ' * ' + write(6,'(2x,12a)',advance='no') ' * ' endif enddo; write(6,'(/)',advance='no') enddo if (any(abs(math_mul33x33(loadCases(currentLoadCase)%rotation, & - math_transpose33(loadCases(currentLoadCase)%rotation))-math_I3) >& + math_transpose33(loadCases(currentLoadCase)%rotation))-math_I3) > & reshape(spread(tol_math_check,1,9),[ 3,3]))& .or. abs(math_det33(loadCases(currentLoadCase)%rotation)) > & 1.0_pReal + tol_math_check) errorID = 846_pInt ! given rotation matrix contains strain @@ -378,10 +374,10 @@ program DAMASK_spectral call Polarisation_init case default - call IO_error(error_ID = 891, ext_msg = trim(spectral_solver)) - - end select - + call IO_error(error_ID = 891_pInt, ext_msg = trim(spectral_solver)) + + end select + case(FIELD_THERMAL_ID) call spectral_thermal_init @@ -428,29 +424,30 @@ program DAMASK_spectral allocate(outputSize(worldsize), source = 0_MPI_OFFSET_KIND) outputSize(worldrank+1) = size(materialpoint_results,kind=MPI_OFFSET_KIND)*int(pReal,MPI_OFFSET_KIND) call MPI_allreduce(MPI_IN_PLACE,outputSize,worldsize,MPI_LONG,MPI_SUM,PETSC_COMM_WORLD,ierr) ! get total output size over each process - if(ierr /=0_pInt) call IO_error(894_pInt, ext_msg='MPI_allreduce') + if (ierr /= 0_pInt) call IO_error(error_ID=894_pInt, ext_msg='MPI_allreduce') call MPI_file_open(PETSC_COMM_WORLD, & trim(getSolverWorkingDirectoryName())//trim(getSolverJobName())//'.spectralOut', & MPI_MODE_WRONLY + MPI_MODE_APPEND, & MPI_INFO_NULL, & resUnit, & ierr) - if(ierr /=0_pInt) call IO_error(894_pInt, ext_msg='MPI_file_open') + if (ierr /= 0_pInt) call IO_error(error_ID=894_pInt, ext_msg='MPI_file_open') call MPI_file_get_position(resUnit,fileOffset,ierr) ! get offset from header - if(ierr /=0_pInt) call IO_error(894_pInt, ext_msg='MPI_file_get_position') + if (ierr /= 0_pInt) call IO_error(error_ID=894_pInt, ext_msg='MPI_file_get_position') fileOffset = fileOffset + sum(outputSize(1:worldrank)) ! offset of my process in file (header + processes before me) call MPI_file_seek (resUnit,fileOffset,MPI_SEEK_SET,ierr) - if(ierr /=0_pInt) call IO_error(894_pInt, ext_msg='MPI_file_seek') + if (ierr /= 0_pInt) call IO_error(error_ID=894_pInt, ext_msg='MPI_file_seek') if (.not. appendToOutFile) then ! if not restarting, write 0th increment - do i=1, size(materialpoint_results,3)/(maxByteOut/(materialpoint_sizeResults*pReal))+1 ! slice the output of my process in chunks not exceeding the limit for one output - outputIndex=int([(i-1_pInt)*((maxRealOut)/materialpoint_sizeResults)+1_pInt, & - min(i*((maxRealOut)/materialpoint_sizeResults),size(materialpoint_results,3))],pLongInt) - call MPI_file_write(resUnit,reshape(materialpoint_results(:,:,outputIndex(1):outputIndex(2)),& - [(outputIndex(2)-outputIndex(1)+1)*materialpoint_sizeResults]), & - (outputIndex(2)-outputIndex(1)+1)*materialpoint_sizeResults,& + do i = 1, size(materialpoint_results,3)/(maxByteOut/(materialpoint_sizeResults*pReal))+1 ! slice the output of my process in chunks not exceeding the limit for one output + outputIndex = int([(i-1_pInt)*((maxRealOut)/materialpoint_sizeResults)+1_pInt, & + min(i*((maxRealOut)/materialpoint_sizeResults),size(materialpoint_results,3))],pLongInt) + call MPI_file_write(resUnit, & + reshape(materialpoint_results(:,:,outputIndex(1):outputIndex(2)), & + [(outputIndex(2)-outputIndex(1)+1)*materialpoint_sizeResults]), & + (outputIndex(2)-outputIndex(1)+1)*materialpoint_sizeResults, & MPI_DOUBLE, MPI_STATUS_IGNORE, ierr) - if(ierr /=0_pInt) call IO_error(894_pInt, ext_msg='MPI_file_write') + if (ierr /= 0_pInt) call IO_error(error_ID=894_pInt, ext_msg='MPI_file_write') enddo fileOffset = fileOffset + sum(outputSize) ! forward to current file position if (worldrank == 0) & @@ -489,7 +486,7 @@ program DAMASK_spectral endif timeinc = timeinc / 2.0_pReal**real(cutBackLevel,pReal) ! depending on cut back level, decrease time step - forwarding: if(totalIncsCounter >= restartInc) then + forwarding: if (totalIncsCounter >= restartInc) then stepFraction = 0_pInt !-------------------------------------------------------------------------------------------------- @@ -595,7 +592,7 @@ program DAMASK_spectral guess,timeinc,timeIncOld,remainingLoadCaseTime) end select - if(.not. solres(field)%converged) exit ! no solution found + if (.not. solres(field)%converged) exit ! no solution found enddo stagIter = stagIter + 1_pInt stagIterate = stagIter < stagItMax .and. & From f9c3d335fcf60a1bba377215191a0ff98668e902 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Thu, 25 Aug 2016 11:59:04 -0400 Subject: [PATCH 162/412] two new methods to convey deemphasis and deletion --- lib/damask/util.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/damask/util.py b/lib/damask/util.py index cfc44f26c..4aec363c5 100644 --- a/lib/damask/util.py +++ b/lib/damask/util.py @@ -20,6 +20,7 @@ class bcolors: FAIL = '\033[91m' ENDC = '\033[0m' BOLD = '\033[1m' + DIM = '\033[2m' UNDERLINE = '\033[4m' def disable(self): @@ -70,9 +71,19 @@ def report_geom(info, # ----------------------------- def emph(what): - """emphasizes string on screen""" + """boldens string""" return bcolors.BOLD+srepr(what)+bcolors.ENDC +# ----------------------------- +def deemph(what): + """dims string""" + return bcolors.DIM+srepr(what)+bcolors.ENDC + +# ----------------------------- +def delete(what): + """dims string""" + return bcolors.DIM+srepr(what)+bcolors.ENDC + # ----------------------------- def execute(cmd, streamIn = None, From d3eb3451e3c9bca2e97fb75537737c7670a2029d Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Thu, 25 Aug 2016 12:00:10 -0400 Subject: [PATCH 163/412] improved readability by splitting to one file per line --- code/Makefile | 113 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 85 insertions(+), 28 deletions(-) diff --git a/code/Makefile b/code/Makefile index 7e5a130b1..331feec27 100644 --- a/code/Makefile +++ b/code/Makefile @@ -257,10 +257,10 @@ COMPILE_OPTIONS_gfortran :=-DDAMASKVERSION=\"${DAMASKVERSION}\"\ #-Wunsafe-loop-optimizations: warn if the loop cannot be optimized due to nontrivial assumptions. #-Wstrict-overflow: -DEBUG_OPTIONS_gfortran :=-g\ - -fbacktrace\ - -fdump-core\ - -fcheck=all\ +DEBUG_OPTIONS_gfortran :=-g \ + -fbacktrace \ + -fdump-core \ + -fcheck=all \ -ffpe-trap=invalid,zero,overflow ################################################################################################### @@ -300,37 +300,60 @@ COMPILE =$(OPENMP_FLAG_$(F90)) $(STANDARD_CHECK_$(F90)) $(OPTIMIZATION_$ COMPILE_MAXOPTI =$(OPENMP_FLAG_$(F90)) $(STANDARD_CHECK_$(F90)) $(OPTIMIZATION_$(MAXOPTI)_$(F90)) $(COMPILE_OPTIONS_$(F90)) $(INCLUDE_DIRS) $(PRECISION_$(F90)) ################################################################################################### SOURCE_FILES = \ - source_thermal_dissipation.o source_thermal_externalheat.o \ - source_damage_isoBrittle.o source_damage_isoDuctile.o source_damage_anisoBrittle.o source_damage_anisoDuctile.o \ - source_vacancy_phenoplasticity.o source_vacancy_irradiation.o source_vacancy_thermalfluc.o + source_thermal_dissipation.o \ + source_thermal_externalheat.o \ + source_damage_isoBrittle.o \ + source_damage_isoDuctile.o \ + source_damage_anisoBrittle.o \ + source_damage_anisoDuctile.o \ + source_vacancy_phenoplasticity.o \ + source_vacancy_irradiation.o \ + source_vacancy_thermalfluc.o KINEMATICS_FILES = \ - kinematics_cleavage_opening.o kinematics_slipplane_opening.o \ + kinematics_cleavage_opening.o \ + kinematics_slipplane_opening.o \ kinematics_thermal_expansion.o \ - kinematics_vacancy_strain.o kinematics_hydrogen_strain.o + kinematics_vacancy_strain.o \ + kinematics_hydrogen_strain.o PLASTIC_FILES = \ - plastic_dislotwin.o plastic_disloUCLA.o plastic_isotropic.o \ - plastic_phenopowerlaw.o plastic_titanmod.o plastic_nonlocal.o plastic_none.o \ + plastic_dislotwin.o \ + plastic_disloUCLA.o \ + plastic_isotropic.o \ + plastic_phenopowerlaw.o \ + plastic_titanmod.o \ + plastic_nonlocal.o \ + plastic_none.o \ plastic_phenoplus.o THERMAL_FILES = \ - thermal_isothermal.o thermal_adiabatic.o thermal_conduction.o + thermal_isothermal.o \ + thermal_adiabatic.o \ + thermal_conduction.o DAMAGE_FILES = \ - damage_none.o damage_local.o damage_nonlocal.o + damage_none.o \ + damage_local.o \ + damage_nonlocal.o VACANCYFLUX_FILES = \ - vacancyflux_isoconc.o vacancyflux_isochempot.o vacancyflux_cahnhilliard.o + vacancyflux_isoconc.o \ + vacancyflux_isochempot.o \ + vacancyflux_cahnhilliard.o POROSITY_FILES = \ - porosity_none.o porosity_phasefield.o + porosity_none.o \ + porosity_phasefield.o HYDROGENFLUX_FILES = \ - hydrogenflux_isoconc.o hydrogenflux_cahnhilliard.o + hydrogenflux_isoconc.o \ + hydrogenflux_cahnhilliard.o HOMOGENIZATION_FILES = \ - homogenization_RGC.o homogenization_isostrain.o homogenization_none.o + homogenization_RGC.o \ + homogenization_isostrain.o \ + homogenization_none.o ##################### # Spectral Solver @@ -351,11 +374,28 @@ DAMASK_spectral.o: INTERFACENAME := spectral_interface.f90 SPECTRAL_SOLVER_FILES = spectral_mech_AL.o spectral_mech_Basic.o spectral_mech_Polarisation.o \ spectral_thermal.o spectral_damage.o -SPECTRAL_FILES = C_routines.o system_routines.o prec.o DAMASK_interface.o IO.o numerics.o debug.o math.o \ - FEsolving.o mesh.o material.o lattice.o \ - $(SOURCE_FILES) $(KINEMATICS_FILES) $(PLASTIC_FILES) constitutive.o \ +SPECTRAL_FILES = C_routines.o \ + system_routines.o \ + prec.o \ + DAMASK_interface.o \ + IO.o \ + numerics.o \ + debug.o \ + math.o \ + FEsolving.o \ + mesh.o \ + material.o \ + lattice.o \ + $(SOURCE_FILES) \ + $(KINEMATICS_FILES) \ + $(PLASTIC_FILES) \ + constitutive.o \ crystallite.o \ - $(THERMAL_FILES) $(DAMAGE_FILES) $(VACANCYFLUX_FILES) $(HYDROGENFLUX_FILES) $(POROSITY_FILES) \ + $(THERMAL_FILES) \ + $(DAMAGE_FILES) \ + $(VACANCYFLUX_FILES) \ + $(HYDROGENFLUX_FILES) \ + $(POROSITY_FILES) \ $(HOMOGENIZATION_FILES) homogenization.o \ CPFEM2.o \ spectral_utilities.o \ @@ -401,14 +441,31 @@ DAMASK_FEM.exe: INCLUDE_DIRS += -I./ FEM_SOLVER_FILES = FEM_mech.o FEM_thermal.o FEM_damage.o FEM_vacancyflux.o FEM_porosity.o FEM_hydrogenflux.o -FEM_FILES = prec.o DAMASK_interface.o FEZoo.o IO.o numerics.o debug.o math.o \ - FEsolving.o mesh.o material.o lattice.o \ - $(SOURCE_FILES) $(KINEMATICS_FILES) $(PLASTIC_FILES) constitutive.o \ +FEM_FILES = prec.o \ + DAMASK_interface.o \ + FEZoo.o \ + IO.o \ + numerics.o \ + debug.o \ + math.o \ + FEsolving.o \ + mesh.o \ + material.o \ + lattice.o \ + $(SOURCE_FILES) \ + $(KINEMATICS_FILES) \ + $(PLASTIC_FILES) \ + constitutive.o \ crystallite.o \ - $(THERMAL_FILES) $(DAMAGE_FILES) $(VACANCYFLUX_FILES) $(HYDROGENFLUX_FILES) $(POROSITY_FILES) \ + $(THERMAL_FILES) \ + $(DAMAGE_FILES) \ + $(VACANCYFLUX_FILES) \ + $(HYDROGENFLUX_FILES) \ + $(POROSITY_FILES) \ $(HOMOGENIZATION_FILES) homogenization.o \ CPFEM.o \ - FEM_utilities.o $(FEM_SOLVER_FILES) + FEM_utilities.o \ + $(FEM_SOLVER_FILES) DAMASK_FEM.exe: DAMASK_FEM_driver.o $(PREFIX) $(LINKERNAME) $(OPENMP_FLAG_$(F90)) $(LINK_OPTIONS_$(F90)) $(STANDARD_CHECK_$(F90)) $(OPTIMIZATION_$(MAXOPTI)_$(F90)) \ @@ -658,8 +715,8 @@ tidy: @rm -rf *.inst.f90 # for instrumentation @rm -rf *.pomp.f90 # for instrumentation @rm -rf *.pp.f90 # for instrumentation - @rm -rf *.pdb # for instrumnentation - @rm -rf *.opari.inc # for instrumnentation + @rm -rf *.pdb # for instrumentation + @rm -rf *.opari.inc # for instrumentation .PHONY: cleanDAMASK cleanDAMASK: From eb9f6c939c4b83e746a4a4293937e6255f32cdf3 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Thu, 25 Aug 2016 12:08:19 -0400 Subject: [PATCH 164/412] condensed output, DAMASK_marc symlinks are relative, add symlink pruning --- installation/symlink_Code.py | 56 +++++++++++++++++++++--------- installation/symlink_Processing.py | 40 ++++++++++++++++----- 2 files changed, 71 insertions(+), 25 deletions(-) diff --git a/installation/symlink_Code.py b/installation/symlink_Code.py index 1e67c8a7b..933f31c8e 100755 --- a/installation/symlink_Code.py +++ b/installation/symlink_Code.py @@ -11,7 +11,15 @@ bin_link = { \ ], } -MarcReleases =[2011,2012,2013,2013.1,2014,2014.2,2015] +MarcReleases =[ \ + '2011', + '2012', + '2013', + '2013.1', + '2014', + '2014.2', + '2015', + ] damaskEnv = damask.Environment() baseDir = damaskEnv.relPath('code/') @@ -20,27 +28,41 @@ binDir = damaskEnv.options['DAMASK_BIN'] if not os.path.isdir(binDir): os.mkdir(binDir) -for dir in bin_link: - for file in bin_link[dir]: - src = os.path.abspath(os.path.join(baseDir,dir,file)) - if os.path.exists(src): - sym_link = os.path.abspath(os.path.join(binDir,\ - {True: dir, - False:os.path.splitext(file)[0]}[file == ''])) - if os.path.lexists(sym_link): os.remove(sym_link) - os.symlink(src,sym_link) - sys.stdout.write(sym_link+' -> '+src+'\n') +sys.stdout.write('\nsymbolic linking...\n') +for subDir in bin_link: + theDir = os.path.abspath(os.path.join(baseDir,subDir)) + sys.stdout.write('\n'+binDir+' ->\n'+theDir+damask.util.deemph(' ...')+'\n') + + for theFile in bin_link[subDir]: + theName,theExt = os.path.splitext(theFile) + src = os.path.abspath(os.path.join(theDir,theFile)) + + if os.path.exists(src): + sym_link = os.path.abspath(os.path.join(binDir,subDir if theFile == '' else theName)) + + if os.path.lexists(sym_link): + os.remove(sym_link) + output = theName+damask.util.deemph(theExt) + else: + output = damask.util.emph(theName)+damask.util.deemph(theExt) + + sys.stdout.write(damask.util.deemph('... ')+output+'\n') + os.symlink(src,sym_link) + + +sys.stdout.write('\nMSC.Marc versioning...\n\n') +theMaster = 'DAMASK_marc.f90' for version in MarcReleases: - src = os.path.abspath(os.path.join(baseDir,'DAMASK_marc.f90')) + src = os.path.abspath(os.path.join(baseDir,theMaster)) if os.path.exists(src): - sym_link = os.path.abspath(os.path.join(baseDir,'DAMASK_marc'+str(version)+'.f90')) + sym_link = os.path.abspath(os.path.join(baseDir,'DAMASK_marc{}.f90'.format(version))) if os.path.lexists(sym_link): os.remove(sym_link) - sys.stdout.write(sym_link) + output = version else: - sys.stdout.write(damask.util.emph(sym_link)) + output = damask.util.emph(version) - os.symlink(src,sym_link) - sys.stdout.write(' -> '+src+'\n') + sys.stdout.write(' '+output+'\n') + os.symlink(theMaster,sym_link) diff --git a/installation/symlink_Processing.py b/installation/symlink_Processing.py index 6cb8f9135..d10b5af55 100755 --- a/installation/symlink_Processing.py +++ b/installation/symlink_Processing.py @@ -13,23 +13,47 @@ if not os.path.isdir(binDir): os.mkdir(binDir) #define ToDo list -processing_subDirs = ['pre','post','misc',] -processing_extensions = ['.py','.sh',] - +processing_subDirs = ['pre', + 'post', + 'misc', + ] +processing_extensions = ['.py', + '.sh', + ] + +sys.stdout.write('\nsymbolic linking...\n') + for subDir in processing_subDirs: theDir = os.path.abspath(os.path.join(baseDir,subDir)) + sys.stdout.write('\n'+binDir+' ->\n'+theDir+damask.util.deemph(' ...')+'\n') + for theFile in os.listdir(theDir): - if os.path.splitext(theFile)[1] in processing_extensions: # only consider files with proper extensions + theName,theExt = os.path.splitext(theFile) + if theExt in processing_extensions: # only consider files with proper extensions src = os.path.abspath(os.path.join(theDir,theFile)) - sym_link = os.path.abspath(os.path.join(binDir,os.path.splitext(theFile)[0])) + sym_link = os.path.abspath(os.path.join(binDir,theName)) if os.path.lexists(sym_link): os.remove(sym_link) - sys.stdout.write(sym_link) + output = theName+damask.util.deemph(theExt) else: - sys.stdout.write(damask.util.emph(sym_link)) + output = damask.util.emph(theName)+damask.util.deemph(theExt) + sys.stdout.write(damask.util.deemph('... ')+output+'\n') os.symlink(src,sym_link) - sys.stdout.write(' -> '+src+'\n') + + +sys.stdout.write('\npruning broken links...\n') + +brokenLinks = 0 + +for filename in os.listdir(binDir): + path = os.path.join(binDir,filename) + if os.path.islink(path) and not os.path.exists(path): + sys.stdout.write(' '+damask.util.delete(path)+'\n') + os.remove(path) + brokenLinks += 1 + +sys.stdout.write(('none.' if brokenLinks == 0 else '')+'\n') From 85abf84186cd89c9d2e8fd2444b1117fa12b14b7 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Thu, 25 Aug 2016 12:15:03 -0400 Subject: [PATCH 165/412] generalized to user-specified mapping function instead of hardwired avg --- processing/post/averageTable.py | 47 ++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/processing/post/averageTable.py b/processing/post/averageTable.py index 25c09625c..f9c6693ed 100755 --- a/processing/post/averageTable.py +++ b/processing/post/averageTable.py @@ -2,6 +2,7 @@ # -*- coding: UTF-8 no BOM -*- import os,sys +import math # noqa import numpy as np from optparse import OptionParser import damask @@ -14,7 +15,7 @@ scriptID = ' '.join([scriptName,damask.version]) # -------------------------------------------------------------------- parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ -Replace all rows for which column 'label' has identical values by a single row containing their average. +Apply a user-specified function to condense all rows for which column 'label' has identical values into a single row. Output table will contain as many rows as there are different (unique) values in the grouping column. Examples: @@ -25,11 +26,33 @@ parser.add_option('-l','--label', dest = 'label', type = 'string', metavar = 'string', help = 'column label for grouping rows') +parser.add_option('-f','--function', + dest = 'function', + type = 'string', metavar = 'string', + help = 'mapping function [%default]') +parser.add_option('-a','--all', + dest = 'all', + action = 'store_true' + help = 'apply mapping function also to grouping column') + +parser.set_defaults(function = 'np.average') (options,filenames) = parser.parse_args() +funcModule,funcName = options.function.split('.') + +try: + mapFunction = getattr(locals().get(funcModule) or + globals().get(funcModule) or + __import__(funcModule), + funcName) +except: + mapFunction = None + if options.label is None: parser.error('no grouping column specified.') +if not hasattr(mapFunction,'__call__'): + parser.error('function "{}" is not callable.'.format(options.function)) # --- loop over input files ------------------------------------------------------------------------- @@ -38,10 +61,6 @@ if filenames == []: filenames = [None] for name in filenames: try: table = damask.ASCIItable(name = name, - outname = os.path.join( - os.path.split(name)[0], - options.label+'_averaged_'+os.path.split(name)[1] - ) if name else name, buffered = False) except: continue damask.util.report(scriptName,name) @@ -53,6 +72,8 @@ for name in filenames: damask.util.croak('column {} is not of scalar dimension.'.format(options.label)) table.close(dismiss = True) # close ASCIItable and remove empty file continue + else: + grpColumn = table.label_index(options.label) # ------------------------------------------ assemble info --------------------------------------- @@ -64,17 +85,17 @@ for name in filenames: table.data_readArray() rows,cols = table.data.shape - table.data = table.data[np.lexsort([table.data[:,table.label_index(options.label)]])] + table.data = table.data[np.lexsort([table.data[:,grpColumn]])] # sort data by grpColumn - values,index = np.unique(table.data[:,table.label_index(options.label)], return_index = True) - index = np.append(index,rows) - avgTable = np.empty((len(values), cols)) + values,index = np.unique(table.data[:,grpColumn], return_index = True) # unique grpColumn values and their positions + index = np.append(index,rows) # add termination position + grpTable = np.empty((len(values), cols)) # initialize output - for j in xrange(cols) : - for i in xrange(len(values)) : - avgTable[i,j] = np.average(table.data[index[i]:index[i+1],j]) + for i in xrange(len(values)): # iterate over groups (unique values in grpColumn) + grpTable[i] = np.apply_along_axis(mapFunction,0,table.data[index[i]:index[i+1]]) # apply mapping function + if not options.all: grpTable[i,grpColumn] = table.data[index[i],grpColumn] # restore grouping column value - table.data = avgTable + table.data = grpTable # ------------------------------------------ output result ------------------------------- From 55d6adf1b84e5164143e08b0f7f5ad252ef9b9dc Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Thu, 25 Aug 2016 12:15:41 -0400 Subject: [PATCH 166/412] renamed to reflect more general nature of script --- processing/post/{averageTable.py => groupTable.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename processing/post/{averageTable.py => groupTable.py} (100%) diff --git a/processing/post/averageTable.py b/processing/post/groupTable.py similarity index 100% rename from processing/post/averageTable.py rename to processing/post/groupTable.py From 891ac4d5855800d40ff5bac96dc0e8598eddfe34 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Thu, 25 Aug 2016 12:17:27 -0400 Subject: [PATCH 167/412] fixed comma syntax error --- processing/post/groupTable.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/processing/post/groupTable.py b/processing/post/groupTable.py index f9c6693ed..924105fba 100755 --- a/processing/post/groupTable.py +++ b/processing/post/groupTable.py @@ -32,7 +32,7 @@ parser.add_option('-f','--function', help = 'mapping function [%default]') parser.add_option('-a','--all', dest = 'all', - action = 'store_true' + action = 'store_true', help = 'apply mapping function also to grouping column') parser.set_defaults(function = 'np.average') From 2d43dbc88156cbde1751ca91a065cec533aab09e Mon Sep 17 00:00:00 2001 From: Test User Date: Fri, 26 Aug 2016 04:27:18 +0200 Subject: [PATCH 168/412] updated version information after successful test of v2.0.1-57-g891ac4d --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index a0ee30953..ea7f6e12c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-49-gf984f1e +v2.0.1-57-g891ac4d From 4b02a55f4d34f45986ccf9e3e9312eb6e9d86b1f Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Tue, 30 Aug 2016 16:08:47 -0400 Subject: [PATCH 169/412] explicit type casting from boolean to int --- processing/post/vtk_rectilinearGrid.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/processing/post/vtk_rectilinearGrid.py b/processing/post/vtk_rectilinearGrid.py index 73a64c4aa..dfe376b3f 100755 --- a/processing/post/vtk_rectilinearGrid.py +++ b/processing/post/vtk_rectilinearGrid.py @@ -79,9 +79,9 @@ for name in filenames: coords = [np.unique(table.data[:,i]) for i in xrange(3)] if options.mode == 'cell': - coords = [0.5 * np.array([3.0 * coords[i][0] - coords[i][0 + len(coords[i]) > 1]] + \ + coords = [0.5 * np.array([3.0 * coords[i][0] - coords[i][0 + int(len(coords[i]) > 1)]] + \ [coords[i][j-1] + coords[i][j] for j in xrange(1,len(coords[i]))] + \ - [3.0 * coords[i][-1] - coords[i][-1 - (len(coords[i]) > 1)]]) for i in xrange(3)] + [3.0 * coords[i][-1] - coords[i][-1 - int(len(coords[i]) > 1)]]) for i in xrange(3)] grid = np.array(map(len,coords),'i') N = grid.prod() if options.mode == 'point' else (grid-1).prod() From 22e7d6d4e129a9dd46a9c9c9c8b02cb7c81d029d Mon Sep 17 00:00:00 2001 From: Test User Date: Wed, 31 Aug 2016 04:26:22 +0200 Subject: [PATCH 170/412] updated version information after successful test of v2.0.1-59-g4b02a55 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index ea7f6e12c..8a765d7c8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-57-g891ac4d +v2.0.1-59-g4b02a55 From d529eae4a44598626badb64d5d9af9dedb8a5e8c Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Wed, 31 Aug 2016 22:54:00 -0400 Subject: [PATCH 171/412] fixed MPI_reduce hiccup see http://stackoverflow.com/questions/17741574/in-place-mpi-reduce-crashes-with-openmpi --- code/spectral_utilities.f90 | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/code/spectral_utilities.f90 b/code/spectral_utilities.f90 index b9ed5245d..bb11ff294 100644 --- a/code/spectral_utilities.f90 +++ b/code/spectral_utilities.f90 @@ -237,7 +237,7 @@ subroutine utilities_init() grid1Red = grid(1)/2_pInt + 1_pInt wgt = 1.0/real(product(grid),pReal) - if (worldrank == 0) then + if (worldrank == 0_pInt) then write(6,'(a,3(i12 ))') ' grid a b c: ', grid write(6,'(a,3(es12.5))') ' size x y z: ', geomSize endif @@ -1015,10 +1015,19 @@ subroutine utilities_constitutiveResponse(F_lastInc,F,timeinc, & defgradDetMax = max(defgradDetMax,defgradDet) defgradDetMin = min(defgradDetMin,defgradDet) end do - call MPI_reduce(MPI_IN_PLACE,defgradDetMax,1,MPI_DOUBLE,MPI_MAX,0,PETSC_COMM_WORLD,ierr) - if(ierr /=0_pInt) call IO_error(894_pInt, ext_msg='MPI_Allreduce max') - call MPI_reduce(MPI_IN_PLACE,defgradDetMin,1,MPI_DOUBLE,MPI_MIN,0,PETSC_COMM_WORLD,ierr) - if(ierr /=0_pInt) call IO_error(894_pInt, ext_msg='MPI_Allreduce min') + + if (worldrank == 0_pInt) then + call MPI_reduce(MPI_IN_PLACE,defgradDetMax,1,MPI_DOUBLE,MPI_MAX,0,PETSC_COMM_WORLD,ierr) + else + call MPI_reduce(defgradDetMax,defgradDetMax,1,MPI_DOUBLE,MPI_MAX,0,PETSC_COMM_WORLD,ierr) + endif + if (ierr /= 0_pInt) call IO_error(894_pInt, ext_msg='MPI_Allreduce max') + if (worldrank == 0_pInt) then + call MPI_reduce(MPI_IN_PLACE,defgradDetMin,1,MPI_DOUBLE,MPI_MIN,0,PETSC_COMM_WORLD,ierr) + else + call MPI_reduce(defgradDetMin,defgradDetMin,1,MPI_DOUBLE,MPI_MIN,0,PETSC_COMM_WORLD,ierr) + endif + if (ierr /= 0_pInt) call IO_error(894_pInt, ext_msg='MPI_Allreduce min') if (worldrank == 0_pInt) then write(6,'(a,1x,es11.4)') ' max determinant of deformation =', defgradDetMax write(6,'(a,1x,es11.4)') ' min determinant of deformation =', defgradDetMin From 6db0a42eaef45ff7b65da7006bd5140377fb76a0 Mon Sep 17 00:00:00 2001 From: Chen Date: Thu, 1 Sep 2016 12:47:26 -0400 Subject: [PATCH 172/412] addvtk data now support tensor type (9 components) --- processing/post/vtk_addPointcloudData.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/processing/post/vtk_addPointcloudData.py b/processing/post/vtk_addPointcloudData.py index 340ef700e..cd767d5f4 100755 --- a/processing/post/vtk_addPointcloudData.py +++ b/processing/post/vtk_addPointcloudData.py @@ -37,12 +37,17 @@ parser.add_option('-v', '--vector', dest = 'vector', action = 'extend', metavar = '', help = 'vector value label(s)') +parser.add_option('-t', '--tensor', + dest = 'tensor', + action = 'extend', metavar = '', + help = 'tensor (3x3) value label(s)') parser.add_option('-c', '--color', dest='color', action='extend', metavar ='', help = 'RGB color tuples') parser.set_defaults(scalar = [], vector = [], + tensor = [], color = [], inplace = False, render = False, @@ -94,9 +99,10 @@ for name in filenames: errors = [] VTKarray = {} active = defaultdict(list) - + for datatype,dimension,label in [['scalar',1,options.scalar], ['vector',3,options.vector], + ['tensor',9,options.tensor], ['color',3,options.color], ]: for i,dim in enumerate(table.label_dimension(label)): @@ -107,7 +113,7 @@ for name in filenames: remarks.append('adding {} "{}"...'.format(datatype,me)) active[datatype].append(me) - if datatype in ['scalar','vector']: VTKarray[me] = vtk.vtkDoubleArray() + if datatype in ['scalar','vector', 'tensor']: VTKarray[me] = vtk.vtkDoubleArray() elif datatype == 'color': VTKarray[me] = vtk.vtkUnsignedCharArray() VTKarray[me].SetNumberOfComponents(dimension) @@ -119,20 +125,21 @@ for name in filenames: table.close(dismiss = True) continue -# ------------------------------------------ process data --------------------------------------- +# ------------------------------------------ process data --------------------------------------- while table.data_read(): # read next data line of ASCII table - + for datatype,labels in active.items(): # loop over scalar,color for me in labels: # loop over all requested items theData = [table.data[i] for i in table.label_indexrange(me)] # read strings if datatype == 'color': VTKarray[me].InsertNextTuple3(*map(lambda x: int(255.*float(x)),theData)) elif datatype == 'vector': VTKarray[me].InsertNextTuple3(*map(float,theData)) + elif datatype == 'tensor': VTKarray[me].InsertNextTuple9(*map(float,theData)) elif datatype == 'scalar': VTKarray[me].InsertNextValue(float(theData[0])) table.input_close() # close input ASCII table -# ------------------------------------------ add data --------------------------------------- +# ------------------------------------------ add data --------------------------------------- for datatype,labels in active.items(): # loop over scalar,color if datatype == 'color': @@ -145,7 +152,7 @@ for name in filenames: Polydata.Modified() if vtk.VTK_MAJOR_VERSION <= 5: Polydata.Update() -# ------------------------------------------ output result --------------------------------------- +# ------------------------------------------ output result --------------------------------------- writer = vtk.vtkXMLPolyDataWriter() writer.SetDataModeToBinary() @@ -155,7 +162,7 @@ for name in filenames: else: writer.SetInputData(Polydata) writer.Write() -# ------------------------------------------ render result --------------------------------------- +# ------------------------------------------ render result --------------------------------------- if options.render: mapper = vtk.vtkDataSetMapper() @@ -179,7 +186,7 @@ if options.render: iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) - + iren.Initialize() renWin.Render() iren.Start() From 32c4a20a46c5e7b9d0e1a3c4d8e5bd2203d57d8e Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Thu, 1 Sep 2016 15:37:49 -0400 Subject: [PATCH 173/412] clean up, added --debug to base class, renamed testPossible to feasible --- lib/damask/test/test.py | 69 +++++++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 30 deletions(-) diff --git a/lib/damask/test/test.py b/lib/damask/test/test.py index c05a6474d..b54615c3a 100644 --- a/lib/damask/test/test.py +++ b/lib/damask/test/test.py @@ -17,40 +17,47 @@ class Test(): variants = [] - def __init__(self,test_description): + def __init__(self,description = ''): - logger = logging.getLogger() - logger.setLevel(0) fh = logging.FileHandler('test.log') # create file handler which logs even debug messages fh.setLevel(logging.DEBUG) - full = logging.Formatter('%(asctime)s - %(levelname)s: \n%(message)s') - fh.setFormatter(full) + fh.setFormatter(logging.Formatter('%(asctime)s - %(levelname)s: \n%(message)s')) + ch = logging.StreamHandler(stream=sys.stdout) # create console handler with a higher log level ch.setLevel(logging.INFO) -# create formatter and add it to the handlers - plain = logging.Formatter('%(message)s') - ch.setFormatter(plain) -# add the handlers to the logger + ch.setFormatter(logging.Formatter('%(message)s')) + + logger = logging.getLogger() logger.addHandler(fh) logger.addHandler(ch) + logger.setLevel(0) - logging.info('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n' \ - +'----------------------------------------------------------------\n' \ - +'| '+test_description+'\n' \ - +'----------------------------------------------------------------') + logging.info('\n'.join(['+'*40, + '-'*40, + '| '+description, + '-'*40, + ])) self.dirBase = os.path.dirname(os.path.realpath(sys.modules[self.__class__.__module__].__file__)) - self.parser = OptionParser( - description = test_description+' (using class: {})'.format(damask.version), - usage='./test.py [options]') - self.updateRequested = False - self.parser.add_option("-d", "--debug", action="store_true",\ - dest="debug",\ - help="debug run, don't calculate but use existing results") - self.parser.add_option("-p", "--pass", action="store_true",\ - dest="accept",\ - help="calculate results but always consider test as successfull") - self.parser.set_defaults(debug=False, - accept=False) + + self.parser = OptionParser(description = '{} (using class: {})'.format(description,damask.version), + usage = './test.py [options]') + self.parser.add_option("-d", "--debug", + action = "store_true", + dest = "debug", + help = "debug run, don't calculate but use existing results") + self.parser.add_option("-p", "--pass", + action = "store_true", + dest = "accept", + help = "calculate results but always consider test as successfull") + self.parser.add_option("-u", "--update", + action = "store_true", + dest = "update", + help = "use current test results as new reference" + ) + self.parser.set_defaults(debug = False, + accept = False, + update = False, + ) def execute(self): """Run all variants and report first failure.""" @@ -65,15 +72,17 @@ class Test(): return variant+1 # return culprit return 0 else: - if not self.testPossible(): return -1 + if not self.feasible(): return -1 + self.clean() self.prepareAll() - for variant in xrange(len(self.variants)): + + for variant,name in enumerate(self.variants): try: self.prepare(variant) self.run(variant) self.postprocess(variant) - if self.updateRequested: # update requested + if self.options.update: # update requested self.update(variant) elif not (self.options.accept or self.compare(variant)): # no update, do comparison return variant+1 # return culprit @@ -82,8 +91,8 @@ class Test(): return variant+1 # return culprit return 0 - def testPossible(self): - """Check if test is possible or not (e.g. no license available).""" + def feasible(self): + """Check whether test is possible or not (e.g. no license available).""" return True def clean(self): From 20d1164e5d8ed5ac2b7cd44132b9c765ecb63dfc Mon Sep 17 00:00:00 2001 From: Chen Date: Thu, 1 Sep 2016 16:57:29 -0400 Subject: [PATCH 174/412] add tensor support for vtk_addRectlinearGridData --- processing/post/vtk_addRectilinearGridData.py | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/processing/post/vtk_addRectilinearGridData.py b/processing/post/vtk_addRectilinearGridData.py index 63e0bf783..283a076c7 100755 --- a/processing/post/vtk_addRectilinearGridData.py +++ b/processing/post/vtk_addRectilinearGridData.py @@ -38,6 +38,10 @@ parser.add_option('-v', '--vector', dest = 'vector', action = 'extend', metavar = '', help = 'vector value label(s)') +parser.add_option('-t', '--tensor', + dest = 'tensor', + action = 'extend', metavar = '', + help = 'tensor (3x3) value label(s)') parser.add_option('-c', '--color', dest = 'color', action = 'extend', metavar = '', @@ -45,6 +49,7 @@ parser.add_option('-c', '--color', parser.set_defaults(scalar = [], vector = [], + tensor = [], color = [], inplace = False, render = False, @@ -92,9 +97,10 @@ for name in filenames: errors = [] VTKarray = {} active = defaultdict(list) - + for datatype,dimension,label in [['scalar',1,options.scalar], ['vector',3,options.vector], + ['tensor',9,options.tensor], ['color',3,options.color], ]: for i,dim in enumerate(table.label_dimension(label)): @@ -105,7 +111,7 @@ for name in filenames: remarks.append('adding {} "{}"...'.format(datatype,me)) active[datatype].append(me) - if datatype in ['scalar','vector']: VTKarray[me] = vtk.vtkDoubleArray() + if datatype in ['scalar','vector','tensor']: VTKarray[me] = vtk.vtkDoubleArray() elif datatype == 'color': VTKarray[me] = vtk.vtkUnsignedCharArray() VTKarray[me].SetNumberOfComponents(dimension) @@ -117,7 +123,7 @@ for name in filenames: table.close(dismiss = True) continue -# ------------------------------------------ process data --------------------------------------- +# ------------------------------------------ process data --------------------------------------- datacount = 0 @@ -129,11 +135,12 @@ for name in filenames: theData = [table.data[i] for i in table.label_indexrange(me)] # read strings if datatype == 'color': VTKarray[me].InsertNextTuple3(*map(lambda x: int(255.*float(x)),theData)) elif datatype == 'vector': VTKarray[me].InsertNextTuple3(*map(float,theData)) + elif datatype == 'tensor': VTKarray[me].InsertNextTuple9(*map(float,theData)) elif datatype == 'scalar': VTKarray[me].InsertNextValue(float(theData[0])) table.close() # close input ASCII table -# ------------------------------------------ add data --------------------------------------- +# ------------------------------------------ add data --------------------------------------- if datacount == Npoints: mode = 'point' elif datacount == Ncells: mode = 'cell' @@ -154,7 +161,7 @@ for name in filenames: rGrid.Modified() if vtk.VTK_MAJOR_VERSION <= 5: rGrid.Update() -# ------------------------------------------ output result --------------------------------------- +# ------------------------------------------ output result --------------------------------------- writer = vtk.vtkXMLRectilinearGridWriter() writer.SetDataModeToBinary() @@ -164,7 +171,7 @@ for name in filenames: else: writer.SetInputData(rGrid) writer.Write() -# ------------------------------------------ render result --------------------------------------- +# ------------------------------------------ render result --------------------------------------- if options.render: mapper = vtk.vtkDataSetMapper() @@ -188,7 +195,7 @@ if options.render: iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) - + iren.Initialize() renWin.Render() iren.Start() From d9077805e497e05f929b759ab24ddc1abb2e9997 Mon Sep 17 00:00:00 2001 From: chen Date: Fri, 2 Sep 2016 09:30:49 -0400 Subject: [PATCH 175/412] Forced symetric tensor when adding tensor to vtk VTK addTensor by default using the lower triangle to populate its tensor object. Enforcing the tensor to be symmetric to avoid necessary confusion when adding data (most stress/strain tensor should symmetric by default, so it should not affect the results) --- processing/post/vtk_addPointcloudData.py | 13 ++++++++----- processing/post/vtk_addRectilinearGridData.py | 7 +++++-- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/processing/post/vtk_addPointcloudData.py b/processing/post/vtk_addPointcloudData.py index cd767d5f4..557b9fdd3 100755 --- a/processing/post/vtk_addPointcloudData.py +++ b/processing/post/vtk_addPointcloudData.py @@ -131,11 +131,14 @@ for name in filenames: for datatype,labels in active.items(): # loop over scalar,color for me in labels: # loop over all requested items - theData = [table.data[i] for i in table.label_indexrange(me)] # read strings - if datatype == 'color': VTKarray[me].InsertNextTuple3(*map(lambda x: int(255.*float(x)),theData)) - elif datatype == 'vector': VTKarray[me].InsertNextTuple3(*map(float,theData)) - elif datatype == 'tensor': VTKarray[me].InsertNextTuple9(*map(float,theData)) - elif datatype == 'scalar': VTKarray[me].InsertNextValue(float(theData[0])) + theData = [float(table.data[i]) for i in table.label_indexrange(me)] # read strings + if datatype == 'color': VTKarray[me].InsertNextTuple3(*map(lambda x: int(255.*x),theData)) + elif datatype == 'scalar': VTKarray[me].InsertNextValue(theData[0]) + elif datatype == 'vector': VTKarray[me].InsertNextTuple3(*theData) + elif datatype == 'tensor': VTKarray[me].InsertNextTuple9(*0.5*(np.array(theData)+ + np.array(theData) \ + .reshape(3,3).T \ + .reshape(9))) table.input_close() # close input ASCII table diff --git a/processing/post/vtk_addRectilinearGridData.py b/processing/post/vtk_addRectilinearGridData.py index 283a076c7..8f639711b 100755 --- a/processing/post/vtk_addRectilinearGridData.py +++ b/processing/post/vtk_addRectilinearGridData.py @@ -134,9 +134,12 @@ for name in filenames: for me in labels: # loop over all requested items theData = [table.data[i] for i in table.label_indexrange(me)] # read strings if datatype == 'color': VTKarray[me].InsertNextTuple3(*map(lambda x: int(255.*float(x)),theData)) - elif datatype == 'vector': VTKarray[me].InsertNextTuple3(*map(float,theData)) - elif datatype == 'tensor': VTKarray[me].InsertNextTuple9(*map(float,theData)) elif datatype == 'scalar': VTKarray[me].InsertNextValue(float(theData[0])) + elif datatype == 'vector': VTKarray[me].InsertNextTuple3(*map(float,theData)) + elif datatype == 'tensor': VTKarray[me].InsertNextTuple9(*0.5*(np.array(theData)+ + np.array(theData) \ + .reshape(3,3).T \ + .reshape(9))) table.close() # close input ASCII table From 2b3faf204c4e745a605ce52c4d6c4691899e9712 Mon Sep 17 00:00:00 2001 From: Chen Date: Fri, 2 Sep 2016 14:30:08 -0400 Subject: [PATCH 176/412] make table compare normalize data by type (scaler, vector, tensor) --- lib/damask/test/test.py | 169 ++++++++++++++++++++-------------------- 1 file changed, 85 insertions(+), 84 deletions(-) diff --git a/lib/damask/test/test.py b/lib/damask/test/test.py index b54615c3a..023e7cb87 100644 --- a/lib/damask/test/test.py +++ b/lib/damask/test/test.py @@ -5,6 +5,7 @@ import os,sys,shutil import logging,logging.config import damask import numpy as np +import itertools from collections import Iterable from optparse import OptionParser @@ -16,7 +17,7 @@ class Test(): """ variants = [] - + def __init__(self,description = ''): fh = logging.FileHandler('test.log') # create file handler which logs even debug messages @@ -90,11 +91,11 @@ class Test(): logging.critical('\nWARNING:\n {}\n'.format(e)) return variant+1 # return culprit return 0 - + def feasible(self): """Check whether test is possible or not (e.g. no license available).""" return True - + def clean(self): """Delete directory tree containing current results.""" status = True @@ -112,7 +113,7 @@ class Test(): status = status and False return status - + def prepareAll(self): """Do all necessary preparations for the whole test""" return True @@ -120,7 +121,7 @@ class Test(): def prepare(self,variant): """Do all necessary preparations for the run of each test variant""" return True - + def run(self,variant): """Execute the requested test variant.""" @@ -152,17 +153,17 @@ class Test(): """Directory containing current results of the test.""" return os.path.normpath(os.path.join(self.dirBase,'current/')) - + def dirProof(self): """Directory containing human readable proof of correctness for the test.""" return os.path.normpath(os.path.join(self.dirBase,'proof/')) - + def fileInRoot(self,dir,file): """Path to a file in the root directory of DAMASK.""" return os.path.join(damask.Environment().rootDir(),dir,file) - + def fileInReference(self,file): """Path to a file in the refrence directory for the test.""" return os.path.join(self.dirReference(),file) @@ -172,7 +173,7 @@ class Test(): """Path to a file in the current results directory for the test.""" return os.path.join(self.dirCurrent(),file) - + def fileInProof(self,file): """Path to a file in the proof directory for the test.""" return os.path.join(self.dirProof(),file) @@ -189,58 +190,58 @@ class Test(): for source,target in zip(map(mapA,A),map(mapB,B)): try: - shutil.copy2(source,target) + shutil.copy2(source,target) except: logging.critical('error copying {} to {}'.format(source,target)) def copy_Reference2Current(self,sourcefiles=[],targetfiles=[]): - + if len(targetfiles) == 0: targetfiles = sourcefiles for i,file in enumerate(sourcefiles): try: - shutil.copy2(self.fileInReference(file),self.fileInCurrent(targetfiles[i])) + shutil.copy2(self.fileInReference(file),self.fileInCurrent(targetfiles[i])) except: logging.critical('Reference2Current: Unable to copy file "{}"'.format(file)) - + def copy_Base2Current(self,sourceDir,sourcefiles=[],targetfiles=[]): - + source=os.path.normpath(os.path.join(self.dirBase,'../../..',sourceDir)) if len(targetfiles) == 0: targetfiles = sourcefiles for i,file in enumerate(sourcefiles): try: - shutil.copy2(os.path.join(source,file),self.fileInCurrent(targetfiles[i])) + shutil.copy2(os.path.join(source,file),self.fileInCurrent(targetfiles[i])) except: logging.error(os.path.join(source,file)) logging.critical('Base2Current: Unable to copy file "{}"'.format(file)) def copy_Current2Reference(self,sourcefiles=[],targetfiles=[]): - + if len(targetfiles) == 0: targetfiles = sourcefiles for i,file in enumerate(sourcefiles): try: - shutil.copy2(self.fileInCurrent(file),self.fileInReference(targetfiles[i])) + shutil.copy2(self.fileInCurrent(file),self.fileInReference(targetfiles[i])) except: logging.critical('Current2Reference: Unable to copy file "{}"'.format(file)) - + def copy_Proof2Current(self,sourcefiles=[],targetfiles=[]): - + if len(targetfiles) == 0: targetfiles = sourcefiles for i,file in enumerate(sourcefiles): try: - shutil.copy2(self.fileInProof(file),self.fileInCurrent(targetfiles[i])) + shutil.copy2(self.fileInProof(file),self.fileInCurrent(targetfiles[i])) except: logging.critical('Proof2Current: Unable to copy file "{}"'.format(file)) - + def copy_Current2Current(self,sourcefiles=[],targetfiles=[]): - + for i,file in enumerate(sourcefiles): try: - shutil.copy2(self.fileInReference(file),self.fileInCurrent(targetfiles[i])) + shutil.copy2(self.fileInReference(file),self.fileInCurrent(targetfiles[i])) except: logging.critical('Current2Current: Unable to copy file "{}"'.format(file)) @@ -252,11 +253,11 @@ class Test(): logging.info(error) logging.debug(out) - - return out,error - - + return out,error + + + def compare_Array(self,File1,File2): import numpy as np @@ -287,28 +288,28 @@ class Test(): def compare_ArrayRefCur(self,ref,cur=''): - + if cur =='': cur = ref refName = self.fileInReference(ref) curName = self.fileInCurrent(cur) return self.compare_Array(refName,curName) - + def compare_ArrayCurCur(self,cur0,cur1): - + cur0Name = self.fileInCurrent(cur0) cur1Name = self.fileInCurrent(cur1) return self.compare_Array(cur0Name,cur1Name) def compare_Table(self,headings0,file0,headings1,file1,normHeadings='',normType=None, absoluteTolerance=False,perLine=False,skipLines=[]): - + import numpy as np logging.info('\n '.join(['comparing ASCII Tables',file0,file1])) if normHeadings == '': normHeadings = headings0 # check if comparison is possible and determine lenght of columns - if len(headings0) == len(headings1) == len(normHeadings): + if len(headings0) == len(headings1) == len(normHeadings): dataLength = len(headings0) length = [1 for i in xrange(dataLength)] shape = [[] for i in xrange(dataLength)] @@ -316,14 +317,14 @@ class Test(): maxError = [0.0 for i in xrange(dataLength)] absTol = [absoluteTolerance for i in xrange(dataLength)] column = [[1 for i in xrange(dataLength)] for j in xrange(2)] - + norm = [[] for i in xrange(dataLength)] normLength = [1 for i in xrange(dataLength)] normShape = [[] for i in xrange(dataLength)] normColumn = [1 for i in xrange(dataLength)] for i in xrange(dataLength): - if headings0[i]['shape'] != headings1[i]['shape']: + if headings0[i]['shape'] != headings1[i]['shape']: raise Exception('shape mismatch between {} and {} '.format(headings0[i]['label'],headings1[i]['label'])) shape[i] = headings0[i]['shape'] for j in xrange(np.shape(shape[i])[0]): @@ -339,7 +340,7 @@ class Test(): table0 = damask.ASCIItable(name=file0,readonly=True) table0.head_read() table1 = damask.ASCIItable(name=file1,readonly=True) - table1.head_read() + table1.head_read() for i in xrange(dataLength): key0 = ('1_' if length[i]>1 else '') + headings0[i]['label'] @@ -355,7 +356,7 @@ class Test(): column[0][i] = table0.label_index(key0) column[1][i] = table1.label_index(key1) normColumn[i] = table0.label_index(normKey) - + line0 = 0 while table0.data_read(): # read next data line of ASCII table if line0 not in skipLines: @@ -370,7 +371,7 @@ class Test(): else: norm[i] = np.append(norm[i],np.linalg.norm(np.reshape(normData,normShape[i]),normType)) line0 += 1 - + for i in xrange(dataLength): if not perLine: norm[i] = [np.max(norm[i]) for j in xrange(line0-len(skipLines))] data[i] = np.reshape(data[i],[line0-len(skipLines),length[i]]) @@ -441,14 +442,14 @@ class Test(): logging.info(files[i]+':'+','.join(columns[i])) if len(files) < 2: return True # single table is always close to itself... - + data = [] for table,labels in zip(tables,columns): table.data_readArray(labels) data.append(table.data) table.close() - - + + for i in xrange(1,len(data)): delta = data[i]-data[i-1] normBy = (np.abs(data[i]) + np.abs(data[i-1]))*0.5 @@ -457,7 +458,7 @@ class Test(): std = np.amax(np.std(normedDelta,0)) logging.info('mean: {:f}'.format(mean)) logging.info('std: {:f}'.format(std)) - + return (mean0.0, maximum, 1) # avoid div by zero for empty columns + + maximum = np.where(maximum > 0.0, maximum, 1) # avoid div by zero for empty columns + + + # normalize each table for i in xrange(len(data)): data[i] /= maximum - - mask = np.zeros_like(table.data,dtype='bool') - for table in data: - mask |= np.where(np.abs(table) Date: Fri, 2 Sep 2016 14:31:00 -0400 Subject: [PATCH 177/412] remove unused import for test.py --- lib/damask/test/test.py | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/damask/test/test.py b/lib/damask/test/test.py index 023e7cb87..cffc318a6 100644 --- a/lib/damask/test/test.py +++ b/lib/damask/test/test.py @@ -5,7 +5,6 @@ import os,sys,shutil import logging,logging.config import damask import numpy as np -import itertools from collections import Iterable from optparse import OptionParser From 4c6b8c490f015b66a25d57820e3917f9c14fe3d4 Mon Sep 17 00:00:00 2001 From: Chen Date: Fri, 2 Sep 2016 14:34:35 -0400 Subject: [PATCH 178/412] change one-line docstring to fit in one line. --- lib/damask/test/test.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/damask/test/test.py b/lib/damask/test/test.py index cffc318a6..b64485234 100644 --- a/lib/damask/test/test.py +++ b/lib/damask/test/test.py @@ -468,9 +468,7 @@ class Test(): rtol = 1e-5, atol = 1e-8, debug = False): - """ - compare tables with np.allclose - """ + """ compare tables with np.allclose """ if not (isinstance(files, Iterable) and not isinstance(files, str)): # check whether list of files is requested files = [str(files)] From d41ac4e46354abd134fb65c65d0dbc6f8f9b8969 Mon Sep 17 00:00:00 2001 From: Chen Date: Fri, 2 Sep 2016 14:35:23 -0400 Subject: [PATCH 179/412] remove white space in docstring --- lib/damask/test/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/damask/test/test.py b/lib/damask/test/test.py index b64485234..10fb993e2 100644 --- a/lib/damask/test/test.py +++ b/lib/damask/test/test.py @@ -468,7 +468,7 @@ class Test(): rtol = 1e-5, atol = 1e-8, debug = False): - """ compare tables with np.allclose """ + """compare tables with np.allclose""" if not (isinstance(files, Iterable) and not isinstance(files, str)): # check whether list of files is requested files = [str(files)] From a2f3839ca84a1f6ee006b796dcecf409b1c2d2bd Mon Sep 17 00:00:00 2001 From: Chen Date: Fri, 2 Sep 2016 14:37:15 -0400 Subject: [PATCH 180/412] add missing numpy import --- processing/post/vtk_addPointcloudData.py | 1 + processing/post/vtk_addRectilinearGridData.py | 1 + 2 files changed, 2 insertions(+) diff --git a/processing/post/vtk_addPointcloudData.py b/processing/post/vtk_addPointcloudData.py index 557b9fdd3..9736e54d0 100755 --- a/processing/post/vtk_addPointcloudData.py +++ b/processing/post/vtk_addPointcloudData.py @@ -3,6 +3,7 @@ import os,vtk import damask +import numpy as np from collections import defaultdict from optparse import OptionParser diff --git a/processing/post/vtk_addRectilinearGridData.py b/processing/post/vtk_addRectilinearGridData.py index 8f639711b..df85288af 100755 --- a/processing/post/vtk_addRectilinearGridData.py +++ b/processing/post/vtk_addRectilinearGridData.py @@ -3,6 +3,7 @@ import os,vtk import damask +import numpy as np from collections import defaultdict from optparse import OptionParser From 9512231d49ed3cb9fad38ed5b57af52a843dbcd1 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 3 Sep 2016 13:53:41 +0200 Subject: [PATCH 181/412] cleaning --- code/debug.f90 | 41 ++++++++++------------------------------- 1 file changed, 10 insertions(+), 31 deletions(-) diff --git a/code/debug.f90 b/code/debug.f90 index 21a5443fe..03a0d6f08 100644 --- a/code/debug.f90 +++ b/code/debug.f90 @@ -104,7 +104,6 @@ contains subroutine debug_init use, intrinsic :: iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment) use numerics, only: & - worldrank, & nStress, & nState, & nCryst, & @@ -130,47 +129,27 @@ subroutine debug_init integer(pInt), allocatable, dimension(:) :: chunkPos character(len=65536) :: tag, line - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- debug init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- debug init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess - if (allocated(debug_StressLoopLpDistribution)) & - deallocate(debug_StressLoopLpDistribution) - allocate(debug_StressLoopLpDistribution(nStress+1,2)) - debug_StressLoopLpDistribution = 0_pInt - if (allocated(debug_StressLoopLiDistribution)) & - deallocate(debug_StressLoopLiDistribution) - allocate(debug_StressLoopLiDistribution(nStress+1,2)) - debug_StressLoopLiDistribution = 0_pInt - if (allocated(debug_StateLoopDistribution)) & - deallocate(debug_StateLoopDistribution) - allocate(debug_StateLoopDistribution(nState+1,2)) - debug_StateLoopDistribution = 0_pInt - if (allocated(debug_CrystalliteLoopDistribution)) & - deallocate(debug_CrystalliteLoopDistribution) - allocate(debug_CrystalliteLoopDistribution(nCryst+1)) - debug_CrystalliteLoopDistribution = 0_pInt - if (allocated(debug_MaterialpointStateLoopDistribution)) & - deallocate(debug_MaterialpointStateLoopDistribution) - allocate(debug_MaterialpointStateLoopDistribution(nMPstate)) - debug_MaterialpointStateLoopDistribution = 0_pInt - if (allocated(debug_MaterialpointLoopDistribution)) & - deallocate(debug_MaterialpointLoopDistribution) - allocate(debug_MaterialpointLoopDistribution(nHomog+1)) - debug_MaterialpointLoopDistribution = 0_pInt + allocate(debug_StressLoopLpDistribution(nStress+1,2), source=0_pInt) + allocate(debug_StressLoopLiDistribution(nStress+1,2), source=0_pInt) + allocate(debug_StateLoopDistribution(nState+1,2), source=0_pInt) + allocate(debug_CrystalliteLoopDistribution(nCryst+1), source=0_pInt) + allocate(debug_MaterialpointStateLoopDistribution(nMPstate), source=0_pInt) + allocate(debug_MaterialpointLoopDistribution(nHomog+1), source=0_pInt) !-------------------------------------------------------------------------------------------------- ! try to open the config file line = '' fileExists: if(IO_open_file_stat(FILEUNIT,debug_configFile)) then - do while (trim(line) /= IO_EOF) ! read thru sections of phase part + do while (trim(line) /= IO_EOF) ! read thru sections of phase part line = IO_read(FILEUNIT) if (IO_isBlank(line)) cycle ! skip empty lines chunkPos = IO_stringPos(line) - tag = IO_lc(IO_stringValue(line,chunkPos,1_pInt)) ! extract key + tag = IO_lc(IO_stringValue(line,chunkPos,1_pInt)) ! extract key select case(tag) case ('element','e','el') debug_e = IO_intValue(line,chunkPos,2_pInt) From 6207f1e7d918d0f8e3e45670608941de5d3ceb67 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 3 Sep 2016 14:25:45 +0200 Subject: [PATCH 182/412] reporting MPI processes --- code/spectral_interface.f90 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/code/spectral_interface.f90 b/code/spectral_interface.f90 index 31b198806..d49a54411 100644 --- a/code/spectral_interface.f90 +++ b/code/spectral_interface.f90 @@ -57,7 +57,8 @@ subroutine DAMASK_interface_init() integer :: & i, & threadLevel, & - worldrank = 0 + worldrank = 0, & + worldsize = 0 integer, allocatable, dimension(:) :: & chunkPos integer, dimension(8) :: & @@ -66,6 +67,7 @@ subroutine DAMASK_interface_init() external :: & quit,& MPI_Comm_rank,& + MPI_Comm_size,& PETScInitialize, & MPI_Init_Thread, & MPI_abort @@ -77,17 +79,17 @@ subroutine DAMASK_interface_init() #ifdef _OPENMP call MPI_Init_Thread(MPI_THREAD_FUNNELED,threadLevel,ierr);CHKERRQ(ierr) ! in case of OpenMP, don't rely on PETScInitialize doing MPI init if (threadLevel>>' #include "compilation_info.f90" From 0d43dfb2f7eef0cfb13e2f1e85b70836312702bb Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 3 Sep 2016 14:27:56 +0200 Subject: [PATCH 183/412] allreduce makes sense here as for all other processes, worldrank check not needed anymore --- code/spectral_utilities.f90 | 97 +++++++++++++------------------------ 1 file changed, 34 insertions(+), 63 deletions(-) diff --git a/code/spectral_utilities.f90 b/code/spectral_utilities.f90 index b9ed5245d..326d7eabb 100644 --- a/code/spectral_utilities.f90 +++ b/code/spectral_utilities.f90 @@ -172,8 +172,7 @@ subroutine utilities_init() memory_efficient, & petsc_defaultOptions, & petsc_options, & - divergence_correction, & - worldrank + divergence_correction use debug, only: & debug_level, & debug_SPECTRAL, & @@ -212,11 +211,9 @@ subroutine utilities_init() vecSize = 3_C_INTPTR_T, & tensorSize = 9_C_INTPTR_T - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- spectral_utilities init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- spectral_utilities init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess !-------------------------------------------------------------------------------------------------- ! set debugging parameters @@ -224,11 +221,11 @@ subroutine utilities_init() debugRotation = iand(debug_level(debug_SPECTRAL),debug_SPECTRALROTATION) /= 0 debugPETSc = iand(debug_level(debug_SPECTRAL),debug_SPECTRALPETSC) /= 0 - if(debugPETSc .and. worldrank == 0_pInt) write(6,'(3(/,a),/)') & + if(debugPETSc) write(6,'(3(/,a),/)') & ' Initializing PETSc with debug options: ', & trim(PETScDebug), & - ' add more using the PETSc_Options keyword in numerics.config ' - flush(6) + ' add more using the PETSc_Options keyword in numerics.config '; flush(6) + call PetscOptionsClear(ierr); CHKERRQ(ierr) if(debugPETSc) call PetscOptionsInsertString(trim(PETSCDEBUG),ierr); CHKERRQ(ierr) call PetscOptionsInsertString(trim(petsc_defaultOptions),ierr); CHKERRQ(ierr) @@ -237,10 +234,8 @@ subroutine utilities_init() grid1Red = grid(1)/2_pInt + 1_pInt wgt = 1.0/real(product(grid),pReal) - if (worldrank == 0) then - write(6,'(a,3(i12 ))') ' grid a b c: ', grid - write(6,'(a,3(es12.5))') ' size x y z: ', geomSize - endif + write(6,'(a,3(i12 ))') ' grid a b c: ', grid + write(6,'(a,3(es12.5))') ' size x y z: ', geomSize select case (spectral_derivative) case ('continuous') ! default, no weighting @@ -342,8 +337,7 @@ subroutine utilities_init() if (pReal /= C_DOUBLE .or. pInt /= C_INT) call IO_error(0_pInt,ext_msg='Fortran to C') ! check for correct precision in C call fftw_set_timelimit(fftw_timelimit) ! set timelimit for plan creation - if (debugGeneral .and. worldrank == 0_pInt) write(6,'(/,a)') ' FFTW initialized' - flush(6) + if (debugGeneral) write(6,'(/,a)') ' FFTW initialized'; flush(6) !-------------------------------------------------------------------------------------------------- ! calculation of discrete angular frequencies, ordered as in FFTW (wrap around) @@ -527,8 +521,6 @@ subroutine utilities_fourierGammaConvolution(fieldAim) use math, only: & math_det33, & math_invert - use numerics, only: & - worldrank use mesh, only: & grid3, & grid, & @@ -545,10 +537,8 @@ subroutine utilities_fourierGammaConvolution(fieldAim) logical :: err - if (worldrank == 0_pInt) then - write(6,'(/,a)') ' ... doing gamma convolution ...............................................' - flush(6) - endif + write(6,'(/,a)') ' ... doing gamma convolution ...............................................' + flush(6) !-------------------------------------------------------------------------------------------------- ! do the actual spectral method calculation (mechanical equilibrium) @@ -624,8 +614,6 @@ end subroutine utilities_fourierGreenConvolution real(pReal) function utilities_divergenceRMS() use IO, only: & IO_error - use numerics, only: & - worldrank use mesh, only: & geomSize, & grid, & @@ -638,10 +626,9 @@ real(pReal) function utilities_divergenceRMS() external :: & MPI_Allreduce - if (worldrank == 0_pInt) then - write(6,'(/,a)') ' ... calculating divergence ................................................' - flush(6) - endif + write(6,'(/,a)') ' ... calculating divergence ................................................' + flush(6) + rescaledGeom = cmplx(geomSize/scaledGeomSize,0.0_pReal) !-------------------------------------------------------------------------------------------------- @@ -680,8 +667,6 @@ end function utilities_divergenceRMS real(pReal) function utilities_curlRMS() use IO, only: & IO_error - use numerics, only: & - worldrank use mesh, only: & geomSize, & grid, & @@ -693,13 +678,11 @@ real(pReal) function utilities_curlRMS() complex(pReal), dimension(3) :: rescaledGeom external :: & - MPI_Reduce, & MPI_Allreduce - if (worldrank == 0_pInt) then - write(6,'(/,a)') ' ... calculating curl ......................................................' - flush(6) - endif + write(6,'(/,a)') ' ... calculating curl ......................................................' + flush(6) + rescaledGeom = cmplx(geomSize/scaledGeomSize,0.0_pReal) !-------------------------------------------------------------------------------------------------- @@ -757,8 +740,6 @@ function utilities_maskedCompliance(rot_BC,mask_stress,C) prec_isNaN use IO, only: & IO_error - use numerics, only: & - worldrank use math, only: & math_Plain3333to99, & math_plain99to3333, & @@ -790,7 +771,7 @@ function utilities_maskedCompliance(rot_BC,mask_stress,C) allocate (sTimesC(size_reduced,size_reduced), source =0.0_pReal) temp99_Real = math_Plain3333to99(math_rotate_forward3333(C,rot_BC)) - if(debugGeneral .and. worldrank == 0_pInt) then + if(debugGeneral) then write(6,'(/,a)') ' ... updating masked compliance ............................................' write(6,'(/,a,/,9(9(2x,f12.7,1x)/))',advance='no') ' Stiffness C (load) / GPa =',& transpose(temp99_Real)/1.e9_pReal @@ -831,7 +812,7 @@ function utilities_maskedCompliance(rot_BC,mask_stress,C) if(m/=n .and. abs(sTimesC(m,n)) > (0.0_pReal + 10.0e-12_pReal)) errmatinv = .true. ! off diagonal elements of S*C should be 0 enddo enddo - if((debugGeneral .or. errmatinv) .and. (worldrank == 0_pInt)) then ! report + if(debugGeneral .or. errmatinv) then write(formatString, '(I16.16)') size_reduced formatString = '(/,a,/,'//trim(formatString)//'('//trim(formatString)//'(2x,es9.2,1x)/))' write(6,trim(formatString),advance='no') ' C * S (load) ', & @@ -845,7 +826,7 @@ function utilities_maskedCompliance(rot_BC,mask_stress,C) else temp99_real = 0.0_pReal endif - if(debugGeneral .and. worldrank == 0_pInt) & ! report + if(debugGeneral) & write(6,'(/,a,/,9(9(2x,f12.7,1x)/),/)',advance='no') ' Masked Compliance (load) * GPa =', & transpose(temp99_Real*1.e9_pReal) flush(6) @@ -938,15 +919,11 @@ end subroutine utilities_fourierTensorDivergence !-------------------------------------------------------------------------------------------------- subroutine utilities_constitutiveResponse(F_lastInc,F,timeinc, & P,C_volAvg,C_minmaxAvg,P_av,forwardData,rotation_BC) - use prec, only: & - dNeq use IO, only: & IO_error use debug, only: & debug_reset, & debug_info - use numerics, only: & - worldrank use math, only: & math_transpose33, & math_rotate_forward33, & @@ -974,7 +951,7 @@ subroutine utilities_constitutiveResponse(F_lastInc,F,timeinc, & real(pReal),intent(out), dimension(3,3,3,3) :: C_volAvg, C_minmaxAvg !< average stiffness real(pReal),intent(out), dimension(3,3) :: P_av !< average PK stress - real(pReal),intent(out), dimension(3,3,grid(1),grid(2),grid3) :: P !< PK stress + real(pReal),intent(out), dimension(3,3,grid(1),grid(2),grid3) :: P !< PK stress logical :: & age @@ -985,13 +962,10 @@ subroutine utilities_constitutiveResponse(F_lastInc,F,timeinc, & real(pReal) :: max_dPdF_norm, min_dPdF_norm, defgradDetMin, defgradDetMax, defgradDet external :: & - MPI_Reduce, & MPI_Allreduce - if (worldrank == 0_pInt) then - write(6,'(/,a)') ' ... evaluating constitutive response ......................................' - flush(6) - endif + write(6,'(/,a)') ' ... evaluating constitutive response ......................................' + flush(6) age = .False. if (forwardData) then ! aging results @@ -1015,15 +989,14 @@ subroutine utilities_constitutiveResponse(F_lastInc,F,timeinc, & defgradDetMax = max(defgradDetMax,defgradDet) defgradDetMin = min(defgradDetMin,defgradDet) end do - call MPI_reduce(MPI_IN_PLACE,defgradDetMax,1,MPI_DOUBLE,MPI_MAX,0,PETSC_COMM_WORLD,ierr) - if(ierr /=0_pInt) call IO_error(894_pInt, ext_msg='MPI_Allreduce max') - call MPI_reduce(MPI_IN_PLACE,defgradDetMin,1,MPI_DOUBLE,MPI_MIN,0,PETSC_COMM_WORLD,ierr) - if(ierr /=0_pInt) call IO_error(894_pInt, ext_msg='MPI_Allreduce min') - if (worldrank == 0_pInt) then - write(6,'(a,1x,es11.4)') ' max determinant of deformation =', defgradDetMax - write(6,'(a,1x,es11.4)') ' min determinant of deformation =', defgradDetMin - flush(6) - endif + + call MPI_Allreduce(MPI_IN_PLACE,defgradDetMax,1,MPI_DOUBLE,MPI_MAX,PETSC_COMM_WORLD,ierr) + if (ierr /= 0_pInt) call IO_error(894_pInt, ext_msg='MPI_Allreduce max') + call MPI_Allreduce(MPI_IN_PLACE,defgradDetMin,1,MPI_DOUBLE,MPI_MIN,PETSC_COMM_WORLD,ierr) + if (ierr /= 0_pInt) call IO_error(894_pInt, ext_msg='MPI_Allreduce min') + write(6,'(a,1x,es11.4)') ' max determinant of deformation =', defgradDetMax + write(6,'(a,1x,es11.4)') ' min determinant of deformation =', defgradDetMin + flush(6) endif call CPFEM_general(age,timeinc) @@ -1061,15 +1034,13 @@ subroutine utilities_constitutiveResponse(F_lastInc,F,timeinc, & P = reshape(materialpoint_P, [3,3,grid(1),grid(2),grid3]) P_av = sum(sum(sum(P,dim=5),dim=4),dim=3) * wgt ! average of P call MPI_Allreduce(MPI_IN_PLACE,P_av,9,MPI_DOUBLE,MPI_SUM,PETSC_COMM_WORLD,ierr) - if (debugRotation .and. worldrank == 0_pInt) & + if (debugRotation) & write(6,'(/,a,/,3(3(2x,f12.4,1x)/))',advance='no') ' Piola--Kirchhoff stress (lab) / MPa =',& math_transpose33(P_av)*1.e-6_pReal P_av = math_rotate_forward33(P_av,rotation_BC) - if (worldrank == 0_pInt) then - write(6,'(/,a,/,3(3(2x,f12.4,1x)/))',advance='no') ' Piola--Kirchhoff stress / MPa =',& + write(6,'(/,a,/,3(3(2x,f12.4,1x)/))',advance='no') ' Piola--Kirchhoff stress / MPa =',& math_transpose33(P_av)*1.e-6_pReal - flush(6) - endif + flush(6) end subroutine utilities_constitutiveResponse From a6940ab84f0ea0b3e30f37926015b0a221376cf4 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 3 Sep 2016 14:29:39 +0200 Subject: [PATCH 184/412] did not compile --- code/IO.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/IO.f90 b/code/IO.f90 index 22b56d819..f5db5c1f1 100644 --- a/code/IO.f90 +++ b/code/IO.f90 @@ -142,7 +142,7 @@ recursive function IO_read(fileUnit,reset) result(line) pathOn(stack) = path(1:scan(path,SEP,.true.))//input ! glue include to current file's dir endif - open(newunit=unitOn(stack),iostat=myStat,file=pathOn(stack),action=read) ! open included file + open(newunit=unitOn(stack),iostat=myStat,file=pathOn(stack),action='read') ! open included file if (myStat /= 0_pInt) call IO_error(100_pInt,el=myStat,ext_msg=pathOn(stack)) line = IO_read(fileUnit) From d94db61534340eecceab407961e438403f13bba5 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 3 Sep 2016 17:01:10 +0200 Subject: [PATCH 185/412] update only supported by minority of the tests --- lib/damask/test/test.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/damask/test/test.py b/lib/damask/test/test.py index 10fb993e2..f2d000ab0 100644 --- a/lib/damask/test/test.py +++ b/lib/damask/test/test.py @@ -49,14 +49,8 @@ class Test(): action = "store_true", dest = "accept", help = "calculate results but always consider test as successfull") - self.parser.add_option("-u", "--update", - action = "store_true", - dest = "update", - help = "use current test results as new reference" - ) self.parser.set_defaults(debug = False, accept = False, - update = False, ) def execute(self): @@ -82,7 +76,7 @@ class Test(): self.prepare(variant) self.run(variant) self.postprocess(variant) - if self.options.update: # update requested + if self.updateRequested: # update requested self.update(variant) elif not (self.options.accept or self.compare(variant)): # no update, do comparison return variant+1 # return culprit From 5fec85a159ec5bc39d9cab262cef91c371c1087a Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 3 Sep 2016 17:01:39 +0200 Subject: [PATCH 186/412] not needed any more --- code/math.f90 | 1 - 1 file changed, 1 deletion(-) diff --git a/code/math.f90 b/code/math.f90 index 8694e30ee..fba431a56 100644 --- a/code/math.f90 +++ b/code/math.f90 @@ -178,7 +178,6 @@ subroutine math_init use, intrinsic :: iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment) use prec, only: tol_math_check use numerics, only: & - worldrank, & fixedSeed use IO, only: IO_error, IO_timeStamp From 6ea7eeee08bec19f12adaa59fc5699d079bc71fc Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 4 Sep 2016 07:34:58 +0200 Subject: [PATCH 187/412] bugfix when restoring old behavior --- lib/damask/test/test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/damask/test/test.py b/lib/damask/test/test.py index f2d000ab0..78af62e95 100644 --- a/lib/damask/test/test.py +++ b/lib/damask/test/test.py @@ -41,6 +41,7 @@ class Test(): self.parser = OptionParser(description = '{} (using class: {})'.format(description,damask.version), usage = './test.py [options]') + self.updateRequested = False self.parser.add_option("-d", "--debug", action = "store_true", dest = "debug", From cde7de4e9fbbb57aa8e5095b67101179a3474460 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Sun, 4 Sep 2016 18:46:53 -0400 Subject: [PATCH 188/412] improved superclass handling and compare_Tables --- lib/damask/test/test.py | 167 +++++++++++++++++++--------------------- 1 file changed, 81 insertions(+), 86 deletions(-) diff --git a/lib/damask/test/test.py b/lib/damask/test/test.py index b54615c3a..f98f572fa 100644 --- a/lib/damask/test/test.py +++ b/lib/damask/test/test.py @@ -17,8 +17,16 @@ class Test(): variants = [] - def __init__(self,description = ''): + def __init__(self, **kwargs): + defaults = {'description': '', + 'keep': False, + 'accept': False, + 'update': False, + } + for arg in defaults.keys(): + setattr(self,arg,kwargs.get(arg) if kwargs.get(arg) else defaults[arg]) + fh = logging.FileHandler('test.log') # create file handler which logs even debug messages fh.setLevel(logging.DEBUG) fh.setFormatter(logging.Formatter('%(asctime)s - %(levelname)s: \n%(message)s')) @@ -34,62 +42,53 @@ class Test(): logging.info('\n'.join(['+'*40, '-'*40, - '| '+description, + '| '+self.description, '-'*40, ])) + self.dirBase = os.path.dirname(os.path.realpath(sys.modules[self.__class__.__module__].__file__)) - self.parser = OptionParser(description = '{} (using class: {})'.format(description,damask.version), + self.parser = OptionParser(description = '{} (Test class version: {})'.format(self.description,damask.version), usage = './test.py [options]') - self.parser.add_option("-d", "--debug", + self.parser.add_option("-k", "--keep", action = "store_true", - dest = "debug", - help = "debug run, don't calculate but use existing results") - self.parser.add_option("-p", "--pass", + dest = "keep", + help = "keep current results, just run postprocessing") + self.parser.add_option("--ok", "--accept", action = "store_true", dest = "accept", help = "calculate results but always consider test as successfull") - self.parser.add_option("-u", "--update", - action = "store_true", - dest = "update", - help = "use current test results as new reference" - ) - self.parser.set_defaults(debug = False, - accept = False, - update = False, + + self.parser.set_defaults(keep = self.keep, + accept = self.accept, + update = self.update, ) + def execute(self): """Run all variants and report first failure.""" - if self.options.debug: - for variant in xrange(len(self.variants)): - try: - self.postprocess(variant) - if not self.compare(variant): - return variant+1 # return culprit - except Exception as e : - logging.critical('\nWARNING:\n {}\n'.format(e)) - return variant+1 # return culprit - return 0 - else: + if not self.options.keep: if not self.feasible(): return -1 - self.clean() self.prepareAll() - for variant,name in enumerate(self.variants): - try: + for variant,name in enumerate(self.variants): + try: + if not self.options.keep: self.prepare(variant) self.run(variant) - self.postprocess(variant) - if self.options.update: # update requested - self.update(variant) - elif not (self.options.accept or self.compare(variant)): # no update, do comparison - return variant+1 # return culprit - except Exception as e : - logging.critical('\nWARNING:\n {}\n'.format(e)) - return variant+1 # return culprit - return 0 + + self.postprocess(variant) + + if self.options.update and not self.update(variant): + logging.critical('update for "{}" failed.'.format(name)) + elif not (self.options.accept or self.compare(variant)): # no update, do comparison + return variant+1 # return culprit + + except Exception as e : + logging.critical('exception during variant execution: {}'.format(e)) + return variant+1 # return culprit + return 0 def feasible(self): """Check whether test is possible or not (e.g. no license available).""" @@ -97,21 +96,18 @@ class Test(): def clean(self): """Delete directory tree containing current results.""" - status = True try: shutil.rmtree(self.dirCurrent()) except: logging.warning('removal of directory "{}" not possible...'.format(self.dirCurrent())) - status = status and False try: os.mkdir(self.dirCurrent()) + return True except: - logging.critical('creation of directory "{}" failed...'.format(self.dirCurrent())) - status = status and False - - return status + logging.critical('creation of directory "{}" failed.'.format(self.dirCurrent())) + return False def prepareAll(self): """Do all necessary preparations for the whole test""" @@ -139,8 +135,8 @@ class Test(): def update(self,variant): """Update reference with current results.""" - logging.debug('Update not necessary') - return True + logging.critical('update not supported.') + return False def dirReference(self): @@ -463,21 +459,17 @@ class Test(): def compare_Tables(self, - files = [None,None], # list of file names + files = [None,None], # list of file names columns = [None], # list of list of column labels (per file) - rtol = 1e-5, - atol = 1e-8, - preFilter = -1.0, - postFilter = -1.0, - debug = False): - """ - compare tables with np.allclose - - threshold can be used to ignore small values (a negative number disables this feature) - """ + rtol = 1e-5, + atol = 1e-8, + debug = False): + """compare multiple tables with np.allclose""" if not (isinstance(files, Iterable) and not isinstance(files, str)): # check whether list of files is requested files = [str(files)] + if len(files) < 2: return True # single table is always close to itself... + tables = [damask.ASCIItable(name = filename,readonly = True) for filename in files] for table in tables: table.head_read() @@ -486,7 +478,7 @@ class Test(): columns = columns[:len(files)] # truncate to same length as files for i,column in enumerate(columns): - if column is None: columns[i] = tables[i].labels(raw = True) # if no column is given, read all + if column is None: columns[i] = tables[i].labels(raw = False) # if no column is given, use all logging.info('comparing ASCIItables') for i in xrange(len(columns)): @@ -494,39 +486,42 @@ class Test(): ([columns[i]] if not (isinstance(columns[i], Iterable) and not isinstance(columns[i], str)) else \ columns[i] ) - logging.info(files[i]+':'+','.join(columns[i])) + logging.info(files[i]+': '+','.join(columns[i])) + + dimensions = tables[0].label_dimension(columns[0]) # width of each requested column + maximum = np.zeros_like(columns[0],dtype=float) # one magnitude per column entry + data = [] # list of feature table extracted from each file (ASCII table) + + for i,(table,labels) in enumerate(zip(tables,columns)): + if np.any(dimensions != table.label_dimension(labels)): # check data object consistency + logging.critical('Table {} differs in data layout.'.format(files[i])) + return False + table.data_readArray(labels) # read data, ... + data.append(table.data) # ... store, ... + table.close() # ... close + + for j,label in enumerate(labels): # iterate over object labels + maximum[j] = np.maximum(\ + maximum[j], + np.amax(np.linalg.norm(table.data[:,table.label_indexrange(label)], + axis=1)) + ) # find maximum Euclidean norm across rows + + maximum = np.where(maximum > 0.0, maximum, 1.0) # avoid div by zero for zero columns + maximum = np.repeat(maximum,dimensions) # spread maximum over columns of each object - if len(files) < 2: return True # single table is always close to itself... - - maximum = np.zeros(len(columns[0]),dtype='f') - data = [] - for table,labels in zip(tables,columns): - table.data_readArray(labels) - data.append(np.where(np.abs(table.data)0.0, maximum, 1) # avoid div by zero for empty columns for i in xrange(len(data)): - data[i] /= maximum - - mask = np.zeros_like(table.data,dtype='bool') + data[i] /= maximum # normalize each table + + if debug: + logging.debug(str(maximum)) + allclose = np.absolute(data[0]-data[1]) <= (atol + rtol*np.absolute(data[1])) + for ok,valA,valB in zip(allclose,data[0],data[1]): + logging.debug('{}:\n{}\n{}'.format(ok,valA,valB)) - for table in data: - mask |= np.where(np.abs(table) Date: Mon, 5 Sep 2016 14:26:54 +0200 Subject: [PATCH 189/412] not needed any more --- code/FEsolving.f90 | 2 -- 1 file changed, 2 deletions(-) diff --git a/code/FEsolving.f90 b/code/FEsolving.f90 index bc7588ff0..8e09a1524 100644 --- a/code/FEsolving.f90 +++ b/code/FEsolving.f90 @@ -60,8 +60,6 @@ subroutine FE_init IO_warning, & IO_timeStamp use DAMASK_interface - use numerics, only: & - worldrank implicit none #if defined(Marc4DAMASK) || defined(Abaqus) From 1fc653ca861b644637eed87566259f30e7637ef0 Mon Sep 17 00:00:00 2001 From: Test User Date: Wed, 7 Sep 2016 22:14:27 +0200 Subject: [PATCH 190/412] updated version information after successful test of v2.0.1-75-g6f843ce --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 8a765d7c8..e317ce9f1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-59-g4b02a55 +v2.0.1-75-g6f843ce From c8f832e12f569f87d58d9c887ce91a9f0c31f7c5 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 8 Sep 2016 08:43:15 +0200 Subject: [PATCH 191/412] communication in code only run with a certain debug option on will not work debug only happens at rank 0! --- code/spectral_utilities.f90 | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/code/spectral_utilities.f90 b/code/spectral_utilities.f90 index 326d7eabb..7b116e264 100644 --- a/code/spectral_utilities.f90 +++ b/code/spectral_utilities.f90 @@ -957,13 +957,10 @@ subroutine utilities_constitutiveResponse(F_lastInc,F,timeinc, & age integer(pInt) :: & - j,k,ierr + j,k real(pReal), dimension(3,3,3,3) :: max_dPdF, min_dPdF real(pReal) :: max_dPdF_norm, min_dPdF_norm, defgradDetMin, defgradDetMax, defgradDet - external :: & - MPI_Allreduce - write(6,'(/,a)') ' ... evaluating constitutive response ......................................' flush(6) age = .False. @@ -990,10 +987,6 @@ subroutine utilities_constitutiveResponse(F_lastInc,F,timeinc, & defgradDetMin = min(defgradDetMin,defgradDet) end do - call MPI_Allreduce(MPI_IN_PLACE,defgradDetMax,1,MPI_DOUBLE,MPI_MAX,PETSC_COMM_WORLD,ierr) - if (ierr /= 0_pInt) call IO_error(894_pInt, ext_msg='MPI_Allreduce max') - call MPI_Allreduce(MPI_IN_PLACE,defgradDetMin,1,MPI_DOUBLE,MPI_MIN,PETSC_COMM_WORLD,ierr) - if (ierr /= 0_pInt) call IO_error(894_pInt, ext_msg='MPI_Allreduce min') write(6,'(a,1x,es11.4)') ' max determinant of deformation =', defgradDetMax write(6,'(a,1x,es11.4)') ' min determinant of deformation =', defgradDetMin flush(6) From 1e16ebe2efd81a277e63315cb8494ea3aba88dd6 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 8 Sep 2016 08:45:46 +0200 Subject: [PATCH 192/412] not used any more --- lib/damask/environment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/damask/environment.py b/lib/damask/environment.py index fedc22e36..040e705b3 100644 --- a/lib/damask/environment.py +++ b/lib/damask/environment.py @@ -1,6 +1,6 @@ # -*- coding: UTF-8 no BOM -*- -import os,subprocess,shlex,re,string +import os,subprocess,shlex,re class Environment(): __slots__ = [ \ From 59e8109ced4110960a8f21408b8c4df86235c3f8 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 8 Sep 2016 08:51:07 +0200 Subject: [PATCH 193/412] some comments, missing ierr --- code/spectral_utilities.f90 | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/code/spectral_utilities.f90 b/code/spectral_utilities.f90 index 7b116e264..1a86b7648 100644 --- a/code/spectral_utilities.f90 +++ b/code/spectral_utilities.f90 @@ -957,7 +957,7 @@ subroutine utilities_constitutiveResponse(F_lastInc,F,timeinc, & age integer(pInt) :: & - j,k + j,k,ierr real(pReal), dimension(3,3,3,3) :: max_dPdF, min_dPdF real(pReal) :: max_dPdF_norm, min_dPdF_norm, defgradDetMin, defgradDetMax, defgradDet @@ -969,12 +969,10 @@ subroutine utilities_constitutiveResponse(F_lastInc,F,timeinc, & age = .True. materialpoint_F0 = reshape(F_lastInc, [3,3,1,product(grid(1:2))*grid3]) endif - if (cutBack) then ! restore saved variables - age = .False. - endif + if (cutBack) age = .False. ! restore saved variables materialpoint_F = reshape(F,[3,3,1,product(grid(1:2))*grid3]) - call debug_reset() + call debug_reset() ! this has no effect on rank >0 !-------------------------------------------------------------------------------------------------- ! calculate bounds of det(F) and report @@ -1019,7 +1017,7 @@ subroutine utilities_constitutiveResponse(F_lastInc,F,timeinc, & call MPI_Allreduce(MPI_IN_PLACE,C_volAvg,81,MPI_DOUBLE,MPI_SUM,PETSC_COMM_WORLD,ierr) - call debug_info() + call debug_info() ! this has no effect on rank >0 restartWrite = .false. ! reset restartWrite status cutBack = .false. ! reset cutBack status From da538fbce9a9a72a55ca1e36f93ee14b1a6068d2 Mon Sep 17 00:00:00 2001 From: chen Date: Thu, 8 Sep 2016 18:05:49 -0400 Subject: [PATCH 194/412] speed up of VTK data transformation --- processing/post/vtk_addPointcloudData.py | 72 +++++++++---------- processing/post/vtk_addRectilinearGridData.py | 43 ++++++----- 2 files changed, 55 insertions(+), 60 deletions(-) diff --git a/processing/post/vtk_addPointcloudData.py b/processing/post/vtk_addPointcloudData.py index 9736e54d0..6a8324567 100755 --- a/processing/post/vtk_addPointcloudData.py +++ b/processing/post/vtk_addPointcloudData.py @@ -6,6 +6,7 @@ import damask import numpy as np from collections import defaultdict from optparse import OptionParser +from vtk.util import numpy_support scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptID = ' '.join([scriptName,damask.version]) @@ -14,10 +15,10 @@ scriptID = ' '.join([scriptName,damask.version]) # MAIN # -------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ -Add scalar and RGB tuples from ASCIItable to existing VTK point cloud (.vtp). - -""", version = scriptID) +parser = OptionParser(option_class=damask.extendableOption, + usage='%prog options [file[s]]', + description = """Add scalar and RGB tuples from ASCIItable to existing VTK point cloud (.vtp).""", + version = scriptID) parser.add_option( '--vtk', dest = 'vtk', @@ -104,60 +105,57 @@ for name in filenames: for datatype,dimension,label in [['scalar',1,options.scalar], ['vector',3,options.vector], ['tensor',9,options.tensor], - ['color',3,options.color], + ['color' ,3,options.color], ]: for i,dim in enumerate(table.label_dimension(label)): me = label[i] - if dim == -1: remarks.append('{} "{}" not found...'.format(datatype,me)) - elif dim > dimension: remarks.append('"{}" not of dimension {}...'.format(me,dimension)) + if dim == -1: remarks.append('{} "{}" not found...'.format(datatype,me)) + elif dim > dimension: remarks.append('"{}" not of dimension {}...'.format(me,dimension)) else: remarks.append('adding {} "{}"...'.format(datatype,me)) active[datatype].append(me) - if datatype in ['scalar','vector', 'tensor']: VTKarray[me] = vtk.vtkDoubleArray() - elif datatype == 'color': VTKarray[me] = vtk.vtkUnsignedCharArray() - - VTKarray[me].SetNumberOfComponents(dimension) - VTKarray[me].SetName(label[i]) - if remarks != []: damask.util.croak(remarks) if errors != []: damask.util.croak(errors) table.close(dismiss = True) continue -# ------------------------------------------ process data --------------------------------------- +# --------------------------------------- process and add data ----------------------------------- - while table.data_read(): # read next data line of ASCII table + table.data_readArray([item for sublist in active.values() for item in sublist]) # read all requested data - for datatype,labels in active.items(): # loop over scalar,color - for me in labels: # loop over all requested items - theData = [float(table.data[i]) for i in table.label_indexrange(me)] # read strings - if datatype == 'color': VTKarray[me].InsertNextTuple3(*map(lambda x: int(255.*x),theData)) - elif datatype == 'scalar': VTKarray[me].InsertNextValue(theData[0]) - elif datatype == 'vector': VTKarray[me].InsertNextTuple3(*theData) - elif datatype == 'tensor': VTKarray[me].InsertNextTuple9(*0.5*(np.array(theData)+ - np.array(theData) \ - .reshape(3,3).T \ - .reshape(9))) + for datatype,labels in active.items(): # loop over scalar,color + for me in labels: # loop over all requested items + VTKtype = vtk.VTK_DOUBLE + VTKdata = table.data[:, table.label_indexrange(me)].copy() # copy to force contiguous layout - table.input_close() # close input ASCII table + if datatype == 'color': + VTKtype = vtk.VTK_UNSIGNED_CHAR + VTKdata = (VTKdata*255).astype(int) # translate to 0..255 UCHAR + elif datatype == 'tensor': + VTKdata[:,1] = VTKdata[:,3] = 0.5*(VTKdata[:,1]+VTKdata[:,3]) + VTKdata[:,2] = VTKdata[:,6] = 0.5*(VTKdata[:,2]+VTKdata[:,6]) + VTKdata[:,5] = VTKdata[:,7] = 0.5*(VTKdata[:,5]+VTKdata[:,7]) -# ------------------------------------------ add data --------------------------------------- + VTKarray[me] = numpy_support.numpy_to_vtk(num_array=VTKdata,array_type=VTKtype) + VTKarray[me].SetName(me) - for datatype,labels in active.items(): # loop over scalar,color - if datatype == 'color': - Polydata.GetPointData().SetScalars(VTKarray[active['color'][0]]) - Polydata.GetCellData().SetScalars(VTKarray[active['color'][0]]) - for me in labels: # loop over all requested items - Polydata.GetPointData().AddArray(VTKarray[me]) - Polydata.GetCellData().AddArray(VTKarray[me]) + if datatype == 'color': + Polydata.GetPointData().SetScalars(VTKarray[me]) + Polydata.GetCellData().SetScalars(VTKarray[me]) + else: + Polydata.GetPointData().AddArray(VTKarray[me]) + Polydata.GetCellData().AddArray(VTKarray[me]) + + + table.input_close() # close input ASCII table + +# ------------------------------------------ output result --------------------------------------- Polydata.Modified() if vtk.VTK_MAJOR_VERSION <= 5: Polydata.Update() -# ------------------------------------------ output result --------------------------------------- - writer = vtk.vtkXMLPolyDataWriter() writer.SetDataModeToBinary() writer.SetCompressorTypeToZLib() @@ -175,7 +173,7 @@ if options.render: actor.SetMapper(mapper) # Create the graphics structure. The renderer renders into the -# render window. The render window interactor captures mouse events +# render window. The render window interactively captures mouse events # and will perform appropriate camera or actor manipulation # depending on the nature of the events. diff --git a/processing/post/vtk_addRectilinearGridData.py b/processing/post/vtk_addRectilinearGridData.py index df85288af..f8d483bf0 100755 --- a/processing/post/vtk_addRectilinearGridData.py +++ b/processing/post/vtk_addRectilinearGridData.py @@ -4,6 +4,7 @@ import os,vtk import damask import numpy as np +from vtk.util import numpy_support from collections import defaultdict from optparse import OptionParser @@ -102,22 +103,16 @@ for name in filenames: for datatype,dimension,label in [['scalar',1,options.scalar], ['vector',3,options.vector], ['tensor',9,options.tensor], - ['color',3,options.color], + ['color' ,3,options.color], ]: for i,dim in enumerate(table.label_dimension(label)): me = label[i] - if dim == -1: remarks.append('{} "{}" not found...'.format(datatype,me)) + if dim == -1: remarks.append('{} "{}" not found...'.format(datatype,me)) elif dim > dimension: remarks.append('"{}" not of dimension {}...'.format(me,dimension)) else: remarks.append('adding {} "{}"...'.format(datatype,me)) active[datatype].append(me) - if datatype in ['scalar','vector','tensor']: VTKarray[me] = vtk.vtkDoubleArray() - elif datatype == 'color': VTKarray[me] = vtk.vtkUnsignedCharArray() - - VTKarray[me].SetNumberOfComponents(dimension) - VTKarray[me].SetName(label[i]) - if remarks != []: damask.util.croak(remarks) if errors != []: damask.util.croak(errors) @@ -126,28 +121,30 @@ for name in filenames: # ------------------------------------------ process data --------------------------------------- - datacount = 0 + table.data_readArray([item for sublist in active.values() for item in sublist]) # read all requested data - while table.data_read(): # read next data line of ASCII table + for datatype,labels in active.items(): # loop over scalar,color + for me in labels: # loop over all requested items + VTKtype = vtk.VTK_DOUBLE + VTKdata = table.data[:, table.label_indexrange(me)].copy() # copy to force contiguous layout - datacount += 1 # count data lines - for datatype,labels in active.items(): # loop over scalar,color - for me in labels: # loop over all requested items - theData = [table.data[i] for i in table.label_indexrange(me)] # read strings - if datatype == 'color': VTKarray[me].InsertNextTuple3(*map(lambda x: int(255.*float(x)),theData)) - elif datatype == 'scalar': VTKarray[me].InsertNextValue(float(theData[0])) - elif datatype == 'vector': VTKarray[me].InsertNextTuple3(*map(float,theData)) - elif datatype == 'tensor': VTKarray[me].InsertNextTuple9(*0.5*(np.array(theData)+ - np.array(theData) \ - .reshape(3,3).T \ - .reshape(9))) + if datatype == 'color': + VTKtype = vtk.VTK_UNSIGNED_CHAR + VTKdata = (VTKdata*255).astype(int) # translate to 0..255 UCHAR + elif datatype == 'tensor': + VTKdata[:,1] = VTKdata[:,3] = 0.5*(VTKdata[:,1]+VTKdata[:,3]) + VTKdata[:,2] = VTKdata[:,6] = 0.5*(VTKdata[:,2]+VTKdata[:,6]) + VTKdata[:,5] = VTKdata[:,7] = 0.5*(VTKdata[:,5]+VTKdata[:,7]) + + VTKarray[me] = numpy_support.numpy_to_vtk(num_array=VTKdata,array_type=VTKtype) + VTKarray[me].SetName(me) table.close() # close input ASCII table # ------------------------------------------ add data --------------------------------------- - if datacount == Npoints: mode = 'point' - elif datacount == Ncells: mode = 'cell' + if len(table.data) == Npoints: mode = 'point' + elif len(table.data) == Ncells: mode = 'cell' else: damask.util.croak('Data count is incompatible with grid...') continue From da08ea70785d21ff316dfac7a870ecbc249d7eff Mon Sep 17 00:00:00 2001 From: Test User Date: Fri, 9 Sep 2016 04:41:06 +0200 Subject: [PATCH 195/412] updated version information after successful test of v2.0.1-103-g59e8109 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index e317ce9f1..aa0e19262 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-75-g6f843ce +v2.0.1-103-g59e8109 From 017c08a7bb31512b492c6033de55e3f71b3d23cc Mon Sep 17 00:00:00 2001 From: Chen Date: Fri, 9 Sep 2016 07:28:31 -0400 Subject: [PATCH 196/412] syntax fix --- processing/post/vtk_addPointcloudData.py | 1 - 1 file changed, 1 deletion(-) diff --git a/processing/post/vtk_addPointcloudData.py b/processing/post/vtk_addPointcloudData.py index 6a8324567..b9f66e684 100755 --- a/processing/post/vtk_addPointcloudData.py +++ b/processing/post/vtk_addPointcloudData.py @@ -3,7 +3,6 @@ import os,vtk import damask -import numpy as np from collections import defaultdict from optparse import OptionParser from vtk.util import numpy_support From 8c4767d58cd31c074b52197ed0d905e3d36ce58a Mon Sep 17 00:00:00 2001 From: Chen Date: Fri, 9 Sep 2016 07:28:54 -0400 Subject: [PATCH 197/412] syntax fix --- processing/post/vtk_addRectilinearGridData.py | 1 - 1 file changed, 1 deletion(-) diff --git a/processing/post/vtk_addRectilinearGridData.py b/processing/post/vtk_addRectilinearGridData.py index f8d483bf0..7d7c39123 100755 --- a/processing/post/vtk_addRectilinearGridData.py +++ b/processing/post/vtk_addRectilinearGridData.py @@ -3,7 +3,6 @@ import os,vtk import damask -import numpy as np from vtk.util import numpy_support from collections import defaultdict from optparse import OptionParser From ee322be870726c89889e77a49ef0d500e23db79f Mon Sep 17 00:00:00 2001 From: chen Date: Fri, 9 Sep 2016 16:17:00 -0400 Subject: [PATCH 198/412] use np.histogram2d, fixed list.append bug when using weight column --- processing/post/binXY.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/processing/post/binXY.py b/processing/post/binXY.py index 4fd635120..2c02b8dcb 100755 --- a/processing/post/binXY.py +++ b/processing/post/binXY.py @@ -20,7 +20,7 @@ Produces a binned grid of two columns from an ASCIItable, i.e. a two-dimensional parser.add_option('-d','--data', dest = 'data', - type='string', nargs = 2, metavar = 'string string', + type = 'string', nargs = 2, metavar = 'string string', help = 'column labels containing x and y ') parser.add_option('-w','--weight', dest = 'weight', @@ -49,15 +49,15 @@ parser.add_option('-z','--zrange', parser.add_option('-i','--invert', dest = 'invert', action = 'store_true', - help = 'invert probability density [%default]') + help = 'invert probability density') parser.add_option('-r','--rownormalize', dest = 'normRow', action = 'store_true', - help = 'normalize probability density in each row [%default]') + help = 'normalize probability density in each row') parser.add_option('-c','--colnormalize', dest = 'normCol', action = 'store_true', - help = 'normalize probability density in each column [%default]') + help = 'normalize probability density in each column') parser.set_defaults(bins = (10,10), type = ('linear','linear','linear'), @@ -79,7 +79,8 @@ result = np.zeros((options.bins[0],options.bins[1],3),'f') if options.data is None: parser.error('no data columns specified.') -labels = options.data +labels = list(options.data) + if options.weight is not None: labels += [options.weight] # prevent character splitting of single string value @@ -106,7 +107,7 @@ for name in filenames: # ------------------------------------------ sanity checks ---------------------------------------- missing_labels = table.data_readArray(labels) - + if len(missing_labels) > 0: damask.util.croak('column{} {} not found.'.format('s' if len(missing_labels) > 1 else '',', '.join(missing_labels))) table.close(dismiss = True) @@ -119,12 +120,11 @@ for name in filenames: minmax[c] = np.log(minmax[c]) # change minmax to log, too delta = minmax[:,1]-minmax[:,0] - - for i in xrange(len(table.data)): - x = int(options.bins[0]*(table.data[i,0]-minmax[0,0])/delta[0]) - y = int(options.bins[1]*(table.data[i,1]-minmax[1,0])/delta[1]) - if x >= 0 and x < options.bins[0] and y >= 0 and y < options.bins[1]: - grid[x,y] += 1. if options.weight is None else table.data[i,2] # count (weighted) occurrences + + (grid,xedges,yedges) = np.histogram2d(table.data[:,0],table.data[:,1], + bins=options.bins, + range=minmax, + weights=None if options.weight is None else table.data[:,2]) if options.normCol: for x in xrange(options.bins[0]): @@ -136,7 +136,7 @@ for name in filenames: sum = np.sum(grid[:,y]) if sum > 0.0: grid[:,y] /= sum - + if (minmax[2] == 0.0).all(): minmax[2] = [grid.min(),grid.max()] # auto scale from data if minmax[2,0] == minmax[2,1]: minmax[2,0] -= 1. @@ -147,7 +147,7 @@ for name in filenames: if options.type[2].lower() == 'log': grid = np.log(grid) minmax[2] = np.log(minmax[2]) - + delta[2] = minmax[2,1]-minmax[2,0] for x in xrange(options.bins[0]): From 0b4e75c20162c0cc4403cd783ab8a4c0e32ec709 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 10 Sep 2016 20:44:46 +0200 Subject: [PATCH 199/412] update function was not working due to name clash for self.update --- lib/damask/test/test.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/damask/test/test.py b/lib/damask/test/test.py index 5cc6d1210..f2c05efd6 100644 --- a/lib/damask/test/test.py +++ b/lib/damask/test/test.py @@ -20,18 +20,18 @@ class Test(): def __init__(self, **kwargs): defaults = {'description': '', - 'keep': False, - 'accept': False, - 'update': False, + 'keep': False, + 'accept': False, + 'updateRequest': False, } for arg in defaults.keys(): setattr(self,arg,kwargs.get(arg) if kwargs.get(arg) else defaults[arg]) - fh = logging.FileHandler('test.log') # create file handler which logs even debug messages + fh = logging.FileHandler('test.log') # create file handler which logs even debug messages fh.setLevel(logging.DEBUG) fh.setFormatter(logging.Formatter('%(asctime)s - %(levelname)s: \n%(message)s')) - ch = logging.StreamHandler(stream=sys.stdout) # create console handler with a higher log level + ch = logging.StreamHandler(stream=sys.stdout) # create console handler with a higher log level ch.setLevel(logging.INFO) ch.setFormatter(logging.Formatter('%(message)s')) @@ -61,7 +61,7 @@ class Test(): self.parser.set_defaults(keep = self.keep, accept = self.accept, - update = self.update, + update = self.updateRequest, ) @@ -80,10 +80,10 @@ class Test(): self.postprocess(variant) - if self.options.update and not self.update(variant): - logging.critical('update for "{}" failed.'.format(name)) - elif not (self.options.accept or self.compare(variant)): # no update, do comparison - return variant+1 # return culprit + if self.options.update: + if self.update(variant) != 0: logging.critical('update for "{}" failed.'.format(name)) + elif not (self.options.accept or self.compare(variant)): # no update, do comparison + return variant+1 # return culprit except Exception as e : logging.critical('exception during variant execution: {}'.format(e)) @@ -135,7 +135,7 @@ class Test(): def update(self,variant): """Update reference with current results.""" logging.critical('update not supported.') - return False + return 1 def dirReference(self): From 2daad7542eb20c5cba101a9a4a72a796f43c077a Mon Sep 17 00:00:00 2001 From: tiasmaiti Date: Sat, 10 Sep 2016 16:33:28 -0400 Subject: [PATCH 200/412] added option for periodic averaging --- processing/post/groupTable.py | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/processing/post/groupTable.py b/processing/post/groupTable.py index 924105fba..cb1359c78 100755 --- a/processing/post/groupTable.py +++ b/processing/post/groupTable.py @@ -4,9 +4,18 @@ import os,sys import math # noqa import numpy as np -from optparse import OptionParser +from optparse import OptionParser, OptionGroup import damask +#"https://en.wikipedia.org/wiki/Center_of_mass#Systems_with_periodic_boundary_conditions" +def periodicAverage(Points, Box): + theta = (Points/Box[1]) * (2.0*np.pi) + xi = np.cos(theta) + zeta = np.sin(theta) + theta_avg = np.arctan2(-1.0*zeta.mean(), -1.0*xi.mean()) + np.pi + Pmean = Box[1] * theta_avg/(2.0*np.pi) + return Pmean + scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptID = ' '.join([scriptName,damask.version]) @@ -35,7 +44,23 @@ parser.add_option('-a','--all', action = 'store_true', help = 'apply mapping function also to grouping column') -parser.set_defaults(function = 'np.average') +group = OptionGroup(parser, "periodic averaging", "") + +group.add_option('-p','--periodic', + dest = 'periodic', + action = 'store_true', + help = 'calculate average in periodic space defined by periodic length [%default]') +group.add_option('--boundary', + dest = 'boundary', metavar = 'MIN MAX', + type = 'float', nargs = 2, + help = 'define periodic box end points %default') + +parser.add_option_group(group) + +parser.set_defaults(function = 'np.average', + all = False, + periodic = False, + boundary = [0.0, 1.0]) (options,filenames) = parser.parse_args() @@ -92,7 +117,10 @@ for name in filenames: grpTable = np.empty((len(values), cols)) # initialize output for i in xrange(len(values)): # iterate over groups (unique values in grpColumn) - grpTable[i] = np.apply_along_axis(mapFunction,0,table.data[index[i]:index[i+1]]) # apply mapping function + if options.periodic : + grpTable[i] = periodicAverage(table.data[index[i]:index[i+1]],options.boundary) # apply periodicAverage mapping function + else : + grpTable[i] = np.apply_along_axis(mapFunction,0,table.data[index[i]:index[i+1]]) # apply mapping function if not options.all: grpTable[i,grpColumn] = table.data[index[i],grpColumn] # restore grouping column value table.data = grpTable From 06405bc2514de01aa04b33e5ff4384e57baab54c Mon Sep 17 00:00:00 2001 From: tiasmaiti Date: Sat, 10 Sep 2016 16:35:50 -0400 Subject: [PATCH 201/412] fixed coordinate system convention to be right handed always instead of random left and right handed assignment --- processing/post/addSpectralDecomposition.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/processing/post/addSpectralDecomposition.py b/processing/post/addSpectralDecomposition.py index aa87e6f3c..ba039758a 100755 --- a/processing/post/addSpectralDecomposition.py +++ b/processing/post/addSpectralDecomposition.py @@ -78,6 +78,8 @@ for name in filenames: for type, data in items.iteritems(): for column in data['column']: (u,v) = np.linalg.eigh(np.array(map(float,table.data[column:column+data['dim']])).reshape(data['shape'])) + if np.dot(np.cross(v[:,0], v[:,1]), v[:,2]) < 0.0 : + v[:, 2] *= -1.0 table.data_append(list(u)) table.data_append(list(v.transpose().reshape(data['dim']))) outputAlive = table.data_write() # output processed line From 77729f39e32d6f282e1be2810a51e275890bee0a Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 11 Sep 2016 14:41:48 +0200 Subject: [PATCH 202/412] commenting last commit --- processing/post/addSpectralDecomposition.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/processing/post/addSpectralDecomposition.py b/processing/post/addSpectralDecomposition.py index ba039758a..f65e8ac76 100755 --- a/processing/post/addSpectralDecomposition.py +++ b/processing/post/addSpectralDecomposition.py @@ -78,8 +78,7 @@ for name in filenames: for type, data in items.iteritems(): for column in data['column']: (u,v) = np.linalg.eigh(np.array(map(float,table.data[column:column+data['dim']])).reshape(data['shape'])) - if np.dot(np.cross(v[:,0], v[:,1]), v[:,2]) < 0.0 : - v[:, 2] *= -1.0 + if np.dot(np.cross(v[:,0], v[:,1]), v[:,2]) < 0.0 : v[:, 2] *= -1.0 # ensure right-handed coordinate system table.data_append(list(u)) table.data_append(list(v.transpose().reshape(data['dim']))) outputAlive = table.data_write() # output processed line From 9d7cad1fa49193fb21dbfff078560f97abb7a337 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 11 Sep 2016 19:03:32 +0200 Subject: [PATCH 203/412] python3 compatible solutions that still work on python2 --- lib/damask/orientation.py | 17 +++++---- lib/damask/test/test.py | 72 +++++++++++++++++++-------------------- lib/damask/util.py | 45 +++++++++++------------- 3 files changed, 63 insertions(+), 71 deletions(-) diff --git a/lib/damask/orientation.py b/lib/damask/orientation.py index 886cd5a36..21a32ab17 100644 --- a/lib/damask/orientation.py +++ b/lib/damask/orientation.py @@ -154,7 +154,7 @@ class Quaternion: def __div__(self, other): """division""" - if isinstance(other, (int,float,long)): + if isinstance(other, (int,float)): w = self.w / other x = self.x / other y = self.y / other @@ -165,7 +165,7 @@ class Quaternion: def __idiv__(self, other): """in place division""" - if isinstance(other, (int,float,long)): + if isinstance(other, (int,float)): self.w /= other self.x /= other self.y /= other @@ -338,7 +338,7 @@ class Quaternion: type = "bunge", degrees = False, standardRange = False): - u""" + """ Orientation as Bunge-Euler angles conversion of ACTIVE rotation to Euler angles taken from: @@ -553,7 +553,7 @@ class Symmetry: def __init__(self, symmetry = None): """lattice with given symmetry, defaults to None""" - if isinstance(symmetry, basestring) and symmetry.lower() in Symmetry.lattices: + if isinstance(symmetry, str) and symmetry.lower() in Symmetry.lattices: self.lattice = symmetry.lower() else: self.lattice = None @@ -650,8 +650,8 @@ class Symmetry: [ 1.0,0.0,0.0,0.0 ], ] - return map(Quaternion, - np.array(symQuats)[np.atleast_1d(np.array(who)) if who != [] else xrange(len(symQuats))]) + return list(map(Quaternion, + np.array(symQuats)[np.atleast_1d(np.array(who)) if who != [] else range(len(symQuats))])) def equivalentQuaternions(self, @@ -887,8 +887,7 @@ class Orientation: def equivalentOrientations(self, who = []): - return map(lambda q: Orientation(quaternion = q, symmetry = self.symmetry.lattice), - self.equivalentQuaternions(who)) + return [Orientation(quaternion = q, symmetry = self.symmetry.lattice) for q in self.equivalentQuaternions(who)] def reduced(self): """Transform orientation to fall into fundamental zone according to symmetry""" @@ -917,7 +916,7 @@ class Orientation: for i,sA in enumerate(mySymQs): for j,sB in enumerate(otherSymQs): theQ = sA.conjugated()*misQ*sB - for k in xrange(2): + for k in range(2): theQ.conjugate() breaker = self.symmetry.inFZ(theQ) \ and (not SST or other.symmetry.inDisorientationSST(theQ)) diff --git a/lib/damask/test/test.py b/lib/damask/test/test.py index c05a6474d..726c8820c 100644 --- a/lib/damask/test/test.py +++ b/lib/damask/test/test.py @@ -55,7 +55,7 @@ class Test(): def execute(self): """Run all variants and report first failure.""" if self.options.debug: - for variant in xrange(len(self.variants)): + for variant in range(len(self.variants)): try: self.postprocess(variant) if not self.compare(variant): @@ -68,7 +68,7 @@ class Test(): if not self.testPossible(): return -1 self.clean() self.prepareAll() - for variant in xrange(len(self.variants)): + for variant in range(len(self.variants)): try: self.prepare(variant) self.run(variant) @@ -178,7 +178,7 @@ class Test(): """ if not B or len(B) == 0: B = A - for source,target in zip(map(mapA,A),map(mapB,B)): + for source,target in zip(list(map(mapA,A)),list(map(mapB,B))): try: shutil.copy2(source,target) except: @@ -269,9 +269,9 @@ class Test(): max_loc=np.argmax(abs(refArrayNonZero[curArray.nonzero()]/curArray[curArray.nonzero()]-1.)) refArrayNonZero = refArrayNonZero[curArray.nonzero()] curArray = curArray[curArray.nonzero()] - print(' ********\n * maximum relative error {} between {} and {}\n ********'.format(max_err, + print((' ********\n * maximum relative error {} between {} and {}\n ********'.format(max_err, refArrayNonZero[max_loc], - curArray[max_loc])) + curArray[max_loc]))) return max_err else: raise Exception('mismatch in array size to compare') @@ -301,26 +301,26 @@ class Test(): # check if comparison is possible and determine lenght of columns if len(headings0) == len(headings1) == len(normHeadings): dataLength = len(headings0) - length = [1 for i in xrange(dataLength)] - shape = [[] for i in xrange(dataLength)] - data = [[] for i in xrange(dataLength)] - maxError = [0.0 for i in xrange(dataLength)] - absTol = [absoluteTolerance for i in xrange(dataLength)] - column = [[1 for i in xrange(dataLength)] for j in xrange(2)] + length = [1 for i in range(dataLength)] + shape = [[] for i in range(dataLength)] + data = [[] for i in range(dataLength)] + maxError = [0.0 for i in range(dataLength)] + absTol = [absoluteTolerance for i in range(dataLength)] + column = [[1 for i in range(dataLength)] for j in range(2)] - norm = [[] for i in xrange(dataLength)] - normLength = [1 for i in xrange(dataLength)] - normShape = [[] for i in xrange(dataLength)] - normColumn = [1 for i in xrange(dataLength)] + norm = [[] for i in range(dataLength)] + normLength = [1 for i in range(dataLength)] + normShape = [[] for i in range(dataLength)] + normColumn = [1 for i in range(dataLength)] - for i in xrange(dataLength): + for i in range(dataLength): if headings0[i]['shape'] != headings1[i]['shape']: raise Exception('shape mismatch between {} and {} '.format(headings0[i]['label'],headings1[i]['label'])) shape[i] = headings0[i]['shape'] - for j in xrange(np.shape(shape[i])[0]): + for j in range(np.shape(shape[i])[0]): length[i] *= shape[i][j] normShape[i] = normHeadings[i]['shape'] - for j in xrange(np.shape(normShape[i])[0]): + for j in range(np.shape(normShape[i])[0]): normLength[i] *= normShape[i][j] else: raise Exception('trying to compare {} with {} normed by {} data sets'.format(len(headings0), @@ -332,7 +332,7 @@ class Test(): table1 = damask.ASCIItable(name=file1,readonly=True) table1.head_read() - for i in xrange(dataLength): + for i in range(dataLength): key0 = ('1_' if length[i]>1 else '') + headings0[i]['label'] key1 = ('1_' if length[i]>1 else '') + headings1[i]['label'] normKey = ('1_' if normLength[i]>1 else '') + normHeadings[i]['label'] @@ -350,11 +350,11 @@ class Test(): line0 = 0 while table0.data_read(): # read next data line of ASCII table if line0 not in skipLines: - for i in xrange(dataLength): - myData = np.array(map(float,table0.data[column[0][i]:\ - column[0][i]+length[i]]),'d') - normData = np.array(map(float,table0.data[normColumn[i]:\ - normColumn[i]+normLength[i]]),'d') + for i in range(dataLength): + myData = np.array(list(map(float,table0.data[column[0][i]:\ + column[0][i]+length[i]])),'d') + normData = np.array(list(map(float,table0.data[normColumn[i]:\ + normColumn[i]+normLength[i]])),'d') data[i] = np.append(data[i],np.reshape(myData,shape[i])) if normType == 'pInf': norm[i] = np.append(norm[i],np.max(np.abs(normData))) @@ -362,11 +362,11 @@ class Test(): norm[i] = np.append(norm[i],np.linalg.norm(np.reshape(normData,normShape[i]),normType)) line0 += 1 - for i in xrange(dataLength): - if not perLine: norm[i] = [np.max(norm[i]) for j in xrange(line0-len(skipLines))] + for i in range(dataLength): + if not perLine: norm[i] = [np.max(norm[i]) for j in range(line0-len(skipLines))] data[i] = np.reshape(data[i],[line0-len(skipLines),length[i]]) if any(norm[i]) == 0.0 or absTol[i]: - norm[i] = [1.0 for j in xrange(line0-len(skipLines))] + norm[i] = [1.0 for j in range(line0-len(skipLines))] absTol[i] = True if perLine: logging.warning('At least one norm of {} in 1. table is 0.0, using absolute tolerance'.format(headings0[i]['label'])) @@ -376,9 +376,9 @@ class Test(): line1 = 0 while table1.data_read(): # read next data line of ASCII table if line1 not in skipLines: - for i in xrange(dataLength): - myData = np.array(map(float,table1.data[column[1][i]:\ - column[1][i]+length[i]]),'d') + for i in range(dataLength): + myData = np.array(list(map(float,table1.data[column[1][i]:\ + column[1][i]+length[i]])),'d') maxError[i] = max(maxError[i],np.linalg.norm(np.reshape(myData-data[i][line1-len(skipLines),:],shape[i]))/ norm[i][line1-len(skipLines)]) line1 +=1 @@ -386,7 +386,7 @@ class Test(): if (line0 != line1): raise Exception('found {} lines in 1. table but {} in 2. table'.format(line0,line1)) logging.info(' ********') - for i in xrange(dataLength): + for i in range(dataLength): if absTol[i]: logging.info(' * maximum absolute error {} between {} and {}'.format(maxError[i], headings0[i]['label'], @@ -424,7 +424,7 @@ class Test(): if column is None: columns[i] = tables[i].labels(raw = True) # if no column is given, read all logging.info('comparing ASCIItables statistically') - for i in xrange(len(columns)): + for i in range(len(columns)): columns[i] = columns[0] if not columns[i] else \ ([columns[i]] if not (isinstance(columns[i], Iterable) and not isinstance(columns[i], str)) else \ columns[i] @@ -440,7 +440,7 @@ class Test(): table.close() - for i in xrange(1,len(data)): + for i in range(1,len(data)): delta = data[i]-data[i-1] normBy = (np.abs(data[i]) + np.abs(data[i-1]))*0.5 normedDelta = np.where(normBy>preFilter,delta/normBy,0.0) @@ -480,7 +480,7 @@ class Test(): if column is None: columns[i] = tables[i].labels(raw = True) # if no column is given, read all logging.info('comparing ASCIItables') - for i in xrange(len(columns)): + for i in range(len(columns)): columns[i] = columns[0] if not columns[i] else \ ([columns[i]] if not (isinstance(columns[i], Iterable) and not isinstance(columns[i], str)) else \ columns[i] @@ -499,7 +499,7 @@ class Test(): maximum /= len(tables) maximum = np.where(maximum >0.0, maximum, 1) # avoid div by zero for empty columns - for i in xrange(len(data)): + for i in range(len(data)): data[i] /= maximum mask = np.zeros_like(table.data,dtype='bool') @@ -509,7 +509,7 @@ class Test(): allclose = True # start optimistic - for i in xrange(1,len(data)): + for i in range(1,len(data)): if debug: t0 = np.where(mask,0.0,data[i-1]) t1 = np.where(mask,0.0,data[i ]) diff --git a/lib/damask/util.py b/lib/damask/util.py index ef2de48eb..087ffcef5 100644 --- a/lib/damask/util.py +++ b/lib/damask/util.py @@ -40,7 +40,7 @@ def srepr(arg,glue = '\n'): hasattr(arg, "__getitem__") or hasattr(arg, "__iter__")): return glue.join(srepr(x) for x in arg) - return arg if isinstance(arg,basestring) else repr(arg) + return arg if isinstance(arg,str) else repr(arg) # ----------------------------- def croak(what, newline = True): @@ -136,29 +136,22 @@ class extendableOption(Option): class backgroundMessage(threading.Thread): """reporting with animation to indicate progress""" - choices = {'bounce': ['_', 'o', 'O', u'\u00B0', - u'\u203e',u'\u203e',u'\u00B0','O','o','_'], - 'spin': [u'\u25dc',u'\u25dd',u'\u25de',u'\u25df'], - 'circle': [u'\u25f4',u'\u25f5',u'\u25f6',u'\u25f7'], - 'hexagon': [u'\u2b22',u'\u2b23'], - 'square': [u'\u2596',u'\u2598',u'\u259d',u'\u2597'], - 'triangle': [u'\u140a',u'\u140a',u'\u1403',u'\u1405',u'\u1405',u'\u1403'], - 'amoeba': [u'\u2596',u'\u258f',u'\u2598',u'\u2594',u'\u259d',u'\u2595', - u'\u2597',u'\u2582'], - 'beat': [u'\u2581',u'\u2582',u'\u2583',u'\u2585',u'\u2586',u'\u2587', - u'\u2587',u'\u2586',u'\u2585',u'\u2583',u'\u2582',], - 'prison': [u'\u168b',u'\u168c',u'\u168d',u'\u168f',u'\u168e',u'\u168d', - u'\u168c',u'\u168b',], - 'breath': [u'\u1690',u'\u1691',u'\u1692',u'\u1693',u'\u1694',u'\u1693', - u'\u1692',u'\u1691',u'\u1690',], - 'pulse': [u'·',u'•',u'\u25cf',u'\u25cf',u'•',], - 'ant': [u'\u2801',u'\u2802',u'\u2810',u'\u2820',u'\u2804',u'\u2840', - u'\u2880',u'\u2820',u'\u2804',u'\u2802',u'\u2810',u'\u2808'], - 'juggle': [u'\ua708',u'\ua709',u'\ua70a',u'\ua70b',u'\ua70c',u'\ua711', - u'\ua710',u'\ua70f',u'\ua70d',], -# 'wobbler': [u'\u2581',u'\u25e3',u'\u258f',u'\u25e4',u'\u2594',u'\u25e5',u'\u2595',u'\u25e2',], - 'grout': [u'\u2581',u'\u258f',u'\u2594',u'\u2595',], - 'partner': [u'\u26ac',u'\u26ad',u'\u26ae',u'\u26af',u'\u26ae',u'\u26ad',], + choices = {'bounce': ['_', 'o', 'O', '°', '‾', '‾', '°', 'O', 'o', '_'], + 'spin': ['◜', '◝', '◞', '◟'], + 'circle': ['◴', '◵', '◶', '◷'], + 'hexagon': ['⬢', '⬣'], + 'square': ['▖', '▘', '▝', '▗'], + 'triangle': ['ᐊ', 'ᐊ', 'ᐃ', 'ᐅ', 'ᐅ', 'ᐃ'], + 'amoeba': ['▖', '▏', '▘', '▔', '▝', '▕', '▗', '▂'], + 'beat': ['▁', '▂', '▃', '▅', '▆', '▇', '▇', '▆', '▅', '▃', '▂'], + 'prison': ['ᚋ', 'ᚌ', 'ᚍ', 'ᚏ', 'ᚎ', 'ᚍ', 'ᚌ', 'ᚋ'], + 'breath': ['ᚐ', 'ᚑ', 'ᚒ', 'ᚓ', 'ᚔ', 'ᚓ', 'ᚒ', 'ᚑ', 'ᚐ'], + 'pulse': ['·', '•', '●', '●', '•'], + 'ant': ['⠁', '⠂', '⠐', '⠠', '⠄', '⡀', '⢀', '⠠', '⠄', '⠂', '⠐', '⠈'], + 'juggle': ['꜈', '꜉', '꜊', '꜋', '꜌', '꜑', '꜐', '꜏', '꜍'], +# 'wobbler': ['▁', '◣', '▏', '◤', '▔', '◥', '▕', '◢'], + 'grout': ['▁', '▏', '▔', '▕'], + 'partner': ['⚬', '⚭', '⚮', '⚯', '⚮', '⚭'], 'classic': ['-', '\\', '|', '/',], } @@ -170,7 +163,7 @@ class backgroundMessage(threading.Thread): self.new_message = '' self.counter = 0 self.gap = ' ' - self.symbols = self.choices[symbol if symbol in self.choices else random.choice(self.choices.keys())] + self.symbols = self.choices[symbol if symbol in self.choices else random.choice(list(self.choices.keys()))] self.waittime = wait def __quit__(self): @@ -199,7 +192,7 @@ class backgroundMessage(threading.Thread): def print_message(self): length = len(self.symbols[self.counter] + self.gap + self.message) sys.stderr.write(chr(8)*length + ' '*length + chr(8)*length + \ - self.symbols[self.counter].encode('utf-8') + self.gap + self.new_message) # delete former and print new message + self.symbols[self.counter] + self.gap + self.new_message) # delete former and print new message sys.stderr.flush() self.message = self.new_message From e76c44b58b3826a9fbb97fa058398b08017bb5c6 Mon Sep 17 00:00:00 2001 From: Test User Date: Mon, 12 Sep 2016 04:41:00 +0200 Subject: [PATCH 204/412] updated version information after successful test of v2.0.1-113-g77729f3 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index aa0e19262..e68f28719 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-103-g59e8109 +v2.0.1-113-g77729f3 From 4cb27b76dfef39dfdddb42d46ab7fb55310f672d Mon Sep 17 00:00:00 2001 From: Test User Date: Mon, 12 Sep 2016 16:40:50 +0200 Subject: [PATCH 205/412] updated version information after successful test of v2.0.1-120-g6941004 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index e68f28719..62d5dc773 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-113-g77729f3 +v2.0.1-120-g6941004 From 804931db9ecb20c171059e69bae1d72c5f86d5e7 Mon Sep 17 00:00:00 2001 From: chen Date: Mon, 12 Sep 2016 19:09:48 -0400 Subject: [PATCH 206/412] force type cast index to int for numpy array Force type casting indices into int array to avoid warning: VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future For more info, see http://stackoverflow.com/questions/20084218/deprecation-warning-in-scikit-learn-svmlight-format-loader --- processing/pre/geom_addPrimitive.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/processing/pre/geom_addPrimitive.py b/processing/pre/geom_addPrimitive.py index 952ba0c4b..8d934368f 100755 --- a/processing/pre/geom_addPrimitive.py +++ b/processing/pre/geom_addPrimitive.py @@ -82,7 +82,7 @@ for name in filenames: table.head_read() info,extra_header = table.head_getGeom() - + damask.util.croak(['grid a b c: %s'%(' x '.join(map(str,info['grid']))), 'size x y z: %s'%(' x '.join(map(str,info['size']))), 'origin x y z: %s'%(' : '.join(map(str,info['origin']))), @@ -126,9 +126,9 @@ for name in filenames: primPos = invRotation*gridpos # rotate back to primitive coordinate system if np.dot(mask*primPos/dim,mask*primPos/dim) <= 0.25 and \ np.all(abs((1.-mask)*primPos/dim) <= 0.5): # inside ellipsoid and inside box - microstructure[(gridpos[0]+options.center[0])%info['grid'][0], - (gridpos[1]+options.center[1])%info['grid'][1], - (gridpos[2]+options.center[2])%info['grid'][2]] = options.fill # assign microstructure index + microstructure[int((gridpos[0]+options.center[0])%info['grid'][0]), + int((gridpos[1]+options.center[1])%info['grid'][1]), + int((gridpos[2]+options.center[2])%info['grid'][2])] = options.fill # assign microstructure index newInfo['microstructures'] = microstructure.max() @@ -153,7 +153,7 @@ for name in filenames: table.labels_clear() table.head_write() table.output_flush() - + # --- write microstructure information ------------------------------------------------------------ formatwidth = int(math.floor(math.log10(microstructure.max())+1)) From 67a5edc93b153ad285745b065538177c7b25c0e7 Mon Sep 17 00:00:00 2001 From: Test User Date: Tue, 13 Sep 2016 16:41:17 +0200 Subject: [PATCH 207/412] updated version information after successful test of v2.0.1-122-g804931d --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 62d5dc773..5923dbca4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-120-g6941004 +v2.0.1-122-g804931d From 53d2df6058f6ce70ece5ca060eeca185632e6075 Mon Sep 17 00:00:00 2001 From: chen Date: Wed, 14 Sep 2016 12:37:07 -0400 Subject: [PATCH 208/412] vector support 1D vector with arbitrary lenght simple hack to bypass the size check for vectors since vtk does not care the vector size. --- processing/post/vtk_addPointcloudData.py | 2 +- processing/post/vtk_addRectilinearGridData.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/processing/post/vtk_addPointcloudData.py b/processing/post/vtk_addPointcloudData.py index b9f66e684..808dd7262 100755 --- a/processing/post/vtk_addPointcloudData.py +++ b/processing/post/vtk_addPointcloudData.py @@ -102,7 +102,7 @@ for name in filenames: active = defaultdict(list) for datatype,dimension,label in [['scalar',1,options.scalar], - ['vector',3,options.vector], + ['vector',99,options.vector], ['tensor',9,options.tensor], ['color' ,3,options.color], ]: diff --git a/processing/post/vtk_addRectilinearGridData.py b/processing/post/vtk_addRectilinearGridData.py index 7d7c39123..7906aeabf 100755 --- a/processing/post/vtk_addRectilinearGridData.py +++ b/processing/post/vtk_addRectilinearGridData.py @@ -100,7 +100,7 @@ for name in filenames: active = defaultdict(list) for datatype,dimension,label in [['scalar',1,options.scalar], - ['vector',3,options.vector], + ['vector',99,options.vector], ['tensor',9,options.tensor], ['color' ,3,options.color], ]: From ae16ccae610e5c70d09b00d95f1c7b451352e8fa Mon Sep 17 00:00:00 2001 From: chen Date: Wed, 14 Sep 2016 15:06:00 -0400 Subject: [PATCH 209/412] need to use deep copy when converting np array to vtk array for batch array conversion, it is necessary to use the deep copy to ensure numpy_support.numpy_to_vtk works as it should. --- processing/post/vtk_addPointcloudData.py | 2 +- processing/post/vtk_addRectilinearGridData.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/processing/post/vtk_addPointcloudData.py b/processing/post/vtk_addPointcloudData.py index 808dd7262..fd1247f52 100755 --- a/processing/post/vtk_addPointcloudData.py +++ b/processing/post/vtk_addPointcloudData.py @@ -137,7 +137,7 @@ for name in filenames: VTKdata[:,2] = VTKdata[:,6] = 0.5*(VTKdata[:,2]+VTKdata[:,6]) VTKdata[:,5] = VTKdata[:,7] = 0.5*(VTKdata[:,5]+VTKdata[:,7]) - VTKarray[me] = numpy_support.numpy_to_vtk(num_array=VTKdata,array_type=VTKtype) + VTKarray[me] = numpy_support.numpy_to_vtk(num_array=VTKdata,deep=True,array_type=VTKtype) VTKarray[me].SetName(me) if datatype == 'color': diff --git a/processing/post/vtk_addRectilinearGridData.py b/processing/post/vtk_addRectilinearGridData.py index 7906aeabf..ba8f313ee 100755 --- a/processing/post/vtk_addRectilinearGridData.py +++ b/processing/post/vtk_addRectilinearGridData.py @@ -135,7 +135,7 @@ for name in filenames: VTKdata[:,2] = VTKdata[:,6] = 0.5*(VTKdata[:,2]+VTKdata[:,6]) VTKdata[:,5] = VTKdata[:,7] = 0.5*(VTKdata[:,5]+VTKdata[:,7]) - VTKarray[me] = numpy_support.numpy_to_vtk(num_array=VTKdata,array_type=VTKtype) + VTKarray[me] = numpy_support.numpy_to_vtk(num_array=VTKdata,deep=True,array_type=VTKtype) VTKarray[me].SetName(me) table.close() # close input ASCII table From 59c1eee16b5f742541d61de24ed44b3c03e884d7 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Wed, 14 Sep 2016 19:42:05 -0400 Subject: [PATCH 210/412] added possibility to restrict seed coordinates to fraction of unit box --- processing/pre/seeds_fromRandom.py | 37 +++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/processing/pre/seeds_fromRandom.py b/processing/pre/seeds_fromRandom.py index 038690df4..f25f210e9 100755 --- a/processing/pre/seeds_fromRandom.py +++ b/processing/pre/seeds_fromRandom.py @@ -29,7 +29,7 @@ def kdtree_search(cloud, queryPoints): # -------------------------------------------------------------------- parser = OptionParser(option_class=damask.extendableOption, usage='%prog [options]', description = """ -Distribute given number of points randomly within the three-dimensional cube [0.0,0.0,0.0]--[1.0,1.0,1.0]. +Distribute given number of points randomly within (a fraction of) the three-dimensional cube [0.0,0.0,0.0]--[1.0,1.0,1.0]. Reports positions with random crystal orientations in seeds file format to STDOUT. """, version = scriptID) @@ -38,6 +38,11 @@ parser.add_option('-N', dest = 'N', type = 'int', metavar = 'int', help = 'number of seed points [%default]') +parser.add_option('-f', + '--fraction', + dest = 'fraction', + type = 'float', nargs = 3, metavar = 'float float float', + help='fractions along x,y,z of unit cube to fill %default') parser.add_option('-g', '--grid', dest = 'grid', @@ -86,8 +91,7 @@ group.add_option( '-s', action = 'store_true', dest = 'selective', help = 'selective picking of seed points from random seed points [%default]') -group.add_option( '-f', - '--force', +group.add_option( '--force', action = 'store_true', dest = 'force', help = 'try selective picking despite large seed point number [%default]') @@ -103,6 +107,7 @@ parser.add_option_group(group) parser.set_defaults(randomSeed = None, grid = (16,16,16), + fraction = (1.0,1.0,1.0), N = 20, weights = False, max = 0.0, @@ -118,6 +123,7 @@ parser.set_defaults(randomSeed = None, (options,filenames) = parser.parse_args() +options.fraction = np.array(options.fraction) options.grid = np.array(options.grid) gridSize = options.grid.prod() @@ -160,16 +166,25 @@ for name in filenames: grainEuler[2,:] *= 360.0 # phi_2 is uniformly distributed if not options.selective: + seeds = np.array([]) + + while len(seeds) < options.N: - seeds = np.zeros((3,options.N),dtype='d') # seed positions array - gridpoints = random.sample(range(gridSize),options.N) # choose first N from random permutation of grid positions + theSeeds = np.zeros((options.N,3),dtype=float) # seed positions array + gridpoints = random.sample(range(gridSize),options.N) # choose first N from random permutation of grid positions - seeds[0,:] = (np.mod(gridpoints ,options.grid[0])\ - +np.random.random(options.N)) /options.grid[0] - seeds[1,:] = (np.mod(gridpoints// options.grid[0] ,options.grid[1])\ - +np.random.random(options.N)) /options.grid[1] - seeds[2,:] = (np.mod(gridpoints//(options.grid[1]*options.grid[0]),options.grid[2])\ - +np.random.random(options.N)) /options.grid[2] + theSeeds[:,0] = (np.mod(gridpoints ,options.grid[0])\ + +np.random.random(options.N)) /options.grid[0] + theSeeds[:,1] = (np.mod(gridpoints// options.grid[0] ,options.grid[1])\ + +np.random.random(options.N)) /options.grid[1] + theSeeds[:,2] = (np.mod(gridpoints//(options.grid[1]*options.grid[0]),options.grid[2])\ + +np.random.random(options.N)) /options.grid[2] + + goodSeeds = theSeeds[np.all(theSeeds<=options.fraction,axis=1)] # pick seeds within threshold fraction + seeds = goodSeeds if len(seeds) == 0 else np.vstack((seeds,goodSeeds)) + if len(seeds) > options.N: seeds = seeds[:min(options.N,len(seeds))] + + seeds = seeds.T # switch layout to point index as last index else: From f3308dbef64a09f09677f066c266359ae3270522 Mon Sep 17 00:00:00 2001 From: chen Date: Wed, 14 Sep 2016 19:59:26 -0400 Subject: [PATCH 211/412] replace scalar/vector option with data vtk does not care 1D data array length --- processing/post/vtk_addPointcloudData.py | 15 +++++---------- processing/post/vtk_addRectilinearGridData.py | 16 +++++----------- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/processing/post/vtk_addPointcloudData.py b/processing/post/vtk_addPointcloudData.py index fd1247f52..b96c9ce17 100755 --- a/processing/post/vtk_addPointcloudData.py +++ b/processing/post/vtk_addPointcloudData.py @@ -31,13 +31,10 @@ parser.add_option('-r', '--render', dest = 'render', action = 'store_true', help = 'open output in VTK render window') -parser.add_option('-s', '--scalar', dest='scalar', action='extend', - metavar ='', - help = 'scalar values') -parser.add_option('-v', '--vector', - dest = 'vector', +parser.add_option('-d', '--data', + dest = 'data', action = 'extend', metavar = '', - help = 'vector value label(s)') + help = 'scalar/vector value(s) label(s)') parser.add_option('-t', '--tensor', dest = 'tensor', action = 'extend', metavar = '', @@ -46,8 +43,7 @@ parser.add_option('-c', '--color', dest='color', action='extend', metavar ='', help = 'RGB color tuples') -parser.set_defaults(scalar = [], - vector = [], +parser.set_defaults(data = [], tensor = [], color = [], inplace = False, @@ -101,8 +97,7 @@ for name in filenames: VTKarray = {} active = defaultdict(list) - for datatype,dimension,label in [['scalar',1,options.scalar], - ['vector',99,options.vector], + for datatype,dimension,label in [['data',99,options.vector], ['tensor',9,options.tensor], ['color' ,3,options.color], ]: diff --git a/processing/post/vtk_addRectilinearGridData.py b/processing/post/vtk_addRectilinearGridData.py index ba8f313ee..78d599f0b 100755 --- a/processing/post/vtk_addRectilinearGridData.py +++ b/processing/post/vtk_addRectilinearGridData.py @@ -31,14 +31,10 @@ parser.add_option('-r', '--render', dest = 'render', action = 'store_true', help = 'open output in VTK render window') -parser.add_option('-s', '--scalar', - dest = 'scalar', +parser.add_option('-d', '--data', + dest = 'data', action = 'extend', metavar = '', - help = 'scalar value label(s)') -parser.add_option('-v', '--vector', - dest = 'vector', - action = 'extend', metavar = '', - help = 'vector value label(s)') + help = 'scalar/vector value(s) label(s)') parser.add_option('-t', '--tensor', dest = 'tensor', action = 'extend', metavar = '', @@ -48,8 +44,7 @@ parser.add_option('-c', '--color', action = 'extend', metavar = '', help = 'RGB color tuple label') -parser.set_defaults(scalar = [], - vector = [], +parser.set_defaults(data = [], tensor = [], color = [], inplace = False, @@ -99,8 +94,7 @@ for name in filenames: VTKarray = {} active = defaultdict(list) - for datatype,dimension,label in [['scalar',1,options.scalar], - ['vector',99,options.vector], + for datatype,dimension,label in [['data',99,options.data], ['tensor',9,options.tensor], ['color' ,3,options.color], ]: From 3b0b677dc9bd0d72e79414d894e4609fd6d317b3 Mon Sep 17 00:00:00 2001 From: Test User Date: Thu, 15 Sep 2016 16:41:14 +0200 Subject: [PATCH 212/412] updated version information after successful test of v2.0.1-130-gf3308db --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 5923dbca4..2a89ebb42 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-122-g804931d +v2.0.1-130-gf3308db From 1180c8bb88c75da8f0f5a3eb3943179fc6b81bef Mon Sep 17 00:00:00 2001 From: Brendan Robert Vande Kieft Date: Thu, 15 Sep 2016 17:36:43 -0400 Subject: [PATCH 213/412] Fix calculation of interfaceEnergy --- processing/pre/geom_grainGrowth.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/processing/pre/geom_grainGrowth.py b/processing/pre/geom_grainGrowth.py index 43e2e49d9..95c67fb28 100755 --- a/processing/pre/geom_grainGrowth.py +++ b/processing/pre/geom_grainGrowth.py @@ -81,17 +81,20 @@ for name in filenames: periodic_microstructure = np.tile(microstructure,(3,3,3))[grid[0]/2:-grid[0]/2, grid[1]/2:-grid[1]/2, grid[2]/2:-grid[2]/2] # periodically extend the microstructure + # store a copy the initial microstructure to find locations of immutable indices microstructure_original = np.copy(microstructure) X,Y,Z = np.mgrid[0:grid[0],0:grid[1],0:grid[2]] + + # Calculates gaussian weights for simulating 3d diffusion gauss = np.exp(-(X*X + Y*Y + Z*Z)/(2.0*options.d*options.d))/math.pow(2.0*np.pi*options.d*options.d,1.5) gauss[:,:,grid[2]/2::] = gauss[:,:,round(grid[2]/2.)-1::-1] # trying to cope with uneven (odd) grid size gauss[:,grid[1]/2::,:] = gauss[:,round(grid[1]/2.)-1::-1,:] gauss[grid[0]/2::,:,:] = gauss[round(grid[0]/2.)-1::-1,:,:] gauss = np.fft.rfftn(gauss) - interfacialEnergy = lambda A,B: (A*B != 0)*(A != B)*1.0 + interfacialEnergy = lambda A,B: (A*B != 0)*(A != B)*1.0 #1.0 if A & B are distinct & nonzero, 0.0 otherwise struc = ndimage.generate_binary_structure(3,1) # 3D von Neumann neighborhood @@ -101,9 +104,11 @@ for name in filenames: for j in (-1,0,1): for k in (-1,0,1): # assign interfacial energy to all voxels that have a differing neighbor (in Moore neighborhood) - interfaceEnergy = np.maximum(boundary, + boundary = np.maximum(boundary, interfacialEnergy(microstructure,np.roll(np.roll(np.roll( microstructure,i,axis=0), j,axis=1), k,axis=2))) + interfaceEnergy = boundary + # periodically extend interfacial energy array by half a grid size in positive and negative directions periodic_interfaceEnergy = np.tile(interfaceEnergy,(3,3,3))[grid[0]/2:-grid[0]/2, grid[1]/2:-grid[1]/2, From 87055f0e63037903e18847fbbbb76e3909906d71 Mon Sep 17 00:00:00 2001 From: Test User Date: Sat, 17 Sep 2016 10:59:57 +0200 Subject: [PATCH 214/412] updated version information after successful test of v2.0.1-132-g1180c8b --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 2a89ebb42..4dd2689d4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-130-gf3308db +v2.0.1-132-g1180c8b From fd9b760c13b1e5640f47d4e073737b4f22573bd9 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 19 Sep 2016 08:47:19 +0200 Subject: [PATCH 215/412] parameters not needed --- .../Phase_Phenopowerlaw_Aluminum.config | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/examples/ConfigFiles/Phase_Phenopowerlaw_Aluminum.config b/examples/ConfigFiles/Phase_Phenopowerlaw_Aluminum.config index 8fa58557a..63ec8f3c8 100644 --- a/examples/ConfigFiles/Phase_Phenopowerlaw_Aluminum.config +++ b/examples/ConfigFiles/Phase_Phenopowerlaw_Aluminum.config @@ -7,11 +7,6 @@ plasticity phenopowerlaw (output) resolvedstress_slip (output) accumulated_shear_slip (output) totalshear -(output) resistance_twin -(output) shearrate_twin -(output) resolvedstress_twin -(output) accumulated_shear_twin -(output) totalvolfrac_twin lattice_structure fcc Nslip 12 # per family @@ -26,19 +21,6 @@ n_slip 20 tau0_slip 31e6 # per family tausat_slip 63e6 # per family a_slip 2.25 -gdot0_twin 0.001 -n_twin 20 -tau0_twin 31e6 # per family -s_pr 0 # push-up factor for slip saturation due to twinning -twin_b 0 -twin_c 0 -twin_d 0 -twin_e 0 h0_slipslip 75e6 -h0_twinslip 0 -h0_twintwin 0 interaction_slipslip 1 1 1.4 1.4 1.4 1.4 -interaction_sliptwin 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -interaction_twinslip 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -interaction_twintwin 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 atol_resistance 1 From 2ad867a41015ba5ba782203e57ce930ee05c218f Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 19 Sep 2016 21:19:30 +0200 Subject: [PATCH 216/412] removed dependend variables --- .../Phase_Nonlocal_Aluminum.config | 32 ------------------- .../ConfigFiles/Phase_Nonlocal_Nickel.config | 20 ------------ 2 files changed, 52 deletions(-) mode change 100755 => 100644 examples/ConfigFiles/Phase_Nonlocal_Nickel.config diff --git a/examples/ConfigFiles/Phase_Nonlocal_Aluminum.config b/examples/ConfigFiles/Phase_Nonlocal_Aluminum.config index b805f09be..6406a47c0 100644 --- a/examples/ConfigFiles/Phase_Nonlocal_Aluminum.config +++ b/examples/ConfigFiles/Phase_Nonlocal_Aluminum.config @@ -8,32 +8,20 @@ plasticity nonlocal (output) rho_edge (output) rho_screw (output) rho_sgl -(output) rho_sgl_edge (output) rho_sgl_edge_pos (output) rho_sgl_edge_neg -(output) rho_sgl_screw (output) rho_sgl_screw_pos (output) rho_sgl_screw_neg -(output) rho_sgl_mobile -(output) rho_sgl_edge_mobile (output) rho_sgl_edge_pos_mobile (output) rho_sgl_edge_neg_mobile -(output) rho_sgl_screw_mobile (output) rho_sgl_screw_pos_mobile (output) rho_sgl_screw_neg_mobile -(output) rho_sgl_immobile -(output) rho_sgl_edge_immobile (output) rho_sgl_edge_pos_immobile (output) rho_sgl_edge_neg_immobile -(output) rho_sgl_screw_immobile (output) rho_sgl_screw_pos_immobile (output) rho_sgl_screw_neg_immobile -(output) rho_dip (output) rho_dip_edge (output) rho_dip_screw -(output) excess_rho -(output) excess_rho_edge -(output) excess_rho_screw (output) rho_forest (output) delta (output) delta_sgl @@ -47,10 +35,8 @@ plasticity nonlocal (output) rho_dot_sgl (output) rho_dot_sgl_mobile (output) rho_dot_dip -(output) rho_dot_gen (output) rho_dot_gen_edge (output) rho_dot_gen_screw -(output) rho_dot_sgl2dip (output) rho_dot_sgl2dip_edge (output) rho_dot_sgl2dip_screw (output) rho_dot_ann_ath @@ -66,24 +52,6 @@ plasticity nonlocal (output) velocity_edge_neg (output) velocity_screw_pos (output) velocity_screw_neg -(output) slipdirection.x -(output) slipdirection.y -(output) slipdirection.z -(output) slipnormal.x -(output) slipnormal.y -(output) slipnormal.z -(output) fluxDensity_edge_pos.x -(output) fluxDensity_edge_pos.y -(output) fluxDensity_edge_pos.z -(output) fluxDensity_edge_neg.x -(output) fluxDensity_edge_neg.y -(output) fluxDensity_edge_neg.z -(output) fluxDensity_screw_pos.x -(output) fluxDensity_screw_pos.y -(output) fluxDensity_screw_pos.z -(output) fluxDensity_screw_neg.x -(output) fluxDensity_screw_neg.y -(output) fluxDensity_screw_neg.z (output) maximumDipoleHeight_edge (output) maximumDipoleHeight_screw (output) accumulated_shear diff --git a/examples/ConfigFiles/Phase_Nonlocal_Nickel.config b/examples/ConfigFiles/Phase_Nonlocal_Nickel.config old mode 100755 new mode 100644 index 4d4c2d1df..3420b4246 --- a/examples/ConfigFiles/Phase_Nonlocal_Nickel.config +++ b/examples/ConfigFiles/Phase_Nonlocal_Nickel.config @@ -14,8 +14,6 @@ plasticity nonlocal (output) rho_dip_edge (output) rho_dip_screw (output) rho_forest -(output) excess_rho_edge -(output) excess_rho_screw (output) accumulatedshear (output) shearrate (output) resolvedstress @@ -30,24 +28,6 @@ plasticity nonlocal (output) rho_dot_edgejogs (output) rho_dot_flux_edge (output) rho_dot_flux_screw -(output) slipdirection.x -(output) slipdirection.y -(output) slipdirection.z -(output) slipnormal.x -(output) slipnormal.y -(output) slipnormal.z -(output) fluxdensity_edge_pos.x -(output) fluxdensity_edge_pos.y -(output) fluxdensity_edge_pos.z -(output) fluxdensity_edge_neg.x -(output) fluxdensity_edge_neg.y -(output) fluxdensity_edge_neg.z -(output) fluxdensity_screw_pos.x -(output) fluxdensity_screw_pos.y -(output) fluxdensity_screw_pos.z -(output) fluxdensity_screw_neg.x -(output) fluxdensity_screw_neg.y -(output) fluxdensity_screw_neg.z lattice_structure fcc Nslip 12 # number of slip systems per family From 03aebdf958908e43fdddda42d2e99ca4af92d546 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 20 Sep 2016 07:08:31 +0200 Subject: [PATCH 217/412] using standard function from C to determine hostname (no export of variable needed, name can be either HOST or HOSTNAME). fixed path separator as '/' --- code/C_routines.c | 23 ++++- code/spectral_interface.f90 | 178 ++++++++++++++---------------------- code/system_routines.f90 | 40 +++++++- 3 files changed, 124 insertions(+), 117 deletions(-) diff --git a/code/C_routines.c b/code/C_routines.c index 7be6264d7..5bc09745f 100644 --- a/code/C_routines.c +++ b/code/C_routines.c @@ -9,6 +9,14 @@ /* http://stackoverflow.com/questions/30279228/is-there-an-alternative-to-getcwd-in-fortran-2003-2008 */ +int isdirectory_c(const char *dir){ + struct stat statbuf; + if(stat(dir, &statbuf) != 0) + return 0; + return S_ISDIR(statbuf.st_mode); +} + + void getcurrentworkdir_c(char cwd[], int *stat ){ char cwd_tmp[1024]; if(getcwd(cwd_tmp, sizeof(cwd_tmp)) == cwd_tmp){ @@ -20,9 +28,14 @@ void getcurrentworkdir_c(char cwd[], int *stat ){ } } -int isdirectory_c(const char *dir){ - struct stat statbuf; - if(stat(dir, &statbuf) != 0) - return 0; - return S_ISDIR(statbuf.st_mode); + +void gethostname_c(char hostname[], int *stat ){ + char hostname_tmp[1024]; + if(gethostname(hostname_tmp, sizeof(hostname_tmp)) == 0){ + strcpy(hostname,hostname_tmp); + *stat = 0; + } + else{ + *stat = 1; + } } diff --git a/code/spectral_interface.f90 b/code/spectral_interface.f90 index d49a54411..cc68e94b5 100644 --- a/code/spectral_interface.f90 +++ b/code/spectral_interface.f90 @@ -1,5 +1,3 @@ -!-------------------------------------------------------------------------------------------------- -!> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH !> @author Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH !> @brief Interfacing between the spectral solver and the material subroutines provided !! by DAMASK @@ -20,6 +18,7 @@ module DAMASK_interface geometryFile = '', & !< parameter given for geometry file loadCaseFile = '' !< parameter given for load case file character(len=1024), private :: workingDirectory !< accessed by getSolverWorkingDirectoryName for compatibility reasons + character, private,parameter :: pathSep = '/' public :: & getSolverWorkingDirectoryName, & @@ -31,7 +30,6 @@ module DAMASK_interface getLoadCaseFile, & rectifyPath, & makeRelativePath, & - getPathSep, & IIO_stringValue, & IIO_intValue, & IIO_lc, & @@ -44,6 +42,8 @@ contains !-------------------------------------------------------------------------------------------------- subroutine DAMASK_interface_init() use, intrinsic :: iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment) + use system_routines, only: & + getHostName implicit none character(len=1024) :: & @@ -64,6 +64,7 @@ subroutine DAMASK_interface_init() integer, dimension(8) :: & dateAndTime ! type default integer PetscErrorCode :: ierr + logical :: error external :: & quit,& MPI_Comm_rank,& @@ -116,54 +117,52 @@ subroutine DAMASK_interface_init() tag = IIO_lc(IIO_stringValue(commandLine,chunkPos,i)) ! extract key select case(tag) case ('-h','--help') - mainProcess2: if (worldrank == 0) then - write(6,'(a)') ' #######################################################################' - write(6,'(a)') ' DAMASK_spectral:' - write(6,'(a)') ' The spectral method boundary value problem solver for' - write(6,'(a)') ' the Düsseldorf Advanced Material Simulation Kit' - write(6,'(a,/)')' #######################################################################' - write(6,'(a,/)')' Valid command line switches:' - write(6,'(a)') ' --geom (-g, --geometry)' - write(6,'(a)') ' --load (-l, --loadcase)' - write(6,'(a)') ' --workingdir (-w, --wd, --workingdirectory, -d, --directory)' - write(6,'(a)') ' --restart (-r, --rs)' - write(6,'(a)') ' --help (-h)' - write(6,'(/,a)')' -----------------------------------------------------------------------' - write(6,'(a)') ' Mandatory arguments:' - write(6,'(/,a)')' --geom PathToGeomFile/NameOfGeom.geom' - write(6,'(a)') ' Specifies the location of the geometry definition file,' - write(6,'(a)') ' if no extension is given, .geom will be appended.' - write(6,'(a)') ' "PathToGeomFile" will be the working directory if not specified' - write(6,'(a)') ' via --workingdir.' - write(6,'(a)') ' Make sure the file "material.config" exists in the working' - write(6,'(a)') ' directory.' - write(6,'(a)') ' For further configuration place "numerics.config"' - write(6,'(a)')' and "numerics.config" in that directory.' - write(6,'(/,a)')' --load PathToLoadFile/NameOfLoadFile.load' - write(6,'(a)') ' Specifies the location of the load case definition file,' - write(6,'(a)') ' if no extension is given, .load will be appended.' - write(6,'(/,a)')' -----------------------------------------------------------------------' - write(6,'(a)') ' Optional arguments:' - write(6,'(/,a)')' --workingdirectory PathToWorkingDirectory' - write(6,'(a)') ' Specifies the working directory and overwrites the default' - write(6,'(a)') ' "PathToGeomFile".' - write(6,'(a)') ' Make sure the file "material.config" exists in the working' - write(6,'(a)') ' directory.' - write(6,'(a)') ' For further configuration place "numerics.config"' - write(6,'(a)')' and "numerics.config" in that directory.' - write(6,'(/,a)')' --restart XX' - write(6,'(a)') ' Reads in total increment No. XX-1 and continues to' - write(6,'(a)') ' calculate total increment No. XX.' - write(6,'(a)') ' Appends to existing results file ' - write(6,'(a)') ' "NameOfGeom_NameOfLoadFile.spectralOut".' - write(6,'(a)') ' Works only if the restart information for total increment' - write(6,'(a)') ' No. XX-1 is available in the working directory.' - write(6,'(/,a)')' -----------------------------------------------------------------------' - write(6,'(a)') ' Help:' - write(6,'(/,a)')' --help' - write(6,'(a,/)')' Prints this message and exits' - call quit(0_pInt) ! normal Termination - endif mainProcess2 + write(6,'(a)') ' #######################################################################' + write(6,'(a)') ' DAMASK_spectral:' + write(6,'(a)') ' The spectral method boundary value problem solver for' + write(6,'(a)') ' the Düsseldorf Advanced Material Simulation Kit' + write(6,'(a,/)')' #######################################################################' + write(6,'(a,/)')' Valid command line switches:' + write(6,'(a)') ' --geom (-g, --geometry)' + write(6,'(a)') ' --load (-l, --loadcase)' + write(6,'(a)') ' --workingdir (-w, --wd, --workingdirectory, -d, --directory)' + write(6,'(a)') ' --restart (-r, --rs)' + write(6,'(a)') ' --help (-h)' + write(6,'(/,a)')' -----------------------------------------------------------------------' + write(6,'(a)') ' Mandatory arguments:' + write(6,'(/,a)')' --geom PathToGeomFile/NameOfGeom.geom' + write(6,'(a)') ' Specifies the location of the geometry definition file,' + write(6,'(a)') ' if no extension is given, .geom will be appended.' + write(6,'(a)') ' "PathToGeomFile" will be the working directory if not specified' + write(6,'(a)') ' via --workingdir.' + write(6,'(a)') ' Make sure the file "material.config" exists in the working' + write(6,'(a)') ' directory.' + write(6,'(a)') ' For further configuration place "numerics.config"' + write(6,'(a)')' and "numerics.config" in that directory.' + write(6,'(/,a)')' --load PathToLoadFile/NameOfLoadFile.load' + write(6,'(a)') ' Specifies the location of the load case definition file,' + write(6,'(a)') ' if no extension is given, .load will be appended.' + write(6,'(/,a)')' -----------------------------------------------------------------------' + write(6,'(a)') ' Optional arguments:' + write(6,'(/,a)')' --workingdirectory PathToWorkingDirectory' + write(6,'(a)') ' Specifies the working directory and overwrites the default' + write(6,'(a)') ' "PathToGeomFile".' + write(6,'(a)') ' Make sure the file "material.config" exists in the working' + write(6,'(a)') ' directory.' + write(6,'(a)') ' For further configuration place "numerics.config"' + write(6,'(a)')' and "numerics.config" in that directory.' + write(6,'(/,a)')' --restart XX' + write(6,'(a)') ' Reads in total increment No. XX-1 and continues to' + write(6,'(a)') ' calculate total increment No. XX.' + write(6,'(a)') ' Appends to existing results file ' + write(6,'(a)') ' "NameOfGeom_NameOfLoadFile.spectralOut".' + write(6,'(a)') ' Works only if the restart information for total increment' + write(6,'(a)') ' No. XX-1 is available in the working directory.' + write(6,'(/,a)')' -----------------------------------------------------------------------' + write(6,'(a)') ' Help:' + write(6,'(/,a)')' --help' + write(6,'(a,/)')' Prints this message and exits' + call quit(0_pInt) ! normal Termination case ('-l', '--load', '--loadcase') loadcaseArg = IIO_stringValue(commandLine,chunkPos,i+1_pInt) case ('-g', '--geom', '--geometry') @@ -185,25 +184,23 @@ subroutine DAMASK_interface_init() geometryFile = getGeometryFile(geometryArg) loadCaseFile = getLoadCaseFile(loadCaseArg) - call get_environment_variable('HOSTNAME',hostName) call get_environment_variable('USER',userName) - mainProcess3: if (worldrank == 0) then - write(6,'(a,a)') ' Host name: ', trim(hostName) - write(6,'(a,a)') ' User name: ', trim(userName) - write(6,'(a,a)') ' Path separator: ', getPathSep() - write(6,'(a,a)') ' Command line call: ', trim(commandLine) - if (len(trim(workingDirArg))>0) & - write(6,'(a,a)') ' Working dir argument: ', trim(workingDirArg) - write(6,'(a,a)') ' Geometry argument: ', trim(geometryArg) - write(6,'(a,a)') ' Loadcase argument: ', trim(loadcaseArg) - write(6,'(a,a)') ' Working directory: ', trim(getSolverWorkingDirectoryName()) - write(6,'(a,a)') ' Geometry file: ', trim(geometryFile) - write(6,'(a,a)') ' Loadcase file: ', trim(loadCaseFile) - write(6,'(a,a)') ' Solver job name: ', trim(getSolverJobName()) - if (SpectralRestartInc > 1_pInt) & - write(6,'(a,i6.6)') ' Restart at increment: ', spectralRestartInc - write(6,'(a,l1,/)') ' Append to result file: ', appendToOutFile - endif mainProcess3 + error = getHostName(hostName) + write(6,'(a,a)') ' Host name: ', trim(hostName) + write(6,'(a,a)') ' User name: ', trim(userName) + write(6,'(a,a)') ' Path separator: ', pathSep + write(6,'(a,a)') ' Command line call: ', trim(commandLine) + if (len(trim(workingDirArg))>0) & + write(6,'(a,a)') ' Working dir argument: ', trim(workingDirArg) + write(6,'(a,a)') ' Geometry argument: ', trim(geometryArg) + write(6,'(a,a)') ' Loadcase argument: ', trim(loadcaseArg) + write(6,'(a,a)') ' Working directory: ', trim(getSolverWorkingDirectoryName()) + write(6,'(a,a)') ' Geometry file: ', trim(geometryFile) + write(6,'(a,a)') ' Loadcase file: ', trim(loadCaseFile) + write(6,'(a,a)') ' Solver job name: ', trim(getSolverJobName()) + if (SpectralRestartInc > 1_pInt) & + write(6,'(a,i6.6)') ' Restart at increment: ', spectralRestartInc + write(6,'(a,l1,/)') ' Append to result file: ', appendToOutFile end subroutine DAMASK_interface_init @@ -222,11 +219,9 @@ character(len=1024) function storeWorkingDirectory(workingDirectoryArg,geometryA character(len=*), intent(in) :: workingDirectoryArg !< working directory argument character(len=*), intent(in) :: geometryArg !< geometry argument character(len=1024) :: cwd - character :: pathSep logical :: error external :: quit - pathSep = getPathSep() wdGiven: if (len(workingDirectoryArg)>0) then absolutePath: if (workingDirectoryArg(1:1) == pathSep) then storeWorkingDirectory = workingDirectoryArg @@ -262,6 +257,7 @@ end function storeWorkingDirectory character(len=1024) function getSolverWorkingDirectoryName() implicit none + getSolverWorkingDirectoryName = workingDirectory end function getSolverWorkingDirectoryName @@ -274,10 +270,8 @@ character(len=1024) function getSolverJobName() implicit none integer :: posExt,posSep - character :: pathSep character(len=1024) :: tempString - pathSep = getPathSep() tempString = geometryFile posExt = scan(tempString,'.',back=.true.) @@ -308,11 +302,9 @@ character(len=1024) function getGeometryFile(geometryParameter) cwd integer :: posExt, posSep logical :: error - character :: pathSep external :: quit getGeometryFile = geometryParameter - pathSep = getPathSep() posExt = scan(getGeometryFile,'.',back=.true.) posSep = scan(getGeometryFile,pathSep,back=.true.) @@ -344,11 +336,9 @@ character(len=1024) function getLoadCaseFile(loadCaseParameter) cwd integer :: posExt, posSep logical :: error - character :: pathSep external :: quit getLoadCaseFile = loadcaseParameter - pathSep = getPathSep() posExt = scan(getLoadCaseFile,'.',back=.true.) posSep = scan(getLoadCaseFile,pathSep,back=.true.) @@ -374,11 +364,8 @@ function rectifyPath(path) implicit none character(len=*) :: path character(len=len_trim(path)) :: rectifyPath - character :: pathSep integer :: i,j,k,l ! no pInt - pathSep = getPathSep() - !-------------------------------------------------------------------------------------------------- ! remove /./ from path l = len_trim(path) @@ -415,10 +402,8 @@ character(len=1024) function makeRelativePath(a,b) implicit none character (len=*) :: a,b - character :: pathSep integer :: i,posLastCommonSlash,remainingSlashes !no pInt - pathSep = getPathSep() posLastCommonSlash = 0 remainingSlashes = 0 @@ -434,35 +419,6 @@ character(len=1024) function makeRelativePath(a,b) end function makeRelativePath -!-------------------------------------------------------------------------------------------------- -!> @brief counting / and \ in $PATH System variable the character occuring more often is assumed -! to be the path separator -!-------------------------------------------------------------------------------------------------- -character function getPathSep() - - implicit none - character(len=2048) :: & - path - integer(pInt) :: & - backslash = 0_pInt, & - slash = 0_pInt - integer :: i - - call get_environment_variable('PATH',path) - do i=1, len(trim(path)) - if (path(i:i)=='/') slash = slash + 1_pInt - if (path(i:i)=='\') backslash = backslash + 1_pInt - enddo - - if (backslash>slash) then - getPathSep = '\' - else - getPathSep = '/' - endif - -end function getPathSep - - !-------------------------------------------------------------------------------------------------- !> @brief taken from IO, check IO_stringValue for documentation !-------------------------------------------------------------------------------------------------- diff --git a/code/system_routines.f90 b/code/system_routines.f90 index ab1aae03f..07e12a20b 100644 --- a/code/system_routines.f90 +++ b/code/system_routines.f90 @@ -9,7 +9,8 @@ module system_routines public :: & isDirectory, & - getCWD + getCWD, & + getHostName interface @@ -29,6 +30,14 @@ interface integer(C_INT),intent(out) :: stat end subroutine getCurrentWorkDir_C + subroutine getHostName_C(str, stat) bind(C) + use, intrinsic :: ISO_C_Binding, only: & + C_INT, & + C_CHAR + character(kind=C_CHAR), dimension(1024), intent(out) :: str ! C string is an array + integer(C_INT),intent(out) :: stat + end subroutine getHostName_C + end interface @@ -85,5 +94,34 @@ logical function getCWD(str) end function getCWD + +!-------------------------------------------------------------------------------------------------- +!> @brief gets the current host name +!-------------------------------------------------------------------------------------------------- +logical function getHostName(str) + use, intrinsic :: ISO_C_Binding, only: & + C_INT, & + C_CHAR, & + C_NULL_CHAR + + implicit none + character(len=*), intent(out) :: str + character(kind=C_CHAR), dimension(1024) :: strFixedLength ! C string is an array + integer(C_INT) :: stat + integer :: i + + str = repeat('',len(str)) + call getHostName_C(strFixedLength,stat) + do i=1,1024 ! copy array components until Null string is found + if (strFixedLength(i) /= C_NULL_CHAR) then + str(i:i)=strFixedLength(i) + else + exit + endif + enddo + getHostName=merge(.True.,.False.,stat /= 0_C_INT) + +end function getHostName + end module system_routines From e5ba50808057ae65117e32ed7c74a35edfb1090e Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 20 Sep 2016 07:10:07 +0200 Subject: [PATCH 218/412] added funtionality to run selected test only and functionality to show available tests --- lib/damask/test/test.py | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/lib/damask/test/test.py b/lib/damask/test/test.py index db58fd4a5..5a06939c6 100644 --- a/lib/damask/test/test.py +++ b/lib/damask/test/test.py @@ -23,6 +23,8 @@ class Test(): 'keep': False, 'accept': False, 'updateRequest': False, + 'show': False, + 'select': None, } for arg in defaults.keys(): setattr(self,arg,kwargs.get(arg) if kwargs.get(arg) else defaults[arg]) @@ -58,10 +60,18 @@ class Test(): action = "store_true", dest = "accept", help = "calculate results but always consider test as successfull") - + self.parser.add_option("-l", "--list", + action = "store_true", + dest = "show", + help = "show all test variants and do no calculation") + self.parser.add_option("-s", "--select", + dest = "select", + help = "run test of given name only") self.parser.set_defaults(keep = self.keep, accept = self.accept, update = self.updateRequest, + show = self.show, + select = self.select, ) @@ -73,21 +83,26 @@ class Test(): self.prepareAll() for variant,name in enumerate(self.variants): - try: - if not self.options.keep: - self.prepare(variant) - self.run(variant) + if self.options.show: + logging.critical('{}: {}'.format(variant,name)) + elif self.options.select is not None and name != self.options.select: + pass + else: + try: + if not self.options.keep: + self.prepare(variant) + self.run(variant) - self.postprocess(variant) + self.postprocess(variant) - if self.options.update: - if self.update(variant) != 0: logging.critical('update for "{}" failed.'.format(name)) - elif not (self.options.accept or self.compare(variant)): # no update, do comparison - return variant+1 # return culprit + if self.options.update: + if self.update(variant) != 0: logging.critical('update for "{}" failed.'.format(name)) + elif not (self.options.accept or self.compare(variant)): # no update, do comparison + return variant+1 # return culprit - except Exception as e : - logging.critical('exception during variant execution: {}'.format(e)) - return variant+1 # return culprit + except Exception as e : + logging.critical('exception during variant execution: {}'.format(e)) + return variant+1 # return culprit return 0 def feasible(self): From d0ea692cf2d6823e9324838b3390e39b881c8cba Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 20 Sep 2016 21:38:18 +0200 Subject: [PATCH 219/412] fix for 03aebdf958908e43fdddda42d2e99ca4af92d546 --- code/spectral_interface.f90 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/spectral_interface.f90 b/code/spectral_interface.f90 index cc68e94b5..85ba30c51 100644 --- a/code/spectral_interface.f90 +++ b/code/spectral_interface.f90 @@ -1,3 +1,5 @@ +!-------------------------------------------------------------------------------------------------- +!> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH !> @author Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH !> @brief Interfacing between the spectral solver and the material subroutines provided !! by DAMASK From ff13925afa4012f93e3658fe960e615316e01122 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 21 Sep 2016 06:28:24 +0200 Subject: [PATCH 220/412] documented and simplified --- code/IO.f90 | 2 -- code/math.f90 | 36 ++++++++++++++---------------------- 2 files changed, 14 insertions(+), 24 deletions(-) diff --git a/code/IO.f90 b/code/IO.f90 index f5db5c1f1..060fcf01f 100644 --- a/code/IO.f90 +++ b/code/IO.f90 @@ -1568,8 +1568,6 @@ subroutine IO_error(error_ID,el,ip,g,ext_msg) msg = 'math_check: R*v == q*v failed' case (410_pInt) msg = 'eigenvalues computation error' - case (450_pInt) - msg = 'unknown symmetry type specified' !------------------------------------------------------------------------------------------------- ! homogenization errors diff --git a/code/math.f90 b/code/math.f90 index d6d26a75d..315da2642 100644 --- a/code/math.f90 +++ b/code/math.f90 @@ -1450,7 +1450,7 @@ pure function math_EulerToQ(eulerangles) cos(halfangles(1)-halfangles(3)) * s, & sin(halfangles(1)-halfangles(3)) * s, & sin(halfangles(1)+halfangles(3)) * c ] - math_EulerToQ = math_qConj(math_EulerToQ) ! convert to passive rotation + math_EulerToQ = math_qConj(math_EulerToQ) ! convert to passive rotation end function math_EulerToQ @@ -1508,7 +1508,7 @@ pure function math_EulerAxisAngleToR(axis,omega) real(pReal), dimension(3), intent(in) :: axis real(pReal), intent(in) :: omega - math_EulerAxisAngleToR = transpose(math_axisAngleToR(axis,omega)) ! convert to passive rotation + math_EulerAxisAngleToR = transpose(math_axisAngleToR(axis,omega)) ! convert to passive rotation end function math_EulerAxisAngleToR @@ -1527,7 +1527,7 @@ pure function math_EulerAxisAngleToQ(axis,omega) real(pReal), dimension(3), intent(in) :: axis real(pReal), intent(in) :: omega - math_EulerAxisAngleToQ = math_qConj(math_axisAngleToQ(axis,omega)) ! convert to passive rotation + math_EulerAxisAngleToQ = math_qConj(math_axisAngleToQ(axis,omega)) ! convert to passive rotation end function math_EulerAxisAngleToQ @@ -1550,7 +1550,7 @@ pure function math_axisAngleToQ(axis,omega) norm = sqrt(math_mul3x3(axis,axis)) rotation: if (norm > 1.0e-8_pReal) then - axisNrm = axis/norm ! normalize axis to be sure + axisNrm = axis/norm ! normalize axis to be sure math_axisAngleToQ = [cos(0.5_pReal*omega), sin(0.5_pReal*omega) * axisNrm(1:3)] else rotation math_axisAngleToQ = [1.0_pReal,0.0_pReal,0.0_pReal,0.0_pReal] @@ -1864,37 +1864,29 @@ end function math_sampleGaussVar !-------------------------------------------------------------------------------------------------- -!> @brief symmetrically equivalent Euler angles for given sample symmetry 1:triclinic, 2:monoclinic, 4:orthotropic +!> @brief symmetrically equivalent Euler angles for given sample symmetry +!> @detail 1 (equivalent to != 2 and !=4):triclinic, 2:monoclinic, 4:orthotropic !-------------------------------------------------------------------------------------------------- pure function math_symmetricEulers(sym,Euler) implicit none - integer(pInt), intent(in) :: sym + integer(pInt), intent(in) :: sym !< symmetry Class real(pReal), dimension(3), intent(in) :: Euler real(pReal), dimension(3,3) :: math_symmetricEulers - integer(pInt) :: i,j - math_symmetricEulers(1,1) = PI+Euler(1) - math_symmetricEulers(2,1) = Euler(2) - math_symmetricEulers(3,1) = Euler(3) + math_symmetricEulers = transpose(reshape([PI+Euler(1), PI-Euler(1), 2.0_pReal*PI-Euler(1), & + Euler(2), PI-Euler(2), PI -Euler(2), & + Euler(3), PI+Euler(3), PI +Euler(3)],[3,3])) ! transpose is needed to have symbolic notation instead of column-major - math_symmetricEulers(1,2) = PI-Euler(1) - math_symmetricEulers(2,2) = PI-Euler(2) - math_symmetricEulers(3,2) = PI+Euler(3) - - math_symmetricEulers(1,3) = 2.0_pReal*PI-Euler(1) - math_symmetricEulers(2,3) = PI-Euler(2) - math_symmetricEulers(3,3) = PI+Euler(3) - - forall (i=1_pInt:3_pInt,j=1_pInt:3_pInt) math_symmetricEulers(j,i) = modulo(math_symmetricEulers(j,i),2.0_pReal*pi) + math_symmetricEulers = modulo(math_symmetricEulers,2.0_pReal*pi) select case (sym) - case (4_pInt) ! all done + case (4_pInt) ! orthotropic: all done - case (2_pInt) ! return only first + case (2_pInt) ! monoclinic: return only first math_symmetricEulers(1:3,2:3) = 0.0_pReal - case default ! return blank + case default ! triclinic: return blank math_symmetricEulers = 0.0_pReal end select From 7291c20cd46f3b518a0b37b9ca9210db39f04c68 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 21 Jul 2016 10:06:02 +0200 Subject: [PATCH 221/412] added reference --- lib/damask/orientation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/damask/orientation.py b/lib/damask/orientation.py index f34f33a53..9d14d12c5 100644 --- a/lib/damask/orientation.py +++ b/lib/damask/orientation.py @@ -999,7 +999,8 @@ class Orientation: if relationModel not in ['KS','GT','GTdash','NW','Pitsch','Bain']: return None if int(direction) == 0: return None - # KS from S. Morito et al./Journal of Alloys and Compounds 5775 (2013) S587-S592 DOES THIS PAPER EXISTS? + # KS from S. Morito et al./Journal of Alloys and Compounds 5775 (2013) S587-S592 + # for KS rotation matrices also check K. Kitahara et al./Acta Materialia 54 (2006) 1279-1288 # GT from Y. He et al./Journal of Applied Crystallography (2006). 39, 72-81 # GT' from Y. He et al./Journal of Applied Crystallography (2006). 39, 72-81 # NW from H. Kitahara et al./Materials Characterization 54 (2005) 378-386 From 4ccc0cf5a1135db7c38b42948023d3a56abc8876 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 19 Aug 2016 18:53:48 +0200 Subject: [PATCH 222/412] tool to mirror geometries (enforce periodicity on measured data) --- processing/pre/geom_mirror.py | 106 ++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100755 processing/pre/geom_mirror.py diff --git a/processing/pre/geom_mirror.py b/processing/pre/geom_mirror.py new file mode 100755 index 000000000..61f212039 --- /dev/null +++ b/processing/pre/geom_mirror.py @@ -0,0 +1,106 @@ +#!/usr/bin/env python2.7 +# -*- coding: UTF-8 no BOM -*- + +import os,sys,math +import numpy as np +import damask +from scipy import ndimage +from optparse import OptionParser + +scriptName = os.path.splitext(os.path.basename(__file__))[0] +scriptID = ' '.join([scriptName,damask.version]) + +#-------------------------------------------------------------------------------------------------- +# MAIN +#-------------------------------------------------------------------------------------------------- + +parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [geomfile(s)]', description = """ +Mirros spectral geometry description along given direction. + +""", version=scriptID) + + +(options, filenames) = parser.parse_args() + + + +# --- loop over input files ------------------------------------------------------------------------- + +if filenames == []: filenames = [None] + +for name in filenames: + try: + table = damask.ASCIItable(name = name, + buffered = False, labeled = False) + except: continue + damask.util.report(scriptName,name) + +# --- interpret header ---------------------------------------------------------------------------- + + table.head_read() + info,extra_header = table.head_getGeom() + + damask.util.croak(['grid a b c: %s'%(' x '.join(map(str,info['grid']))), + 'size x y z: %s'%(' x '.join(map(str,info['size']))), + 'origin x y z: %s'%(' : '.join(map(str,info['origin']))), + 'homogenization: %i'%info['homogenization'], + 'microstructures: %i'%info['microstructures'], + ]) + + errors = [] + if np.any(info['grid'] < 1): errors.append('invalid grid a b c.') + if np.any(info['size'] <= 0.0): errors.append('invalid size x y z.') + if errors != []: + damask.util.croak(errors) + table.close(dismiss = True) + continue + +# --- read data ------------------------------------------------------------------------------------ + + microstructure = table.microstructure_read(info['grid']).reshape(info['grid'],order='F') # read microstructure + + microstructure = np.concatenate([microstructure,microstructure[:,:,::-1]],2) + microstructure = np.concatenate([microstructure,microstructure[:,::-1,:]],1) + microstructure = np.concatenate([microstructure,microstructure[::-1,:,:]],0) + +# --- do work ------------------------------------------------------------------------------------ + + newInfo = { + 'size': microstructure.shape*info['size']/info['grid'], + 'grid': microstructure.shape, + } + + +# --- report --------------------------------------------------------------------------------------- + + remarks = [] + if (any(newInfo['grid'] != info['grid'])): + remarks.append('--> grid a b c: %s'%(' x '.join(map(str,newInfo['grid'])))) + if (any(newInfo['size'] != info['size'])): + remarks.append('--> size x y z: %s'%(' x '.join(map(str,newInfo['size'])))) + if remarks != []: damask.util.croak(remarks) + +# --- write header --------------------------------------------------------------------------------- + + table.labels_clear() + table.info_clear() + table.info_append([ + scriptID + ' ' + ' '.join(sys.argv[1:]), + "grid\ta {grid[0]}\tb {grid[1]}\tc {grid[2]}".format(grid=newInfo['grid']), + "size\tx {size[0]}\ty {size[1]}\tz {size[2]}".format(size=newInfo['size']), + "origin\tx {origin[0]}\ty {origin[1]}\tz {origin[2]}".format(origin=info['origin']), + "homogenization\t{homog}".format(homog=info['homogenization']), + "microstructures\t{microstructures}".format(microstructures=info['microstructures']), + extra_header + ]) + table.head_write() + +# --- write microstructure information ------------------------------------------------------------ + + formatwidth = int(math.floor(math.log10(microstructure.max())+1)) + table.data = microstructure.reshape((newInfo['grid'][0],np.prod(newInfo['grid'][1:])),order='F').transpose() + table.data_writeArray('%%%ii'%(formatwidth),delimiter = ' ') + +# --- output finalization -------------------------------------------------------------------------- + + table.close() # close ASCII table From 9e3c54b0e337b660ec2305ca5f99a4e28c9c97de Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 2 Sep 2016 18:19:01 +0200 Subject: [PATCH 223/412] a few comments and adjusted calculation --- lib/damask/orientation.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/damask/orientation.py b/lib/damask/orientation.py index 9d14d12c5..e28d30a7a 100644 --- a/lib/damask/orientation.py +++ b/lib/damask/orientation.py @@ -995,6 +995,12 @@ class Orientation: relationModel, direction, targetSymmetry = None): + """ + orientation relationship + + positive number: fcc --> bcc + negative number: bcc --> fcc + """ if relationModel not in ['KS','GT','GTdash','NW','Pitsch','Bain']: return None if int(direction) == 0: return None @@ -1227,14 +1233,14 @@ class Orientation: myPlane /= np.linalg.norm(myPlane) myNormal = [float(i) for i in normals[relationModel][variant,me]] # map(float, planes[...]) does not work in python 3 myNormal /= np.linalg.norm(myNormal) - myMatrix = np.array([myPlane,myNormal,np.cross(myPlane,myNormal)]) + myMatrix = np.array([myNormal,np.cross(myPlane,myNormal),myPlane]).T otherPlane = [float(i) for i in planes[relationModel][variant,other]] # map(float, planes[...]) does not work in python 3 otherPlane /= np.linalg.norm(otherPlane) otherNormal = [float(i) for i in normals[relationModel][variant,other]] # map(float, planes[...]) does not work in python 3 otherNormal /= np.linalg.norm(otherNormal) - otherMatrix = np.array([otherPlane,otherNormal,np.cross(otherPlane,otherNormal)]) + otherMatrix = np.array([otherNormal,np.cross(otherPlane,otherNormal),otherPlane]).T - rot=np.dot(otherMatrix.T,myMatrix) + rot=np.dot(otherMatrix,myMatrix.T) return Orientation(matrix=np.dot(rot,self.asMatrix())) # no symmetry information ?? From 43457dcfc52ae198b861dabf40a095500ad8155d Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 21 Sep 2016 17:43:07 +0200 Subject: [PATCH 224/412] flexible selection of axes --- processing/pre/geom_mirror.py | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/processing/pre/geom_mirror.py b/processing/pre/geom_mirror.py index 61f212039..da4c7f581 100755 --- a/processing/pre/geom_mirror.py +++ b/processing/pre/geom_mirror.py @@ -14,15 +14,24 @@ scriptID = ' '.join([scriptName,damask.version]) # MAIN #-------------------------------------------------------------------------------------------------- +validDirections = ['x','y','z'] parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [geomfile(s)]', description = """ -Mirros spectral geometry description along given direction. +Mirrors spectral geometry description along given directions. """, version=scriptID) +parser.add_option('-d','--direction', + dest = 'directions', + action = 'extend', metavar = '', + help = "directions in which to mirror {'x','y','z'}") (options, filenames) = parser.parse_args() - +if options.directions is None: + parser.error('no direction given.') +if not set(options.directions).issubset(validDirections): + invalidDirections = [str(e) for e in set(options.directions).difference(validDirections)] + parser.error('invalid directions {}. '.format(*invalidDirections)) # --- loop over input files ------------------------------------------------------------------------- @@ -57,11 +66,14 @@ for name in filenames: # --- read data ------------------------------------------------------------------------------------ - microstructure = table.microstructure_read(info['grid']).reshape(info['grid'],order='F') # read microstructure + microstructure = table.microstructure_read(info['grid']).reshape(info['grid'],order='F') # read microstructure - microstructure = np.concatenate([microstructure,microstructure[:,:,::-1]],2) - microstructure = np.concatenate([microstructure,microstructure[:,::-1,:]],1) - microstructure = np.concatenate([microstructure,microstructure[::-1,:,:]],0) + if 'z' in options.directions: + microstructure = np.concatenate([microstructure,microstructure[:,:,::-1]],2) + if 'y' in options.directions: + microstructure = np.concatenate([microstructure,microstructure[:,::-1,:]],1) + if 'x' in options.directions: + microstructure = np.concatenate([microstructure,microstructure[::-1,:,:]],0) # --- do work ------------------------------------------------------------------------------------ From 4cd8fe7f369c1a66e4d104069559e15219276550 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 21 Sep 2016 17:45:23 +0200 Subject: [PATCH 225/412] indices should be integers (visible warning) --- processing/pre/geom_grainGrowth.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/processing/pre/geom_grainGrowth.py b/processing/pre/geom_grainGrowth.py index 95c67fb28..2781f90d9 100755 --- a/processing/pre/geom_grainGrowth.py +++ b/processing/pre/geom_grainGrowth.py @@ -89,9 +89,9 @@ for name in filenames: # Calculates gaussian weights for simulating 3d diffusion gauss = np.exp(-(X*X + Y*Y + Z*Z)/(2.0*options.d*options.d))/math.pow(2.0*np.pi*options.d*options.d,1.5) - gauss[:,:,grid[2]/2::] = gauss[:,:,round(grid[2]/2.)-1::-1] # trying to cope with uneven (odd) grid size - gauss[:,grid[1]/2::,:] = gauss[:,round(grid[1]/2.)-1::-1,:] - gauss[grid[0]/2::,:,:] = gauss[round(grid[0]/2.)-1::-1,:,:] + gauss[:,:,grid[2]/2::] = gauss[:,:,int(round(grid[2]/2.))-1::-1] # trying to cope with uneven (odd) grid size + gauss[:,grid[1]/2::,:] = gauss[:,int(round(grid[1]/2.))-1::-1,:] + gauss[grid[0]/2::,:,:] = gauss[int(round(grid[0]/2.))-1::-1,:,:] gauss = np.fft.rfftn(gauss) interfacialEnergy = lambda A,B: (A*B != 0)*(A != B)*1.0 #1.0 if A & B are distinct & nonzero, 0.0 otherwise From 6fade1532335b2b14280533daa206850f891eae5 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 21 Sep 2016 17:46:20 +0200 Subject: [PATCH 226/412] no blank lines after docstring --- lib/damask/orientation.py | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/damask/orientation.py b/lib/damask/orientation.py index e28d30a7a..d5274571b 100644 --- a/lib/damask/orientation.py +++ b/lib/damask/orientation.py @@ -1001,7 +1001,6 @@ class Orientation: positive number: fcc --> bcc negative number: bcc --> fcc """ - if relationModel not in ['KS','GT','GTdash','NW','Pitsch','Bain']: return None if int(direction) == 0: return None From 0f636bf6c3c7cde1427a194d9b3f545f2a54ec8a Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 21 Sep 2016 17:47:37 +0200 Subject: [PATCH 227/412] not needed --- processing/pre/geom_mirror.py | 1 - 1 file changed, 1 deletion(-) diff --git a/processing/pre/geom_mirror.py b/processing/pre/geom_mirror.py index da4c7f581..cc51749d4 100755 --- a/processing/pre/geom_mirror.py +++ b/processing/pre/geom_mirror.py @@ -4,7 +4,6 @@ import os,sys,math import numpy as np import damask -from scipy import ndimage from optparse import OptionParser scriptName = os.path.splitext(os.path.basename(__file__))[0] From 25103205a8e86bd9cf5aadb2812ac151e0498431 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 21 Sep 2016 22:01:16 +0200 Subject: [PATCH 228/412] bug fix, adjust to options change of vtk_addXXXData --- processing/pre/geom_check.sh | 2 +- processing/pre/seeds_check.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/processing/pre/geom_check.sh b/processing/pre/geom_check.sh index 1eb85913c..5a39d4fc7 100755 --- a/processing/pre/geom_check.sh +++ b/processing/pre/geom_check.sh @@ -11,7 +11,7 @@ do < $geom \ | \ vtk_addRectilinearGridData \ - --scalar microstructure \ + --data microstructure \ --inplace \ --vtk ${geom%.*}.vtk rm ${geom%.*}.vtk diff --git a/processing/pre/seeds_check.sh b/processing/pre/seeds_check.sh index f24cd1c64..9bc054406 100755 --- a/processing/pre/seeds_check.sh +++ b/processing/pre/seeds_check.sh @@ -5,7 +5,7 @@ do vtk_pointcloud $seeds vtk_addPointcloudData $seeds \ - --scalar microstructure,weight \ + --data microstructure,weight \ --inplace \ --vtk ${seeds%.*}.vtp \ From 0f09a66b625ca6701a7a47550b63925628c6d6f2 Mon Sep 17 00:00:00 2001 From: Jennifer Nastola Date: Thu, 22 Sep 2016 15:36:28 +0200 Subject: [PATCH 229/412] pyflake was complaining --- processing/misc/DREAM3D_toTable.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/processing/misc/DREAM3D_toTable.py b/processing/misc/DREAM3D_toTable.py index e42d09a31..4cd93cf5b 100644 --- a/processing/misc/DREAM3D_toTable.py +++ b/processing/misc/DREAM3D_toTable.py @@ -1,7 +1,7 @@ #!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- -import os,h5py,sys +import os,h5py import numpy as np from optparse import OptionParser import damask @@ -43,8 +43,8 @@ for name in filenames: # --- read comments -------------------------------------------------------------------------------- coords = (np.mgrid[0:grid[2], 0:grid[1], 0: grid[0]]).reshape(3, -1).T - coords = (np.fliplr(coords)*inFile[rootDir+'/_SIMPL_GEOMETRY/SPACING'][...] - + inFile[rootDir+'/_SIMPL_GEOMETRY/ORIGIN'][...] + coords = (np.fliplr(coords)*inFile[rootDir+'/_SIMPL_GEOMETRY/SPACING'][...] \ + + inFile[rootDir+'/_SIMPL_GEOMETRY/ORIGIN'][...] \ + inFile[rootDir+'/_SIMPL_GEOMETRY/SPACING'][...]*0.5) table.data = np.hstack( (coords, From fdee2ece0a0dbfd0da1972aed00028f51529d008 Mon Sep 17 00:00:00 2001 From: Test User Date: Thu, 22 Sep 2016 16:34:08 +0200 Subject: [PATCH 230/412] updated version information after successful test of v2.0.1-140-g0f636bf --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 4dd2689d4..f25d9b3e6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-132-g1180c8b +v2.0.1-140-g0f636bf From 92155cf12c1039329dd6a8e24c0aad515a95c653 Mon Sep 17 00:00:00 2001 From: Test User Date: Fri, 23 Sep 2016 04:33:52 +0200 Subject: [PATCH 231/412] updated version information after successful test of v2.0.1-146-ge540476 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index f25d9b3e6..d625e2d19 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-140-g0f636bf +v2.0.1-146-ge540476 From fb23c49b41b35bd6b069766a1895166d50b4ec5b Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 24 Sep 2016 15:58:13 +0200 Subject: [PATCH 232/412] should be executable --- processing/misc/DREAM3D_toTable.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 processing/misc/DREAM3D_toTable.py diff --git a/processing/misc/DREAM3D_toTable.py b/processing/misc/DREAM3D_toTable.py old mode 100644 new mode 100755 From a03c28f308d2988e66e3df85797c71ead411bae9 Mon Sep 17 00:00:00 2001 From: Test User Date: Sun, 25 Sep 2016 16:41:00 +0200 Subject: [PATCH 233/412] updated version information after successful test of v2.0.1-148-gfb23c49 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index d625e2d19..85c030ae0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-146-ge540476 +v2.0.1-148-gfb23c49 From 5345b42d71f8c9a232c5465adf9f555b47d4805e Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Sun, 25 Sep 2016 21:13:02 -0400 Subject: [PATCH 234/412] improved robustness against faulty RCB data deals gracefully with duplicate segments, new option to export cleaned up RCB --- .../pre/patchFromReconstructedBoundaries.py | 167 ++++++++++++------ 1 file changed, 114 insertions(+), 53 deletions(-) diff --git a/processing/pre/patchFromReconstructedBoundaries.py b/processing/pre/patchFromReconstructedBoundaries.py index ada92b09d..e4ec9ef42 100755 --- a/processing/pre/patchFromReconstructedBoundaries.py +++ b/processing/pre/patchFromReconstructedBoundaries.py @@ -2,6 +2,7 @@ # -*- coding: UTF-8 no BOM -*- import sys,os,math,re +import numpy as np from optparse import OptionParser import damask @@ -63,9 +64,8 @@ def rcbOrientationParser(content,idcolumn): grains = [] myOrientation = [0.0,0.0,0.0] - for line in content: - m = re.match(r'\s*(#|$)',line) - if m: continue # skip comments and blank lines + for j,line in enumerate(content): + if re.match(r'^\s*(#|$)',line): continue # skip comments and blank lines for grain in range(2): myID = int(line.split()[idcolumn+grain]) # get grain id myOrientation = map(float,line.split())[3*grain:3+3*grain] # get orientation @@ -75,8 +75,8 @@ def rcbOrientationParser(content,idcolumn): try: grains[myID-1] = myOrientation # store Euler angles except IndexError: - message = 'You might not have chosen the correct column for the grain IDs! Please check the "--id" option.' - print '\033[1;31m'+message+'\033[0m\n' + damask.util.croak('You might not have chosen the correct column for the grain IDs! '+ + 'Please check the "--id" option.') raise except: raise @@ -91,13 +91,13 @@ def rcbParser(content,M,size,tolerance,idcolumn,segmentcolumn): x = [0.,0.] y = [0.,0.] for line in content: - m = re.match(r'\s*(#|$)',line) + m = re.match(r'^\s*(#|$)',line) if m: continue # skip comments and blank lines try: (x[0],y[0],x[1],y[1]) = map(float,line.split())[segmentcolumn:segmentcolumn+4] # get start and end coordinates of each segment. except IndexError: - message = 'You might not have chosen the correct column for the segment end points! Please check the "--segment" option.' - print '\033[1;31m'+message+'\033[0m\n' + damask.util.croak('You might not have chosen the correct column for the segment end points! '+ + 'Please check the "--segment" option.') raise except: raise @@ -110,6 +110,9 @@ def rcbParser(content,M,size,tolerance,idcolumn,segmentcolumn): dX = boxX[1]-boxX[0] dY = boxY[1]-boxY[0] + damask.util.croak(' bounding box {},{} -- {},{}'.format(boxX[0],boxY[0],boxX[1],boxY[1])) + damask.util.croak(' dimension {} x {}'.format(dX,dY)) + if size > 0.0: scalePatch = size/dX else: scalePatch = 1.0 @@ -122,8 +125,7 @@ def rcbParser(content,M,size,tolerance,idcolumn,segmentcolumn): grainNeighbors = [] for line in content: - m = re.match(r'\s*(#|$)',line) - if m: continue # skip comments and blank lines + if re.match(r'^\s*(#|$)',line): continue # skip comments and blank lines (x[0],y[0],x[1],y[1]) = map(float,line.split())[segmentcolumn:segmentcolumn+4] # get start and end coordinates of each segment. (x[0],y[0]) = (M[0]*x[0]+M[1]*y[0],M[2]*x[0]+M[3]*y[0]) # apply transformation to coordinates (x[1],y[1]) = (M[0]*x[1]+M[1]*y[1],M[2]*x[1]+M[3]*y[1]) # to get rcb --> Euler system @@ -133,8 +135,8 @@ def rcbParser(content,M,size,tolerance,idcolumn,segmentcolumn): y[0] -= boxY[0] y[1] -= boxY[0] grainNeighbors.append(map(int,line.split()[idcolumn:idcolumn+2])) # remember right and left grain per segment - for i in range(2): # store segment to both points - match = False # check whether point is already known (within a small range) + for i in range(2): # store segment to both points + match = False # check whether point is already known (within a small range) for posX in connectivityXY.keys(): if (abs(float(posX)-x[i]) 0: + damask.util.croak(' culling {} duplicate segments...'.format(len(dupSegments))) + for rm in dupSegments: + segments[rm] = None + crappyData = False for pointId,point in enumerate(points): if len(point['segments']) < 2: # point marks a dead end! - print "Dead end at segment %i (%f,%f)"\ - %(1+point['segments'][0],boxX[0]+point['coords'][0]/scalePatch,boxY[0]+point['coords'][1]/scalePatch,) + damask.util.croak('dead end at segment {} for point {} ({},{}).' + .format(point['segments'][0], + pointId, + boxX[0]+point['coords'][0]/scalePatch,boxY[0]+point['coords'][1]/scalePatch,)) crappyData = True grains = {'draw': [], 'legs': []} @@ -249,39 +269,42 @@ def rcbParser(content,M,size,tolerance,idcolumn,segmentcolumn): innerAngleSum = 0.0 myWalk = point['segments'].pop() grainLegs = [myWalk] - if segments[myWalk][0] == myStart: - myEnd = segments[myWalk][1] - else: - myEnd = segments[myWalk][0] + myEnd = segments[myWalk][1 if segments[myWalk][0] == myStart else 0] while (myEnd != pointId): - myV = [points[myEnd]['coords'][0]-points[myStart]['coords'][0],\ - points[myEnd]['coords'][1]-points[myStart]['coords'][1]] + myV = [points[myEnd]['coords'][0]-points[myStart]['coords'][0], + points[myEnd]['coords'][1]-points[myStart]['coords'][1]] myLen = math.sqrt(myV[0]**2+myV[1]**2) + if myLen == 0.0: damask.util.croak('mylen is zero: point {} --> {}'.format(myStart,myEnd)) best = {'product': -2.0, 'peek': -1, 'len': -1, 'point': -1} for peek in points[myEnd]['segments']: # trying in turn all segments emanating from current end if peek == myWalk: - continue - peekEnd = segments[peek][1] if segments[peek][0] == myEnd else segments[peek][0] + continue # do not go back same path + peekEnd = segments[peek][1 if segments[peek][0] == myEnd else 0] peekV = [points[myEnd]['coords'][0]-points[peekEnd]['coords'][0], points[myEnd]['coords'][1]-points[peekEnd]['coords'][1]] peekLen = math.sqrt(peekV[0]**2+peekV[1]**2) - crossproduct = (myV[0]*peekV[1]-myV[1]*peekV[0])/myLen/peekLen - dotproduct = (myV[0]*peekV[0]+myV[1]*peekV[1])/myLen/peekLen - if crossproduct*(dotproduct+1.0) >= best['product']: - best['product'] = crossproduct*(dotproduct+1.0) + if peekLen == 0.0: damask.util.croak('peeklen is zero: peek point {}'.format(peek)) + crossproduct = (myV[0]*peekV[1] - myV[1]*peekV[0])/myLen/peekLen + dotproduct = (myV[0]*peekV[0] + myV[1]*peekV[1])/myLen/peekLen + innerAngle = crossproduct*(dotproduct+1.0) + if innerAngle >= best['product']: # takes sharpest left turn + best['product'] = innerAngle best['peek'] = peek best['point'] = peekEnd + innerAngleSum += best['product'] myWalk = best['peek'] myStart = myEnd myEnd = best['point'] + if myWalk in points[myStart]['segments']: points[myStart]['segments'].remove(myWalk) else: - sys.stderr.write(str(myWalk)+' not in segments of point '+str(myStart)+'\n') + damask.utilcroak('{} not in segments of point {}'.format(myWalk,myStart)) grainDraw.append(points[myStart]['coords']) grainLegs.append(myWalk) + if innerAngleSum > 0.0: grains['draw'].append(grainDraw) grains['legs'].append(grainLegs) @@ -291,16 +314,26 @@ def rcbParser(content,M,size,tolerance,idcolumn,segmentcolumn): # build overall data structure - rcData = {'dimension':[dX,dY], 'point': [],'segment': [], 'grain': [], 'grainMapping': []} - print " dimension %g x %g"%(dX,dY) + rcData = {'dimension':[dX,dY], + 'bounds': [[boxX[0],boxY[0]],[boxX[1],boxY[1]]], + 'scale': scalePatch, + 'point': [], + 'segment': [], + 'neighbors': [], + 'grain': [], + 'grainMapping': [], + } for point in points: rcData['point'].append(point['coords']) - print " found %i points"%(len(rcData['point'])) + damask.util.croak(' found {} points'.format(len(rcData['point']))) - for segment in segments: + for segment in segments: rcData['segment'].append(segment) - print " built %i segments"%(len(rcData['segment'])) + damask.util.croak(' built {} segments'.format(len(rcData['segment']))) + + for neighbors in grainNeighbors: + rcData['neighbors'].append(neighbors) for legs in grains['legs']: # loop over grains rcData['grain'].append(legs) # store list of boundary segments @@ -314,12 +347,11 @@ def rcbParser(content,M,size,tolerance,idcolumn,segmentcolumn): myNeighbors[grainNeighbors[leg][side]] = 1 if myNeighbors: # do I have any neighbors (i.e., non-bounding box segment) candidateGrains = sorted(myNeighbors.iteritems(), key=lambda (k,v): (v,k), reverse=True) # sort grain counting - if candidateGrains[0][0] not in rcData['grainMapping']: # most frequent one not yet seen? - rcData['grainMapping'].append(candidateGrains[0][0]) # must be me then - else: - rcData['grainMapping'].append(candidateGrains[1][0]) # special case of bi-crystal situation... + # most frequent one not yet seen? + rcData['grainMapping'].append(candidateGrains[0 if candidateGrains[0][0] not in rcData['grainMapping'] else 1][0]) # must be me then + # special case of bi-crystal situation... - print " found %i grains\n"%(len(rcData['grain'])) + damask.util.croak(' found {} grains'.format(len(rcData['grain']))) rcData['box'] = grains['box'] if 'box' in grains else [] @@ -670,9 +702,10 @@ def image(name,imgsize,marginX,marginY,rcData): draw.text([offsetX+point[0]*scaleImg,sizeY-(offsetY+point[1]*scaleImg)],"%i"%id,fill=(0,0,0)) for id,vertex in enumerate(rcData['segment']): + if vertex: start = rcData['point'][vertex[0]] end = rcData['point'][vertex[1]] - draw.text([offsetX+(start[0]+end[0])/2.0*scaleImg,sizeY-(offsetY+(start[1]+end[1])/2.0*scaleImg)],"%i"%id,fill=(0,0,128)) + draw.text([offsetX+(start[0]+end[0])/2.0*scaleImg,sizeY-(offsetY+(start[1]+end[1])/2.0*scaleImg)],"%i"%id,fill=(255,0,128)) draw.line([offsetX+start[0]*scaleImg,sizeY-(offsetY+start[1]*scaleImg), offsetX+ end[0]*scaleImg,sizeY-(offsetY+ end[1]*scaleImg)],width=1,fill=(128,128,128)) @@ -789,7 +822,7 @@ reconstructed boundary file meshes=['dt_planar_trimesh','af_planar_trimesh','af_planar_quadmesh'] parser.add_option('-o', '--output', action='extend', dest='output', metavar = '', - help='types of output {image, mentat, procedure, spectral}') + help='types of output {rcb, image, mentat, procedure, spectral}') parser.add_option('-p', '--port', type='int', metavar = 'int', dest='port', help='Mentat connection port [%default]') parser.add_option('-2', '--twodimensional', action='store_true', @@ -847,16 +880,15 @@ parser.set_defaults(output = [], (options, args) = parser.parse_args() -print '\033[1m'+scriptName+'\033[0m\n' if not len(args): - parser.error('no boundary file specified') + parser.error('no boundary file specified.') try: boundaryFile = open(args[0]) boundarySegments = boundaryFile.readlines() boundaryFile.close() except: - print 'unable to read boundary file "%s"'%args[0] + damask.util.croak('unable to read boundary file "{}".'.format(args[0])) raise options.output = [s.lower() for s in options.output] # lower case @@ -864,18 +896,46 @@ options.idcolumn -= 1 # py options.segmentcolumn -= 1 # python indexing starts with 0 myName = os.path.splitext(args[0])[0] -print "%s\n"%myName +damask.util.report(scriptName,myName) orientationData = rcbOrientationParser(boundarySegments,options.idcolumn) rcData = rcbParser(boundarySegments,options.M,options.size,options.tolerance,options.idcolumn,options.segmentcolumn) +# ----- write corrected RCB ----- + +Minv = np.linalg.inv(np.array(options.M).reshape(2,2)) + +if 'rcb' in options.output: + print """# Header: +# +# Column 1-3: right hand average orientation (phi1, PHI, phi2 in radians) +# Column 4-6: left hand average orientation (phi1, PHI, phi2 in radians) +# Column 7: length (in microns) +# Column 8: trace angle (in degrees) +# Column 9-12: x,y coordinates of endpoints (in microns) +# Column 13-14: IDs of right hand and left hand grains""" + for i,(left,right) in enumerate(rcData['neighbors']): + if rcData['segment'][i]: + first = np.dot(Minv,np.array([rcData['bounds'][0][0]+rcData['point'][rcData['segment'][i][0]][0]/rcData['scale'], + rcData['bounds'][0][1]+rcData['point'][rcData['segment'][i][0]][1]/rcData['scale'], + ])) + second = np.dot(Minv,np.array([rcData['bounds'][0][0]+rcData['point'][rcData['segment'][i][1]][0]/rcData['scale'], + rcData['bounds'][0][1]+rcData['point'][rcData['segment'][i][1]][1]/rcData['scale'], + ])) + print ' '.join(map(str,orientationData[left-1]+orientationData[right-1])), + print np.linalg.norm(first-second), + print '0', + print ' '.join(map(str,first)), + print ' '.join(map(str,second)), + print ' '.join(map(str,[left,right])) + # ----- write image ----- if 'image' in options.output and options.imgsize > 0: if ImageCapability: image(myName,options.imgsize,options.xmargin,options.ymargin,rcData) else: - print '...no image drawing possible (PIL missing)...' + damask.util.croak('...no image drawing possible (PIL missing)...') # ----- write spectral geom ----- @@ -893,8 +953,9 @@ if 'spectral' in options.output: (y+1)*fftdata['resolution'][0]]))+'\n') # grain indexes, x-row per line geomFile.close() # close geom file - print('assigned %i out of %i (2D) Fourier points.'\ - %(len(fftdata['fftpoints']), int(fftdata['resolution'][0])*int(fftdata['resolution'][1]))) + damask.util.croak('assigned {} out of {} (2D) Fourier points...' + .format(len(fftdata['fftpoints']), + int(fftdata['resolution'][0])*int(fftdata['resolution'][1]))) # ----- write Mentat procedure ----- @@ -936,7 +997,7 @@ if 'mentat' in options.output: if 'procedure' in options.output: output(outputLocals['log'],outputLocals,'Stdout') else: - print '...no interaction with Mentat possible...' + damask.util.croak('...no interaction with Mentat possible...') # ----- write config data to file ----- From 9f08258e05d2424fd33989bad2575dc7f7f946d0 Mon Sep 17 00:00:00 2001 From: Test User Date: Mon, 26 Sep 2016 16:34:07 +0200 Subject: [PATCH 235/412] updated version information after successful test of v2.0.1-150-g5345b42 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 85c030ae0..37c33ab3c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-148-gfb23c49 +v2.0.1-150-g5345b42 From b663903606c8a092766ffb44dd4600ef255a2bd6 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Mon, 26 Sep 2016 10:34:53 -0400 Subject: [PATCH 236/412] updated geom-header to current labels (grid,size) --- processing/pre/patchFromReconstructedBoundaries.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/processing/pre/patchFromReconstructedBoundaries.py b/processing/pre/patchFromReconstructedBoundaries.py index e4ec9ef42..918b60e3b 100755 --- a/processing/pre/patchFromReconstructedBoundaries.py +++ b/processing/pre/patchFromReconstructedBoundaries.py @@ -944,8 +944,8 @@ if 'spectral' in options.output: geomFile = open(myName+'_'+str(int(fftdata['resolution'][0]))+'.geom','w') # open geom file for writing geomFile.write('3\theader\n') # write header info - geomFile.write('resolution a %i b %i c %i\n'%(fftdata['resolution'])) # resolution - geomFile.write('dimension x %f y %f z %f\n'%(fftdata['dimension'])) # size + geomFile.write('grid a %i b %i c %i\n'%(fftdata['resolution'])) # grid resolution + geomFile.write('size x %f y %f z %f\n'%(fftdata['dimension'])) # size geomFile.write('homogenization 1\n') # homogenization for z in xrange(fftdata['resolution'][2]): # z repetions for y in xrange(fftdata['resolution'][1]): # each x-row separately From 1d06e82700fef86b8f8c2c63b6c3ec1fba28a989 Mon Sep 17 00:00:00 2001 From: Aritra Chakraborty Date: Mon, 26 Sep 2016 16:30:50 -0400 Subject: [PATCH 237/412] grain circumference identification fixed right most path selection criteria for grain circumference --- .../pre/patchFromReconstructedBoundaries.py | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/processing/pre/patchFromReconstructedBoundaries.py b/processing/pre/patchFromReconstructedBoundaries.py index e4ec9ef42..572c929fa 100755 --- a/processing/pre/patchFromReconstructedBoundaries.py +++ b/processing/pre/patchFromReconstructedBoundaries.py @@ -270,7 +270,6 @@ def rcbParser(content,M,size,tolerance,idcolumn,segmentcolumn): myWalk = point['segments'].pop() grainLegs = [myWalk] myEnd = segments[myWalk][1 if segments[myWalk][0] == myStart else 0] - while (myEnd != pointId): myV = [points[myEnd]['coords'][0]-points[myStart]['coords'][0], points[myEnd]['coords'][1]-points[myStart]['coords'][1]] @@ -281,18 +280,18 @@ def rcbParser(content,M,size,tolerance,idcolumn,segmentcolumn): if peek == myWalk: continue # do not go back same path peekEnd = segments[peek][1 if segments[peek][0] == myEnd else 0] - peekV = [points[myEnd]['coords'][0]-points[peekEnd]['coords'][0], - points[myEnd]['coords'][1]-points[peekEnd]['coords'][1]] + peekV = [points[peekEnd]['coords'][0]-points[myEnd]['coords'][0], + points[peekEnd]['coords'][1]-points[myEnd]['coords'][1]] peekLen = math.sqrt(peekV[0]**2+peekV[1]**2) if peekLen == 0.0: damask.util.croak('peeklen is zero: peek point {}'.format(peek)) crossproduct = (myV[0]*peekV[1] - myV[1]*peekV[0])/myLen/peekLen dotproduct = (myV[0]*peekV[0] + myV[1]*peekV[1])/myLen/peekLen - innerAngle = crossproduct*(dotproduct+1.0) + innerAngle = math.copysign(1.0,crossproduct)*(dotproduct-1.0) if innerAngle >= best['product']: # takes sharpest left turn best['product'] = innerAngle best['peek'] = peek best['point'] = peekEnd - + innerAngleSum += best['product'] myWalk = best['peek'] myStart = myEnd @@ -301,7 +300,7 @@ def rcbParser(content,M,size,tolerance,idcolumn,segmentcolumn): if myWalk in points[myStart]['segments']: points[myStart]['segments'].remove(myWalk) else: - damask.utilcroak('{} not in segments of point {}'.format(myWalk,myStart)) + damask.util.croak('{} not in segments of point {}'.format(myWalk,myStart)) grainDraw.append(points[myStart]['coords']) grainLegs.append(myWalk) @@ -311,7 +310,6 @@ def rcbParser(content,M,size,tolerance,idcolumn,segmentcolumn): else: grains['box'] = grainLegs - # build overall data structure rcData = {'dimension':[dX,dY], @@ -772,8 +770,8 @@ def fftbuild(rcData,height,xframe,yframe,resolution,extrusion): 'dimension':(xsize,ysize,zsize)} frameindex=len(rcData['grain'])+1 # calculate frame index as largest grain index plus one - dx = xsize/(xres+1) # calculate step sizes - dy = ysize/(yres+1) + dx = xsize/(xres) # calculate step sizes + dy = ysize/(yres) grainpoints = [] for segments in rcData['grain']: # get segments of each grain @@ -788,11 +786,10 @@ def fftbuild(rcData,height,xframe,yframe,resolution,extrusion): grainpoints.append([]) # start out blank for current grain for p in sorted(points, key=points.get): # loop thru set of sorted points grainpoints[-1].append([rcData['point'][p][0],rcData['point'][p][1]]) # append x,y of point - bestGuess = 0 # assume grain 0 as best guess for i in range(int(xres*yres)): # walk through all points in xy plane xtest = -xframe+((i%xres)+0.5)*dx # calculate coordinates - ytest = -yframe+(int(i/xres)+0.5)*dy + ytest = -yframe+((i//xres)+0.5)*dy if(xtest < 0 or xtest > maxX): # check wether part of frame if( ytest < 0 or ytest > maxY): # part of edges fftdata['fftpoints'].append(frameindex+2) # append frameindex to result array @@ -944,8 +941,8 @@ if 'spectral' in options.output: geomFile = open(myName+'_'+str(int(fftdata['resolution'][0]))+'.geom','w') # open geom file for writing geomFile.write('3\theader\n') # write header info - geomFile.write('resolution a %i b %i c %i\n'%(fftdata['resolution'])) # resolution - geomFile.write('dimension x %f y %f z %f\n'%(fftdata['dimension'])) # size + geomFile.write('grid a %i b %i c %i\n'%(fftdata['resolution'])) # grid resolution + geomFile.write('size x %f y %f z %f\n'%(fftdata['dimension'])) # size geomFile.write('homogenization 1\n') # homogenization for z in xrange(fftdata['resolution'][2]): # z repetions for y in xrange(fftdata['resolution'][1]): # each x-row separately From 0ffd74d53680ab15d04ae1ad02b63d7514fc4ea8 Mon Sep 17 00:00:00 2001 From: Aritra Chakraborty Date: Mon, 26 Sep 2016 16:32:39 -0400 Subject: [PATCH 238/412] correct flag "data" for updated vtk_addRectilinearGridData --- processing/pre/geom_check.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/processing/pre/geom_check.sh b/processing/pre/geom_check.sh index 1eb85913c..5a39d4fc7 100755 --- a/processing/pre/geom_check.sh +++ b/processing/pre/geom_check.sh @@ -11,7 +11,7 @@ do < $geom \ | \ vtk_addRectilinearGridData \ - --scalar microstructure \ + --data microstructure \ --inplace \ --vtk ${geom%.*}.vtk rm ${geom%.*}.vtk From 858d3c8b035e24a50de0c15c9f6fea6ef5292611 Mon Sep 17 00:00:00 2001 From: Test User Date: Wed, 28 Sep 2016 04:41:18 +0200 Subject: [PATCH 239/412] updated version information after successful test of v2.0.1-165-g03b023a --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 37c33ab3c..43795816a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-150-g5345b42 +v2.0.1-165-g03b023a From ef785cd7b5502fb9f3b93cb0f3fb4629366329b8 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Wed, 28 Sep 2016 18:27:06 -0400 Subject: [PATCH 240/412] removed PETSC_ARCH output --- DAMASK_env.csh | 3 --- DAMASK_env.sh | 2 -- DAMASK_env.zsh | 2 -- 3 files changed, 7 deletions(-) diff --git a/DAMASK_env.csh b/DAMASK_env.csh index 8c2d783d1..96ddbf8c2 100644 --- a/DAMASK_env.csh +++ b/DAMASK_env.csh @@ -53,9 +53,6 @@ if ( $?prompt ) then if ( $?PETSC_DIR) then echo "PETSc location $PETSC_DIR" endif - if ( $?PETSC_ARCH) then - echo "PETSc architecture $PETSC_ARCH" - endif if ( $?MSC_ROOT) then echo "MSC.Marc/Mentat $MSC_ROOT" endif diff --git a/DAMASK_env.sh b/DAMASK_env.sh index 19d2c627d..6abaff19b 100644 --- a/DAMASK_env.sh +++ b/DAMASK_env.sh @@ -63,8 +63,6 @@ if [ ! -z "$PS1" ]; then [[ $(python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" "$PETSC_DIR") == $PETSC_DIR ]] \ || echo " ~~> "$(python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" "$PETSC_DIR") fi - [[ "x$PETSC_ARCH" == "x" ]] \ - || echo "PETSc architecture $PETSC_ARCH" echo "MSC.Marc/Mentat $MSC_ROOT" echo echo -n "heap size " diff --git a/DAMASK_env.zsh b/DAMASK_env.zsh index 3bbab82df..ccb534b99 100644 --- a/DAMASK_env.zsh +++ b/DAMASK_env.zsh @@ -51,8 +51,6 @@ if [ ! -z "$PS1" ]; then [[ $(python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" "$PETSC_DIR") == $PETSC_DIR ]] \ || echo " ~~> "$(python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" "$PETSC_DIR") fi - [[ "x$PETSC_ARCH" == "x" ]] \ - || echo "PETSc architecture $PETSC_ARCH" echo "MSC.Marc/Mentat $MSC_ROOT" echo echo -n "heap size " From e49d1d47924863e65d7a51f018c17b4f2acf2bb2 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Wed, 28 Sep 2016 18:27:52 -0400 Subject: [PATCH 241/412] slight readability improvement --- code/lattice.f90 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/lattice.f90 b/code/lattice.f90 index bf1f53658..06f9c84d9 100644 --- a/code/lattice.f90 +++ b/code/lattice.f90 @@ -577,26 +577,26 @@ module lattice real(pReal), dimension(4+4,LATTICE_hex_Nslip), parameter, private :: & LATTICE_hex_systemSlip = reshape(real([& ! Slip direction Plane normal - ! Basal systems <11.0>{00.1} (independent of c/a-ratio, Bravais notation (4 coordinate base)) + ! Basal systems <11.0>{00.1} (independent of c/a-ratio, Bravais notation (4 coordinate base)) 2, -1, -1, 0, 0, 0, 0, 1, & -1, 2, -1, 0, 0, 0, 0, 1, & -1, -1, 2, 0, 0, 0, 0, 1, & - ! 1st type prismatic systems <11.0>{10.0} (independent of c/a-ratio) + ! 1st type prismatic systems <11.0>{10.0} (independent of c/a-ratio) 2, -1, -1, 0, 0, 1, -1, 0, & -1, 2, -1, 0, -1, 0, 1, 0, & -1, -1, 2, 0, 1, -1, 0, 0, & - ! 2nd type prismatic systems <10.0>{11.0} -- a slip; plane normals independent of c/a-ratio + ! 2nd type prismatic systems <10.0>{11.0} -- a slip; plane normals independent of c/a-ratio 0, 1, -1, 0, 2, -1, -1, 0, & -1, 0, 1, 0, -1, 2, -1, 0, & 1, -1, 0, 0, -1, -1, 2, 0, & - ! 1st type 1st order pyramidal systems <11.0>{-11.1} -- plane normals depend on the c/a-ratio + ! 1st type 1st order pyramidal systems <11.0>{-11.1} -- plane normals depend on the c/a-ratio 2, -1, -1, 0, 0, 1, -1, 1, & -1, 2, -1, 0, -1, 0, 1, 1, & -1, -1, 2, 0, 1, -1, 0, 1, & 1, 1, -2, 0, -1, 1, 0, 1, & -2, 1, 1, 0, 0, -1, 1, 1, & 1, -2, 1, 0, 1, 0, -1, 1, & - ! pyramidal system: c+a slip <11.3>{-10.1} -- plane normals depend on the c/a-ratio + ! pyramidal system: c+a slip <11.3>{-10.1} -- plane normals depend on the c/a-ratio 2, -1, -1, 3, -1, 1, 0, 1, & 1, -2, 1, 3, -1, 1, 0, 1, & -1, -1, 2, 3, 1, 0, -1, 1, & @@ -609,7 +609,7 @@ module lattice 2, -1, -1, 3, -1, 0, 1, 1, & 1, -2, 1, 3, 0, 1, -1, 1, & -1, -1, 2, 3, 0, 1, -1, 1, & - ! pyramidal system: c+a slip <11.3>{-1-1.2} -- as for hexagonal ice (Castelnau et al. 1996, similar to twin system found below) + ! pyramidal system: c+a slip <11.3>{-1-1.2} -- as for hexagonal ice (Castelnau et al. 1996, similar to twin system found below) 2, -1, -1, 3, -2, 1, 1, 2, & ! sorted according to similar twin system -1, 2, -1, 3, 1, -2, 1, 2, & ! <11.3>{-1-1.2} shear = 2((c/a)^2-2)/(3 c/a) -1, -1, 2, 3, 1, 1, -2, 2, & From 546d83cdc3506b829b04e3b6943f7193b14012ed Mon Sep 17 00:00:00 2001 From: Test User Date: Thu, 29 Sep 2016 04:40:32 +0200 Subject: [PATCH 242/412] updated version information after successful test of v2.0.1-168-ge49d1d4 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 43795816a..ea95afc10 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-165-g03b023a +v2.0.1-168-ge49d1d4 From f78f89fb12e3306b70296379d2cf1452894918e6 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 5 Oct 2016 15:24:37 +0200 Subject: [PATCH 243/412] periodic microstructure needs to be updated per iteration (N). now calling script twice gives the same result as one call with N=2. results for N=1 are not affected --- processing/pre/geom_grainGrowth.py | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/processing/pre/geom_grainGrowth.py b/processing/pre/geom_grainGrowth.py index 2781f90d9..55b98e627 100755 --- a/processing/pre/geom_grainGrowth.py +++ b/processing/pre/geom_grainGrowth.py @@ -78,9 +78,6 @@ for name in filenames: #--- initialize support data ----------------------------------------------------------------------- - periodic_microstructure = np.tile(microstructure,(3,3,3))[grid[0]/2:-grid[0]/2, - grid[1]/2:-grid[1]/2, - grid[2]/2:-grid[2]/2] # periodically extend the microstructure # store a copy the initial microstructure to find locations of immutable indices microstructure_original = np.copy(microstructure) @@ -94,25 +91,27 @@ for name in filenames: gauss[grid[0]/2::,:,:] = gauss[int(round(grid[0]/2.))-1::-1,:,:] gauss = np.fft.rfftn(gauss) - interfacialEnergy = lambda A,B: (A*B != 0)*(A != B)*1.0 #1.0 if A & B are distinct & nonzero, 0.0 otherwise - struc = ndimage.generate_binary_structure(3,1) # 3D von Neumann neighborhood + getInterfaceEnergy = lambda A,B: (A*B != 0)*(A != B)*1.0 # 1.0 if A & B are distinct & nonzero, 0.0 otherwise + struc = ndimage.generate_binary_structure(3,1) # 3D von Neumann neighborhood for smoothIter in xrange(options.N): - boundary = np.zeros(microstructure.shape) + periodic_microstructure = np.tile(microstructure,(3,3,3))[grid[0]/2:-grid[0]/2, + grid[1]/2:-grid[1]/2, + grid[2]/2:-grid[2]/2] # periodically extend the microstructure + interfaceEnergy = np.zeros(microstructure.shape) for i in (-1,0,1): for j in (-1,0,1): for k in (-1,0,1): # assign interfacial energy to all voxels that have a differing neighbor (in Moore neighborhood) - boundary = np.maximum(boundary, - interfacialEnergy(microstructure,np.roll(np.roll(np.roll( - microstructure,i,axis=0), j,axis=1), k,axis=2))) - interfaceEnergy = boundary - + interfaceEnergy = np.maximum(interfaceEnergy, + getInterfaceEnergy(microstructure,np.roll(np.roll(np.roll( + microstructure,i,axis=0), j,axis=1), k,axis=2))) + # periodically extend interfacial energy array by half a grid size in positive and negative directions periodic_interfaceEnergy = np.tile(interfaceEnergy,(3,3,3))[grid[0]/2:-grid[0]/2, - grid[1]/2:-grid[1]/2, - grid[2]/2:-grid[2]/2] + grid[1]/2:-grid[1]/2, + grid[2]/2:-grid[2]/2] # transform bulk volume (i.e. where interfacial energy is zero) index = ndimage.morphology.distance_transform_edt(periodic_interfaceEnergy == 0., return_distances = False, From d7e5c97c563139518a6f94a5a1b63b0e2bffd307 Mon Sep 17 00:00:00 2001 From: Test User Date: Thu, 6 Oct 2016 04:40:33 +0200 Subject: [PATCH 244/412] updated version information after successful test of v2.0.1-170-gf78f89f --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index ea95afc10..a10c01289 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-168-ge49d1d4 +v2.0.1-170-gf78f89f From de88bebe99bd5a7c948355ff02177ca7c003151e Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 6 Oct 2016 12:14:07 +0200 Subject: [PATCH 245/412] handling defaults correctly for extend option --- processing/misc/OIMgrainFile_toTable.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/processing/misc/OIMgrainFile_toTable.py b/processing/misc/OIMgrainFile_toTable.py index c936d92e6..a2a8c9d3b 100755 --- a/processing/misc/OIMgrainFile_toTable.py +++ b/processing/misc/OIMgrainFile_toTable.py @@ -17,17 +17,19 @@ Adds header to OIM grain file to make it accesible as ASCII table """, version = scriptID) +defaults = {'labels':['1_euler','2_euler','3_euler','1_pos','2_pos','IQ','CI','Fit','GrainID']} + parser.add_option('-l', '--labels', dest = 'labels', action = 'extend', metavar = '', - help = 'lables of requested columns') + help = 'lables of requested columns [{}]'.format(defaults['labels'])) -parser.set_defaults(labels = ['1_euler','2_euler','3_euler', - '1_pos','2_pos', 'IQ', 'CI', 'Fit', 'GrainID',], - ) (options, filenames) = parser.parse_args() +if options.labels is None: + options.labels = defaults['labels'] + # --- loop over input files ------------------------------------------------------------------------- if filenames == []: filenames = [None] From 5951b45259611f554a5fec1e0c3bf5381cc7bbc0 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 6 Oct 2016 15:22:05 +0200 Subject: [PATCH 246/412] only grain file type 1 seems to make sense (type 2 has average values). For type one, data is fixed i.e. flexible labels are not useful --- processing/misc/OIMgrainFile_toTable.py | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/processing/misc/OIMgrainFile_toTable.py b/processing/misc/OIMgrainFile_toTable.py index a2a8c9d3b..063adb0db 100755 --- a/processing/misc/OIMgrainFile_toTable.py +++ b/processing/misc/OIMgrainFile_toTable.py @@ -13,23 +13,13 @@ scriptID = ' '.join([scriptName,damask.version]) #-------------------------------------------------------------------------------------------------- parser = OptionParser(option_class=damask.extendableOption, usage='%prog [file[s]]', description = """ -Adds header to OIM grain file to make it accesible as ASCII table +Adds header to OIM grain file type 1 to make it accesible as ASCII table """, version = scriptID) -defaults = {'labels':['1_euler','2_euler','3_euler','1_pos','2_pos','IQ','CI','Fit','GrainID']} - -parser.add_option('-l', '--labels', - dest = 'labels', - action = 'extend', metavar = '', - help = 'lables of requested columns [{}]'.format(defaults['labels'])) - (options, filenames) = parser.parse_args() -if options.labels is None: - options.labels = defaults['labels'] - # --- loop over input files ------------------------------------------------------------------------- if filenames == []: filenames = [None] @@ -44,10 +34,10 @@ for name in filenames: table.head_read() data = [] while table.data_read(): - data.append(table.data[0:len(options.labels)]) + data.append(table.data[0:9]) table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) - table.labels_append(options.labels) + table.labels_append(['1_euler','2_euler','3_euler','1_pos','2_pos','IQ','CI','Fit','GrainID']) table.head_write() for i in data: table.data = i From 25b0ebb19d05a1b80b4a076e91640f84ce274ab8 Mon Sep 17 00:00:00 2001 From: Test User Date: Thu, 6 Oct 2016 16:40:49 +0200 Subject: [PATCH 247/412] updated version information after successful test of v2.0.1-173-gfb8a464 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index a10c01289..c623cba3a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-170-gf78f89f +v2.0.1-173-gfb8a464 From aae2bcf6f9601651a7eb51bf813e3a58f66dd3ed Mon Sep 17 00:00:00 2001 From: chen Date: Fri, 7 Oct 2016 09:47:15 -0400 Subject: [PATCH 248/412] add new interface class to HDF5 --- lib/damask/h5table.py | 101 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 lib/damask/h5table.py diff --git a/lib/damask/h5table.py b/lib/damask/h5table.py new file mode 100644 index 000000000..553d53010 --- /dev/null +++ b/lib/damask/h5table.py @@ -0,0 +1,101 @@ +# -*- coding: UTF-8 no BOM -*- + +import os +import sys +import h5py +import numpy as np + +# ---------------------------------------------------------------- # +# python 3 has no unicode object, this ensures that the code works # +# on Python 2&3 # +# ---------------------------------------------------------------- # +try: + test=isinstance('test', unicode) +except(NameError): + unicode=str + + +# ------------------------------------------------------- # +# Singleton class for converting feature name to H5F path # +# ------------------------------------------------------- # +# NOTE: +# 1. use simple diction to mimic the singleton class in +# C++/Java +# 2. data structure +# {: (, ), ...} +# ==> the name of the feature, e.g. f, ... +# ==> attribute, dataset +# ==> path_in_HDF5_file, e.g. '/f' +# 3. for future HDF5 data structure, this can be convert +# into a function to get more complicated path, this would +# be a great time to integrate XML parser +def lables_to_path(label): + """ read the xml definition file and return the path.""" + path = '/{}'.format(lable) + return path + + +# ----------------------- # +# H5Table interface class # +# ----------------------- # +class H5Table(object): + """ + DESCRIPTION + ----------- + Container class for interfacing with HDF5 file format. This + is a bare-bone interface class that provide simplified getter + and setter for retrieving and appending data and attributes. + PARAMETERS + ---------- + h5f_path + METHOD + ------ + get_attr() + add_attr() + del_attr() + + get_data() + add_data() + del_data() + NOTE + ---- + 1. As an interface class, it uses the lazy evaluation design + that read the data only when its absolutely necessary. + 2. + """ + + def __init__(self, h5f_path): + """ + """ + self.h5f_path = h5f_path + + def get_attr(self, feature_name=None): + """ + """ + h5f = h5py.File(self.h5f_path, 'r') + pass + + def add_attr(self, ): + """ + """ + pass + + def del_attr(self, ): + """ + """ + pass + + def get_data(self, ): + """ + """ + pass + + def add_data(self, ): + """ + """ + pass + + def del_data(self, ): + """ + """ + pass \ No newline at end of file From 7262ed9a179dbcaf5fdaf2e8d6695d63a657405e Mon Sep 17 00:00:00 2001 From: chen Date: Fri, 7 Oct 2016 10:00:03 -0400 Subject: [PATCH 249/412] use xml file showing the data structure in HDF5 --- lib/damask/DS_HDF5.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 lib/damask/DS_HDF5.xml diff --git a/lib/damask/DS_HDF5.xml b/lib/damask/DS_HDF5.xml new file mode 100644 index 000000000..12c0670c3 --- /dev/null +++ b/lib/damask/DS_HDF5.xml @@ -0,0 +1,13 @@ + + + + tensor + /f + deformation gradient (F) + + + tensor + /Cauchy + Cauchy stress tensor + + \ No newline at end of file From 1a47d81fad71a908bdce2bab1e2280860a79e829 Mon Sep 17 00:00:00 2001 From: Test User Date: Fri, 7 Oct 2016 16:38:58 +0200 Subject: [PATCH 250/412] updated version information after successful test of v2.0.1-176-gde793b5 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index c623cba3a..7c90639ca 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-173-gfb8a464 +v2.0.1-176-gde793b5 From 2cbec97eabb1b4299141ba6f5260ca99dc5edf2a Mon Sep 17 00:00:00 2001 From: chen Date: Fri, 7 Oct 2016 10:45:31 -0400 Subject: [PATCH 251/412] update xml definition of data structure in HDF5 --- lib/damask/DS_HDF5.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/damask/DS_HDF5.xml b/lib/damask/DS_HDF5.xml index 12c0670c3..9fdfef612 100644 --- a/lib/damask/DS_HDF5.xml +++ b/lib/damask/DS_HDF5.xml @@ -1,5 +1,5 @@ - + tensor /f @@ -10,4 +10,4 @@ /Cauchy Cauchy stress tensor - \ No newline at end of file + \ No newline at end of file From e148ecc3e3e328fee7ad53c375c5465d8bf4e81e Mon Sep 17 00:00:00 2001 From: chen Date: Fri, 7 Oct 2016 10:46:07 -0400 Subject: [PATCH 252/412] quick hack to locate the HDF5 data structure def file --- lib/damask/h5table.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/damask/h5table.py b/lib/damask/h5table.py index 553d53010..0043fdc2b 100644 --- a/lib/damask/h5table.py +++ b/lib/damask/h5table.py @@ -4,6 +4,7 @@ import os import sys import h5py import numpy as np +import xml.etree.cElementTree as ET # ---------------------------------------------------------------- # # python 3 has no unicode object, this ensures that the code works # @@ -26,12 +27,13 @@ except(NameError): # ==> the name of the feature, e.g. f, ... # ==> attribute, dataset # ==> path_in_HDF5_file, e.g. '/f' -# 3. for future HDF5 data structure, this can be convert -# into a function to get more complicated path, this would -# be a great time to integrate XML parser -def lables_to_path(label): +def lables_to_path(label, ns="https://damask.mpie.de"): """ read the xml definition file and return the path.""" - path = '/{}'.format(lable) + dsXMLPath = os.path.abspath(__file__).replace("h5table.py", + "DS_HDF5.xml") + tree = ET.parse(dsXMLPath) + root = tree.getroot() + path = 'test' return path From 753d71965ed49460c089b8bd6dc391ed3cfed102 Mon Sep 17 00:00:00 2001 From: chen Date: Fri, 7 Oct 2016 15:31:29 -0400 Subject: [PATCH 253/412] data structure file for HDF5 --- lib/damask/DS_HDF5.xml | 143 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 142 insertions(+), 1 deletion(-) diff --git a/lib/damask/DS_HDF5.xml b/lib/damask/DS_HDF5.xml index 9fdfef612..1c9daae59 100644 --- a/lib/damask/DS_HDF5.xml +++ b/lib/damask/DS_HDF5.xml @@ -1,13 +1,154 @@ - + + + attr + + + + + + + scalar + /ip + + + + + + scalar + /node + + + + + + vector + + + + integer + /elem + + + + + + integer + /phase + Crystallite + + + + + integer + /texture + Crystallite + + + + + scalar + /volume + Crystallite + + + + + vector + /orientation + Crystallite + + + + + vector + /eulerangles + Crystallite + Bunnge Euler angles in degrees + + + + vector + /grainrotation + Crystallite + + + tensor /f + Crystallite deformation gradient (F) + +

+ tensor + /p + Crystallite + Pikola Kirkhoff stress +

+ + + vector + /resistance_slip + Constitutive + + + + + vector + /shearrate_slip + Constitutive + + + + + vector + /resolvedstress_slip + Constitutive + + + + + scalar + /totalshear + Constitutive + + + + + vector + /accumulatedshear_slip + Constitutive + vector contains accumulated shear per slip system + + tensor /Cauchy + Derived Cauchy stress tensor + + + tensor + /lnV + Derived + + + + + scalar + /MisesCauchy + Derived + von Mises equivalent of Cauchy stress + + + + scalar + /MiseslnV + Derived + left von Mises strain + +
\ No newline at end of file From 4e8bd83d4bef6e97e71de8587abf49ac38ac4360 Mon Sep 17 00:00:00 2001 From: chen Date: Fri, 7 Oct 2016 15:32:10 -0400 Subject: [PATCH 254/412] syntax error fix --- processing/post/vtk_addPointcloudData.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/processing/post/vtk_addPointcloudData.py b/processing/post/vtk_addPointcloudData.py index b96c9ce17..bc76c7e72 100755 --- a/processing/post/vtk_addPointcloudData.py +++ b/processing/post/vtk_addPointcloudData.py @@ -97,7 +97,7 @@ for name in filenames: VTKarray = {} active = defaultdict(list) - for datatype,dimension,label in [['data',99,options.vector], + for datatype,dimension,label in [['data',99,options.data], ['tensor',9,options.tensor], ['color' ,3,options.color], ]: From 491b4e31ec843817d776d5e4b84240731746c808 Mon Sep 17 00:00:00 2001 From: chen Date: Fri, 7 Oct 2016 15:33:43 -0400 Subject: [PATCH 255/412] add function to extract path based on label --- lib/damask/h5table.py | 42 +++++++++++++++++++----------------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/lib/damask/h5table.py b/lib/damask/h5table.py index 0043fdc2b..eaef5d1c7 100644 --- a/lib/damask/h5table.py +++ b/lib/damask/h5table.py @@ -20,21 +20,17 @@ except(NameError): # Singleton class for converting feature name to H5F path # # ------------------------------------------------------- # # NOTE: -# 1. use simple diction to mimic the singleton class in +# use simple function to mimic the singleton class in # C++/Java -# 2. data structure -# {: (, ), ...} -# ==> the name of the feature, e.g. f, ... -# ==> attribute, dataset -# ==> path_in_HDF5_file, e.g. '/f' -def lables_to_path(label, ns="https://damask.mpie.de"): +def lables_to_path(label, dsXMLPath=None): """ read the xml definition file and return the path.""" - dsXMLPath = os.path.abspath(__file__).replace("h5table.py", - "DS_HDF5.xml") + if dsXMLPath is None: + dsXMLPath = os.path.abspath(__file__).replace("h5table.py", + "DS_HDF5.xml") tree = ET.parse(dsXMLPath) - root = tree.getroot() - path = 'test' - return path + dataType = tree.find('{}/type'.format(label)).text + h5path = tree.find('{}/h5path'.format(label)).text + return (dataType, h5path) # ----------------------- # @@ -44,12 +40,12 @@ class H5Table(object): """ DESCRIPTION ----------- - Container class for interfacing with HDF5 file format. This - is a bare-bone interface class that provide simplified getter - and setter for retrieving and appending data and attributes. + Interface class for manipulating data in HDF5 with DAMASK + specialized data structure. PARAMETERS ---------- - h5f_path + h5f_path: str + Absolute path the HDF5 file METHOD ------ get_attr() @@ -63,7 +59,6 @@ class H5Table(object): ---- 1. As an interface class, it uses the lazy evaluation design that read the data only when its absolutely necessary. - 2. """ def __init__(self, h5f_path): @@ -71,11 +66,10 @@ class H5Table(object): """ self.h5f_path = h5f_path - def get_attr(self, feature_name=None): + def get_attr(self, attr_name=None): """ """ h5f = h5py.File(self.h5f_path, 'r') - pass def add_attr(self, ): """ @@ -87,10 +81,12 @@ class H5Table(object): """ pass - def get_data(self, ): - """ - """ - pass + def get_data(self, feature_name=None): + """ extract dataset from HDF5 table and return it in a numpy array """ + dataType, h5f_path = lables_to_path(feature_name) + h5f = h5py.File(self.h5f_path, 'r') + h5f_dst = h5f[h5f_path] # get the handle for target dataset(table) + return h5f_dst.read_direct(np.zeros(h5f_dst.shape)) def add_data(self, ): """ From 83dae7f9a8ce81ecb842b2738a4081c4a5faf2c6 Mon Sep 17 00:00:00 2001 From: chen Date: Fri, 7 Oct 2016 16:41:17 -0400 Subject: [PATCH 256/412] add data manipulator --- lib/damask/h5table.py | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/lib/damask/h5table.py b/lib/damask/h5table.py index eaef5d1c7..65c98d605 100644 --- a/lib/damask/h5table.py +++ b/lib/damask/h5table.py @@ -50,11 +50,9 @@ class H5Table(object): ------ get_attr() add_attr() - del_attr() get_data() add_data() - del_data() NOTE ---- 1. As an interface class, it uses the lazy evaluation design @@ -66,6 +64,11 @@ class H5Table(object): """ self.h5f_path = h5f_path + def __del__(self, feature_name=None): + dataType, h5f_path = lables_to_path(feature_name) + h5f = h5py.File(self.h5f_path, 'a') + del h5f[h5f_path] + def get_attr(self, attr_name=None): """ """ @@ -76,11 +79,6 @@ class H5Table(object): """ pass - def del_attr(self, ): - """ - """ - pass - def get_data(self, feature_name=None): """ extract dataset from HDF5 table and return it in a numpy array """ dataType, h5f_path = lables_to_path(feature_name) @@ -88,12 +86,11 @@ class H5Table(object): h5f_dst = h5f[h5f_path] # get the handle for target dataset(table) return h5f_dst.read_direct(np.zeros(h5f_dst.shape)) - def add_data(self, ): - """ - """ - pass - - def del_data(self, ): - """ - """ - pass \ No newline at end of file + def add_data(self, feature_name, dataset=None): + """ adding new feature into existing HDF5 file """ + dataType, h5f_path = lables_to_path(feature_name) + if dataType is not "attr": + h5f = h5py.File(self.h5f_path, 'a') + h5f.create_dataset(h5f_path, data=dataset) + else: + raise ValueError("feature {} isn't valid".format(feature_name)) From 859e3584cab43da261ab423528f2b5cce5a15615 Mon Sep 17 00:00:00 2001 From: chen Date: Fri, 7 Oct 2016 17:43:27 -0400 Subject: [PATCH 257/412] add log for demo --- lib/damask/DS_HDF5.xml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/damask/DS_HDF5.xml b/lib/damask/DS_HDF5.xml index 1c9daae59..26e288250 100644 --- a/lib/damask/DS_HDF5.xml +++ b/lib/damask/DS_HDF5.xml @@ -2,9 +2,10 @@ attr - + / + @@ -12,6 +13,7 @@ /ip + @@ -19,10 +21,12 @@ /node + vector + @@ -30,6 +34,7 @@ /elem + @@ -37,6 +42,7 @@ /phase Crystallite + @@ -44,6 +50,7 @@ /texture Crystallite + @@ -51,6 +58,7 @@ /volume Crystallite + @@ -58,6 +66,7 @@ /orientation Crystallite + @@ -65,6 +74,7 @@ /eulerangles Crystallite Bunnge Euler angles in degrees + @@ -72,6 +82,7 @@ /grainrotation Crystallite + @@ -79,6 +90,7 @@ /f Crystallite deformation gradient (F) +

@@ -86,6 +98,7 @@ /p Crystallite Pikola Kirkhoff stress +

From 012b702f7a96267d883fbe8b10d8bc52b77f2159 Mon Sep 17 00:00:00 2001 From: chen Date: Fri, 7 Oct 2016 17:43:52 -0400 Subject: [PATCH 258/412] finish h5table class --- lib/damask/h5table.py | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/lib/damask/h5table.py b/lib/damask/h5table.py index 65c98d605..eb75cbd6f 100644 --- a/lib/damask/h5table.py +++ b/lib/damask/h5table.py @@ -48,15 +48,17 @@ class H5Table(object): Absolute path the HDF5 file METHOD ------ + del_entry() get_attr() add_attr() - get_data() add_data() NOTE ---- 1. As an interface class, it uses the lazy evaluation design that read the data only when its absolutely necessary. + 2. The command line used to generate new feature is stored with + each dataset as dataset attribute. """ def __init__(self, h5f_path): @@ -64,20 +66,24 @@ class H5Table(object): """ self.h5f_path = h5f_path - def __del__(self, feature_name=None): + def del_entry(self, feature_name): + """ delete entry in HDF5 table """ dataType, h5f_path = lables_to_path(feature_name) h5f = h5py.File(self.h5f_path, 'a') del h5f[h5f_path] - def get_attr(self, attr_name=None): - """ - """ + def get_attr(self, attr_name): h5f = h5py.File(self.h5f_path, 'r') + dataType, h5f_path = lables_to_path(attr_name) + return h5f[h5f_path].attrs[attr_name] - def add_attr(self, ): - """ - """ - pass + def add_attr(self, attr_name, attr_data): + h5f = h5py.File(self.h5f_path, 'a') + dataType, h5f_path = lables_to_path(attr_name) + if dataType == "attr": + h5f[h5f_path].attrs[attr_name] = attr_data + else: + raise ValueError("Unspported attr: {}".format(attr_name)) def get_data(self, feature_name=None): """ extract dataset from HDF5 table and return it in a numpy array """ @@ -94,3 +100,9 @@ class H5Table(object): h5f.create_dataset(h5f_path, data=dataset) else: raise ValueError("feature {} isn't valid".format(feature_name)) + + def get_log(self, feature_name): + """ get cmd history used to generate the data""" + dataType, h5f_path = lables_to_path(feature_name) + h5f = ht5py.File(self.h5f_path, 'r') + return h5f[h5f_path].attrs['log'] From fad9938a8b0a82314ca8b3402b530f7a4f510c22 Mon Sep 17 00:00:00 2001 From: chen Date: Sun, 9 Oct 2016 17:06:56 -0400 Subject: [PATCH 259/412] add cmd history as root attributes --- lib/damask/DS_HDF5.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/damask/DS_HDF5.xml b/lib/damask/DS_HDF5.xml index 26e288250..44844b87c 100644 --- a/lib/damask/DS_HDF5.xml +++ b/lib/damask/DS_HDF5.xml @@ -1,5 +1,12 @@ + + attr + / + + store cmd history + + attr / From 0c2c450659494a095261da680abf076097e61482 Mon Sep 17 00:00:00 2001 From: chen Date: Sun, 9 Oct 2016 17:13:40 -0400 Subject: [PATCH 260/412] adding more comments explaining the reason for this interface class and its simplified API design --- lib/damask/h5table.py | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/lib/damask/h5table.py b/lib/damask/h5table.py index eb75cbd6f..80e64a6f4 100644 --- a/lib/damask/h5table.py +++ b/lib/damask/h5table.py @@ -1,5 +1,13 @@ # -*- coding: UTF-8 no BOM -*- +# ----------------------------------------------------------- # +# Ideally the h5py should be enough to serve as the data # +# interface for future DAMASK, but since we are still not # +# sure when this major shift will happen, it seems to be a # +# good idea to provide a interface class that help user ease # +# into using HDF5 as the new daily storage driver. # +# ----------------------------------------------------------- # + import os import sys import h5py @@ -25,8 +33,14 @@ except(NameError): def lables_to_path(label, dsXMLPath=None): """ read the xml definition file and return the path.""" if dsXMLPath is None: + # use the default storage layout in DS_HDF5.xml dsXMLPath = os.path.abspath(__file__).replace("h5table.py", "DS_HDF5.xml") + # This current implementation requires that all variables + # stay under the root node, the nesting is defined through the + # h5path. This could be improved easily with more advanced parsing + # using ET interface, but for now I can not see the benefits in doing + # so. tree = ET.parse(dsXMLPath) dataType = tree.find('{}/type'.format(label)).text h5path = tree.find('{}/h5path'.format(label)).text @@ -53,6 +67,8 @@ class H5Table(object): add_attr() get_data() add_data() + get_cmdlog() + Return the command used to generate the data if possible. NOTE ---- 1. As an interface class, it uses the lazy evaluation design @@ -68,6 +84,8 @@ class H5Table(object): def del_entry(self, feature_name): """ delete entry in HDF5 table """ + # WARNING: this will PERMENANTLY delete attributes/dataset + # use with caution dataType, h5f_path = lables_to_path(feature_name) h5f = h5py.File(self.h5f_path, 'a') del h5f[h5f_path] @@ -92,17 +110,20 @@ class H5Table(object): h5f_dst = h5f[h5f_path] # get the handle for target dataset(table) return h5f_dst.read_direct(np.zeros(h5f_dst.shape)) - def add_data(self, feature_name, dataset=None): + def add_data(self, feature_name, dataset=None, cmd_log=None): """ adding new feature into existing HDF5 file """ dataType, h5f_path = lables_to_path(feature_name) if dataType is not "attr": h5f = h5py.File(self.h5f_path, 'a') h5f.create_dataset(h5f_path, data=dataset) + # store the cmd in log is possible + if cmd_log is not None: + h5f[h5f_path].attrs['log'] = str(cmd_log) else: raise ValueError("feature {} isn't valid".format(feature_name)) - def get_log(self, feature_name): - """ get cmd history used to generate the data""" + def get_cmdlog(self, feature_name): + """ get cmd history used to generate the feature""" dataType, h5f_path = lables_to_path(feature_name) h5f = ht5py.File(self.h5f_path, 'r') return h5f[h5f_path].attrs['log'] From f992edd3e99efbd58979cabce8e5fd784b3bb8fa Mon Sep 17 00:00:00 2001 From: chen Date: Sun, 9 Oct 2016 17:19:30 -0400 Subject: [PATCH 261/412] add import at package level --- lib/damask/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/damask/__init__.py b/lib/damask/__init__.py index a1c08ea18..11ea24bc9 100644 --- a/lib/damask/__init__.py +++ b/lib/damask/__init__.py @@ -8,6 +8,7 @@ with open(os.path.join(os.path.dirname(__file__),'../../VERSION')) as f: from .environment import Environment # noqa from .asciitable import ASCIItable # noqa +from .h5table import H5Table from .config import Material # noqa from .colormaps import Colormap, Color # noqa from .orientation import Quaternion, Rodrigues, Symmetry, Orientation # noqa From 52813351be62bd5b5aa3d1b9e18d06437e911a3f Mon Sep 17 00:00:00 2001 From: chen Date: Sun, 9 Oct 2016 17:19:49 -0400 Subject: [PATCH 262/412] add comments at class level --- lib/damask/h5table.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/damask/h5table.py b/lib/damask/h5table.py index 80e64a6f4..133d9fc5d 100644 --- a/lib/damask/h5table.py +++ b/lib/damask/h5table.py @@ -54,21 +54,21 @@ class H5Table(object): """ DESCRIPTION ----------- - Interface class for manipulating data in HDF5 with DAMASK + Interface/wrapper class for manipulating data in HDF5 with DAMASK specialized data structure. + -->Minimal API design. PARAMETERS ---------- h5f_path: str Absolute path the HDF5 file METHOD ------ - del_entry() - get_attr() - add_attr() - get_data() - add_data() - get_cmdlog() - Return the command used to generate the data if possible. + del_entry() -- Force delete attributes/group/datasets (Dangerous) + get_attr() -- Return attributes if possible + add_attr() -- Add NEW attributes to dataset/group (please delete old first!) + get_data() -- Retrieve data in numpy.ndarray + add_data() -- Add dataset to H5 file + get_cmdlog() -- Return the command used to generate the data if possible. NOTE ---- 1. As an interface class, it uses the lazy evaluation design From 753bdfd5a92f7a4e996418a4ec02f9fa05388799 Mon Sep 17 00:00:00 2001 From: chen Date: Sun, 9 Oct 2016 18:59:06 -0400 Subject: [PATCH 263/412] adding more definition --- lib/damask/DS_HDF5.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/damask/DS_HDF5.xml b/lib/damask/DS_HDF5.xml index 44844b87c..af3523bfb 100644 --- a/lib/damask/DS_HDF5.xml +++ b/lib/damask/DS_HDF5.xml @@ -31,8 +31,19 @@ + + vector + /grain + + + + + vector + /pos + + From 912aa6989c0f3c4e88153c469a054f809267cb8a Mon Sep 17 00:00:00 2001 From: chen Date: Sun, 9 Oct 2016 18:59:50 -0400 Subject: [PATCH 264/412] H5Table support customize data storage layout --- lib/damask/h5table.py | 72 ++++++++++++++++++++++++------------------- 1 file changed, 41 insertions(+), 31 deletions(-) diff --git a/lib/damask/h5table.py b/lib/damask/h5table.py index 133d9fc5d..978d2a564 100644 --- a/lib/damask/h5table.py +++ b/lib/damask/h5table.py @@ -34,8 +34,12 @@ def lables_to_path(label, dsXMLPath=None): """ read the xml definition file and return the path.""" if dsXMLPath is None: # use the default storage layout in DS_HDF5.xml - dsXMLPath = os.path.abspath(__file__).replace("h5table.py", - "DS_HDF5.xml") + if "h5table.pyc" in __file__: + dsXMLPath = os.path.abspath(__file__).replace("h5table.pyc", + "DS_HDF5.xml") + else: + dsXMLPath = os.path.abspath(__file__).replace("h5table.py", + "DS_HDF5.xml") # This current implementation requires that all variables # stay under the root node, the nesting is defined through the # h5path. This could be improved easily with more advanced parsing @@ -77,53 +81,59 @@ class H5Table(object): each dataset as dataset attribute. """ - def __init__(self, h5f_path): - """ - """ + def __init__(self, h5f_path, new_file=False, dsXMLFile=None): self.h5f_path = h5f_path + self.dsXMLFile = dsXMLFile + msg = 'Created by H5Talbe from DAMASK' + mode = 'w' if new_file else 'a' + with h5py.File(self.h5f_path, mode) as h5f: + h5f['/'].attrs['description'] = msg def del_entry(self, feature_name): """ delete entry in HDF5 table """ - # WARNING: this will PERMENANTLY delete attributes/dataset - # use with caution - dataType, h5f_path = lables_to_path(feature_name) - h5f = h5py.File(self.h5f_path, 'a') - del h5f[h5f_path] + dataType, h5f_path = lables_to_path(feature_name, + dsXMLPath=self.dsXMLFile) + with h5py.File(self.h5f_path, 'a') as h5f: + del h5f[h5f_path] def get_attr(self, attr_name): - h5f = h5py.File(self.h5f_path, 'r') - dataType, h5f_path = lables_to_path(attr_name) - return h5f[h5f_path].attrs[attr_name] + dataType, h5f_path = lables_to_path(attr_name, + dsXMLPath=self.dsXMLFile) + with h5py.File(self.h5f_path, 'a') as h5f: + rst_attr = h5f[h5f_path].attrs[attr_name] + return rst_attr def add_attr(self, attr_name, attr_data): - h5f = h5py.File(self.h5f_path, 'a') - dataType, h5f_path = lables_to_path(attr_name) - if dataType == "attr": + dataType, h5f_path = lables_to_path(attr_name, + dsXMLPath=self.dsXMLFile) + with h5py.File(self.h5f_path, 'a') as h5f: h5f[h5f_path].attrs[attr_name] = attr_data - else: - raise ValueError("Unspported attr: {}".format(attr_name)) + h5f.flush() def get_data(self, feature_name=None): """ extract dataset from HDF5 table and return it in a numpy array """ - dataType, h5f_path = lables_to_path(feature_name) - h5f = h5py.File(self.h5f_path, 'r') - h5f_dst = h5f[h5f_path] # get the handle for target dataset(table) - return h5f_dst.read_direct(np.zeros(h5f_dst.shape)) + dataType, h5f_path = lables_to_path(feature_name, + dsXMLPath=self.dsXMLFile) + with h5py.File(self.h5f_path, 'a') as h5f: + h5f_dst = h5f[h5f_path] # get the handle for target dataset(table) + rst_data = h5f_dst.read_direct(np.zeros(h5f_dst.shape)) + return rst_data - def add_data(self, feature_name, dataset=None, cmd_log=None): + def add_data(self, feature_name, dataset, cmd_log=None): """ adding new feature into existing HDF5 file """ - dataType, h5f_path = lables_to_path(feature_name) - if dataType is not "attr": - h5f = h5py.File(self.h5f_path, 'a') + dataType, h5f_path = lables_to_path(feature_name, + dsXMLPath=self.dsXMLFile) + with h5py.File(self.h5f_path, 'a') as h5f: h5f.create_dataset(h5f_path, data=dataset) # store the cmd in log is possible if cmd_log is not None: h5f[h5f_path].attrs['log'] = str(cmd_log) - else: - raise ValueError("feature {} isn't valid".format(feature_name)) + h5f.flush() def get_cmdlog(self, feature_name): """ get cmd history used to generate the feature""" - dataType, h5f_path = lables_to_path(feature_name) - h5f = ht5py.File(self.h5f_path, 'r') - return h5f[h5f_path].attrs['log'] + dataType, h5f_path = lables_to_path(feature_name, + dsXMLPath=self.dsXMLFile) + with ht5py.File(self.h5f_path, 'a') as h5f: + cmd_logs = h5f[h5f_path].attrs['log'] + return cmd_logs From 6eb111dc7c112de63bddfcab06c5cef58111270e Mon Sep 17 00:00:00 2001 From: chen Date: Sun, 9 Oct 2016 19:01:38 -0400 Subject: [PATCH 265/412] add script convert ASCII table to HDF5 using H5Table --- processing/post/ascii2hdf5.py | 80 +++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 processing/post/ascii2hdf5.py diff --git a/processing/post/ascii2hdf5.py b/processing/post/ascii2hdf5.py new file mode 100644 index 000000000..c679d7741 --- /dev/null +++ b/processing/post/ascii2hdf5.py @@ -0,0 +1,80 @@ +#!/usr/bin/env python2.7 +# -*- coding: UTF-8 no BOM -*- + +# ------------------------------------------------------------------- # +# NOTE: # +# 1. Not all output is defined in the DS_HDF5.xml, please add new # +# new one to the system wide definition file # +# /lib/damask/DS_HDF5.xml # +# or specify your own when initializing HDF5 class # +# ------------------------------------------------------------------- # + +import os +import damask +from optparse import OptionParser + +scriptName = os.path.splitext(os.path.basename(__file__))[0] +scriptID = ' '.join([scriptName,damask.version]) + +# -------------------------------------------------------------------- +# MAIN +# -------------------------------------------------------------------- + +desp_msg = "Convert DAMASK ascii table to HDF5 file" +parser = OptionParser(option_class=damask.extendableOption, + usage='%prog options [file[s]]', + description = desp_msg, + version = scriptID) +parser.add_option('-D', '--DefinitionFile', + dest = 'storage definition file', + type = 'string', + metavar = 'string', + help = 'definition file for H5 data storage') +parser.add_option('-d','--debug', + dest = 'debug output toggle', + type = 'boolean', + metavar = 'boolean', + help = 'toggle on debug output') # not necessary for now + +parser.set_defaults(debug=False, + DefinitionFile='default') + +(options,filenames) = parser.parse_args() + +if options.DefinitionFile == 'default': + defFile = None +else: + defFile = options.DefinitionFile + +# ----- read in data using DAMASK ASCII table class ----- # +asciiTable = damask.ASCIItable(name=filenames, buffered=False) +asciiTable.head_read() +asciiTable.data_readArray() +incNum = int(asciiTable.data[asciiTable.label_index('inc'), 0]) +allData = np.copy(asciiTable.data) # deep copy all data, just to be safe +featuresDim = [labels_idx[i+1] - labels_idx[i] for i in xrange(len(labels)-1)] +featuresDim.append(fullTable.shape[1] - labels_idx[-1]) + +# ----- create a new HDF5 file and save the data -----# +# Will overwrite existing HDF5 file with the same name + +h5f = damask.H5Table(filenames.replace(".txt", ".h5"), + new_file=True, + dsXMLFile=defFile) +# adding increment number as root level attributes +h5f.add_attr('inc', incNum) +for fi in xrange(len(labels)): + featureName = labels[fi] + if featureName == 'inc': continue + # remove trouble maker "("" and ")" + if "(" in featureName: featureName = featureName.replace("(", "") + if ")" in featureName: featureName = featureName.replace(")", "") + featureIdx = labels_idx[fi] + featureDim = featuresDim[fi] + # grab the data hook + dataset = fullTable[:, featureIdx:featureIdx+featureDim] + # reshape tensor to 3x3 --> just make life slightly easier + if dataset.shape[1] == 9: + dataset = dataset.reshape((dataset.shape[0], 3, 3)) + # write out data + h5f.add_data(featureName, dataset) From e9c1068c99b988e0a6b8bd2d75c0147d528efcd9 Mon Sep 17 00:00:00 2001 From: chen Date: Sun, 9 Oct 2016 19:03:28 -0400 Subject: [PATCH 266/412] mimic other sub modules in DAMASK for H5Table --- lib/damask/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/damask/__init__.py b/lib/damask/__init__.py index 11ea24bc9..d1496a1b7 100644 --- a/lib/damask/__init__.py +++ b/lib/damask/__init__.py @@ -8,7 +8,7 @@ with open(os.path.join(os.path.dirname(__file__),'../../VERSION')) as f: from .environment import Environment # noqa from .asciitable import ASCIItable # noqa -from .h5table import H5Table +from .h5table import H5Table # noqa from .config import Material # noqa from .colormaps import Colormap, Color # noqa from .orientation import Quaternion, Rodrigues, Symmetry, Orientation # noqa From cc5e0721e01d63dc9828bcfeb9b4e1f0c74896d8 Mon Sep 17 00:00:00 2001 From: chen Date: Sun, 9 Oct 2016 19:06:24 -0400 Subject: [PATCH 267/412] coding style fix --- lib/damask/h5table.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/damask/h5table.py b/lib/damask/h5table.py index 978d2a564..35b8f841b 100644 --- a/lib/damask/h5table.py +++ b/lib/damask/h5table.py @@ -9,7 +9,6 @@ # ----------------------------------------------------------- # import os -import sys import h5py import numpy as np import xml.etree.cElementTree as ET @@ -31,7 +30,7 @@ except(NameError): # use simple function to mimic the singleton class in # C++/Java def lables_to_path(label, dsXMLPath=None): - """ read the xml definition file and return the path.""" + """read the xml definition file and return the path.""" if dsXMLPath is None: # use the default storage layout in DS_HDF5.xml if "h5table.pyc" in __file__: @@ -51,9 +50,6 @@ def lables_to_path(label, dsXMLPath=None): return (dataType, h5path) -# ----------------------- # -# H5Table interface class # -# ----------------------- # class H5Table(object): """ DESCRIPTION @@ -90,7 +86,7 @@ class H5Table(object): h5f['/'].attrs['description'] = msg def del_entry(self, feature_name): - """ delete entry in HDF5 table """ + """delete entry in HDF5 table""" dataType, h5f_path = lables_to_path(feature_name, dsXMLPath=self.dsXMLFile) with h5py.File(self.h5f_path, 'a') as h5f: @@ -111,7 +107,7 @@ class H5Table(object): h5f.flush() def get_data(self, feature_name=None): - """ extract dataset from HDF5 table and return it in a numpy array """ + """extract dataset from HDF5 table and return it in a numpy array""" dataType, h5f_path = lables_to_path(feature_name, dsXMLPath=self.dsXMLFile) with h5py.File(self.h5f_path, 'a') as h5f: @@ -120,7 +116,7 @@ class H5Table(object): return rst_data def add_data(self, feature_name, dataset, cmd_log=None): - """ adding new feature into existing HDF5 file """ + """adding new feature into existing HDF5 file""" dataType, h5f_path = lables_to_path(feature_name, dsXMLPath=self.dsXMLFile) with h5py.File(self.h5f_path, 'a') as h5f: @@ -131,7 +127,7 @@ class H5Table(object): h5f.flush() def get_cmdlog(self, feature_name): - """ get cmd history used to generate the feature""" + """get cmd history used to generate the feature""" dataType, h5f_path = lables_to_path(feature_name, dsXMLPath=self.dsXMLFile) with ht5py.File(self.h5f_path, 'a') as h5f: From 4dece54019d81186412438f071eda9386b193d08 Mon Sep 17 00:00:00 2001 From: chen Date: Sun, 9 Oct 2016 19:07:41 -0400 Subject: [PATCH 268/412] minor syntax error --- lib/damask/h5table.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/damask/h5table.py b/lib/damask/h5table.py index 35b8f841b..5e0a0a70a 100644 --- a/lib/damask/h5table.py +++ b/lib/damask/h5table.py @@ -51,6 +51,7 @@ def lables_to_path(label, dsXMLPath=None): class H5Table(object): + """ DESCRIPTION ----------- @@ -130,6 +131,6 @@ class H5Table(object): """get cmd history used to generate the feature""" dataType, h5f_path = lables_to_path(feature_name, dsXMLPath=self.dsXMLFile) - with ht5py.File(self.h5f_path, 'a') as h5f: + with h5py.File(self.h5f_path, 'a') as h5f: cmd_logs = h5f[h5f_path].attrs['log'] return cmd_logs From 280f8f7c2b84ac330db65dd1a28410bfcedbd611 Mon Sep 17 00:00:00 2001 From: chen Date: Sun, 9 Oct 2016 19:09:45 -0400 Subject: [PATCH 269/412] correct docstring according to PEP requirement --- lib/damask/h5table.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/damask/h5table.py b/lib/damask/h5table.py index 5e0a0a70a..a393c4805 100644 --- a/lib/damask/h5table.py +++ b/lib/damask/h5table.py @@ -51,8 +51,8 @@ def lables_to_path(label, dsXMLPath=None): class H5Table(object): + """Interface class for h5py - """ DESCRIPTION ----------- Interface/wrapper class for manipulating data in HDF5 with DAMASK @@ -76,6 +76,7 @@ class H5Table(object): that read the data only when its absolutely necessary. 2. The command line used to generate new feature is stored with each dataset as dataset attribute. + """ def __init__(self, h5f_path, new_file=False, dsXMLFile=None): From 6450cb3003e8be67e49b05e005dd63e04e0cf1ab Mon Sep 17 00:00:00 2001 From: chen Date: Sun, 9 Oct 2016 19:12:45 -0400 Subject: [PATCH 270/412] fix syntax error --- processing/post/ascii2hdf5.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/processing/post/ascii2hdf5.py b/processing/post/ascii2hdf5.py index c679d7741..4efd0bd06 100644 --- a/processing/post/ascii2hdf5.py +++ b/processing/post/ascii2hdf5.py @@ -11,6 +11,7 @@ import os import damask +import numpy as np from optparse import OptionParser scriptName = os.path.splitext(os.path.basename(__file__))[0] @@ -51,7 +52,9 @@ asciiTable = damask.ASCIItable(name=filenames, buffered=False) asciiTable.head_read() asciiTable.data_readArray() incNum = int(asciiTable.data[asciiTable.label_index('inc'), 0]) -allData = np.copy(asciiTable.data) # deep copy all data, just to be safe +fullTable = np.copy(asciiTable.data) # deep copy all data, just to be safe +labels = table.labels() +labels_idx = [table.label_index(label) for label in labels] featuresDim = [labels_idx[i+1] - labels_idx[i] for i in xrange(len(labels)-1)] featuresDim.append(fullTable.shape[1] - labels_idx[-1]) From 7278605004e409f93b8fd99f95cf40d7cd555d0f Mon Sep 17 00:00:00 2001 From: chen Date: Sun, 9 Oct 2016 19:13:44 -0400 Subject: [PATCH 271/412] fix naming error --- processing/post/ascii2hdf5.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/processing/post/ascii2hdf5.py b/processing/post/ascii2hdf5.py index 4efd0bd06..c142d8106 100644 --- a/processing/post/ascii2hdf5.py +++ b/processing/post/ascii2hdf5.py @@ -53,8 +53,8 @@ asciiTable.head_read() asciiTable.data_readArray() incNum = int(asciiTable.data[asciiTable.label_index('inc'), 0]) fullTable = np.copy(asciiTable.data) # deep copy all data, just to be safe -labels = table.labels() -labels_idx = [table.label_index(label) for label in labels] +labels = asciiTable.labels() +labels_idx = [asciiTable.label_index(label) for label in labels] featuresDim = [labels_idx[i+1] - labels_idx[i] for i in xrange(len(labels)-1)] featuresDim.append(fullTable.shape[1] - labels_idx[-1]) From 9b27c5749bd5a100b7139b2bf7fece2c196a4966 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 10 Oct 2016 09:23:58 +0200 Subject: [PATCH 272/412] should be executable --- processing/post/ascii2hdf5.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 processing/post/ascii2hdf5.py diff --git a/processing/post/ascii2hdf5.py b/processing/post/ascii2hdf5.py old mode 100644 new mode 100755 From ffcfe67c73b9c739bf00efbba4f433186c5f379d Mon Sep 17 00:00:00 2001 From: chen Date: Mon, 10 Oct 2016 09:46:11 -0400 Subject: [PATCH 273/412] remove debug output, fix name handling error --- processing/post/ascii2hdf5.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) mode change 100644 => 100755 processing/post/ascii2hdf5.py diff --git a/processing/post/ascii2hdf5.py b/processing/post/ascii2hdf5.py old mode 100644 new mode 100755 index c142d8106..e2f1622e0 --- a/processing/post/ascii2hdf5.py +++ b/processing/post/ascii2hdf5.py @@ -31,24 +31,20 @@ parser.add_option('-D', '--DefinitionFile', type = 'string', metavar = 'string', help = 'definition file for H5 data storage') -parser.add_option('-d','--debug', - dest = 'debug output toggle', - type = 'boolean', - metavar = 'boolean', - help = 'toggle on debug output') # not necessary for now -parser.set_defaults(debug=False, - DefinitionFile='default') +parser.set_defaults(DefinitionFile='default') (options,filenames) = parser.parse_args() +filename = filenames[0] + if options.DefinitionFile == 'default': defFile = None else: defFile = options.DefinitionFile # ----- read in data using DAMASK ASCII table class ----- # -asciiTable = damask.ASCIItable(name=filenames, buffered=False) +asciiTable = damask.ASCIItable(name=filename, buffered=False) asciiTable.head_read() asciiTable.data_readArray() incNum = int(asciiTable.data[asciiTable.label_index('inc'), 0]) @@ -61,7 +57,7 @@ featuresDim.append(fullTable.shape[1] - labels_idx[-1]) # ----- create a new HDF5 file and save the data -----# # Will overwrite existing HDF5 file with the same name -h5f = damask.H5Table(filenames.replace(".txt", ".h5"), +h5f = damask.H5Table(filename.replace(".txt", ".h5"), new_file=True, dsXMLFile=defFile) # adding increment number as root level attributes From 1b3d798746f9d06a8f0fdf090e841d474817e2c1 Mon Sep 17 00:00:00 2001 From: Test User Date: Tue, 11 Oct 2016 04:35:23 +0200 Subject: [PATCH 274/412] updated version information after successful test of v2.0.1-201-g7278605 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 7c90639ca..fa2ed41e2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-176-gde793b5 +v2.0.1-201-g7278605 From c311ac47ca74eddab55ba17d6ee0f9b5a9c258c2 Mon Sep 17 00:00:00 2001 From: chen Date: Wed, 12 Oct 2016 20:20:15 -0400 Subject: [PATCH 275/412] force using rectangular mesh Paraview cannot handle large number of polyvertices using xdmf, forcing a meshed structure to by pass the problem. --- lib/damask/DS_HDF5.xml | 177 ++++++++++++++++++---------------- lib/damask/h5table.py | 26 +++-- processing/post/ascii2hdf5.py | 54 +++++++++-- 3 files changed, 152 insertions(+), 105 deletions(-) diff --git a/lib/damask/DS_HDF5.xml b/lib/damask/DS_HDF5.xml index af3523bfb..1277ce8d2 100644 --- a/lib/damask/DS_HDF5.xml +++ b/lib/damask/DS_HDF5.xml @@ -1,5 +1,6 @@ + attr / @@ -12,174 +13,186 @@ / - + + + Scalar + /Geometry/Vx + Geometry + Vector along x define the spectral mesh + + + + Scalar + /Geometry/Vy + Geometry + Vector along y defines the spectral mesh + + + + Scalar + /Geometry/Vz + Geometry + Vector along z defines the spectral mesh + + - scalar - /ip - + Scalar + /Geometry/ip + Geometry - - scalar - /node - + Scalar + /Geometry/node + Geometry - - vector - /grain - + Scalar + /Geometry/grain + Geometry - - vector - /pos - + Vector + /Geometry/pos + Geometry - - integer - /elem - + Scalar + /Geometry/elem + Geometry - + - integer - /phase + Scalar + /Crystallite/phase Crystallite - - integer - /texture + Scalar + /Crystallite/texture Crystallite - - scalar - /volume + Scalar + /Crystallite/volume Crystallite - - vector - /orientation + Vector + /Crystallite/orientation Crystallite - - vector - /eulerangles + Vector + /Crystallite/eulerangles Crystallite Bunnge Euler angles in degrees - - vector - /grainrotation + Vector + /Crystallite/grainrotation Crystallite - - tensor - /f + Tensor + /Crystallite/f Crystallite deformation gradient (F) -

- tensor - /p + Tensor + /Crystallite/p Crystallite Pikola Kirkhoff stress -

+ + Tensor + /Crystallite/Cauchy + Crystallite + Cauchy stress tensor + + + + Tensor + /Crystallite/lnV + Crystallite + + + + + Scalar + /Crystallite/MisesCauchy + Crystallite + von Mises equivalent of Cauchy stress + + + + Scalar + /Crystallite/MiseslnV + Crystallite + left von Mises strain + + + - vector - /resistance_slip + Vector + /Constitutive/resistance_slip Constitutive - vector - /shearrate_slip + Vector + /Constitutive/shearrate_slip Constitutive - vector - /resolvedstress_slip + Vector + /Constitutive/resolvedstress_slip Constitutive - scalar - /totalshear + Scalar + /Constitutive/totalshear Constitutive - vector - /accumulatedshear_slip + Matrix + /Constitutive/accumulatedshear_slip Constitutive vector contains accumulated shear per slip system - - tensor - /Cauchy - Derived - Cauchy stress tensor - - - - tensor - /lnV - Derived - - - - - scalar - /MisesCauchy - Derived - von Mises equivalent of Cauchy stress - - - - scalar - /MiseslnV - Derived - left von Mises strain - +
\ No newline at end of file diff --git a/lib/damask/h5table.py b/lib/damask/h5table.py index a393c4805..f0c3fd72f 100644 --- a/lib/damask/h5table.py +++ b/lib/damask/h5table.py @@ -23,12 +23,6 @@ except(NameError): unicode=str -# ------------------------------------------------------- # -# Singleton class for converting feature name to H5F path # -# ------------------------------------------------------- # -# NOTE: -# use simple function to mimic the singleton class in -# C++/Java def lables_to_path(label, dsXMLPath=None): """read the xml definition file and return the path.""" if dsXMLPath is None: @@ -41,23 +35,26 @@ def lables_to_path(label, dsXMLPath=None): "DS_HDF5.xml") # This current implementation requires that all variables # stay under the root node, the nesting is defined through the - # h5path. This could be improved easily with more advanced parsing - # using ET interface, but for now I can not see the benefits in doing - # so. + # h5path. + # Allow new derived data to be put under the root tree = ET.parse(dsXMLPath) - dataType = tree.find('{}/type'.format(label)).text - h5path = tree.find('{}/h5path'.format(label)).text + try: + dataType = tree.find('{}/type'.format(label)).text + h5path = tree.find('{}/h5path'.format(label)).text + except: + dataType = "Scalar" + h5path = "/{}".format(label) # just put it under root return (dataType, h5path) class H5Table(object): - """Interface class for h5py + """light weight interface class for h5py DESCRIPTION ----------- Interface/wrapper class for manipulating data in HDF5 with DAMASK specialized data structure. - -->Minimal API design. + -->try to maintain a minimal API design. PARAMETERS ---------- h5f_path: str @@ -114,7 +111,8 @@ class H5Table(object): dsXMLPath=self.dsXMLFile) with h5py.File(self.h5f_path, 'a') as h5f: h5f_dst = h5f[h5f_path] # get the handle for target dataset(table) - rst_data = h5f_dst.read_direct(np.zeros(h5f_dst.shape)) + rst_data = np.zeros(h5f_dst.shape) + h5f_dst.read_direct(rst_data) return rst_data def add_data(self, feature_name, dataset, cmd_log=None): diff --git a/processing/post/ascii2hdf5.py b/processing/post/ascii2hdf5.py index e2f1622e0..d8c9daaab 100755 --- a/processing/post/ascii2hdf5.py +++ b/processing/post/ascii2hdf5.py @@ -7,6 +7,11 @@ # new one to the system wide definition file # # /lib/damask/DS_HDF5.xml # # or specify your own when initializing HDF5 class # +# 2. Somehow the point cloud structure cannot be properly handled # +# by Xdmf, which is a descriptive wrapper for visualizing HDF5 # +# using Paraview. The current solution is using cell structured # +# HDF5 so that Xdmf can describe the data shape as a rectangular # +# mesh rather than polyvertex. # # ------------------------------------------------------------------- # import os @@ -14,13 +19,24 @@ import damask import numpy as np from optparse import OptionParser + scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptID = ' '.join([scriptName,damask.version]) -# -------------------------------------------------------------------- -# MAIN -# -------------------------------------------------------------------- +# ----- helper function ----- # +def get_rectMshVectors(xyz_array, posNum): + """take in a xyz array from rectangular mesh and figure out Vx, Vy, Vz""" + # need some improvement, and only works for rectangular grid + v = sorted(list(set(xyz_array[:, posNum]))) + v_interval = (v[2]+v[1])/2.0 - (v[1]+v[0])/2.0 + v_start = (v[1]+v[0])/2.0 - v_interval + v_end = (v[-1]+v[-2])/2.0 + v_interval + V = np.linspace(v_start, v_end, len(v)+1) + return V + + +# ----- MAIN ---- # desp_msg = "Convert DAMASK ascii table to HDF5 file" parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', @@ -31,8 +47,14 @@ parser.add_option('-D', '--DefinitionFile', type = 'string', metavar = 'string', help = 'definition file for H5 data storage') +parser.add_option('-p', + '--pos', '--position', + dest = 'pos', + type = 'string', metavar = 'string', + help = 'label of coordinates [%default]') -parser.set_defaults(DefinitionFile='default') +parser.set_defaults(DefinitionFile='default', + pos='pos') (options,filenames) = parser.parse_args() @@ -54,17 +76,31 @@ labels_idx = [asciiTable.label_index(label) for label in labels] featuresDim = [labels_idx[i+1] - labels_idx[i] for i in xrange(len(labels)-1)] featuresDim.append(fullTable.shape[1] - labels_idx[-1]) +# ----- figure out size and grid ----- # +pos_idx = asciiTable.label_index('pos') +xyz_array = asciiTable.data[:, pos_idx:pos_idx+3] +Vx = get_rectMshVectors(xyz_array, 0) +Vy = get_rectMshVectors(xyz_array, 1) +Vz = get_rectMshVectors(xyz_array, 2) +# use the dimension of the rectangular grid to reshape all other data +mshGridDim = (len(Vx)-1, len(Vy)-1, len(Vz)-1) + # ----- create a new HDF5 file and save the data -----# # Will overwrite existing HDF5 file with the same name - h5f = damask.H5Table(filename.replace(".txt", ".h5"), new_file=True, dsXMLFile=defFile) # adding increment number as root level attributes h5f.add_attr('inc', incNum) +# add the mesh grid data now +h5f.add_data("Vx", Vx) +h5f.add_data("Vy", Vy) +h5f.add_data("Vz", Vz) + +# add the rest of data from table for fi in xrange(len(labels)): featureName = labels[fi] - if featureName == 'inc': continue + if 'inc' in featureName: continue # remove trouble maker "("" and ")" if "(" in featureName: featureName = featureName.replace("(", "") if ")" in featureName: featureName = featureName.replace(")", "") @@ -72,8 +108,8 @@ for fi in xrange(len(labels)): featureDim = featuresDim[fi] # grab the data hook dataset = fullTable[:, featureIdx:featureIdx+featureDim] - # reshape tensor to 3x3 --> just make life slightly easier - if dataset.shape[1] == 9: - dataset = dataset.reshape((dataset.shape[0], 3, 3)) + # mapping 2D data onto a 3D rectangular mesh to get 4D data + dataset = dataset.reshape((mshGridDim[0], mshGridDim[1], mshGridDim[2], + dataset.shape[1])) # write out data h5f.add_data(featureName, dataset) From ace06fd0e121c0a008cd1ae4d10942da682c554a Mon Sep 17 00:00:00 2001 From: chen Date: Thu, 13 Oct 2016 11:33:38 -0400 Subject: [PATCH 276/412] skip dulplicated columns in ascii table also add a todo list at the top --- processing/post/ascii2hdf5.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/processing/post/ascii2hdf5.py b/processing/post/ascii2hdf5.py index d8c9daaab..990bddf23 100755 --- a/processing/post/ascii2hdf5.py +++ b/processing/post/ascii2hdf5.py @@ -12,6 +12,13 @@ # using Paraview. The current solution is using cell structured # # HDF5 so that Xdmf can describe the data shape as a rectangular # # mesh rather than polyvertex. # +# TODO: # +# 1. remove the ._tmp file, basically need a way to # +# just load data from ASCII table. # +# 2. a progress monitor when transferring data from ASCII table # +# to HDF5. # +# 3. a more flexible way handle the data structure rather than a # +# xml file. # # ------------------------------------------------------------------- # import os @@ -98,9 +105,11 @@ h5f.add_data("Vy", Vy) h5f.add_data("Vz", Vz) # add the rest of data from table +addedLabels = ['inc'] for fi in xrange(len(labels)): featureName = labels[fi] - if 'inc' in featureName: continue + # skip increment and duplicated columns in the ASCII table + if featureName in addedLabels: continue # remove trouble maker "("" and ")" if "(" in featureName: featureName = featureName.replace("(", "") if ")" in featureName: featureName = featureName.replace(")", "") @@ -109,7 +118,11 @@ for fi in xrange(len(labels)): # grab the data hook dataset = fullTable[:, featureIdx:featureIdx+featureDim] # mapping 2D data onto a 3D rectangular mesh to get 4D data - dataset = dataset.reshape((mshGridDim[0], mshGridDim[1], mshGridDim[2], + # In paraview, the data is mapped as: + # --> len(z), len(y), len(x), size(data) + dataset = dataset.reshape((mshGridDim[2], mshGridDim[1], mshGridDim[0], dataset.shape[1])) # write out data h5f.add_data(featureName, dataset) + # write down the processed label + addedLabels.append(featureName) From ec59dfeec00188e088bd2af7d76f1dcfd76c8798 Mon Sep 17 00:00:00 2001 From: chen Date: Thu, 13 Oct 2016 13:22:37 -0400 Subject: [PATCH 277/412] do not reshape data since xdmf is not stable right now, there is no need to reshape the data to tie it to the mesh. comment them out for future reference --- processing/post/ascii2hdf5.py | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/processing/post/ascii2hdf5.py b/processing/post/ascii2hdf5.py index 990bddf23..40360ace8 100755 --- a/processing/post/ascii2hdf5.py +++ b/processing/post/ascii2hdf5.py @@ -90,11 +90,16 @@ Vx = get_rectMshVectors(xyz_array, 0) Vy = get_rectMshVectors(xyz_array, 1) Vz = get_rectMshVectors(xyz_array, 2) # use the dimension of the rectangular grid to reshape all other data -mshGridDim = (len(Vx)-1, len(Vy)-1, len(Vz)-1) +mshGridDim = [len(Vx)-1, len(Vy)-1, len(Vz)-1] # ----- create a new HDF5 file and save the data -----# -# Will overwrite existing HDF5 file with the same name -h5f = damask.H5Table(filename.replace(".txt", ".h5"), +# force remove existing HDF5 file +h5fName = filename.replace(".txt", ".h5") +try: + os.remove(h5fName) +except OSError: + pass +h5f = damask.H5Table(h5fName, new_file=True, dsXMLFile=defFile) # adding increment number as root level attributes @@ -105,24 +110,26 @@ h5f.add_data("Vy", Vy) h5f.add_data("Vz", Vz) # add the rest of data from table -addedLabels = ['inc'] +labelsProcessed = ['inc'] for fi in xrange(len(labels)): featureName = labels[fi] - # skip increment and duplicated columns in the ASCII table - if featureName in addedLabels: continue - # remove trouble maker "("" and ")" + # remove trouble maker "("" and ")" from label/feature name if "(" in featureName: featureName = featureName.replace("(", "") if ")" in featureName: featureName = featureName.replace(")", "") + # skip increment and duplicated columns in the ASCII table + if featureName in labelsProcessed: continue + featureIdx = labels_idx[fi] featureDim = featuresDim[fi] # grab the data hook dataset = fullTable[:, featureIdx:featureIdx+featureDim] # mapping 2D data onto a 3D rectangular mesh to get 4D data - # In paraview, the data is mapped as: + # WARNING: In paraview, the data for a recmesh is mapped as: # --> len(z), len(y), len(x), size(data) - dataset = dataset.reshape((mshGridDim[2], mshGridDim[1], mshGridDim[0], - dataset.shape[1])) + # dataset = dataset.reshape((mshGridDim[0], mshGridDim[1], mshGridDim[2], + # dataset.shape[1])) # write out data + print "adding {}...".format(featureName) h5f.add_data(featureName, dataset) # write down the processed label - addedLabels.append(featureName) + labelsProcessed.append(featureName) From 8cdc7c0b106ecfcd5514aeabc591f85327db02a9 Mon Sep 17 00:00:00 2001 From: chen Date: Thu, 13 Oct 2016 13:41:04 -0400 Subject: [PATCH 278/412] add xdmf wrapper generator for HDF5 Not recommended for large dataset due to potential memory leak currently plaguing Xdmf ilbrary. --- processing/post/h5_addXdmfWapper.py | 127 ++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100755 processing/post/h5_addXdmfWapper.py diff --git a/processing/post/h5_addXdmfWapper.py b/processing/post/h5_addXdmfWapper.py new file mode 100755 index 000000000..2ede3d80f --- /dev/null +++ b/processing/post/h5_addXdmfWapper.py @@ -0,0 +1,127 @@ +#!/usr/bin/env python2.7 +# -*- coding: UTF-8 no BOM -*- + +# ------------------------------------------------------------------- # +# NOTE: # +# 1. Current Xdmf rendering in Paraview has some memory issue where # +# large number of polyvertices will cause segmentation fault. By # +# default, paraview output a cell based xdmf description, which # +# is working for small and medium mesh (<10,000) points. Hence a # +# rectangular mesh is used as the de facto Geometry description # +# here. # +# 2. Due to the unstable state Xdmf, it is safer to use port data # +# to VTR rather than using xdmf as interpretive layer for data # +# visualization. # +# ------------------------------------------------------------------- # + + +import damask +import h5py +import xml.etree.cElementTree as ET +from xml.dom import minidom +from damask.h5table import lables_to_path + +scriptName = os.path.splitext(os.path.basename(__file__))[0] +scriptID = ' '.join([scriptName,damask.version]) + + +# ----- HELPER FUNCTIONS -----# +def addTopLvlCmt(xmlstr, topLevelCmt): + """add top level comment to string from ET""" + # a quick hack to add the top level comment to XML file + # --> somehow Elementtree does not provide this functionality + # --> by default + strList = xmlstr.split("\n") + strList[0] += "\n"+topLevelCmt + return "\n".join(strList) + + +# -------------------------------------------------------------------- +# MAIN +# -------------------------------------------------------------------- + +msg = 'generate Xdmf wrapper for HDF5 file.' +parser = OptionParser(option_class=damask.extendableOption, + usage='%prog options [file[s]]', + description = msg, + version = scriptID) + +(options, filenames) = parser.parse_args() + +h5f = filenames[0] + +# ----- parse HDF5 file ----- # +h5f_dataDim = {} +h5f_dataPath = {} +h5f_dataType = {} +with h5py.File(h5f, 'a') as f: + labels = f.keys() + labels += f['/Constitutive'].keys() + labels += f['/Crystallite'].keys() + labels += ['Vx', 'Vy', "Vz"] + # remove group names as they do not contain real data + # TODO: use h5py/H5table API to detect dataset name to + # avoid necessary name space pruning. + labels.remove('Constitutive') + labels.remove('Crystallite') + labels.remove('Geometry') + # loop through remaining labels + for label in labels: + dataType, h5Path = lables_to_path(label) + h5f_dataType[label] = dataType + h5f_dataDim[label] = " ".join(map(str,f[h5Path].shape)) + h5f_dataPath[label] = h5Paths + +# ----- constructing xdmf elements ----- # +root = ET.Element("Xdmf", version='3.3') +root.set('xmlns:xi', "http://www.w3.org/2001/XInclude") +root.append(ET.Comment('Generated Xdmf wapper for DAMASH H5 output')) + +# usually there should only be ONE domain +domain = ET.SubElement(root, 'Domain', + Name=h5f_base.split(".")[0]) + +# use global topology through reference +grid = ET.SubElement(domain, 'Grid', GridType="Uniform") +# geometry section +geometry = ET.SubElement(grid, 'Geometry', GeometryType="VXVYVZ") +for vector in ["Vz", "Vy", "Vx"]: + dataitem = ET.SubElement(geometry, "DataItem", + DataType="Float", + Dimensions=h5f_dataDim[vector], + Name=vector, + Format="HDF") + dataitem.text = h5f_base.split("/")[-1] + ":{}".format(h5f_dataPath[vector]) +# topology section +# TODO: support for other format based on given option +meshDim = [h5f_dataDim["Vz"], h5f_dataDim["Vy"], h5f_dataDim["Vx"]] +topology = ET.SubElement(grid, 'Topology', + TopologyType="3DRectMesh", + Dimensions=" ".join(map(str, meshDim))) + +# attributes section +# Question: how to properly handle data mapping for multiphase situations +labelsProcessed = ['Vx', 'Vy', 'Vz'] +# walk through each attributes +for label in labels: + if label in labelsProcessed: continue + print "adding {}...".format(label) + attr = ET.SubElement(grid, 'Attribute', + Name=label, + Type="None", + Center="Cell") + dataitem = ET.SubElement(attr, 'DataItem', + Name=label, + Format='HDF', + Dimensions=h5f_dataDim[label]) + dataitem.text = h5f_base + ":" + h5f_dataPath[label] + # update progress list + labelsProcessed.append(label) + + +# pretty print the xdmf(xml) file content +xmlstr = minidom.parseString(ET.tostring(root)).toprettyxml(indent="\t") +xmlstr = addTopLvlCmt(xmlstr, '') +# write str to file through native python API +with open(h5f.replace(".h5", ".xmf"), 'w') as f: + f.write(xmlstr) From 9ac3f564c8c16a4ab2af64537bfede5bd2d7ffb4 Mon Sep 17 00:00:00 2001 From: chen Date: Thu, 13 Oct 2016 13:45:25 -0400 Subject: [PATCH 279/412] syntax fix --- processing/post/h5_addXdmfWapper.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/processing/post/h5_addXdmfWapper.py b/processing/post/h5_addXdmfWapper.py index 2ede3d80f..2f213ba84 100755 --- a/processing/post/h5_addXdmfWapper.py +++ b/processing/post/h5_addXdmfWapper.py @@ -15,9 +15,11 @@ # ------------------------------------------------------------------- # +import os import damask import h5py import xml.etree.cElementTree as ET +from optparse import OptionParser from xml.dom import minidom from damask.h5table import lables_to_path @@ -49,6 +51,7 @@ parser = OptionParser(option_class=damask.extendableOption, (options, filenames) = parser.parse_args() h5f = filenames[0] +h5f_base = h5f.split("/")[-1] # ----- parse HDF5 file ----- # h5f_dataDim = {} @@ -70,7 +73,7 @@ with h5py.File(h5f, 'a') as f: dataType, h5Path = lables_to_path(label) h5f_dataType[label] = dataType h5f_dataDim[label] = " ".join(map(str,f[h5Path].shape)) - h5f_dataPath[label] = h5Paths + h5f_dataPath[label] = h5Path # ----- constructing xdmf elements ----- # root = ET.Element("Xdmf", version='3.3') From 75149cc0cd88c5510a915c4e7dda6aee09387380 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 14 Oct 2016 07:04:46 +0200 Subject: [PATCH 280/412] h5py is not available on IronPython (Abaqus python environment) --- lib/damask/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/damask/__init__.py b/lib/damask/__init__.py index d1496a1b7..c71d50a94 100644 --- a/lib/damask/__init__.py +++ b/lib/damask/__init__.py @@ -8,7 +8,10 @@ with open(os.path.join(os.path.dirname(__file__),'../../VERSION')) as f: from .environment import Environment # noqa from .asciitable import ASCIItable # noqa -from .h5table import H5Table # noqa +try: + from .h5table import H5Table # noqa +except ImportError: + print("h5py module not found") from .config import Material # noqa from .colormaps import Colormap, Color # noqa from .orientation import Quaternion, Rodrigues, Symmetry, Orientation # noqa From 07d9ef9ba120b29a71e6407da64575e3e2dbb5d5 Mon Sep 17 00:00:00 2001 From: chen Date: Fri, 14 Oct 2016 10:41:35 -0400 Subject: [PATCH 281/412] change indentation to 4 sapces PEP8 checking suggestions --- lib/damask/h5table.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/damask/h5table.py b/lib/damask/h5table.py index f0c3fd72f..94f3421ae 100644 --- a/lib/damask/h5table.py +++ b/lib/damask/h5table.py @@ -18,9 +18,9 @@ import xml.etree.cElementTree as ET # on Python 2&3 # # ---------------------------------------------------------------- # try: - test=isinstance('test', unicode) + test = isinstance('test', unicode) except(NameError): - unicode=str + unicode = str def lables_to_path(label, dsXMLPath=None): From 353b5b6994c30fcbb91790cd0b5758ea389cd045 Mon Sep 17 00:00:00 2001 From: chen Date: Fri, 14 Oct 2016 10:42:03 -0400 Subject: [PATCH 282/412] avoid doctring as argument --- processing/post/vtk_addRectilinearGridData.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/processing/post/vtk_addRectilinearGridData.py b/processing/post/vtk_addRectilinearGridData.py index 78d599f0b..4848e0efc 100755 --- a/processing/post/vtk_addRectilinearGridData.py +++ b/processing/post/vtk_addRectilinearGridData.py @@ -6,6 +6,7 @@ import damask from vtk.util import numpy_support from collections import defaultdict from optparse import OptionParser +from damask.h5table import lables_to_path scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptID = ' '.join([scriptName,damask.version]) @@ -14,10 +15,12 @@ scriptID = ' '.join([scriptName,damask.version]) # MAIN # -------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ -Add scalars, vectors, and/or an RGB tuple from an ASCIItable to existing VTK rectilinear grid (.vtr/.vtk). - -""", version = scriptID) +msg = "Add scalars, vectors, and/or an RGB tuple from" +msg += "an ASCIItable to existing VTK rectilinear grid (.vtr/.vtk)." +parser = OptionParser(option_class=damask.extendableOption, + usage='%prog options [file[s]]', + description = msg, + version = scriptID) parser.add_option( '--vtk', dest = 'vtk', From 81ada5ffde06456c62b73a3dd6e421ec28be8c83 Mon Sep 17 00:00:00 2001 From: Test User Date: Fri, 14 Oct 2016 16:42:18 +0200 Subject: [PATCH 283/412] updated version information after successful test of v2.0.1-213-g75149cc --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index fa2ed41e2..da01b9df1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-201-g7278605 +v2.0.1-213-g75149cc From e5e2eef375ef619a8f98678c4e7813e8726fa0d2 Mon Sep 17 00:00:00 2001 From: chen Date: Fri, 14 Oct 2016 10:45:42 -0400 Subject: [PATCH 284/412] add script generate vtr file from HDF5 following "let-it-fail" design --- processing/post/h5_vtkRectilinearGrid.py | 135 +++++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100755 processing/post/h5_vtkRectilinearGrid.py diff --git a/processing/post/h5_vtkRectilinearGrid.py b/processing/post/h5_vtkRectilinearGrid.py new file mode 100755 index 000000000..e8a615986 --- /dev/null +++ b/processing/post/h5_vtkRectilinearGrid.py @@ -0,0 +1,135 @@ +#!/usr/bin/env python2.7 +# -*- coding: UTF-8 no BOM -*- + +# ------------------------------------------------------------------ # +# NOTE: # +# 1. It might be a good idea to separate IO and calculation. # +# 2. Some of the calculation could be useful in other situations, # +# why not build a math_util, or math_sup module that contains # +# all the useful functions. # +# ------------------------------------------------------------------ # + +import os +import vtk +import numpy as np +import damask +from optparse import OptionParser + +scriptName = os.path.splitext(os.path.basename(__file__))[0] +scriptID = ' '.join([scriptName, damask.version]) + + +# ----- HELPER FUNCTION ----- # +def getMeshFromXYZ(xyzArray, mode): + """calc Vx,Vy,Vz vectors for vtk rectangular mesh""" + # NOTE: + # --> np.unique will automatically sort the list + # --> although not exactly n(1), but since mesh dimension should + # small anyway, so this is still light weight. + dim = xyzArray.shape[1] # 2D:2, 3D:3 + coords = [np.unique(xyzArray[:, i]) for i in xrange(dim)] + + if mode == 'cell': + # since x, y, z might now have the same number of elements, + # we have to deal with them individually + for ri in xrange(dim): + vctr_pt = coords[ri] + vctr_cell = np.empty(len(vctr_pt)+1) + # calculate first and last end point + vctr_cell[0] = vctr_pt[0] - 0.5*abs(vctr_pt[1] - vctr_pt[0]) + vctr_cell[-1] = vctr_pt[-1] + 0.5*abs(vctr_pt[-2] - vctr_pt[-1]) + for cj in xrange(1, len(vctr_cell)-1): + vctr_cell[cj] = 0.5*(vctr_pt[cj-1] + vctr_pt[cj]) + # update the coords + coords[ri] = vctr_cell + + if dim < 3: + coords.append([0]) # expand to a 3D with 0 for z + + # auxiliary description + grid = np.array(map(len, coords), 'i') + N = grid.prod() if mode == 'point' else (grid-1).prod() + return coords, grid, N + +# -------------------------------------------------------------------- +# MAIN +# -------------------------------------------------------------------- + +msg = "Create regular voxel grid from points in an ASCIItable." +parser = OptionParser(option_class=damask.extendableOption, + usage='%prog options [file[s]]', + description=msg, + version=scriptID) + +parser.add_option('-m', + '--mode', + dest='mode', + metavar='string', + type='choice', choices=['cell', 'point'], + help='cell-centered or point-centered coordinates') +parser.add_option('-p', + '--pos', '--position', + dest='pos', + type='string', metavar='string', + help='label of coordinates [%default]') + +parser.set_defaults(mode='cell', + pos='pos') + +(options, filenames) = parser.parse_args() + +# ----- loop over input files ----- # +for name in filenames: + try: + h5f = damask.H5Table(name, new_file=False) + except: + continue + damask.util.report(scriptName, name) + + # ----- read xyzArray from HDF5 file ----- # + xyzArray = h5f.get_data(options.pos) + + # ----- figure out size and grid ----- # + coords, grid, N = getMeshFromXYZ(xyzArray, options.mode) + + # ----- process data ----- # + rGrid = vtk.vtkRectilinearGrid() + # WARNING: list expansion does not work here as these are + # just pointers for a vtk instance. Simply put, + # DON't USE + # [] * + coordArray = [vtk.vtkDoubleArray(), + vtk.vtkDoubleArray(), + vtk.vtkDoubleArray()] + + rGrid.SetDimensions(*grid) + for i, points in enumerate(coords): + for point in points: + coordArray[i].InsertNextValue(point) + + rGrid.SetXCoordinates(coordArray[0]) + rGrid.SetYCoordinates(coordArray[1]) + rGrid.SetZCoordinates(coordArray[2]) + + # ----- output result ----- # + dirPath = os.path.split(name)[0] + if name: + writer = vtk.vtkXMLRectilinearGridWriter() + writer.SetCompressorTypeToZLib() + writer.SetDataModeToBinary() + # getting the name is a little bit tricky + vtkFileName = os.path.splitext(os.path.split(name)[1])[0] + vtkFileName += '_{}({})'.format(options.pos, options.mode) + vtkFileName += '.' + writer.GetDefaultFileExtension() + writer.SetFileName(os.path.join(dirPath, vtkFileName)) + else: + writer = vtk.vtkDataSetWriter() + writer.SetHeader('# powered by '+scriptID) + writer.WriteToOutputStringOn() + + if vtk.VTK_MAJOR_VERSION <= 5: + writer.SetInput(rGrid) + else: + writer.SetInputData(rGrid) + + writer.Write() From 2f2490e784d453b39c1c92200fdf64324c862764 Mon Sep 17 00:00:00 2001 From: chen Date: Fri, 14 Oct 2016 10:48:08 -0400 Subject: [PATCH 285/412] remove unused import --- processing/post/vtk_addRectilinearGridData.py | 1 - 1 file changed, 1 deletion(-) diff --git a/processing/post/vtk_addRectilinearGridData.py b/processing/post/vtk_addRectilinearGridData.py index 4848e0efc..4c068b19d 100755 --- a/processing/post/vtk_addRectilinearGridData.py +++ b/processing/post/vtk_addRectilinearGridData.py @@ -6,7 +6,6 @@ import damask from vtk.util import numpy_support from collections import defaultdict from optparse import OptionParser -from damask.h5table import lables_to_path scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptID = ' '.join([scriptName,damask.version]) From 87b857d3079eeb41bcf391ea03ca45a25ec65c00 Mon Sep 17 00:00:00 2001 From: chen Date: Fri, 14 Oct 2016 12:05:36 -0400 Subject: [PATCH 286/412] update some comments --- lib/damask/h5table.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/damask/h5table.py b/lib/damask/h5table.py index 94f3421ae..7b987fad4 100644 --- a/lib/damask/h5table.py +++ b/lib/damask/h5table.py @@ -63,7 +63,7 @@ class H5Table(object): ------ del_entry() -- Force delete attributes/group/datasets (Dangerous) get_attr() -- Return attributes if possible - add_attr() -- Add NEW attributes to dataset/group (please delete old first!) + add_attr() -- Add NEW attributes to dataset/group (no force overwrite) get_data() -- Retrieve data in numpy.ndarray add_data() -- Add dataset to H5 file get_cmdlog() -- Return the command used to generate the data if possible. From 1f01dce8626a97987f0d48a1bacfc1ec43018981 Mon Sep 17 00:00:00 2001 From: chen Date: Fri, 14 Oct 2016 12:06:09 -0400 Subject: [PATCH 287/412] use 4 space indentation --- processing/post/ascii2hdf5.py | 93 ++++++++++++++++++----------------- 1 file changed, 49 insertions(+), 44 deletions(-) diff --git a/processing/post/ascii2hdf5.py b/processing/post/ascii2hdf5.py index 40360ace8..5442cd53b 100755 --- a/processing/post/ascii2hdf5.py +++ b/processing/post/ascii2hdf5.py @@ -33,44 +33,44 @@ scriptID = ' '.join([scriptName,damask.version]) # ----- helper function ----- # def get_rectMshVectors(xyz_array, posNum): - """take in a xyz array from rectangular mesh and figure out Vx, Vy, Vz""" - # need some improvement, and only works for rectangular grid - v = sorted(list(set(xyz_array[:, posNum]))) - v_interval = (v[2]+v[1])/2.0 - (v[1]+v[0])/2.0 - v_start = (v[1]+v[0])/2.0 - v_interval - v_end = (v[-1]+v[-2])/2.0 + v_interval - V = np.linspace(v_start, v_end, len(v)+1) - return V + """take in a xyz array from rectangular mesh and figure out Vx, Vy, Vz""" + # need some improvement, and only works for rectangular grid + v = sorted(list(set(xyz_array[:, posNum]))) + v_interval = (v[2]+v[1])/2.0 - (v[1]+v[0])/2.0 + v_start = (v[1]+v[0])/2.0 - v_interval + v_end = (v[-1]+v[-2])/2.0 + v_interval + V = np.linspace(v_start, v_end, len(v)+1) + return V # ----- MAIN ---- # desp_msg = "Convert DAMASK ascii table to HDF5 file" parser = OptionParser(option_class=damask.extendableOption, - usage='%prog options [file[s]]', - description = desp_msg, - version = scriptID) + usage='%prog options [file[s]]', + description = desp_msg, + version = scriptID) parser.add_option('-D', '--DefinitionFile', - dest = 'storage definition file', - type = 'string', - metavar = 'string', - help = 'definition file for H5 data storage') + dest = 'storage definition file', + type = 'string', + metavar = 'string', + help = 'definition file for H5 data storage') parser.add_option('-p', - '--pos', '--position', - dest = 'pos', - type = 'string', metavar = 'string', - help = 'label of coordinates [%default]') + '--pos', '--position', + dest = 'pos', + type = 'string', metavar = 'string', + help = 'label of coordinates [%default]') parser.set_defaults(DefinitionFile='default', - pos='pos') + pos='pos') (options,filenames) = parser.parse_args() filename = filenames[0] if options.DefinitionFile == 'default': - defFile = None + defFile = None else: - defFile = options.DefinitionFile + defFile = options.DefinitionFile # ----- read in data using DAMASK ASCII table class ----- # asciiTable = damask.ASCIItable(name=filename, buffered=False) @@ -96,9 +96,9 @@ mshGridDim = [len(Vx)-1, len(Vy)-1, len(Vz)-1] # force remove existing HDF5 file h5fName = filename.replace(".txt", ".h5") try: - os.remove(h5fName) + os.remove(h5fName) except OSError: - pass + pass h5f = damask.H5Table(h5fName, new_file=True, dsXMLFile=defFile) @@ -112,24 +112,29 @@ h5f.add_data("Vz", Vz) # add the rest of data from table labelsProcessed = ['inc'] for fi in xrange(len(labels)): - featureName = labels[fi] - # remove trouble maker "("" and ")" from label/feature name - if "(" in featureName: featureName = featureName.replace("(", "") - if ")" in featureName: featureName = featureName.replace(")", "") - # skip increment and duplicated columns in the ASCII table - if featureName in labelsProcessed: continue + featureName = labels[fi] + # remove trouble maker "("" and ")" from label/feature name + if "(" in featureName: + featureName = featureName.replace("(", "") + if ")" in featureName: + featureName = featureName.replace(")", "") + # skip increment and duplicated columns in the ASCII table + if featureName in labelsProcessed: + continue - featureIdx = labels_idx[fi] - featureDim = featuresDim[fi] - # grab the data hook - dataset = fullTable[:, featureIdx:featureIdx+featureDim] - # mapping 2D data onto a 3D rectangular mesh to get 4D data - # WARNING: In paraview, the data for a recmesh is mapped as: - # --> len(z), len(y), len(x), size(data) - # dataset = dataset.reshape((mshGridDim[0], mshGridDim[1], mshGridDim[2], - # dataset.shape[1])) - # write out data - print "adding {}...".format(featureName) - h5f.add_data(featureName, dataset) - # write down the processed label - labelsProcessed.append(featureName) + featureIdx = labels_idx[fi] + featureDim = featuresDim[fi] + # grab the data hook + dataset = fullTable[:, featureIdx:featureIdx+featureDim] + # mapping 2D data onto a 3D rectangular mesh to get 4D data + # WARNING: In paraview, the data for a recmesh is mapped as: + # --> len(z), len(y), len(x), size(data) + # dataset = dataset.reshape((mshGridDim[0], + # mshGridDim[1], + # mshGridDim[2], + # dataset.shape[1])) + # write out data + print "adding {}...".format(featureName) + h5f.add_data(featureName, dataset) + # write down the processed label + labelsProcessed.append(featureName) From 33de9cf2b98a41af0a07e46e7631c5ab49bb66fe Mon Sep 17 00:00:00 2001 From: chen Date: Fri, 14 Oct 2016 12:06:59 -0400 Subject: [PATCH 288/412] script for adding data from HDF5 to vtk file --- .../post/h5_vtkAddRectilinearGridData.py | 191 ++++++++++++++++++ 1 file changed, 191 insertions(+) create mode 100755 processing/post/h5_vtkAddRectilinearGridData.py diff --git a/processing/post/h5_vtkAddRectilinearGridData.py b/processing/post/h5_vtkAddRectilinearGridData.py new file mode 100755 index 000000000..1c0492f53 --- /dev/null +++ b/processing/post/h5_vtkAddRectilinearGridData.py @@ -0,0 +1,191 @@ +#!/usr/bin/env python2.7 +# -*- coding: UTF-8 no BOM -*- + +import os +import vtk +import damask +from vtk.util import numpy_support +from optparse import OptionParser + +scriptName = os.path.splitext(os.path.basename(__file__))[0] +scriptID = ' '.join([scriptName, damask.version]) + + +# -------------------------------------------------------------------- +# MAIN +# -------------------------------------------------------------------- +msg = "Add scalars, vectors, and/or an RGB tuple from" +msg += "an HDF5 to existing VTK rectilinear grid (.vtr/.vtk)." +parser = OptionParser(option_class=damask.extendableOption, + usage='%prog options [file[s]]', + description=msg, + version=scriptID) +parser.add_option('--vtk', + dest='vtk', + type='string', metavar='string', + help='VTK file name') +parser.add_option('--inplace', + dest='inplace', + action='store_true', + help='modify VTK file in-place') +parser.add_option('-r', '--render', + dest='render', + action='store_true', + help='open output in VTK render window') +parser.add_option('-d', '--data', + dest='data', + action='extend', metavar='', + help='scalar/vector value(s) label(s)') +parser.add_option('-t', '--tensor', + dest='tensor', + action='extend', metavar='', + help='tensor (3x3) value label(s)') +parser.add_option('-c', '--color', + dest='color', + action='extend', metavar='', + help='RGB color tuple label') +parser.add_option('-m', + '--mode', + dest='mode', + metavar='string', + type='choice', choices=['cell', 'point'], + help='cell-centered or point-centered coordinates') + +parser.set_defaults(data=[], + tensor=[], + color=[], + mode='cell', + inplace=False, + render=False) + +(options, filenames) = parser.parse_args() + +# ----- Legacy VTK format support ----- # +if os.path.splitext(options.vtk)[1] == '.vtr': + reader = vtk.vtkXMLRectilinearGridReader() + reader.SetFileName(options.vtk) + reader.Update() + rGrid = reader.GetOutput() +elif os.path.splitext(options.vtk)[1] == '.vtk': + reader = vtk.vtkGenericDataObjectReader() + reader.SetFileName(options.vtk) + reader.Update() + rGrid = reader.GetRectilinearGridOutput() +else: + parser.error('Unsupported VTK file type extension.') + +Npoints = rGrid.GetNumberOfPoints() +Ncells = rGrid.GetNumberOfCells() + +# ----- Summary output (Sanity Check) ----- # +msg = '{}: {} points and {} cells...'.format(options.vtk, + Npoints, + Ncells) +damask.util.croak(msg) + +# ----- Read HDF5 file ----- # +# NOTE: +# --> It is possible in the future we are trying to add data +# from different increment into the same VTK file, but +# this feature is not supported for the moment. +# --> Let it fail, if the HDF5 is invalid, python interpretor +# --> should be able to catch this error. +h5f = damask.H5Table(filenames[0], new_file=False) + +# ----- Process data ----- # +featureToAdd = {'data': options.data, + 'tensor': options.tensor, + 'color': options.color} +VTKarray = {} # store all vtkData in dict, then ship them to file +for dataType in featureToAdd.keys(): + featureNames = featureToAdd[dataType] + for featureName in featureNames: + VTKtype = vtk.VTK_DOUBLE + VTKdata = h5f.get_data(featureName) + if dataType == 'color': + VTKtype = vtk.VTK_UNSIGNED_CHAR + VTKdata = (VTKdata*255).astype(int) + elif dataType == 'tensor': + # Force symmetries tensor type data + VTKdata[:, 1] = VTKdata[:, 3] = 0.5*(VTKdata[:, 1]+VTKdata[:, 3]) + VTKdata[:, 2] = VTKdata[:, 6] = 0.5*(VTKdata[:, 2]+VTKdata[:, 6]) + VTKdata[:, 5] = VTKdata[:, 7] = 0.5*(VTKdata[:, 5]+VTKdata[:, 7]) + # use vtk build-in numpy support to add data (much faster) + # NOTE: + # --> deep copy is necessary here, otherwise memory leak could occur + VTKarray[featureName] = numpy_support.numpy_to_vtk(num_array=VTKdata, + deep=True, + array_type=VTKtype) + VTKarray[featureName].SetName(featureName) + +# ----- ship data to vtkGrid ----- # +mode = options.mode +damask.util.croak('{} mode...'.format(mode)) + +# NOTE: +# --> For unknown reason, Paraview only recognize one +# tensor attributes per cell, thus it would be safe +# to only add one attributes as tensor. +for dataType in featureToAdd.keys(): + featureNames = featureToAdd[dataType] + for featureName in featureNames: + if dataType == 'color': + if mode == 'cell': + rGrid.GetCellData().SetScalars(VTKarray[featureName]) + elif mode == 'point': + rGrid.GetPointData().SetScalars(VTKarray[featureName]) + elif dataType == 'tensor': + if mode == 'cell': + rGrid.GetCellData().SetTensors(VTKarray[featureName]) + elif mode == 'point': + rGrid.GetPointData().SetTensors(VTKarray[featureName]) + else: + if mode == 'cell': + rGrid.GetCellData().AddArray(VTKarray[featureName]) + elif mode == 'point': + rGrid.GetPointData().AddArray(VTKarray[featureName]) + +rGrid.Modified() +if vtk.VTK_MAJOR_VERSION <= 5: + rGrid.Update() + +# ----- write Grid to VTK file ----- # +writer = vtk.vtkXMLRectilinearGridWriter() +writer.SetDataModeToBinary() +writer.SetCompressorTypeToZLib() +vtkFileN = os.path.splitext(options.vtk)[0] +vtkExtsn = '.vtr' if options.inplace else '_added.vtr' +writer.SetFileName(vtkFileN+vtkExtsn) +if vtk.VTK_MAJOR_VERSION <= 5: + writer.SetInput(rGrid) +else: + writer.SetInputData(rGrid) +writer.Write() + +# ----- render results from script ----- # +if options.render: + mapper = vtk.vtkDataSetMapper() + mapper.SetInputData(rGrid) + actor = vtk.vtkActor() + actor.SetMapper(mapper) + + # Create the graphics structure. The renderer renders into the + # render window. The render window interactor captures mouse events + # and will perform appropriate camera or actor manipulation + # depending on the nature of the events. + + ren = vtk.vtkRenderer() + + renWin = vtk.vtkRenderWindow() + renWin.AddRenderer(ren) + + ren.AddActor(actor) + ren.SetBackground(1, 1, 1) + renWin.SetSize(200, 200) + + iren = vtk.vtkRenderWindowInteractor() + iren.SetRenderWindow(renWin) + + iren.Initialize() + renWin.Render() + iren.Start() From 05a3b569fc30ee53a4a73a25e6883d7dd5d944f7 Mon Sep 17 00:00:00 2001 From: chen Date: Fri, 14 Oct 2016 12:26:46 -0400 Subject: [PATCH 289/412] adding parallel version of addCalc for H5 table --- processing/post/h5_addCalculation.py | 56 ++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100755 processing/post/h5_addCalculation.py diff --git a/processing/post/h5_addCalculation.py b/processing/post/h5_addCalculation.py new file mode 100755 index 000000000..0ceeeefea --- /dev/null +++ b/processing/post/h5_addCalculation.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python2.7 +# -*- coding: UTF-8 no BOM -*- + +import os +import re +import sys +import collections +import math +import damask +import numpy as np +from optparse import OptionParser + +scriptName = os.path.splitext(os.path.basename(__file__))[0] +scriptID = ' '.join([scriptName, damask.version]) + + +# ----- Helper functions ----- # +def listify(x): + return x if isinstance(x, collections.Iterable) else [x] + + +# -------------------------------------------------------------------- +# MAIN +# -------------------------------------------------------------------- +usageEx = """ +usage_in_details: + Column labels are tagged by '#label#' in formulas. + Use ';' for ',' in functions. Numpy is available as 'np'. + Special variables: #_row_# -- row index + + Examples: + (1) magnitude of vector -- "np.linalg.norm(#vec#)" + (2) rounded root of row number -- "round(math.sqrt(#_row_#);3)" +""" +desp = "Add or alter column(s) with derived values according to " +desp += "user-defined arithmetic operation between column(s)." + +parser = OptionParser(option_class=damask.extendableOption, + usage='%prog options [file[s]]' + usageEx, + description=desp, + version=scriptID) +parser.add_option('-l', '--label', + dest='labels', + action='extend', metavar='', + help='(list of) new column labels') +parser.add_option('-f', '--formula', + dest='formulas', + action='extend', metavar='', + help='(list of) formulas corresponding to labels') +parser.add_option('-c', '--condition', + dest='condition', metavar='string', + help='condition to filter rows') + +parser.set_defaults(condition=None) + +(options, filenames) = parser.parse_args() From 434514e0f29e30469d05a824e4fd6cbfabe5f4c8 Mon Sep 17 00:00:00 2001 From: chen Date: Fri, 14 Oct 2016 14:30:04 -0400 Subject: [PATCH 290/412] allow overwriting existing dataset modification to the data is logged --- lib/damask/h5table.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/damask/h5table.py b/lib/damask/h5table.py index 7b987fad4..829379dea 100644 --- a/lib/damask/h5table.py +++ b/lib/damask/h5table.py @@ -120,6 +120,16 @@ class H5Table(object): dataType, h5f_path = lables_to_path(feature_name, dsXMLPath=self.dsXMLFile) with h5py.File(self.h5f_path, 'a') as h5f: + # NOTE: + # --> If dataset exists, delete the old one so as to write + # a new one. For brand new dataset. For brand new one, + # record its state as fresh in the cmd log. + try: + del h5f[h5f_path] + print "***deleting old {} from {}".format(feature_name, + self.h5f_path) + except: + cmd_log += " [FRESH]" h5f.create_dataset(h5f_path, data=dataset) # store the cmd in log is possible if cmd_log is not None: From fd4b495de21c7550863d15a79943a847fad49fcc Mon Sep 17 00:00:00 2001 From: chen Date: Fri, 14 Oct 2016 14:30:46 -0400 Subject: [PATCH 291/412] adding interface for addCalc with HDF5 --- processing/post/h5_addCalculation.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/processing/post/h5_addCalculation.py b/processing/post/h5_addCalculation.py index 0ceeeefea..2861eb915 100755 --- a/processing/post/h5_addCalculation.py +++ b/processing/post/h5_addCalculation.py @@ -54,3 +54,19 @@ parser.add_option('-c', '--condition', parser.set_defaults(condition=None) (options, filenames) = parser.parse_args() + +# ----- parse formulas ----- # +for i in xrange(len(options.formulas)): + options.formulas[i] = options.formulas[i].replace(';', ',') + +# ----- loop over input files ----- # +for name in filenames: + try: + h5f = damask.H5Table(name, new_file=False) + except: + print "!!!Cannot process {}".format(name) + continue + damask.util.report(scriptName, name) + +# Note: +# --> not immediately needed, come back later From dfb49c3138da194b3f41b2e8f46639891aa5fc0a Mon Sep 17 00:00:00 2001 From: chen Date: Fri, 14 Oct 2016 14:32:20 -0400 Subject: [PATCH 292/412] as script for calc Cauchy stress in HDF5 no safe net in the script, following 'let-it-fail' design --- processing/post/h5_addCauchy.py | 62 +++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100755 processing/post/h5_addCauchy.py diff --git a/processing/post/h5_addCauchy.py b/processing/post/h5_addCauchy.py new file mode 100755 index 000000000..abcfefafe --- /dev/null +++ b/processing/post/h5_addCauchy.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python2.7 +# -*- coding: UTF-8 no BOM -*- + +import os +import sys +import damask +import numpy as np +from optparse import OptionParser + +scriptName = os.path.splitext(os.path.basename(__file__))[0] +scriptID = ' '.join([scriptName, damask.version]) + + +def getCauchy(f, p): + """return Cauchy stress for given f and p""" + # [Cauchy] = (1/det(F)) * [P].[F_transpose] + f = f.reshape((3, 3)) + p = p.reshape((3, 3)) + return 1.0/np.linalg.det(f)*np.dot(p, f.T).reshape(9) + + +# -------------------------------------------------------------------- +# MAIN +# -------------------------------------------------------------------- +desp = "Add column(s) containing Cauchy stress based on given column(s)" +desp += "of deformation gradient and first Piola--Kirchhoff stress." +parser = OptionParser(option_class=damask.extendableOption, + usage='%prog options [file[s]]', + description=desp, + version=scriptID) +parser.add_option('-f', '--defgrad', + dest='defgrad', + type='string', metavar='string', + help='heading for deformation gradient [%default]') +parser.add_option('-p', '--stress', + dest='stress', + type='string', metavar='string', + help='heading for first Piola--Kirchhoff stress [%default]') + +parser.set_defaults(defgrad='f', + stress='p') + +(options, filenames) = parser.parse_args() + +# ----- loop over input H5 files ----- # +for name in filenames: + try: + h5f = damask.H5Table(name, new_file=False) + except: + continue + damask.util.report(scriptName, name) + + # ----- read in data ----- # + f = h5f.get_data("f") + p = h5f.get_data("p") + + # ----- calculate Cauchy stress ----- # + cauchy = [getCauchy(f_i, p_i) for f_i, p_i in zip(f, p)] + + # ----- write to HDF5 file ----- # + cmd_log = " ".join([scriptID, name]) + h5f.add_data('Cauchy', np.array(cauchy), cmd_log=cmd_log) From 0a357616363386aa38b58da2465f34f85cb50246 Mon Sep 17 00:00:00 2001 From: chen Date: Fri, 14 Oct 2016 14:33:22 -0400 Subject: [PATCH 293/412] delete unused module --- processing/post/h5_addCauchy.py | 1 - 1 file changed, 1 deletion(-) diff --git a/processing/post/h5_addCauchy.py b/processing/post/h5_addCauchy.py index abcfefafe..d80492623 100755 --- a/processing/post/h5_addCauchy.py +++ b/processing/post/h5_addCauchy.py @@ -2,7 +2,6 @@ # -*- coding: UTF-8 no BOM -*- import os -import sys import damask import numpy as np from optparse import OptionParser From b04c5801a5b610ee2e47c58936eefb415a4f03d8 Mon Sep 17 00:00:00 2001 From: chen Date: Fri, 14 Oct 2016 14:38:09 -0400 Subject: [PATCH 294/412] syntax polish --- processing/post/ascii2hdf5.py | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/processing/post/ascii2hdf5.py b/processing/post/ascii2hdf5.py index 5442cd53b..aef575f38 100755 --- a/processing/post/ascii2hdf5.py +++ b/processing/post/ascii2hdf5.py @@ -28,12 +28,12 @@ from optparse import OptionParser scriptName = os.path.splitext(os.path.basename(__file__))[0] -scriptID = ' '.join([scriptName,damask.version]) +scriptID = ' '.join([scriptName, damask.version]) # ----- helper function ----- # def get_rectMshVectors(xyz_array, posNum): - """take in a xyz array from rectangular mesh and figure out Vx, Vy, Vz""" + """Get Vx, Vy, Vz for rectLinear grid""" # need some improvement, and only works for rectangular grid v = sorted(list(set(xyz_array[:, posNum]))) v_interval = (v[2]+v[1])/2.0 - (v[1]+v[0])/2.0 @@ -46,24 +46,23 @@ def get_rectMshVectors(xyz_array, posNum): # ----- MAIN ---- # desp_msg = "Convert DAMASK ascii table to HDF5 file" parser = OptionParser(option_class=damask.extendableOption, - usage='%prog options [file[s]]', - description = desp_msg, - version = scriptID) + usage='%prog options [file[s]]', + description=desp_msg, + version=scriptID) parser.add_option('-D', '--DefinitionFile', - dest = 'storage definition file', - type = 'string', - metavar = 'string', - help = 'definition file for H5 data storage') -parser.add_option('-p', - '--pos', '--position', - dest = 'pos', - type = 'string', metavar = 'string', - help = 'label of coordinates [%default]') + dest='storage definition file', + type='string', + metavar='string', + help='definition file for H5 data storage') +parser.add_option('-p', '--pos', '--position', + dest='pos', + type='string', metavar='string', + help='label of coordinates [%default]') parser.set_defaults(DefinitionFile='default', - pos='pos') + pos='pos') -(options,filenames) = parser.parse_args() +(options, filenames) = parser.parse_args() filename = filenames[0] From 185a5aaabe3a047b29718052877d5544ca18dd57 Mon Sep 17 00:00:00 2001 From: Test User Date: Sat, 15 Oct 2016 11:00:59 +0200 Subject: [PATCH 295/412] updated version information after successful test of v2.0.1-222-g33de9cf --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index da01b9df1..ca4ee7d2a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-213-g75149cc +v2.0.1-222-g33de9cf From fb1e4f0c3973fa4810507565c6f0334bfc35e5b0 Mon Sep 17 00:00:00 2001 From: chen Date: Mon, 17 Oct 2016 12:24:29 -0400 Subject: [PATCH 296/412] add IPF color tuple for HDF5 file --- processing/post/h5_addIPFcolor.py | 174 ++++++++++++++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100755 processing/post/h5_addIPFcolor.py diff --git a/processing/post/h5_addIPFcolor.py b/processing/post/h5_addIPFcolor.py new file mode 100755 index 000000000..469e3e386 --- /dev/null +++ b/processing/post/h5_addIPFcolor.py @@ -0,0 +1,174 @@ +#!/usr/bin/env python2.7 +# -*- coding: UTF-8 no BOM -*- + +import os +import sys +import math +import damask +import numpy as np +from optparse import OptionParser + +scriptName = os.path.splitext(os.path.basename(__file__))[0] +scriptID = ' '.join([scriptName, damask.version]) + +# TODO +# This implementation will have to iterate through the array one +# element at a time, maybe there are some other ways to make this +# faster. + + +# ----- Helper functions ----- # +# ref: http://stackoverflow.com/questions/16801322/how-can-i-check-that-a-list- +# has-one-and-only-one-truthy-value +# NOTE: +# These functions might be useful in the future +def n_trues(iterable, n=1): + """N(trues) = n""" + i = iter(iterable) + return all(any(i) for j in range(n)) and not any(i) + + +def up_to_n_trues(iterable, n=1): + i = iter(iterable) + all(any(i) for j in range(n)) + return not any(i) + + +def at_least_n_trues(iterable, n=1): + i = iter(iterable) + return all(any(i) for j in range(n)) + + +def m_to_n_trues(iterable, m=1, n=1): + i = iter(iterable) + assert m <= n + return at_least_n_trues(i, m) and up_to_n_trues(i, n - m) + + +# -------------------------------------------------------------------- +# MAIN +# -------------------------------------------------------------------- +desp = "Add RGB color value corresponding to TSL-OIM scheme for IPF." +parser = OptionParser(option_class=damask.extendableOption, + usage='%prog options [file[s]]', + description=desp, + version=scriptID) +parser.add_option('-p', '--pole', + dest='pole', + type='float', nargs=3, metavar='float float float', + help='lab frame direction for IPF [%default]') +msg = ', '.join(damask.Symmetry.lattices[1:]) +parser.add_option('-s', '--symmetry', + dest='symmetry', + type='choice', choices=damask.Symmetry.lattices[1:], + metavar='string', + help='crystal symmetry [%default] {{{}}} '.format(msg)) +parser.add_option('-e', '--eulers', + dest='eulers', + type='string', metavar='string', + help='Euler angles label') +parser.add_option('-d', '--degrees', + dest='degrees', + action='store_true', + help='Euler angles are given in degrees [%default]') +parser.add_option('-m', '--matrix', + dest='matrix', + type='string', metavar='string', + help='orientation matrix label') +parser.add_option('-a', + dest='a', + type='string', metavar='string', + help='crystal frame a vector label') +parser.add_option('-b', + dest='b', + type='string', metavar='string', + help='crystal frame b vector label') +parser.add_option('-c', + dest='c', + type='string', metavar='string', + help='crystal frame c vector label') +parser.add_option('-q', '--quaternion', + dest='quaternion', + type='string', metavar='string', + help='quaternion label') + +parser.set_defaults(pole=(0.0, 0.0, 1.0), + symmetry=damask.Symmetry.lattices[-1], + degrees=False) + +(options, filenames) = parser.parse_args() + +# safe guarding to have only one orientation representation +# use dynamic typing to group a,b,c into frame +options.frame = [options.a, options.b, options.c] +input = [options.eulers is not None, + all(options.frame), + options.matrix is not None, + options.quaternion is not None] + +if np.sum(input) != 1: + parser.error('needs exactly one input format.') + +# select input label that was requested (active) +label_active = np.where(input)[0][0] +(label, dim, inputtype) = [(options.eulers, 3, 'eulers'), + (options.frame, [3, 3, 3], 'frame'), + (options.matrix, 9, 'matrix'), + (options.quaternion, 4, 'quaternion')][label_active] + +# rescale degrees to radians +toRadians = math.pi/180.0 if options.degrees else 1.0 + +# only use normalized pole +pole = np.array(options.pole) +pole /= np.linalg.norm(pole) + +# ----- Loop over input files ----- # +for name in filenames: + try: + h5f = damask.H5Table(name, new_file=False) + except: + continue + damask.util.report(scriptName, name) + + # extract data from HDF5 file + if inputtype == 'eulers': + orieData = h5f.get_data(label) + elif inputtype == 'matrix': + orieData = h5f.get_data(label) + orieData = orieData.reshape(orieData.shape[0], 3, 3) + elif inputtype == 'frame': + vctr_a = h5f.get_data(label[0]) + vctr_b = h5f.get_data(label[1]) + vctr_c = h5f.get_data(label[2]) + frame = np.column_stack((vctr_a, vctr_b, vctr_c)) + orieData = frame.reshape(frame.shape[0], 3, 3) + elif inputtype == 'quaternion': + orieData = h5f.get_data(label) + + # calculate the IPF color + rgbArrays = np.zeros((orieData.shape[0], 3)) + for ci in xrange(rgbArrays.shape[0]): + if inputtype == 'eulers': + o = damask.Orientation(Eulers=np.array(orieData[ci, :])*toRadians, + symmetry=options.symmetry).reduced() + elif inputtype == 'matrix': + o = damask.Orientation(matrix=orieData[ci, :, :].transpose(), + symmetry=options.symmetry).reduced() + elif inputtype == 'frame': + o = damask.Orientation(matrix=orieData[ci, :, :], + symmetry=options.symmetry).reduced() + elif inputtype == 'quaternion': + o = damask.Orientation(quaternion=orieData[ci, :], + symmetry=options.symmetry).reduced() + rgbArrays[ci, :] = o.IPFcolor(pole) + + # compose labels/headers for IPF color (RGB) + labelIPF = 'IPF_{:g}{:g}{:g}_{sym}'.format(*options.pole, + sym=options.symmetry.lower()) + + # compose cmd history (go with dataset) + cmd_log = scriptID + '\t' + ' '.join(sys.argv[1:]) + + # write data to HDF5 file + h5f.add_data(labelIPF, rgbArrays, cmd_log=cmd_log) From 1a2194f0428afbdebed38f7afb4e2f46cfe1776e Mon Sep 17 00:00:00 2001 From: chen Date: Mon, 17 Oct 2016 16:23:21 -0400 Subject: [PATCH 297/412] remove useless functions --- processing/post/h5_addIPFcolor.py | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/processing/post/h5_addIPFcolor.py b/processing/post/h5_addIPFcolor.py index 469e3e386..e8abc2a0f 100755 --- a/processing/post/h5_addIPFcolor.py +++ b/processing/post/h5_addIPFcolor.py @@ -16,35 +16,6 @@ scriptID = ' '.join([scriptName, damask.version]) # element at a time, maybe there are some other ways to make this # faster. - -# ----- Helper functions ----- # -# ref: http://stackoverflow.com/questions/16801322/how-can-i-check-that-a-list- -# has-one-and-only-one-truthy-value -# NOTE: -# These functions might be useful in the future -def n_trues(iterable, n=1): - """N(trues) = n""" - i = iter(iterable) - return all(any(i) for j in range(n)) and not any(i) - - -def up_to_n_trues(iterable, n=1): - i = iter(iterable) - all(any(i) for j in range(n)) - return not any(i) - - -def at_least_n_trues(iterable, n=1): - i = iter(iterable) - return all(any(i) for j in range(n)) - - -def m_to_n_trues(iterable, m=1, n=1): - i = iter(iterable) - assert m <= n - return at_least_n_trues(i, m) and up_to_n_trues(i, n - m) - - # -------------------------------------------------------------------- # MAIN # -------------------------------------------------------------------- From 74b29881f31bb2f45447972cb9f315bad59a31b3 Mon Sep 17 00:00:00 2001 From: chen Date: Mon, 17 Oct 2016 16:24:11 -0400 Subject: [PATCH 298/412] strain tensor calculation script for HDF5 --- processing/post/h5_addStrainTensors.py | 153 +++++++++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 processing/post/h5_addStrainTensors.py diff --git a/processing/post/h5_addStrainTensors.py b/processing/post/h5_addStrainTensors.py new file mode 100644 index 000000000..eca63e317 --- /dev/null +++ b/processing/post/h5_addStrainTensors.py @@ -0,0 +1,153 @@ +#!/usr/bin/env python2.7 +# -*- coding: UTF-8 no BOM -*- + +import os +import sys +import damask +import numpy as np +from optparse import OptionParser + +scriptName = os.path.splitext(os.path.basename(__file__))[0] +scriptID = ' '.join([scriptName, damask.version]) + + +# ----- Helper functions ----- # +def operator(stretch, strain, eigenvalues): + # Albrecht Bertram: Elasticity and Plasticity of Large Deformations + # An Introduction (3rd Edition, 2012), p. 102 + return {'V#ln': np.log(eigenvalues), + 'U#ln': np.log(eigenvalues), + 'V#Biot': (np.ones(3, 'd') - 1.0/eigenvalues), + 'U#Biot': (eigenvalues - np.ones(3, 'd')), + 'V#Green': (np.ones(3, 'd') - 1.0/eigenvalues/eigenvalues)*0.5, + 'U#Green': (eigenvalues*eigenvalues - np.ones(3, 'd'))*0.5, + }[stretch+'#'+strain] + + +def calcEPS(defgrads, stretchType, strainType): + """calculate specific type of strain tensor""" + eps = np.zeros(defgrads.shape) # initialize container + + # TODO: + # this loop can use some performance boost + # (multi-threading?) + for ri in xrange(defgrads.shape[0]): + f = defgrads[ri, :, :].reshape(3, 3) + U, S, Vh = np.lingalg.svd(f) + R = np.dot(U, Vh) # rotation of polar decomposition + if stretchType == 'U': + stretch = np.dot(np.linalg.inv(R), f) # F = RU + elif stretchType == 'V': + stretch = np.dot(f, np.linalg.inv(R)) # F = VR + + # kill nasty noisy data + stretch = np.where(abs(stretch) < 1e-12, 0, stretch) + + (D, V) = np.linalg.eig(stretch) + # flip principal component with negative Eigen values + neg = np.where(D < 0.0) + D[neg] *= -1. + V[:, neg] *= -1. + + # check each vector for orthogonality + # --> brutal force enforcing orthogonal base + # and re-normalize + for i, eigval in enumerate(D): + if np.dot(V[:, i], V[:, (i+1) % 3]) != 0.0: + V[:, (i+1) % 3] = np.cross(V[:, (i+2) % 3], V[:, i]) + V[:, (i+1) % 3] /= np.sqrt(np.dot(V[:, (i+1) % 3], + V[:, (i+1) % 3].conj())) + + # calculate requested version of strain tensor + d = operator(stretchType, strainType, D) + eps[ri] = (np.dot(V, np.dot(np.diag(d), V.T)).real).reshape(9) + + return eps + +# -------------------------------------------------------------------- +# MAIN +# -------------------------------------------------------------------- +desp = "Add column(s) containing given strains based on given stretches" +parser = OptionParser(option_class=damask.extendableOption, + usage='%prog options [file[s]]', + description=desp, + version=scriptID) +msg = 'material strains based on right Cauchy-Green deformation, i.e., C and U' +parser.add_option('-u', '--right', + dest='right', + action='store_true', + help=msg) +msg = 'spatial strains based on left Cauchy--Green deformation, i.e., B and V' +parser.add_option('-v', '--left', + dest='left', + action='store_true', + help=msg) +parser.add_option('-0', '--logarithmic', + dest='logarithmic', + action='store_true', + help='calculate logarithmic strain tensor') +parser.add_option('-1', '--biot', + dest='biot', + action='store_true', + help='calculate biot strain tensor') +parser.add_option('-2', '--green', + dest='green', + action='store_true', + help='calculate green strain tensor') +msg = 'heading(s) of columns containing deformation tensor values' +parser.add_option('-f', '--defgrad', + dest='defgrad', + action='extend', + metavar='', + help=msg) + +parser.set_defaults(right=False, left=False, + logarithmic=False, biot=False, green=False, + defgrad=['f']) + +(options, filenames) = parser.parse_args() + +stretches = [] +strains = [] + +if options.right: + stretches.append('U') +if options.left: + stretches.append('V') + +if options.logarithmic: + strains.append('ln') +if options.biot: + strains.append('Biot') +if options.green: + strains.append('Green') + +if options.defgrad is None: + parser.error('no data column specified.') + +# ----- Loop over input files ----- # +for name in filenames: + try: + h5f = damask.H5Table(name, new_file=False) + except: + continue + damask.util.report(scriptName, name) + + # extract defgrads from HDF5 storage + F = h5f.get_data(options.defgrads) + + # allow calculate multiple types of strain within the + # same cmd call + for stretchType in stretches: + for strainType in strains: + # calculate strain tensor for this type + eps = calcEPS(F, stretchType, strainType) + + # compose labels/headers for this strain tensor + labelsStrain = strainType + stretchType + + # prepare log info + cmd_log = scriptID + '\t' + ' '.join(sys.argv[1:]) + + # write data to HDF5 file + h5f.add_data(labelsStrain, eps, cmd_log=cmd_log) From 8e7f0c255bcf601ded78e290431b9d7ea080588e Mon Sep 17 00:00:00 2001 From: chen Date: Mon, 17 Oct 2016 16:58:04 -0400 Subject: [PATCH 299/412] fix some syntax error --- processing/post/h5_addStrainTensors.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) mode change 100644 => 100755 processing/post/h5_addStrainTensors.py diff --git a/processing/post/h5_addStrainTensors.py b/processing/post/h5_addStrainTensors.py old mode 100644 new mode 100755 index eca63e317..65f71e50c --- a/processing/post/h5_addStrainTensors.py +++ b/processing/post/h5_addStrainTensors.py @@ -32,8 +32,8 @@ def calcEPS(defgrads, stretchType, strainType): # this loop can use some performance boost # (multi-threading?) for ri in xrange(defgrads.shape[0]): - f = defgrads[ri, :, :].reshape(3, 3) - U, S, Vh = np.lingalg.svd(f) + f = defgrads[ri, :].reshape(3, 3) + U, S, Vh = np.linalg.svd(f) R = np.dot(U, Vh) # rotation of polar decomposition if stretchType == 'U': stretch = np.dot(np.linalg.inv(R), f) # F = RU @@ -94,6 +94,9 @@ parser.add_option('-2', '--green', dest='green', action='store_true', help='calculate green strain tensor') +# NOTE: +# It might be easier to just calculate one type of deformation gradient +# at a time. msg = 'heading(s) of columns containing deformation tensor values' parser.add_option('-f', '--defgrad', dest='defgrad', @@ -103,7 +106,7 @@ parser.add_option('-f', '--defgrad', parser.set_defaults(right=False, left=False, logarithmic=False, biot=False, green=False, - defgrad=['f']) + defgrad='f') (options, filenames) = parser.parse_args() @@ -134,7 +137,7 @@ for name in filenames: damask.util.report(scriptName, name) # extract defgrads from HDF5 storage - F = h5f.get_data(options.defgrads) + F = h5f.get_data(options.defgrad) # allow calculate multiple types of strain within the # same cmd call From 4d849219f7e78a416d79b621cc638821fb5d1386 Mon Sep 17 00:00:00 2001 From: chen Date: Mon, 17 Oct 2016 16:59:42 -0400 Subject: [PATCH 300/412] will come back for this later --- processing/post/h5_addCalculation.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/processing/post/h5_addCalculation.py b/processing/post/h5_addCalculation.py index 2861eb915..dc4975dbf 100755 --- a/processing/post/h5_addCalculation.py +++ b/processing/post/h5_addCalculation.py @@ -2,12 +2,12 @@ # -*- coding: UTF-8 no BOM -*- import os -import re -import sys +# import re +# import sys import collections -import math +# import math import damask -import numpy as np +# import numpy as np from optparse import OptionParser scriptName = os.path.splitext(os.path.basename(__file__))[0] From 703ae3c6d6a89ac698007ebf20033f5d3737a303 Mon Sep 17 00:00:00 2001 From: chen Date: Mon, 17 Oct 2016 17:29:44 -0400 Subject: [PATCH 301/412] add script for adding von Mises equivalent to HDF5 file --- processing/post/h5_addMises.py | 85 ++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100755 processing/post/h5_addMises.py diff --git a/processing/post/h5_addMises.py b/processing/post/h5_addMises.py new file mode 100755 index 000000000..941a2f5da --- /dev/null +++ b/processing/post/h5_addMises.py @@ -0,0 +1,85 @@ +#!/usr/bin/env python2.7 +# -*- coding: UTF-8 no BOM -*- + +import os +import sys +import math +import damask +import numpy as np +from optparse import OptionParser + +scriptName = os.path.splitext(os.path.basename(__file__))[0] +scriptID = ' '.join([scriptName, damask.version]) + + +# ----- Helper functions ----- # +def calcMises(what, tensor): + """calculate von Mises equivalent""" + dev = tensor - np.trace(tensor)/3.0*np.eye(3) + symdev = 0.5*(dev+dev.T) + return math.sqrt(np.sum(symdev*symdev.T) * + { + 'stress': 3.0/2.0, + 'strain': 2.0/3.0, + }[what.lower()]) + + +# -------------------------------------------------------------------- +# MAIN +# -------------------------------------------------------------------- +desp = "Add von Mises equivalent values for symmetric part of requested" +parser = OptionParser(option_class=damask.extendableOption, + usage='%prog options [file[s]]', + description=desp, + version=scriptID) +parser.add_option('-e', '--strain', + dest='strain', + metavar='string', + help='name of dataset containing strain tensors') +parser.add_option('-s', '--stress', + dest='stress', + metavar='string', + help='name of dataset containing stress tensors') + +parser.set_defaults(strain=None, stress=None) + +(options, filenames) = parser.parse_args() + +# ----- Loop over input files ----- # +for name in filenames: + try: + h5f = damask.H5Table(name, new_file=False) + except: + continue + damask.util.report(scriptName, name) + + # TODO: + # Could use some refactoring here + if options.stress is not None: + # extract stress tensor from HDF5 + tnsr = h5f.get_data(options.stress) + + # calculate von Mises equivalent row by row + vmStress = np.zeros(tnsr.shape[0]) + for ri in xrange(tnsr.shape[0]): + stressTnsr = tnsr[ri, :].reshape(3, 3) + vmStress[ri] = calcMises('stress', stressTnsr) + + # compose label + label = "Mises{}".format(options.stress) + + # prepare log info + cmd_log = scriptID + '\t' + ' '.join(sys.argv[1:]) + + # write data to HDF5 file + h5f.add_data(label, vmStress, cmd_log=cmd_log) + + if options.strain is not None: + tnsr = h5f.get_data(options.strain) + vmStrain = np.zeros(tnsr.shape[0]) + for ri in xrange(tnsr.shape[0]): + strainTnsr = tnsr[ri, :].reshape(3, 3) + vmStrain[ri] = calcMises('strain', strainTnsr) + label = "Mises{}".format(options.strain) + cmd_log = scriptID + '\t' + ' '.join(sys.argv[1:]) + h5f.add_data(label, vmStrain, cmd_log=cmd_log) From 51e408a5bf4c18116a0aeab8e1455fa4a7137155 Mon Sep 17 00:00:00 2001 From: chen Date: Mon, 17 Oct 2016 18:24:26 -0400 Subject: [PATCH 302/412] fix error regarding log if no log is provided when adding data, use None --- lib/damask/h5table.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/damask/h5table.py b/lib/damask/h5table.py index 829379dea..95e25f191 100644 --- a/lib/damask/h5table.py +++ b/lib/damask/h5table.py @@ -129,7 +129,8 @@ class H5Table(object): print "***deleting old {} from {}".format(feature_name, self.h5f_path) except: - cmd_log += " [FRESH]" + # if no cmd log, None will used + cmd_log = str(cmd_log) + " [FRESH]" h5f.create_dataset(h5f_path, data=dataset) # store the cmd in log is possible if cmd_log is not None: From 96349ebf53ba581304a5edcfac030595dd414c9d Mon Sep 17 00:00:00 2001 From: chen Date: Mon, 17 Oct 2016 18:24:47 -0400 Subject: [PATCH 303/412] add log to each dataset --- processing/post/ascii2hdf5.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/processing/post/ascii2hdf5.py b/processing/post/ascii2hdf5.py index aef575f38..ea2819592 100755 --- a/processing/post/ascii2hdf5.py +++ b/processing/post/ascii2hdf5.py @@ -91,6 +91,9 @@ Vz = get_rectMshVectors(xyz_array, 2) # use the dimension of the rectangular grid to reshape all other data mshGridDim = [len(Vx)-1, len(Vy)-1, len(Vz)-1] +# ----- compose cmd log ----- # +cmd_log = " ".join([scriptID, filename]) + # ----- create a new HDF5 file and save the data -----# # force remove existing HDF5 file h5fName = filename.replace(".txt", ".h5") @@ -104,9 +107,9 @@ h5f = damask.H5Table(h5fName, # adding increment number as root level attributes h5f.add_attr('inc', incNum) # add the mesh grid data now -h5f.add_data("Vx", Vx) -h5f.add_data("Vy", Vy) -h5f.add_data("Vz", Vz) +h5f.add_data("Vx", Vx, cmd_log=cmd_log) +h5f.add_data("Vy", Vy, cmd_log=cmd_log) +h5f.add_data("Vz", Vz, cmd_log=cmd_log) # add the rest of data from table labelsProcessed = ['inc'] @@ -134,6 +137,6 @@ for fi in xrange(len(labels)): # dataset.shape[1])) # write out data print "adding {}...".format(featureName) - h5f.add_data(featureName, dataset) + h5f.add_data(featureName, dataset, cmd_log=cmd_log) # write down the processed label labelsProcessed.append(featureName) From 9818a074c6206096fe34105e2e644058790614df Mon Sep 17 00:00:00 2001 From: Test User Date: Tue, 18 Oct 2016 04:41:46 +0200 Subject: [PATCH 304/412] updated version information after successful test of v2.0.1-238-g96349eb --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index ca4ee7d2a..d0bf70ba1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-222-g33de9cf +v2.0.1-238-g96349eb From aab3d9af318236073135a51f00e46e6879870da8 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 18 Oct 2016 19:50:05 +0200 Subject: [PATCH 305/412] updated reference and used recommendation for comparison to 0.0 --- code/prec.f90 | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/code/prec.f90 b/code/prec.f90 index b123d02d0..2b7ef8ab9 100644 --- a/code/prec.f90 +++ b/code/prec.f90 @@ -171,7 +171,7 @@ end function prec_isNaN !-------------------------------------------------------------------------------------------------- !> @brief equality comparison for float with double precision ! replaces "==" but for certain (relative) tolerance. Counterpart to dNeq -! http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm +! https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ !-------------------------------------------------------------------------------------------------- logical elemental pure function dEq(a,b,tol) @@ -187,7 +187,7 @@ end function dEq !-------------------------------------------------------------------------------------------------- !> @brief inequality comparison for float with double precision ! replaces "!=" but for certain (relative) tolerance. Counterpart to dEq -! http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm +! https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ !-------------------------------------------------------------------------------------------------- logical elemental pure function dNeq(a,b,tol) @@ -201,9 +201,9 @@ end function dNeq !-------------------------------------------------------------------------------------------------- -!> @brief equality to 0comparison for float with double precision -! replaces "==0" but for certain (relative) tolerance. Counterpart to dNeq0 -! http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm +!> @brief equality to 0 comparison for float with double precision +! replaces "==0" but for certain (absolute) tolerance. Counterpart to dNeq0 +! https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ !-------------------------------------------------------------------------------------------------- logical elemental pure function dEq0(a,tol) @@ -212,14 +212,14 @@ logical elemental pure function dEq0(a,tol) real(pReal), intent(in), optional :: tol real(pReal), parameter :: eps = 2.220446049250313E-16 ! DBL_EPSILON in C - dEq0 = merge(.True., .False.,abs(a) <= merge(tol,eps,present(tol))*abs(a)) + dEq0 = merge(.True., .False.,abs(a) <= merge(tol,eps,present(tol))*10.0_pReal) end function dEq0 !-------------------------------------------------------------------------------------------------- -!> @brief inequality comparison to 0 for float with double precision -! replaces "!=0" but for certain (relative) tolerance. Counterpart to dEq0 -! http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm +!> @brief inequality to 0 comparison for float with double precision +! replaces "!=0" but for certain (absolute) tolerance. Counterpart to dEq0 +! https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ !-------------------------------------------------------------------------------------------------- logical elemental pure function dNeq0(a,tol) @@ -228,14 +228,14 @@ logical elemental pure function dNeq0(a,tol) real(pReal), intent(in), optional :: tol real(pReal), parameter :: eps = 2.220446049250313E-16 ! DBL_EPSILON in C - dNeq0 = merge(.False., .True.,abs(a) <= merge(tol,eps,present(tol))*abs(a)) + dNeq0 = merge(.False., .True.,abs(a) <= merge(tol,eps,present(tol))*10.0_pReal) end function dNeq0 !-------------------------------------------------------------------------------------------------- !> @brief equality comparison for complex with double precision ! replaces "==" but for certain (relative) tolerance. Counterpart to cNeq -! http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm +! https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ ! probably a component wise comparison would be more accurate than the comparsion of the absolute ! value !-------------------------------------------------------------------------------------------------- @@ -253,7 +253,7 @@ end function cEq !-------------------------------------------------------------------------------------------------- !> @brief inequality comparison for complex with double precision ! replaces "!=" but for certain (relative) tolerance. Counterpart to cEq -! http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm +! https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ ! probably a component wise comparison would be more accurate than the comparsion of the absolute ! value !-------------------------------------------------------------------------------------------------- From b8bf51b366fdfb20fe7ce6bd3843064c5dcb41e2 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Tue, 18 Oct 2016 15:31:52 -0400 Subject: [PATCH 306/412] changed default FFT spatial derivative to "fwbw_difference" --- code/numerics.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/numerics.f90 b/code/numerics.f90 index 9840630db..c968c7090 100644 --- a/code/numerics.f90 +++ b/code/numerics.f90 @@ -110,7 +110,7 @@ module numerics fftw_plan_mode = 'FFTW_PATIENT' !< reads the planing-rigor flag, see manual on www.fftw.org, Default FFTW_PATIENT: use patient planner flag character(len=64), protected, public :: & spectral_solver = 'basicpetsc' , & !< spectral solution method - spectral_derivative = 'continuous' !< spectral filtering method + spectral_derivative = 'fwbw_difference' !< spectral spatial derivative method character(len=1024), protected, public :: & petsc_defaultOptions = '-mech_snes_type ngmres & &-damage_snes_type ngmres & From ff2f827a68cb81d222e4fe9cc827e68c46308435 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Tue, 18 Oct 2016 15:33:24 -0400 Subject: [PATCH 307/412] strip outermost quotes from labels --- lib/damask/asciitable.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/damask/asciitable.py b/lib/damask/asciitable.py index 06a52280b..3509a5284 100644 --- a/lib/damask/asciitable.py +++ b/lib/damask/asciitable.py @@ -336,6 +336,7 @@ class ASCIItable(): try: idx.append(int(label)-1) # column given as integer number? except ValueError: + label = label[1:-1] if label[0] == label[-1] and label[0] in ('"',"'") else label # remove outermost quotations try: idx.append(self.tags.index(label)) # locate string in label list except ValueError: @@ -348,6 +349,7 @@ class ASCIItable(): idx = int(labels)-1 # offset for python array indexing except ValueError: try: + labels = labels[1:-1] if labels[0] == labels[-1] and labels[0] in ('"',"'") else labels # remove outermost quotations idx = self.tags.index(labels) except ValueError: try: @@ -380,6 +382,7 @@ class ASCIItable(): while idx+myDim < len(self.tags) and self.tags[idx+myDim].startswith("%i_"%(myDim+1)): myDim += 1 # add while found except ValueError: # column has string label + label = label[1:-1] if label[0] == label[-1] and label[0] in ('"',"'") else label # remove outermost quotations if label in self.tags: # can be directly found? myDim = 1 # scalar by definition elif '1_'+label in self.tags: # look for first entry of possible multidim object @@ -399,6 +402,7 @@ class ASCIItable(): while idx+dim < len(self.tags) and self.tags[idx+dim].startswith("%i_"%(dim+1)): dim += 1 # add as long as found except ValueError: # column has string label + labels = labels[1:-1] if labels[0] == labels[-1] and labels[0] in ('"',"'") else labels # remove outermost quotations if labels in self.tags: # can be directly found? dim = 1 # scalar by definition elif '1_'+labels in self.tags: # look for first entry of possible multidim object From 85076ad61300f70b4f5b77f8b43fd174f15b7665 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Tue, 18 Oct 2016 16:23:52 -0400 Subject: [PATCH 308/412] check agreement between rate and time #points, extrapolate to outside --- code/source_thermal_externalheat.f90 | 68 ++++++++++++++++------------ 1 file changed, 38 insertions(+), 30 deletions(-) diff --git a/code/source_thermal_externalheat.f90 b/code/source_thermal_externalheat.f90 index e2b14d45d..60aaebe42 100644 --- a/code/source_thermal_externalheat.f90 +++ b/code/source_thermal_externalheat.f90 @@ -1,6 +1,7 @@ !-------------------------------------------------------------------------------------------------- !> @author Pratheek Shanthraj, Max-Planck-Institut für Eisenforschung GmbH -!> @brief material subroutine for thermal source due to plastic dissipation +!> @author Philip Eisenlohr, Michigan State University +!> @brief material subroutine for variable heat source !> @details to be done !-------------------------------------------------------------------------------------------------- module source_thermal_externalheat @@ -10,24 +11,24 @@ module source_thermal_externalheat implicit none private - integer(pInt), dimension(:), allocatable, public, protected :: & + integer(pInt), dimension(:), allocatable, public, protected :: & source_thermal_externalheat_sizePostResults, & !< cumulative size of post results source_thermal_externalheat_offset, & !< which source is my current thermal dissipation mechanism? source_thermal_externalheat_instance !< instance of thermal dissipation source mechanism - integer(pInt), dimension(:,:), allocatable, target, public :: & + integer(pInt), dimension(:,:), allocatable, target, public :: & source_thermal_externalheat_sizePostResult !< size of each post result output - character(len=64), dimension(:,:), allocatable, target, public :: & + character(len=64), dimension(:,:), allocatable, target, public :: & source_thermal_externalheat_output !< name of each post result output - integer(pInt), dimension(:), allocatable, target, public :: & + integer(pInt), dimension(:), allocatable, target, public :: & source_thermal_externalheat_Noutput !< number of outputs per instance of this source - integer(pInt), dimension(:), allocatable, private :: & + integer(pInt), dimension(:), allocatable, private :: & source_thermal_externalheat_nIntervals - real(pReal), dimension(:,:), allocatable, private :: & + real(pReal), dimension(:,:), allocatable, private :: & source_thermal_externalheat_time, & source_thermal_externalheat_rate @@ -136,23 +137,26 @@ subroutine source_thermal_externalheat_init(fileUnit) if (phase > 0_pInt ) then; if (any(phase_source(:,phase) == SOURCE_thermal_externalheat_ID)) then ! do not short-circuit here (.and. with next if statemen). It's not safe in Fortran - instance = source_thermal_externalheat_instance(phase) ! which instance of my source is present phase + instance = source_thermal_externalheat_instance(phase) ! which instance of my source is present phase chunkPos = IO_stringPos(line) - tag = IO_lc(IO_stringValue(line,chunkPos,1_pInt)) ! extract key + tag = IO_lc(IO_stringValue(line,chunkPos,1_pInt)) ! extract key select case(tag) - case ('externalheat_time') + case ('externalheat_time','externalheat_rate') if (chunkPos(1) <= 2_pInt) & call IO_error(150_pInt,ext_msg=trim(tag)//' ('//SOURCE_thermal_externalheat_label//')') + if ( source_thermal_externalheat_nIntervals(instance) > 0_pInt & + .and. source_thermal_externalheat_nIntervals(instance) /= chunkPos(1) - 2_pInt) & + call IO_error(150_pInt,ext_msg=trim(tag)//' ('//SOURCE_thermal_externalheat_label//')') + source_thermal_externalheat_nIntervals(instance) = chunkPos(1) - 2_pInt do interval = 1, source_thermal_externalheat_nIntervals(instance) + 1_pInt - temp_time(instance, interval) = IO_floatValue(line,chunkPos,1_pInt + interval) + select case(tag) + case ('externalheat_time') + temp_time(instance, interval) = IO_floatValue(line,chunkPos,1_pInt + interval) + case ('externalheat_rate') + temp_rate(instance, interval) = IO_floatValue(line,chunkPos,1_pInt + interval) + end select enddo - - case ('externalheat_rate') - do interval = 1, source_thermal_externalheat_nIntervals(instance) + 1_pInt - temp_rate(instance, interval) = IO_floatValue(line,chunkPos,1_pInt + interval) - enddo - end select endif; endif enddo parsingFile @@ -162,13 +166,13 @@ subroutine source_thermal_externalheat_init(fileUnit) initializeInstances: do phase = 1_pInt, material_Nphase if (any(phase_source(:,phase) == SOURCE_thermal_externalheat_ID)) then - NofMyPhase=count(material_phase==phase) + NofMyPhase = count(material_phase==phase) instance = source_thermal_externalheat_instance(phase) sourceOffset = source_thermal_externalheat_offset(phase) source_thermal_externalheat_time(instance,1:source_thermal_externalheat_nIntervals(instance)+1_pInt) = & - temp_time(instance,1:source_thermal_externalheat_nIntervals(instance)+1_pInt) + temp_time(instance,1:source_thermal_externalheat_nIntervals(instance)+1_pInt) source_thermal_externalheat_rate(instance,1:source_thermal_externalheat_nIntervals(instance)+1_pInt) = & - temp_rate(instance,1:source_thermal_externalheat_nIntervals(instance)+1_pInt) + temp_rate(instance,1:source_thermal_externalheat_nIntervals(instance)+1_pInt) sizeDotState = 1_pInt sizeDeltaState = 0_pInt @@ -200,7 +204,8 @@ subroutine source_thermal_externalheat_init(fileUnit) end subroutine source_thermal_externalheat_init !-------------------------------------------------------------------------------------------------- -!> @brief calculates derived quantities from state +!> @brief rate of change of state +!> @details state only contains current time to linearly interpolate given heat powers !-------------------------------------------------------------------------------------------------- subroutine source_thermal_externalheat_dotState(ipc, ip, el) use material, only: & @@ -221,12 +226,12 @@ subroutine source_thermal_externalheat_dotState(ipc, ip, el) constituent = phasememberAt(ipc,ip,el) sourceOffset = source_thermal_externalheat_offset(phase) - sourceState(phase)%p(sourceOffset)%dotState(1,constituent) = 1.0_pReal + sourceState(phase)%p(sourceOffset)%dotState(1,constituent) = 1.0_pReal ! state is current time end subroutine source_thermal_externalheat_dotState !-------------------------------------------------------------------------------------------------- -!> @brief returns local vacancy generation rate +!> @brief returns local heat generation rate !-------------------------------------------------------------------------------------------------- subroutine source_thermal_externalheat_getRateAndItsTangent(TDot, dTDot_dT, ipc, ip, el) use material, only: & @@ -244,21 +249,24 @@ subroutine source_thermal_externalheat_getRateAndItsTangent(TDot, dTDot_dT, ipc, integer(pInt) :: & instance, phase, constituent, sourceOffset, interval real(pReal) :: & - norm_time + frac_time phase = phaseAt(ipc,ip,el) constituent = phasememberAt(ipc,ip,el) instance = source_thermal_externalheat_instance(phase) sourceOffset = source_thermal_externalheat_offset(phase) - do interval = 1, source_thermal_externalheat_nIntervals(instance) - norm_time = (sourceState(phase)%p(sourceOffset)%state(1,constituent) - & + do interval = 1, source_thermal_externalheat_nIntervals(instance) ! scan through all rate segments + frac_time = (sourceState(phase)%p(sourceOffset)%state(1,constituent) - & source_thermal_externalheat_time(instance,interval)) / & (source_thermal_externalheat_time(instance,interval+1) - & - source_thermal_externalheat_time(instance,interval)) - if (norm_time >= 0.0_pReal .and. norm_time < 1.0_pReal) & - TDot = source_thermal_externalheat_rate(instance,interval ) * (1.0_pReal - norm_time) + & - source_thermal_externalheat_rate(instance,interval+1) * norm_time + source_thermal_externalheat_time(instance,interval)) ! fractional time within segment + if ( (frac_time < 0.0_pReal .and. interval == 1) & + .or. (frac_time >= 1.0_pReal .and. interval == source_thermal_externalheat_nIntervals(instance)) & + .or. (frac_time >= 0.0_pReal .and. frac_time < 1.0_pReal) ) & + TDot = source_thermal_externalheat_rate(instance,interval ) * (1.0_pReal - frac_time) + & + source_thermal_externalheat_rate(instance,interval+1) * frac_time ! interpolate heat rate between segment boundaries... + ! ...or extrapolate if outside of bounds enddo dTDot_dT = 0.0 From e93db170da36fe5b364bdfde0e2b9ce046805af4 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Tue, 18 Oct 2016 16:24:23 -0400 Subject: [PATCH 309/412] fixed typo in help message --- code/spectral_interface.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/spectral_interface.f90 b/code/spectral_interface.f90 index 85ba30c51..7050d7b45 100644 --- a/code/spectral_interface.f90 +++ b/code/spectral_interface.f90 @@ -152,7 +152,7 @@ subroutine DAMASK_interface_init() write(6,'(a)') ' Make sure the file "material.config" exists in the working' write(6,'(a)') ' directory.' write(6,'(a)') ' For further configuration place "numerics.config"' - write(6,'(a)')' and "numerics.config" in that directory.' + write(6,'(a)')' and "debug.config" in that directory.' write(6,'(/,a)')' --restart XX' write(6,'(a)') ' Reads in total increment No. XX-1 and continues to' write(6,'(a)') ' calculate total increment No. XX.' From 12e94bd310a228f1c96d64e1a2667dea7df1422e Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Wed, 19 Oct 2016 08:07:54 -0400 Subject: [PATCH 310/412] revert to continuous spectral derivative, fwbw gets own branch --- code/numerics.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/numerics.f90 b/code/numerics.f90 index c968c7090..24bd19018 100644 --- a/code/numerics.f90 +++ b/code/numerics.f90 @@ -110,7 +110,7 @@ module numerics fftw_plan_mode = 'FFTW_PATIENT' !< reads the planing-rigor flag, see manual on www.fftw.org, Default FFTW_PATIENT: use patient planner flag character(len=64), protected, public :: & spectral_solver = 'basicpetsc' , & !< spectral solution method - spectral_derivative = 'fwbw_difference' !< spectral spatial derivative method + spectral_derivative = 'continuous' !< spectral spatial derivative method character(len=1024), protected, public :: & petsc_defaultOptions = '-mech_snes_type ngmres & &-damage_snes_type ngmres & From c5217d8db5acac152422761cd8eeeb444fa10b4a Mon Sep 17 00:00:00 2001 From: Test User Date: Thu, 20 Oct 2016 04:41:54 +0200 Subject: [PATCH 311/412] updated version information after successful test of v2.0.1-244-g12e94bd --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index d0bf70ba1..110bfbbce 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-238-g96349eb +v2.0.1-244-g12e94bd From cc28da502bc5f74ae55e4fb4b4bd150589d3920d Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 21 Oct 2016 15:05:34 +0200 Subject: [PATCH 312/412] ifort 2017 requires new option format --- code/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Makefile b/code/Makefile index 331feec27..5a43040aa 100644 --- a/code/Makefile +++ b/code/Makefile @@ -65,7 +65,7 @@ endif # settings for shared memory multicore support ifeq "$(OPENMP)" "ON" -OPENMP_FLAG_ifort =-openmp -openmp-report0 -parallel +OPENMP_FLAG_ifort =-qopenmp -parallel OPENMP_FLAG_gfortran =-fopenmp endif From 633744bfa9b1e9ab7632d2205d7b444e842a8814 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 21 Oct 2016 15:08:47 +0200 Subject: [PATCH 313/412] used only for commercial FEM anyway --- code/CPFEM.f90 | 53 -------------------------------------------------- 1 file changed, 53 deletions(-) diff --git a/code/CPFEM.f90 b/code/CPFEM.f90 index 0774fba86..a1dac9801 100644 --- a/code/CPFEM.f90 +++ b/code/CPFEM.f90 @@ -10,7 +10,6 @@ module CPFEM implicit none private -#if defined(Marc4DAMASK) || defined(Abaqus) real(pReal), parameter, private :: & CPFEM_odd_stress = 1e15_pReal, & !< return value for stress in case of ping pong dummy cycle CPFEM_odd_jacobian = 1e50_pReal !< return value for jacobian in case of ping pong dummy cycle @@ -20,7 +19,6 @@ module CPFEM CPFEM_dcsdE !< Cauchy stress tangent real(pReal), dimension (:,:,:,:), allocatable, private :: & CPFEM_dcsdE_knownGood !< known good tangent -#endif integer(pInt), public :: & cycleCounter = 0_pInt, & !< needs description theInc = -1_pInt, & !< needs description @@ -83,10 +81,6 @@ subroutine CPFEM_initAll(el,ip) use IO, only: & IO_init use DAMASK_interface -#ifdef FEM - use FEZoo, only: & - FEZoo_init -#endif implicit none integer(pInt), intent(in) :: el, & !< FE el number @@ -97,9 +91,6 @@ subroutine CPFEM_initAll(el,ip) call DAMASK_interface_init ! Spectral and FEM interface to commandline call prec_init call IO_init -#ifdef FEM - call FEZoo_init -#endif call numerics_init call debug_init call math_init @@ -138,16 +129,12 @@ subroutine CPFEM_init debug_levelBasic, & debug_levelExtensive use FEsolving, only: & -#if defined(Marc4DAMASK) || defined(Abaqus) symmetricSolver, & -#endif restartRead, & modelName -#if defined(Marc4DAMASK) || defined(Abaqus) use mesh, only: & mesh_NcpElems, & mesh_maxNips -#endif use material, only: & material_phase, & homogState, & @@ -173,12 +160,10 @@ subroutine CPFEM_init #include "compilation_info.f90" endif mainProcess -#if defined(Marc4DAMASK) || defined(Abaqus) ! initialize stress and jacobian to zero allocate(CPFEM_cs(6,mesh_maxNips,mesh_NcpElems)) ; CPFEM_cs = 0.0_pReal allocate(CPFEM_dcsdE(6,6,mesh_maxNips,mesh_NcpElems)) ; CPFEM_dcsdE = 0.0_pReal allocate(CPFEM_dcsdE_knownGood(6,6,mesh_maxNips,mesh_NcpElems)) ; CPFEM_dcsdE_knownGood = 0.0_pReal -#endif ! *** restore the last converged values of each essential variable from the binary file if (restartRead) then @@ -243,21 +228,17 @@ subroutine CPFEM_init enddo readHomogInstances close (777) -#if defined(Marc4DAMASK) || defined(Abaqus) call IO_read_realFile(777,'convergeddcsdE',modelName,size(CPFEM_dcsdE)) read (777,rec=1) CPFEM_dcsdE close (777) -#endif restartRead = .false. endif -#if defined(Marc4DAMASK) || defined(Abaqus) if (iand(debug_level(debug_CPFEM), debug_levelBasic) /= 0) then write(6,'(a32,1x,6(i8,1x))') 'CPFEM_cs: ', shape(CPFEM_cs) write(6,'(a32,1x,6(i8,1x))') 'CPFEM_dcsdE: ', shape(CPFEM_dcsdE) write(6,'(a32,1x,6(i8,1x),/)') 'CPFEM_dcsdE_knownGood: ', shape(CPFEM_dcsdE_knownGood) write(6,'(a32,l1)') 'symmetricSolver: ', symmetricSolver endif -#endif flush(6) end subroutine CPFEM_init @@ -266,11 +247,7 @@ end subroutine CPFEM_init !-------------------------------------------------------------------------------------------------- !> @brief perform initialization at first call, update variables and call the actual material model !-------------------------------------------------------------------------------------------------- -#if defined(Marc4DAMASK) || defined(Abaqus) subroutine CPFEM_general(mode, parallelExecution, ffn, ffn1, temperature_inp, dt, elFE, ip, cauchyStress, jacobian) -#else -subroutine CPFEM_general(mode, ffn, ffn1, dt, elFE, ip) -#endif use numerics, only: & defgradTolerance, & iJacoStiffness, & @@ -281,7 +258,6 @@ subroutine CPFEM_general(mode, ffn, ffn1, dt, elFE, ip) debug_levelBasic, & debug_levelExtensive, & debug_levelSelective, & -#if defined(Marc4DAMASK) || defined(Abaqus) debug_stressMaxLocation, & debug_stressMinLocation, & debug_jacobianMaxLocation, & @@ -290,7 +266,6 @@ subroutine CPFEM_general(mode, ffn, ffn1, dt, elFE, ip) debug_stressMin, & debug_jacobianMax, & debug_jacobianMin, & -#endif debug_e, & debug_i use FEsolving, only: & @@ -348,12 +323,10 @@ subroutine CPFEM_general(mode, ffn, ffn1, dt, elFE, ip) use homogenization, only: & materialpoint_F, & materialpoint_F0, & -#if defined(Marc4DAMASK) || defined(Abaqus) materialpoint_P, & materialpoint_dPdF, & materialpoint_results, & materialpoint_sizeResults, & -#endif materialpoint_stressAndItsTangent, & materialpoint_postResults use IO, only: & @@ -368,7 +341,6 @@ subroutine CPFEM_general(mode, ffn, ffn1, dt, elFE, ip) real(pReal), dimension (3,3), intent(in) :: ffn, & !< deformation gradient for t=t0 ffn1 !< deformation gradient for t=t1 integer(pInt), intent(in) :: mode !< computation mode 1: regular computation plus aging of results -#if defined(Marc4DAMASK) || defined(Abaqus) real(pReal), intent(in) :: temperature_inp !< temperature logical, intent(in) :: parallelExecution !< flag indicating parallel computation of requested IPs real(pReal), dimension(6), intent(out) :: cauchyStress !< stress vector in Mandel notation @@ -381,20 +353,13 @@ subroutine CPFEM_general(mode, ffn, ffn1, dt, elFE, ip) real(pReal), dimension (3,3,3,3) :: H_sym, & H, & jacobian3333 ! jacobian in Matrix notation -#else - logical, parameter :: parallelExecution = .true. -#endif integer(pInt) elCP, & ! crystal plasticity element number i, j, k, l, m, n, ph, homog, mySource logical updateJaco ! flag indicating if JAcobian has to be updated character(len=1024) :: rankStr -#if defined(Marc4DAMASK) || defined(Abaqus) elCP = mesh_FEasCP('elem',elFE) -#else - elCP = elFE -#endif if (iand(debug_level(debug_CPFEM), debug_levelBasic) /= 0_pInt & .and. elCP == debug_e .and. ip == debug_i) then @@ -411,13 +376,10 @@ subroutine CPFEM_general(mode, ffn, ffn1, dt, elFE, ip) write(6,'(a,/)') '#############################################'; flush (6) endif - -#if defined(Marc4DAMASK) || defined(Abaqus) if (iand(mode, CPFEM_BACKUPJACOBIAN) /= 0_pInt) & CPFEM_dcsde_knownGood = CPFEM_dcsde if (iand(mode, CPFEM_RESTOREJACOBIAN) /= 0_pInt) & CPFEM_dcsde = CPFEM_dcsde_knownGood -#endif !*** age results and write restart data if requested if (iand(mode, CPFEM_AGERESULTS) /= 0_pInt) then @@ -514,11 +476,9 @@ subroutine CPFEM_general(mode, ffn, ffn1, dt, elFE, ip) enddo writeHomogInstances close (777) -#if defined(Marc4DAMASK) || defined(Abaqus) call IO_write_jobRealFile(777,'convergeddcsdE',size(CPFEM_dcsdE)) write (777,rec=1) CPFEM_dcsdE close (777) -#endif endif endif ! results aging @@ -529,22 +489,18 @@ subroutine CPFEM_general(mode, ffn, ffn1, dt, elFE, ip) !* If no parallel execution is required, there is no need to collect FEM input if (.not. parallelExecution) then -#if defined(Marc4DAMASK) || defined(Abaqus) temperature(material_homog(ip,elCP))%p(thermalMapping(material_homog(ip,elCP))%p(ip,elCP)) = & temperature_inp -#endif materialpoint_F0(1:3,1:3,ip,elCP) = ffn materialpoint_F(1:3,1:3,ip,elCP) = ffn1 elseif (iand(mode, CPFEM_COLLECT) /= 0_pInt) then -#if defined(Marc4DAMASK) || defined(Abaqus) call random_number(rnd) if (rnd < 0.5_pReal) rnd = rnd - 1.0_pReal CPFEM_cs(1:6,ip,elCP) = rnd * CPFEM_odd_stress CPFEM_dcsde(1:6,1:6,ip,elCP) = CPFEM_odd_jacobian * math_identity2nd(6) temperature(material_homog(ip,elCP))%p(thermalMapping(material_homog(ip,elCP))%p(ip,elCP)) = & temperature_inp -#endif materialpoint_F0(1:3,1:3,ip,elCP) = ffn materialpoint_F(1:3,1:3,ip,elCP) = ffn1 CPFEM_calc_done = .false. @@ -569,12 +525,10 @@ subroutine CPFEM_general(mode, ffn, ffn1, dt, elFE, ip) endif outdatedFFN1 = .true. endif -#if defined(Marc4DAMASK) || defined(Abaqus) call random_number(rnd) if (rnd < 0.5_pReal) rnd = rnd - 1.0_pReal CPFEM_cs(1:6,ip,elCP) = rnd*CPFEM_odd_stress CPFEM_dcsde(1:6,1:6,ip,elCP) = CPFEM_odd_jacobian*math_identity2nd(6) -#endif !*** deformation gradient is not outdated @@ -607,7 +561,6 @@ subroutine CPFEM_general(mode, ffn, ffn1, dt, elFE, ip) endif !* map stress and stiffness (or return odd values if terminally ill) -#if defined(Marc4DAMASK) || defined(Abaqus) terminalIllness: if ( terminallyIll ) then call random_number(rnd) @@ -648,11 +601,8 @@ subroutine CPFEM_general(mode, ffn, ffn1, dt, elFE, ip) CPFEM_dcsde(1:6,1:6,ip,elCP) = math_Mandel3333to66(J_inverse * H_sym) endif terminalIllness -#endif - endif validCalculation -#if defined(Marc4DAMASK) || defined(Abaqus) !* report stress and stiffness if ((iand(debug_level(debug_CPFEM), debug_levelExtensive) /= 0_pInt) & .and. ((debug_e == elCP .and. debug_i == ip) & @@ -663,11 +613,9 @@ subroutine CPFEM_general(mode, ffn, ffn1, dt, elFE, ip) '<< CPFEM >> Jacobian/GPa at elFE ip ', elFE, ip, transpose(CPFEM_dcsdE(1:6,1:6,ip,elCP))*1.0e-9_pReal flush(6) endif -#endif endif -#if defined(Marc4DAMASK) || defined(Abaqus) !*** warn if stiffness close to zero if (all(abs(CPFEM_dcsdE(1:6,1:6,ip,elCP)) < 1e-10_pReal)) call IO_warning(601,elCP,ip) @@ -696,7 +644,6 @@ subroutine CPFEM_general(mode, ffn, ffn1, dt, elFE, ip) debug_jacobianMinLocation = [elCP, ip] debug_jacobianMin = minval(jacobian3333) endif -#endif end subroutine CPFEM_general From 54d98a20466c6e9239dc905d0567240773e61a2e Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 21 Oct 2016 15:11:14 +0200 Subject: [PATCH 314/412] leftovers from perturbation calculation --- code/crystallite.f90 | 6 ------ 1 file changed, 6 deletions(-) diff --git a/code/crystallite.f90 b/code/crystallite.f90 index 399e63b0e..2212ba9a1 100644 --- a/code/crystallite.f90 +++ b/code/crystallite.f90 @@ -513,8 +513,6 @@ subroutine crystallite_stressAndItsTangent(updateJaco) subStepMinCryst, & subStepSizeCryst, & stepIncreaseCryst, & - pert_Fg, & - pert_method, & nCryst, & numerics_integrator, & numerics_integrationMode, & @@ -574,7 +572,6 @@ subroutine crystallite_stressAndItsTangent(updateJaco) logical, intent(in) :: & updateJaco !< whether to update the Jacobian (stiffness) or not real(pReal) :: & - myPert, & ! perturbation with correct sign formerSubStep, & subFracIntermediate real(pReal), dimension(3,3) :: & @@ -586,14 +583,11 @@ subroutine crystallite_stressAndItsTangent(updateJaco) c, & !< counter in integration point component loop i, & !< counter in integration point loop e, & !< counter in element loop - k, & - l, & n, startIP, endIP, & neighboring_e, & neighboring_i, & o, & p, & - perturbation , & ! loop counter for forward,backward perturbation mode myNcomponents, & mySource ! local variables used for calculating analytic Jacobian From 54c0ba5599f6444b08afcbb0f8bcd19ebac1f914 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 21 Oct 2016 15:12:40 +0200 Subject: [PATCH 315/412] Abaqus does not restore the jacobian (strange, but true) --- code/DAMASK_abaqus_std.f | 1 - 1 file changed, 1 deletion(-) diff --git a/code/DAMASK_abaqus_std.f b/code/DAMASK_abaqus_std.f index cdd12dac8..d15682c58 100644 --- a/code/DAMASK_abaqus_std.f +++ b/code/DAMASK_abaqus_std.f @@ -116,7 +116,6 @@ subroutine UMAT(STRESS,STATEV,DDSDDE,SSE,SPD,SCD,& CPFEM_CALCRESULTS, & CPFEM_AGERESULTS, & CPFEM_COLLECT, & - CPFEM_RESTOREJACOBIAN, & CPFEM_BACKUPJACOBIAN, & cycleCounter, & theInc, & From 20985f83b51f7995e31c1016bf12809edf774c78 Mon Sep 17 00:00:00 2001 From: Test User Date: Sat, 22 Oct 2016 11:02:13 +0200 Subject: [PATCH 316/412] updated version information after successful test of v2.0.1-249-g54c0ba5 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 110bfbbce..6a2d0648d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-244-g12e94bd +v2.0.1-249-g54c0ba5 From 41f01e16cd1ad0a55f751bb54baa44c39fa96556 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 22 Oct 2016 12:16:02 +0200 Subject: [PATCH 317/412] using PETSC_NULL_OBJECT instead of dummy where possible --- code/spectral_damage.f90 | 4 ++-- code/spectral_mech_AL.f90 | 5 ++--- code/spectral_mech_Basic.f90 | 5 ++--- code/spectral_mech_Polarisation.f90 | 5 ++--- code/spectral_thermal.f90 | 4 ++-- 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/code/spectral_damage.f90 b/code/spectral_damage.f90 index 6260fe43a..3803d482e 100644 --- a/code/spectral_damage.f90 +++ b/code/spectral_damage.f90 @@ -81,7 +81,6 @@ subroutine spectral_damage_init() DM :: damage_grid Vec :: uBound, lBound PetscErrorCode :: ierr - PetscObject :: dummy character(len=100) :: snes_type external :: & @@ -124,7 +123,8 @@ subroutine spectral_damage_init() CHKERRQ(ierr) call SNESSetDM(damage_snes,damage_grid,ierr); CHKERRQ(ierr) !< connect snes to da call DMCreateGlobalVector(damage_grid,solution,ierr); CHKERRQ(ierr) !< global solution vector (grid x 1, i.e. every def grad tensor) - call DMDASNESSetFunctionLocal(damage_grid,INSERT_VALUES,spectral_damage_formResidual,dummy,ierr) !< residual vector of same shape as solution vector + call DMDASNESSetFunctionLocal(damage_grid,INSERT_VALUES,spectral_damage_formResidual,& + PETSC_NULL_OBJECT,ierr) !< residual vector of same shape as solution vector CHKERRQ(ierr) call SNESSetFromOptions(damage_snes,ierr); CHKERRQ(ierr) !< pull it all together with additional cli arguments call SNESGetType(damage_snes,snes_type,ierr); CHKERRQ(ierr) diff --git a/code/spectral_mech_AL.f90 b/code/spectral_mech_AL.f90 index 0077ba2c3..f74d76ead 100644 --- a/code/spectral_mech_AL.f90 +++ b/code/spectral_mech_AL.f90 @@ -116,7 +116,6 @@ subroutine AL_init temp33_Real = 0.0_pReal PetscErrorCode :: ierr - PetscObject :: dummy PetscScalar, pointer, dimension(:,:,:,:) :: xx_psc, F, F_lambda integer(pInt), dimension(:), allocatable :: localK integer(pInt) :: proc @@ -165,9 +164,9 @@ subroutine AL_init CHKERRQ(ierr) call SNESSetDM(snes,da,ierr); CHKERRQ(ierr) call DMCreateGlobalVector(da,solution_vec,ierr); CHKERRQ(ierr) - call DMDASNESSetFunctionLocal(da,INSERT_VALUES,AL_formResidual,dummy,ierr) + call DMDASNESSetFunctionLocal(da,INSERT_VALUES,AL_formResidual,PETSC_NULL_OBJECT,ierr) CHKERRQ(ierr) - call SNESSetConvergenceTest(snes,AL_converged,dummy,PETSC_NULL_FUNCTION,ierr) + call SNESSetConvergenceTest(snes,AL_converged,PETSC_NULL_OBJECT,PETSC_NULL_FUNCTION,ierr) CHKERRQ(ierr) call SNESSetFromOptions(snes,ierr); CHKERRQ(ierr) diff --git a/code/spectral_mech_Basic.f90 b/code/spectral_mech_Basic.f90 index 445fbdf10..7b8c7996f 100644 --- a/code/spectral_mech_Basic.f90 +++ b/code/spectral_mech_Basic.f90 @@ -105,7 +105,6 @@ subroutine basicPETSc_init temp33_Real = 0.0_pReal PetscErrorCode :: ierr - PetscObject :: dummy PetscScalar, pointer, dimension(:,:,:,:) :: F integer(pInt), dimension(:), allocatable :: localK @@ -153,10 +152,10 @@ subroutine basicPETSc_init CHKERRQ(ierr) call SNESSetDM(snes,da,ierr); CHKERRQ(ierr) call DMCreateGlobalVector(da,solution_vec,ierr); CHKERRQ(ierr) ! global solution vector (grid x 9, i.e. every def grad tensor) - call DMDASNESSetFunctionLocal(da,INSERT_VALUES,BasicPETSC_formResidual,dummy,ierr) ! residual vector of same shape as solution vector + call DMDASNESSetFunctionLocal(da,INSERT_VALUES,BasicPETSC_formResidual,PETSC_NULL_OBJECT,ierr) ! residual vector of same shape as solution vector CHKERRQ(ierr) call SNESSetDM(snes,da,ierr); CHKERRQ(ierr) ! connect snes to da - call SNESSetConvergenceTest(snes,BasicPETSC_converged,dummy,PETSC_NULL_FUNCTION,ierr) ! specify custom convergence check function "_converged" + call SNESSetConvergenceTest(snes,BasicPETSC_converged,PETSC_NULL_OBJECT,PETSC_NULL_FUNCTION,ierr) ! specify custom convergence check function "_converged" CHKERRQ(ierr) call SNESSetFromOptions(snes,ierr); CHKERRQ(ierr) ! pull it all together with additional cli arguments diff --git a/code/spectral_mech_Polarisation.f90 b/code/spectral_mech_Polarisation.f90 index fc9fae7d7..2c309bc69 100644 --- a/code/spectral_mech_Polarisation.f90 +++ b/code/spectral_mech_Polarisation.f90 @@ -116,7 +116,6 @@ subroutine Polarisation_init temp33_Real = 0.0_pReal PetscErrorCode :: ierr - PetscObject :: dummy PetscScalar, pointer, dimension(:,:,:,:) :: xx_psc, F, F_tau integer(pInt), dimension(:), allocatable :: localK integer(pInt) :: proc @@ -165,9 +164,9 @@ subroutine Polarisation_init CHKERRQ(ierr) call SNESSetDM(snes,da,ierr); CHKERRQ(ierr) call DMCreateGlobalVector(da,solution_vec,ierr); CHKERRQ(ierr) - call DMDASNESSetFunctionLocal(da,INSERT_VALUES,Polarisation_formResidual,dummy,ierr) + call DMDASNESSetFunctionLocal(da,INSERT_VALUES,Polarisation_formResidual,PETSC_NULL_OBJECT,ierr) CHKERRQ(ierr) - call SNESSetConvergenceTest(snes,Polarisation_converged,dummy,PETSC_NULL_FUNCTION,ierr) + call SNESSetConvergenceTest(snes,Polarisation_converged,PETSC_NULL_OBJECT,PETSC_NULL_FUNCTION,ierr) CHKERRQ(ierr) call SNESSetFromOptions(snes,ierr); CHKERRQ(ierr) diff --git a/code/spectral_thermal.f90 b/code/spectral_thermal.f90 index bb5747574..e440fcf26 100644 --- a/code/spectral_thermal.f90 +++ b/code/spectral_thermal.f90 @@ -86,7 +86,6 @@ subroutine spectral_thermal_init DM :: thermal_grid PetscScalar, dimension(:,:,:), pointer :: x_scal PetscErrorCode :: ierr - PetscObject :: dummy external :: & SNESCreate, & @@ -123,7 +122,8 @@ subroutine spectral_thermal_init CHKERRQ(ierr) call SNESSetDM(thermal_snes,thermal_grid,ierr); CHKERRQ(ierr) ! connect snes to da call DMCreateGlobalVector(thermal_grid,solution ,ierr); CHKERRQ(ierr) ! global solution vector (grid x 1, i.e. every def grad tensor) - call DMDASNESSetFunctionLocal(thermal_grid,INSERT_VALUES,spectral_thermal_formResidual,dummy,ierr) ! residual vector of same shape as solution vector + call DMDASNESSetFunctionLocal(thermal_grid,INSERT_VALUES,spectral_thermal_formResidual,& + PETSC_NULL_OBJECT,ierr) ! residual vector of same shape as solution vector CHKERRQ(ierr) call SNESSetFromOptions(thermal_snes,ierr); CHKERRQ(ierr) ! pull it all together with additional cli arguments From b5c1b49137877f16d4782142401464f5a53b68ad Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 22 Oct 2016 12:17:18 +0200 Subject: [PATCH 318/412] unified definition of NaN for Intel and GNU Fortran (works for Intel 15. und 16.) --- code/prec.f90 | 5 ----- 1 file changed, 5 deletions(-) diff --git a/code/prec.f90 b/code/prec.f90 index b123d02d0..f5e787237 100644 --- a/code/prec.f90 +++ b/code/prec.f90 @@ -20,12 +20,7 @@ module prec private #if (FLOAT==8) integer, parameter, public :: pReal = 8 !< floating point double precision (was selected_real_kind(15,300), number with 15 significant digits, up to 1e+-300) -#ifdef __INTEL_COMPILER - real(pReal), parameter, public :: DAMASK_NaN = Z'7FF8000000000000' !< quiet NaN for double precision (from http://www.hpc.unimelb.edu.au/doc/f90lrm/dfum_035.html) -#endif -#ifdef __GFORTRAN__ real(pReal), parameter, public :: DAMASK_NaN = real(Z'7FF8000000000000',pReal) !< quiet NaN for double precision (from http://www.hpc.unimelb.edu.au/doc/f90lrm/dfum_035.html) -#endif #else NO SUITABLE PRECISION FOR REAL SELECTED, STOPPING COMPILATION #endif From cfb90c83d06313dfdb0047ba77eb810f20d48184 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 22 Oct 2016 13:24:50 +0200 Subject: [PATCH 319/412] more infos for humans and compilers --- code/spectral_damage.f90 | 4 ++-- code/spectral_mech_AL.f90 | 4 ++-- code/spectral_mech_Basic.f90 | 4 ++-- code/spectral_mech_Polarisation.f90 | 4 ++-- code/spectral_thermal.f90 | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/code/spectral_damage.f90 b/code/spectral_damage.f90 index 3803d482e..adbab4f16 100644 --- a/code/spectral_damage.f90 +++ b/code/spectral_damage.f90 @@ -283,10 +283,10 @@ subroutine spectral_damage_formResidual(in,x_scal,f_scal,dummy,ierr) DMDALocalInfo, dimension(DMDA_LOCAL_INFO_SIZE) :: & in PetscScalar, dimension( & - XG_RANGE,YG_RANGE,ZG_RANGE) :: & + XG_RANGE,YG_RANGE,ZG_RANGE), intent(in) :: & x_scal PetscScalar, dimension( & - X_RANGE,Y_RANGE,Z_RANGE) :: & + X_RANGE,Y_RANGE,Z_RANGE), intent(out) :: & f_scal PetscObject :: dummy PetscErrorCode :: ierr diff --git a/code/spectral_mech_AL.f90 b/code/spectral_mech_AL.f90 index f74d76ead..ebbe212be 100644 --- a/code/spectral_mech_AL.f90 +++ b/code/spectral_mech_AL.f90 @@ -368,10 +368,10 @@ subroutine AL_formResidual(in,x_scal,f_scal,dummy,ierr) DMDA_LOCAL_INFO_SIZE) :: & in PetscScalar, target, dimension(3,3,2, & - XG_RANGE,YG_RANGE,ZG_RANGE) :: & + XG_RANGE,YG_RANGE,ZG_RANGE), intent(in) :: & x_scal PetscScalar, target, dimension(3,3,2, & - X_RANGE,Y_RANGE,Z_RANGE) :: & + X_RANGE,Y_RANGE,Z_RANGE), intent(out) :: & f_scal PetscScalar, pointer, dimension(:,:,:,:,:) :: & F, & diff --git a/code/spectral_mech_Basic.f90 b/code/spectral_mech_Basic.f90 index 7b8c7996f..8d3e18263 100644 --- a/code/spectral_mech_Basic.f90 +++ b/code/spectral_mech_Basic.f90 @@ -330,10 +330,10 @@ subroutine BasicPETSC_formResidual(in,x_scal,f_scal,dummy,ierr) DMDALocalInfo, dimension(DMDA_LOCAL_INFO_SIZE) :: & in PetscScalar, dimension(3,3, & - XG_RANGE,YG_RANGE,ZG_RANGE) :: & + XG_RANGE,YG_RANGE,ZG_RANGE), intent(in) :: & x_scal PetscScalar, dimension(3,3, & - X_RANGE,Y_RANGE,Z_RANGE) :: & + X_RANGE,Y_RANGE,Z_RANGE), intent(out) :: & f_scal PetscInt :: & PETScIter, & diff --git a/code/spectral_mech_Polarisation.f90 b/code/spectral_mech_Polarisation.f90 index 2c309bc69..882d13c75 100644 --- a/code/spectral_mech_Polarisation.f90 +++ b/code/spectral_mech_Polarisation.f90 @@ -368,10 +368,10 @@ subroutine Polarisation_formResidual(in,x_scal,f_scal,dummy,ierr) DMDA_LOCAL_INFO_SIZE) :: & in PetscScalar, target, dimension(3,3,2, & - XG_RANGE,YG_RANGE,ZG_RANGE) :: & + XG_RANGE,YG_RANGE,ZG_RANGE), intent(in) :: & x_scal PetscScalar, target, dimension(3,3,2, & - X_RANGE,Y_RANGE,Z_RANGE) :: & + X_RANGE,Y_RANGE,Z_RANGE), intent(out) :: & f_scal PetscScalar, pointer, dimension(:,:,:,:,:) :: & F, & diff --git a/code/spectral_thermal.f90 b/code/spectral_thermal.f90 index e440fcf26..a3e02dfe1 100644 --- a/code/spectral_thermal.f90 +++ b/code/spectral_thermal.f90 @@ -283,10 +283,10 @@ subroutine spectral_thermal_formResidual(in,x_scal,f_scal,dummy,ierr) DMDALocalInfo, dimension(DMDA_LOCAL_INFO_SIZE) :: & in PetscScalar, dimension( & - XG_RANGE,YG_RANGE,ZG_RANGE) :: & + XG_RANGE,YG_RANGE,ZG_RANGE), intent(in) :: & x_scal PetscScalar, dimension( & - X_RANGE,Y_RANGE,Z_RANGE) :: & + X_RANGE,Y_RANGE,Z_RANGE), intent(out) :: & f_scal PetscObject :: dummy PetscErrorCode :: ierr From 8c1fe4fff065d2b3fe9de73619139b68ff3b2788 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 22 Oct 2016 13:40:45 +0200 Subject: [PATCH 320/412] no need to have unused dummy arguments --- code/DAMASK_spectral.f90 | 24 +++++++----------------- code/spectral_damage.f90 | 10 ++-------- code/spectral_mech_AL.f90 | 10 +++------- code/spectral_mech_Basic.f90 | 10 +++------- code/spectral_mech_Polarisation.f90 | 10 +++------- code/spectral_thermal.f90 | 10 ++-------- 6 files changed, 20 insertions(+), 54 deletions(-) diff --git a/code/DAMASK_spectral.f90 b/code/DAMASK_spectral.f90 index 67e3f4042..122e126ea 100644 --- a/code/DAMASK_spectral.f90 +++ b/code/DAMASK_spectral.f90 @@ -541,13 +541,8 @@ program DAMASK_spectral rotation_BC = loadCases(currentLoadCase)%rotation) end select - case(FIELD_THERMAL_ID) - call spectral_thermal_forward (& - guess,timeinc,timeIncOld,remainingLoadCaseTime) - - case(FIELD_DAMAGE_ID) - call spectral_damage_forward (& - guess,timeinc,timeIncOld,remainingLoadCaseTime) + case(FIELD_THERMAL_ID); call spectral_thermal_forward() + case(FIELD_DAMAGE_ID); call spectral_damage_forward() end select enddo @@ -562,34 +557,29 @@ program DAMASK_spectral select case (spectral_solver) case (DAMASK_spectral_SolverBasicPETSc_label) solres(field) = BasicPETSC_solution (& - incInfo,guess,timeinc,timeIncOld,remainingLoadCaseTime, & + incInfo,timeinc,timeIncOld, & P_BC = loadCases(currentLoadCase)%P, & - F_BC = loadCases(currentLoadCase)%deformation, & rotation_BC = loadCases(currentLoadCase)%rotation) case (DAMASK_spectral_SolverAL_label) solres(field) = AL_solution (& - incInfo,guess,timeinc,timeIncOld,remainingLoadCaseTime, & + incInfo,timeinc,timeIncOld, & P_BC = loadCases(currentLoadCase)%P, & - F_BC = loadCases(currentLoadCase)%deformation, & rotation_BC = loadCases(currentLoadCase)%rotation) case (DAMASK_spectral_SolverPolarisation_label) solres(field) = Polarisation_solution (& - incInfo,guess,timeinc,timeIncOld,remainingLoadCaseTime, & + incInfo,timeinc,timeIncOld, & P_BC = loadCases(currentLoadCase)%P, & - F_BC = loadCases(currentLoadCase)%deformation, & rotation_BC = loadCases(currentLoadCase)%rotation) end select case(FIELD_THERMAL_ID) - solres(field) = spectral_thermal_solution (& - guess,timeinc,timeIncOld,remainingLoadCaseTime) + solres(field) = spectral_thermal_solution(timeinc,timeIncOld,remainingLoadCaseTime) case(FIELD_DAMAGE_ID) - solres(field) = spectral_damage_solution (& - guess,timeinc,timeIncOld,remainingLoadCaseTime) + solres(field) = spectral_damage_solution(timeinc,timeIncOld,remainingLoadCaseTime) end select if (.not. solres(field)%converged) exit ! no solution found diff --git a/code/spectral_damage.f90 b/code/spectral_damage.f90 index adbab4f16..0c03c3b85 100644 --- a/code/spectral_damage.f90 +++ b/code/spectral_damage.f90 @@ -171,7 +171,7 @@ end subroutine spectral_damage_init !-------------------------------------------------------------------------------------------------- !> @brief solution for the spectral damage scheme with internal iterations !-------------------------------------------------------------------------------------------------- -type(tSolutionState) function spectral_damage_solution(guess,timeinc,timeinc_old,loadCaseTime) +type(tSolutionState) function spectral_damage_solution(timeinc,timeinc_old,loadCaseTime) use numerics, only: & itmax, & err_damage_tolAbs, & @@ -190,7 +190,6 @@ type(tSolutionState) function spectral_damage_solution(guess,timeinc,timeinc_old timeinc, & !< increment in time for current solution timeinc_old, & !< increment in time of last increment loadCaseTime !< remaining time of current load case - logical, intent(in) :: guess integer(pInt) :: i, j, k, cell PetscInt ::position PetscReal :: minDamage, maxDamage, stagNorm, solnNorm @@ -341,7 +340,7 @@ end subroutine spectral_damage_formResidual !-------------------------------------------------------------------------------------------------- !> @brief spectral damage forwarding routine !-------------------------------------------------------------------------------------------------- -subroutine spectral_damage_forward(guess,timeinc,timeinc_old,loadCaseTime) +subroutine spectral_damage_forward() use mesh, only: & grid, & grid3 @@ -354,11 +353,6 @@ subroutine spectral_damage_forward(guess,timeinc,timeinc_old,loadCaseTime) damage_nonlocal_getMobility implicit none - real(pReal), intent(in) :: & - timeinc_old, & - timeinc, & - loadCaseTime !< remaining time of current load case - logical, intent(in) :: guess integer(pInt) :: i, j, k, cell DM :: dm_local PetscScalar, dimension(:,:,:), pointer :: x_scal diff --git a/code/spectral_mech_AL.f90 b/code/spectral_mech_AL.f90 index ebbe212be..6272c1493 100644 --- a/code/spectral_mech_AL.f90 +++ b/code/spectral_mech_AL.f90 @@ -244,7 +244,7 @@ end subroutine AL_init !> @brief solution for the AL scheme with internal iterations !-------------------------------------------------------------------------------------------------- type(tSolutionState) function & - AL_solution(incInfoIn,guess,timeinc,timeinc_old,loadCaseTime,P_BC,F_BC,rotation_BC) + AL_solution(incInfoIn,timeinc,timeinc_old,P_BC,rotation_BC) use IO, only: & IO_error use numerics, only: & @@ -265,13 +265,9 @@ type(tSolutionState) function & ! input data for solution real(pReal), intent(in) :: & timeinc, & !< increment in time for current solution - timeinc_old, & !< increment in time of last increment - loadCaseTime !< remaining time of current load case - logical, intent(in) :: & - guess + timeinc_old !< increment in time of last increment type(tBoundaryCondition), intent(in) :: & - P_BC, & - F_BC + P_BC character(len=*), intent(in) :: & incInfoIn real(pReal), dimension(3,3), intent(in) :: rotation_BC diff --git a/code/spectral_mech_Basic.f90 b/code/spectral_mech_Basic.f90 index 8d3e18263..8bac5bd76 100644 --- a/code/spectral_mech_Basic.f90 +++ b/code/spectral_mech_Basic.f90 @@ -219,7 +219,7 @@ end subroutine basicPETSc_init !> @brief solution for the Basic PETSC scheme with internal iterations !-------------------------------------------------------------------------------------------------- type(tSolutionState) function & - basicPETSc_solution(incInfoIn,guess,timeinc,timeinc_old,loadCaseTime,P_BC,F_BC,rotation_BC) + basicPETSc_solution(incInfoIn,timeinc,timeinc_old,P_BC,rotation_BC) use IO, only: & IO_error use numerics, only: & @@ -238,13 +238,9 @@ type(tSolutionState) function & ! input data for solution real(pReal), intent(in) :: & timeinc, & !< increment in time for current solution - timeinc_old, & !< increment in time of last increment - loadCaseTime !< remaining time of current load case - logical, intent(in) :: & - guess + timeinc_old !< increment in time of last increment type(tBoundaryCondition), intent(in) :: & - P_BC, & - F_BC + P_BC character(len=*), intent(in) :: & incInfoIn real(pReal), dimension(3,3), intent(in) :: rotation_BC diff --git a/code/spectral_mech_Polarisation.f90 b/code/spectral_mech_Polarisation.f90 index 882d13c75..35048f37c 100644 --- a/code/spectral_mech_Polarisation.f90 +++ b/code/spectral_mech_Polarisation.f90 @@ -244,7 +244,7 @@ end subroutine Polarisation_init !> @brief solution for the Polarisation scheme with internal iterations !-------------------------------------------------------------------------------------------------- type(tSolutionState) function & - Polarisation_solution(incInfoIn,guess,timeinc,timeinc_old,loadCaseTime,P_BC,F_BC,rotation_BC) + Polarisation_solution(incInfoIn,timeinc,timeinc_old,P_BC,rotation_BC) use IO, only: & IO_error use numerics, only: & @@ -265,13 +265,9 @@ type(tSolutionState) function & ! input data for solution real(pReal), intent(in) :: & timeinc, & !< increment in time for current solution - timeinc_old, & !< increment in time of last increment - loadCaseTime !< remaining time of current load case - logical, intent(in) :: & - guess + timeinc_old !< increment in time of last increment type(tBoundaryCondition), intent(in) :: & - P_BC, & - F_BC + P_BC character(len=*), intent(in) :: & incInfoIn real(pReal), dimension(3,3), intent(in) :: rotation_BC diff --git a/code/spectral_thermal.f90 b/code/spectral_thermal.f90 index a3e02dfe1..490325ab7 100644 --- a/code/spectral_thermal.f90 +++ b/code/spectral_thermal.f90 @@ -170,7 +170,7 @@ end subroutine spectral_thermal_init !-------------------------------------------------------------------------------------------------- !> @brief solution for the spectral thermal scheme with internal iterations !-------------------------------------------------------------------------------------------------- -type(tSolutionState) function spectral_thermal_solution(guess,timeinc,timeinc_old,loadCaseTime) +type(tSolutionState) function spectral_thermal_solution(timeinc,timeinc_old,loadCaseTime) use numerics, only: & itmax, & err_thermal_tolAbs, & @@ -189,7 +189,6 @@ type(tSolutionState) function spectral_thermal_solution(guess,timeinc,timeinc_ol timeinc, & !< increment in time for current solution timeinc_old, & !< increment in time of last increment loadCaseTime !< remaining time of current load case - logical, intent(in) :: guess integer(pInt) :: i, j, k, cell PetscInt :: position PetscReal :: minTemperature, maxTemperature, stagNorm, solnNorm @@ -337,7 +336,7 @@ end subroutine spectral_thermal_formResidual !-------------------------------------------------------------------------------------------------- !> @brief forwarding routine !-------------------------------------------------------------------------------------------------- -subroutine spectral_thermal_forward(guess,timeinc,timeinc_old,loadCaseTime) +subroutine spectral_thermal_forward() use mesh, only: & grid, & grid3 @@ -351,11 +350,6 @@ subroutine spectral_thermal_forward(guess,timeinc,timeinc_old,loadCaseTime) thermal_conduction_getSpecificHeat implicit none - real(pReal), intent(in) :: & - timeinc_old, & - timeinc, & - loadCaseTime !< remaining time of current load case - logical, intent(in) :: guess integer(pInt) :: i, j, k, cell DM :: dm_local PetscScalar, dimension(:,:,:), pointer :: x_scal From 1f5a3f474c4c351c04b16ff28d12e7f4580556b6 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 24 Oct 2016 10:33:01 +0200 Subject: [PATCH 321/412] consistent use of same name for communicator will not make any difference, but clearer to understand http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PETSC_COMM_WORLD.html --- code/mesh.f90 | 4 +-- code/spectral_interface.f90 | 2 +- code/spectral_utilities.f90 | 52 ++++++++++++++++++++----------------- 3 files changed, 31 insertions(+), 27 deletions(-) diff --git a/code/mesh.f90 b/code/mesh.f90 index 32f94d66b..7da3d4968 100644 --- a/code/mesh.f90 +++ b/code/mesh.f90 @@ -549,13 +549,13 @@ subroutine mesh_init(ip,el) call IO_open_file(FILEUNIT,geometryFile) ! parse info from geometry file... if (myDebug) write(6,'(a)') ' Opened geometry file'; flush(6) grid = mesh_spectral_getGrid(fileUnit) - call MPI_comm_size(MPI_COMM_WORLD, worldsize, ierr) + call MPI_comm_size(PETSC_COMM_WORLD, worldsize, ierr) if(ierr /=0_pInt) call IO_error(894_pInt, ext_msg='MPI_comm_size') if(worldsize>grid(3)) call IO_error(894_pInt, ext_msg='number of processes exceeds grid(3)') geomSize = mesh_spectral_getSize(fileUnit) devNull = fftw_mpi_local_size_3d(int(grid(3),C_INTPTR_T),int(grid(2),C_INTPTR_T),& - int(grid(1),C_INTPTR_T)/2+1,MPI_COMM_WORLD,local_K,local_K_offset) + int(grid(1),C_INTPTR_T)/2+1,PETSC_COMM_WORLD,local_K,local_K_offset) grid3 = int(local_K,pInt) grid3Offset = int(local_K_offset,pInt) size3 = geomSize(3)*real(grid3,pReal) /real(grid(3),pReal) diff --git a/code/spectral_interface.f90 b/code/spectral_interface.f90 index 7050d7b45..8d9a41619 100644 --- a/code/spectral_interface.f90 +++ b/code/spectral_interface.f90 @@ -89,7 +89,7 @@ subroutine DAMASK_interface_init() call PetscInitialize(PETSC_NULL_CHARACTER,ierr) ! according to PETSc manual, that should be the first line in the code CHKERRQ(ierr) ! this is a macro definition, it is case sensitive call MPI_Comm_rank(PETSC_COMM_WORLD,worldrank,ierr);CHKERRQ(ierr) - call MPI_Comm_size(MPI_COMM_WORLD, worldsize, ierr);CHKERRQ(ierr) + call MPI_Comm_size(PETSC_COMM_WORLD,worldsize,ierr);CHKERRQ(ierr) mainProcess: if (worldrank == 0) then if (output_unit /= 6) then write(output_unit,'(a)') ' STDOUT != 6' diff --git a/code/spectral_utilities.f90 b/code/spectral_utilities.f90 index 1a86b7648..e42f1ef5d 100644 --- a/code/spectral_utilities.f90 +++ b/code/spectral_utilities.f90 @@ -1,3 +1,4 @@ +!-------------------------------------------------------------------------------------------------- !> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH !> @author Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH !> @brief Utilities used by the different spectral solver variants @@ -227,9 +228,12 @@ subroutine utilities_init() ' add more using the PETSc_Options keyword in numerics.config '; flush(6) call PetscOptionsClear(ierr); CHKERRQ(ierr) - if(debugPETSc) call PetscOptionsInsertString(trim(PETSCDEBUG),ierr); CHKERRQ(ierr) - call PetscOptionsInsertString(trim(petsc_defaultOptions),ierr); CHKERRQ(ierr) - call PetscOptionsInsertString(trim(petsc_options),ierr); CHKERRQ(ierr) + if(debugPETSc) call PetscOptionsInsertString(trim(PETSCDEBUG),ierr) + CHKERRQ(ierr) + call PetscOptionsInsertString(trim(petsc_defaultOptions),ierr) + CHKERRQ(ierr) + call PetscOptionsInsertString(trim(petsc_options),ierr) + CHKERRQ(ierr) grid1Red = grid(1)/2_pInt + 1_pInt wgt = 1.0/real(product(grid),pReal) @@ -238,11 +242,11 @@ subroutine utilities_init() write(6,'(a,3(es12.5))') ' size x y z: ', geomSize select case (spectral_derivative) - case ('continuous') ! default, no weighting + case ('continuous') spectral_derivative_ID = DERIVATIVE_CONTINUOUS_ID - case ('central_difference') ! cosine curve with 1 for avg and zero for highest freq + case ('central_difference') spectral_derivative_ID = DERIVATIVE_CENTRAL_DIFF_ID - case ('fwbw_difference') ! gradient, might need grid scaling as for cosine filter + case ('fwbw_difference') spectral_derivative_ID = DERIVATIVE_FWBW_DIFF_ID case default call IO_error(892_pInt,ext_msg=trim(spectral_derivative)) @@ -271,9 +275,9 @@ subroutine utilities_init() ! MPI allocation gridFFTW = int(grid,C_INTPTR_T) alloc_local = fftw_mpi_local_size_3d(gridFFTW(3), gridFFTW(2), gridFFTW(1)/2 +1, & - MPI_COMM_WORLD, local_K, local_K_offset) - allocate (xi1st (3,grid1Red,grid(2),grid3),source = cmplx(0.0_pReal,0.0_pReal,pReal)) ! frequencies, only half the size for first dimension - allocate (xi2nd (3,grid1Red,grid(2),grid3),source = cmplx(0.0_pReal,0.0_pReal,pReal)) ! frequencies, only half the size for first dimension + PETSC_COMM_WORLD, local_K, local_K_offset) + allocate (xi1st (3,grid1Red,grid(2),grid3),source = cmplx(0.0_pReal,0.0_pReal,pReal)) ! frequencies for first derivatives, only half the size for first dimension + allocate (xi2nd (3,grid1Red,grid(2),grid3),source = cmplx(0.0_pReal,0.0_pReal,pReal)) ! frequencies for second derivatives, only half the size for first dimension tensorField = fftw_alloc_complex(tensorSize*alloc_local) call c_f_pointer(tensorField, tensorField_real, [3_C_INTPTR_T,3_C_INTPTR_T, & @@ -298,12 +302,12 @@ subroutine utilities_init() planTensorForth = fftw_mpi_plan_many_dft_r2c(3, [gridFFTW(3),gridFFTW(2),gridFFTW(1)], & ! dimension, logical length in each dimension in reversed order tensorSize, FFTW_MPI_DEFAULT_BLOCK, FFTW_MPI_DEFAULT_BLOCK, &! no. of transforms, default iblock and oblock tensorField_real, tensorField_fourier, & ! input data, output data - MPI_COMM_WORLD, fftw_planner_flag) ! use all processors, planer precision + PETSC_COMM_WORLD, fftw_planner_flag) ! use all processors, planer precision if (.not. C_ASSOCIATED(planTensorForth)) call IO_error(810, ext_msg='planTensorForth') planTensorBack = fftw_mpi_plan_many_dft_c2r(3, [gridFFTW(3),gridFFTW(2),gridFFTW(1)], & ! dimension, logical length in each dimension in reversed order tensorSize, FFTW_MPI_DEFAULT_BLOCK, FFTW_MPI_DEFAULT_BLOCK, &! no. of transforms, default iblock and oblock tensorField_fourier,tensorField_real, & ! input data, output data - MPI_COMM_WORLD, fftw_planner_flag) ! all processors, planer precision + PETSC_COMM_WORLD, fftw_planner_flag) ! all processors, planer precision if (.not. C_ASSOCIATED(planTensorBack)) call IO_error(810, ext_msg='planTensorBack') !-------------------------------------------------------------------------------------------------- @@ -311,12 +315,12 @@ subroutine utilities_init() planVectorForth = fftw_mpi_plan_many_dft_r2c(3, [gridFFTW(3),gridFFTW(2),gridFFTW(1)], & ! dimension, logical length in each dimension in reversed order vecSize, FFTW_MPI_DEFAULT_BLOCK, FFTW_MPI_DEFAULT_BLOCK, &! no. of transforms, default iblock and oblock vectorField_real, vectorField_fourier, & ! input data, output data - MPI_COMM_WORLD, fftw_planner_flag) ! use all processors, planer precision + PETSC_COMM_WORLD, fftw_planner_flag) ! use all processors, planer precision if (.not. C_ASSOCIATED(planVectorForth)) call IO_error(810, ext_msg='planVectorForth') planVectorBack = fftw_mpi_plan_many_dft_c2r(3, [gridFFTW(3),gridFFTW(2),gridFFTW(1)], & ! dimension, logical length in each dimension in reversed order vecSize, FFTW_MPI_DEFAULT_BLOCK, FFTW_MPI_DEFAULT_BLOCK, & ! no. of transforms, default iblock and oblock vectorField_fourier,vectorField_real, & ! input data, output data - MPI_COMM_WORLD, fftw_planner_flag) ! all processors, planer precision + PETSC_COMM_WORLD, fftw_planner_flag) ! all processors, planer precision if (.not. C_ASSOCIATED(planVectorBack)) call IO_error(810, ext_msg='planVectorBack') !-------------------------------------------------------------------------------------------------- @@ -324,12 +328,12 @@ subroutine utilities_init() planScalarForth = fftw_mpi_plan_many_dft_r2c(3, [gridFFTW(3),gridFFTW(2),gridFFTW(1)], & ! dimension, logical length in each dimension in reversed order scalarSize, FFTW_MPI_DEFAULT_BLOCK, FFTW_MPI_DEFAULT_BLOCK, & ! no. of transforms, default iblock and oblock scalarField_real, scalarField_fourier, & ! input data, output data - MPI_COMM_WORLD, fftw_planner_flag) ! use all processors, planer precision + PETSC_COMM_WORLD, fftw_planner_flag) ! use all processors, planer precision if (.not. C_ASSOCIATED(planScalarForth)) call IO_error(810, ext_msg='planScalarForth') - planScalarBack = fftw_mpi_plan_many_dft_c2r(3, [gridFFTW(3),gridFFTW(2),gridFFTW(1)], & ! dimension, logical length in each dimension in reversed order, no. of transforms + planScalarBack = fftw_mpi_plan_many_dft_c2r(3, [gridFFTW(3),gridFFTW(2),gridFFTW(1)], & ! dimension, logical length in each dimension in reversed order, no. of transforms scalarSize, FFTW_MPI_DEFAULT_BLOCK, FFTW_MPI_DEFAULT_BLOCK, & ! no. of transforms, default iblock and oblock - scalarField_fourier,scalarField_real, & ! input data, output data - MPI_COMM_WORLD, fftw_planner_flag) ! use all processors, planer precision + scalarField_fourier,scalarField_real, & ! input data, output data + PETSC_COMM_WORLD, fftw_planner_flag) ! use all processors, planer precision if (.not. C_ASSOCIATED(planScalarBack)) call IO_error(810, ext_msg='planScalarBack') !-------------------------------------------------------------------------------------------------- @@ -699,8 +703,8 @@ real(pReal) function utilities_curlRMS() curl_fourier(l,3) = (+tensorField_fourier(l,2,i,j,k)*xi1st(1,i,j,k)*rescaledGeom(1) & -tensorField_fourier(l,1,i,j,k)*xi1st(2,i,j,k)*rescaledGeom(2)) enddo - utilities_curlRMS = utilities_curlRMS + & - 2.0_pReal*sum(real(curl_fourier)**2.0_pReal + aimag(curl_fourier)**2.0_pReal)! Has somewhere a conj. complex counterpart. Therefore count it twice. + utilities_curlRMS = utilities_curlRMS & + +2.0_pReal*sum(real(curl_fourier)**2.0_pReal+aimag(curl_fourier)**2.0_pReal) ! Has somewhere a conj. complex counterpart. Therefore count it twice. enddo do l = 1_pInt, 3_pInt curl_fourier = (+tensorField_fourier(l,3,1,j,k)*xi1st(2,1,j,k)*rescaledGeom(2) & @@ -710,8 +714,8 @@ real(pReal) function utilities_curlRMS() curl_fourier = (+tensorField_fourier(l,2,1,j,k)*xi1st(1,1,j,k)*rescaledGeom(1) & -tensorField_fourier(l,1,1,j,k)*xi1st(2,1,j,k)*rescaledGeom(2)) enddo - utilities_curlRMS = utilities_curlRMS + & - sum(real(curl_fourier)**2.0_pReal + aimag(curl_fourier)**2.0_pReal)! this layer (DC) does not have a conjugate complex counterpart (if grid(1) /= 1) + utilities_curlRMS = utilities_curlRMS & + + sum(real(curl_fourier)**2.0_pReal + aimag(curl_fourier)**2.0_pReal) ! this layer (DC) does not have a conjugate complex counterpart (if grid(1) /= 1) do l = 1_pInt, 3_pInt curl_fourier = (+tensorField_fourier(l,3,grid1Red,j,k)*xi1st(2,grid1Red,j,k)*rescaledGeom(2) & -tensorField_fourier(l,2,grid1Red,j,k)*xi1st(3,grid1Red,j,k)*rescaledGeom(3)) @@ -720,14 +724,14 @@ real(pReal) function utilities_curlRMS() curl_fourier = (+tensorField_fourier(l,2,grid1Red,j,k)*xi1st(1,grid1Red,j,k)*rescaledGeom(1) & -tensorField_fourier(l,1,grid1Red,j,k)*xi1st(2,grid1Red,j,k)*rescaledGeom(2)) enddo - utilities_curlRMS = utilities_curlRMS + & - sum(real(curl_fourier)**2.0_pReal + aimag(curl_fourier)**2.0_pReal)! this layer (Nyquist) does not have a conjugate complex counterpart (if grid(1) /= 1) + utilities_curlRMS = utilities_curlRMS & + + sum(real(curl_fourier)**2.0_pReal + aimag(curl_fourier)**2.0_pReal) ! this layer (Nyquist) does not have a conjugate complex counterpart (if grid(1) /= 1) enddo; enddo call MPI_Allreduce(MPI_IN_PLACE,utilities_curlRMS,1,MPI_DOUBLE,MPI_SUM,PETSC_COMM_WORLD,ierr) if(ierr /=0_pInt) call IO_error(894_pInt, ext_msg='utilities_curlRMS') utilities_curlRMS = sqrt(utilities_curlRMS) * wgt - if(grid(1) == 1_pInt) utilities_curlRMS = utilities_curlRMS * 0.5_pReal ! counted twice in case of grid(1) == 1 + if(grid(1) == 1_pInt) utilities_curlRMS = utilities_curlRMS * 0.5_pReal ! counted twice in case of grid(1) == 1 end function utilities_curlRMS From b957f1f016d8a8d8ec62af5bb21bb17a57a58377 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 24 Oct 2016 14:17:26 +0200 Subject: [PATCH 322/412] include of lib dir no longer needed --- code/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Makefile b/code/Makefile index 5a43040aa..a3d50d6ef 100644 --- a/code/Makefile +++ b/code/Makefile @@ -22,7 +22,7 @@ DAMASKVERSION :=$(shell cat ../VERSION) include ${PETSC_DIR}/lib/petsc/conf/variables include ${PETSC_DIR}/lib/petsc/conf/rules -INCLUDE_DIRS := $(PETSC_FC_INCLUDES) -DPETSc -I../lib +INCLUDE_DIRS := $(PETSC_FC_INCLUDES) -DPETSc LIBRARIES := $(PETSC_WITH_EXTERNAL_LIB) FCOMPILERNAME ?= $(FC) CCOMPILERNAME ?= $(CC) From a84e7310f58d5a1bc425f338133166ba1cb173b1 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 24 Oct 2016 20:30:51 +0200 Subject: [PATCH 323/412] fixed prospector hints --- lib/damask/result/marc2vtk.py | 2 -- processing/post/groupTable.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/damask/result/marc2vtk.py b/lib/damask/result/marc2vtk.py index a04c710d7..f712bd963 100644 --- a/lib/damask/result/marc2vtk.py +++ b/lib/damask/result/marc2vtk.py @@ -13,7 +13,6 @@ import numpy as np import py_post # MSC closed source module to access marc result files class MARC_POST(): - import re def __init__(self): self.projdir='./' @@ -383,7 +382,6 @@ class VTK_WRITER(): to plot semi-transparent iso-surfaces. """ - import re def __init__(self): self.p=MARC_POST() # self.p diff --git a/processing/post/groupTable.py b/processing/post/groupTable.py index cb1359c78..a533794e8 100755 --- a/processing/post/groupTable.py +++ b/processing/post/groupTable.py @@ -2,7 +2,7 @@ # -*- coding: UTF-8 no BOM -*- import os,sys -import math # noqa +import math # noqa import numpy as np from optparse import OptionParser, OptionGroup import damask From e49081e56e69752edf7ed6064d998d91a5da7a3f Mon Sep 17 00:00:00 2001 From: Test User Date: Tue, 25 Oct 2016 04:42:52 +0200 Subject: [PATCH 324/412] updated version information after successful test of v2.0.1-257-g68006f0 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 6a2d0648d..a1ebc5acf 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-249-g54c0ba5 +v2.0.1-257-g68006f0 From 8a94f55a2e7187167f30dbd5b146c2805573f64b Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 24 Oct 2016 21:16:29 +0200 Subject: [PATCH 325/412] python 3 compatibility --- lib/damask/asciitable.py | 42 +++++----- lib/damask/config/material.py | 4 +- lib/damask/h5table.py | 15 ++-- lib/damask/test/test.py | 9 +- lib/damask/util.py | 35 ++++---- processing/post/addAPS34IDEstrainCoords.py | 4 +- processing/post/addCalculation.py | 4 +- processing/post/addCauchy.py | 2 +- processing/post/addCompatibilityMismatch.py | 28 +++---- processing/post/addCumulative.py | 2 +- processing/post/addCurl.py | 12 +-- processing/post/addDeviator.py | 4 +- processing/post/addDisplacement.py | 20 ++--- processing/post/addDivergence.py | 12 +-- processing/post/addEuclideanDistance.py | 18 ++-- processing/post/addGradient.py | 10 +-- processing/post/addIPFcolor.py | 2 +- processing/post/addOrientations.py | 6 +- processing/post/addPK2.py | 2 +- processing/post/addPole.py | 2 +- processing/post/addSchmidfactors.py | 2 +- processing/post/addSpectralDecomposition.py | 4 +- processing/post/addStrainTensors.py | 2 +- processing/post/ascii2hdf5.py | 6 +- processing/post/averageDown.py | 2 +- processing/post/binXY.py | 8 +- processing/post/blowUp.py | 14 ++-- processing/post/groupTable.py | 16 ++-- processing/post/h5_addCalculation.py | 4 +- processing/post/h5_addCauchy.py | 2 +- processing/post/h5_addIPFcolor.py | 2 +- processing/post/h5_addMises.py | 6 +- processing/post/h5_addStrainTensors.py | 4 +- processing/post/h5_addXdmfWapper.py | 6 +- processing/post/h5_vtkRectilinearGrid.py | 8 +- processing/post/imageDataDeformed.py | 4 +- processing/post/mentat_colorMap.py | 12 +-- processing/post/postResults.py | 82 +++++++++---------- processing/post/reLabel.py | 2 +- processing/post/vtk2ang.py | 20 ++--- processing/post/vtk_rectilinearGrid.py | 6 +- processing/pre/abq_addUserOutput.py | 33 ++++---- processing/pre/geom_canvas.py | 12 +-- processing/pre/geom_fromMinimalSurface.py | 6 +- processing/pre/geom_fromOsteonGeometry.py | 8 +- processing/pre/geom_fromTable.py | 8 +- .../pre/geom_fromVoronoiTessellation.py | 4 +- processing/pre/geom_grainGrowth.py | 2 +- processing/pre/geom_pack.py | 2 +- processing/pre/geom_rescale.py | 4 +- processing/pre/geom_toTable.py | 2 +- processing/pre/geom_translate.py | 4 +- processing/pre/hybridIA_linODFsampling.py | 16 ++-- processing/pre/marc_addUserOutput.py | 35 ++++---- processing/pre/mentat_pbcOnBoxMesh.py | 20 ++--- .../pre/patchFromReconstructedBoundaries.py | 30 +++---- processing/pre/seeds_fromDistribution.py | 22 +++-- processing/pre/seeds_fromPokes.py | 6 +- processing/pre/seeds_fromRandom.py | 8 +- 59 files changed, 328 insertions(+), 339 deletions(-) diff --git a/lib/damask/asciitable.py b/lib/damask/asciitable.py index 3509a5284..ab745e24d 100644 --- a/lib/damask/asciitable.py +++ b/lib/damask/asciitable.py @@ -84,7 +84,7 @@ class ASCIItable(): # ------------------------------------------------------------------ def _quote(self, what): - """quote empty or white space-containing output""" + """Quote empty or white space-containing output""" import re return '{quote}{content}{quote}'.format( @@ -107,7 +107,7 @@ class ASCIItable(): # ------------------------------------------------------------------ def output_write(self, what): - """aggregate a single row (string) or list of (possibly containing further lists of) rows into output""" + """Aggregate a single row (string) or list of (possibly containing further lists of) rows into output""" if not isinstance(what, (str, unicode)): try: for item in what: self.output_write(item) @@ -147,7 +147,7 @@ class ASCIItable(): # ------------------------------------------------------------------ def head_read(self): """ - get column labels + Get column labels by either reading the first row or, if keyword "head[*]" is present, the last line of the header @@ -200,7 +200,7 @@ class ASCIItable(): # ------------------------------------------------------------------ def head_write(self, header = True): - """write current header information (info + labels)""" + """Write current header information (info + labels)""" head = ['{}\theader'.format(len(self.info)+self.__IO__['labeled'])] if header else [] head.append(self.info) if self.__IO__['labeled']: head.append('\t'.join(map(self._quote,self.tags))) @@ -209,7 +209,7 @@ class ASCIItable(): # ------------------------------------------------------------------ def head_getGeom(self): - """interpret geom header""" + """Interpret geom header""" identifiers = { 'grid': ['a','b','c'], 'size': ['x','y','z'], @@ -249,7 +249,7 @@ class ASCIItable(): # ------------------------------------------------------------------ def head_putGeom(self,info): - """translate geometry description to header""" + """Translate geometry description to header""" self.info_append([ "grid\ta {}\tb {}\tc {}".format(*info['grid']), "size\tx {}\ty {}\tz {}".format(*info['size']), @@ -262,7 +262,7 @@ class ASCIItable(): def labels_append(self, what, reset = False): - """add item or list to existing set of labels (and switch on labeling)""" + """Add item or list to existing set of labels (and switch on labeling)""" if not isinstance(what, (str, unicode)): try: for item in what: self.labels_append(item) @@ -276,7 +276,7 @@ class ASCIItable(): # ------------------------------------------------------------------ def labels_clear(self): - """delete existing labels and switch to no labeling""" + """Delete existing labels and switch to no labeling""" self.tags = [] self.__IO__['labeled'] = False @@ -285,7 +285,7 @@ class ASCIItable(): tags = None, raw = False): """ - tell abstract labels. + Tell abstract labels. "x" for "1_x","2_x",... unless raw output is requested. operates on object tags or given list. @@ -322,7 +322,7 @@ class ASCIItable(): def label_index(self, labels): """ - tell index of column label(s). + Tell index of column label(s). return numpy array if asked for list of labels. transparently deals with label positions implicitly given as numbers or their headings given as strings. @@ -363,7 +363,7 @@ class ASCIItable(): def label_dimension(self, labels): """ - tell dimension (length) of column label(s). + Tell dimension (length) of column label(s). return numpy array if asked for list of labels. transparently deals with label positions implicitly given as numbers or their headings given as strings. @@ -417,7 +417,7 @@ class ASCIItable(): def label_indexrange(self, labels): """ - tell index range for given label(s). + Tell index range for given label(s). return numpy array if asked for list of labels. transparently deals with label positions implicitly given as numbers or their headings given as strings. @@ -434,7 +434,7 @@ class ASCIItable(): # ------------------------------------------------------------------ def info_append(self, what): - """add item or list to existing set of infos""" + """Add item or list to existing set of infos""" if not isinstance(what, (str, unicode)): try: for item in what: self.info_append(item) @@ -445,7 +445,7 @@ class ASCIItable(): # ------------------------------------------------------------------ def info_clear(self): - """delete any info block""" + """Delete any info block""" self.info = [] # ------------------------------------------------------------------ @@ -458,7 +458,7 @@ class ASCIItable(): # ------------------------------------------------------------------ def data_skipLines(self, count): - """wind forward by count number of lines""" + """Wind forward by count number of lines""" for i in range(count): alive = self.data_read() @@ -468,7 +468,7 @@ class ASCIItable(): def data_read(self, advance = True, respectLabels = True): - """read next line (possibly buffered) and parse it into data array""" + """Read next line (possibly buffered) and parse it into data array""" import shlex self.line = self.__IO__['readBuffer'].pop(0) if len(self.__IO__['readBuffer']) > 0 \ @@ -490,7 +490,7 @@ class ASCIItable(): # ------------------------------------------------------------------ def data_readArray(self, labels = []): - """read whole data of all (given) labels as numpy array""" + """Read whole data of all (given) labels as numpy array""" from collections import Iterable try: @@ -527,7 +527,7 @@ class ASCIItable(): # ------------------------------------------------------------------ def data_write(self, delimiter = '\t'): - """write current data array and report alive output back""" + """Write current data array and report alive output back""" if len(self.data) == 0: return True if isinstance(self.data[0],list): @@ -539,7 +539,7 @@ class ASCIItable(): def data_writeArray(self, fmt = None, delimiter = '\t'): - """write whole numpy array data""" + """Write whole numpy array data""" for row in self.data: try: output = [fmt % value for value in row] if fmt else list(map(repr,row)) @@ -562,7 +562,7 @@ class ASCIItable(): # ------------------------------------------------------------------ def data_set(self, what, where): - """update data entry in column "where". grows data array if needed.""" + """Update data entry in column "where". grows data array if needed.""" idx = -1 try: idx = self.label_index(where) @@ -589,7 +589,7 @@ class ASCIItable(): grid, type = 'i', strict = False): - """read microstructure data (from .geom format)""" + """Read microstructure data (from .geom format)""" def datatype(item): return int(item) if type.lower() == 'i' else float(item) diff --git a/lib/damask/config/material.py b/lib/damask/config/material.py index f586ee098..d59aaa6a9 100644 --- a/lib/damask/config/material.py +++ b/lib/damask/config/material.py @@ -104,7 +104,7 @@ class Material(): __slots__ = ['data'] def __init__(self,verbose=True): - """generates ordered list of parts""" + """Generates ordered list of parts""" self.parts = [ 'homogenization', 'microstructure', @@ -122,7 +122,7 @@ class Material(): self.verbose = verbose def __repr__(self): - """returns current configuration to be used as material.config""" + """Returns current configuration to be used as material.config""" me = [] for part in self.parts: if self.verbose: print('doing '+part) diff --git a/lib/damask/h5table.py b/lib/damask/h5table.py index 95e25f191..095146d09 100644 --- a/lib/damask/h5table.py +++ b/lib/damask/h5table.py @@ -24,7 +24,7 @@ except(NameError): def lables_to_path(label, dsXMLPath=None): - """read the xml definition file and return the path.""" + """Read the xml definition file and return the path.""" if dsXMLPath is None: # use the default storage layout in DS_HDF5.xml if "h5table.pyc" in __file__: @@ -48,7 +48,7 @@ def lables_to_path(label, dsXMLPath=None): class H5Table(object): - """light weight interface class for h5py + """Light weight interface class for h5py DESCRIPTION ----------- @@ -85,7 +85,7 @@ class H5Table(object): h5f['/'].attrs['description'] = msg def del_entry(self, feature_name): - """delete entry in HDF5 table""" + """Delete entry in HDF5 table""" dataType, h5f_path = lables_to_path(feature_name, dsXMLPath=self.dsXMLFile) with h5py.File(self.h5f_path, 'a') as h5f: @@ -106,7 +106,7 @@ class H5Table(object): h5f.flush() def get_data(self, feature_name=None): - """extract dataset from HDF5 table and return it in a numpy array""" + """Extract dataset from HDF5 table and return it in a numpy array""" dataType, h5f_path = lables_to_path(feature_name, dsXMLPath=self.dsXMLFile) with h5py.File(self.h5f_path, 'a') as h5f: @@ -116,7 +116,7 @@ class H5Table(object): return rst_data def add_data(self, feature_name, dataset, cmd_log=None): - """adding new feature into existing HDF5 file""" + """Adding new feature into existing HDF5 file""" dataType, h5f_path = lables_to_path(feature_name, dsXMLPath=self.dsXMLFile) with h5py.File(self.h5f_path, 'a') as h5f: @@ -126,8 +126,7 @@ class H5Table(object): # record its state as fresh in the cmd log. try: del h5f[h5f_path] - print "***deleting old {} from {}".format(feature_name, - self.h5f_path) + print("***deleting old {} from {}".format(feature_name,self.h5f_path)) except: # if no cmd log, None will used cmd_log = str(cmd_log) + " [FRESH]" @@ -138,7 +137,7 @@ class H5Table(object): h5f.flush() def get_cmdlog(self, feature_name): - """get cmd history used to generate the feature""" + """Get cmd history used to generate the feature""" dataType, h5f_path = lables_to_path(feature_name, dsXMLPath=self.dsXMLFile) with h5py.File(self.h5f_path, 'a') as h5f: diff --git a/lib/damask/test/test.py b/lib/damask/test/test.py index 5a06939c6..223b21b78 100644 --- a/lib/damask/test/test.py +++ b/lib/damask/test/test.py @@ -1,6 +1,5 @@ # -*- coding: UTF-8 no BOM -*- - import os,sys,shutil import logging,logging.config import damask @@ -191,7 +190,7 @@ class Test(): def copy(self, mapA, mapB, A = [], B = []): """ - copy list of files from (mapped) source to target. + Copy list of files from (mapped) source to target. mapA/B is one of self.fileInX. """ @@ -382,7 +381,7 @@ class Test(): line0 += 1 for i in range(dataLength): - if not perLine: norm[i] = [np.max(norm[i]) for j in xrange(line0-len(skipLines))] + if not perLine: norm[i] = [np.max(norm[i]) for j in range(line0-len(skipLines))] data[i] = np.reshape(data[i],[line0-len(skipLines),length[i]]) if any(norm[i]) == 0.0 or absTol[i]: norm[i] = [1.0 for j in range(line0-len(skipLines))] @@ -425,7 +424,7 @@ class Test(): stdTol = 1.0e-6, preFilter = 1.0e-9): """ - calculate statistics of tables + Calculate statistics of tables threshold can be used to ignore small values (a negative number disables this feature) """ @@ -478,7 +477,7 @@ class Test(): rtol = 1e-5, atol = 1e-8, debug = False): - """compare multiple tables with np.allclose""" + """Compare multiple tables with np.allclose""" if not (isinstance(files, Iterable) and not isinstance(files, str)): # check whether list of files is requested files = [str(files)] diff --git a/lib/damask/util.py b/lib/damask/util.py index 6cea7c54b..2949d259c 100644 --- a/lib/damask/util.py +++ b/lib/damask/util.py @@ -1,6 +1,5 @@ # -*- coding: UTF-8 no BOM -*- -# damask utility functions import sys,time,random,threading,os,subprocess,shlex import numpy as np from optparse import Option @@ -36,7 +35,7 @@ class bcolors: # ----------------------------- def srepr(arg,glue = '\n'): - """joins arguments as individual lines""" + """Joins arguments as individual lines""" if (not hasattr(arg, "strip") and hasattr(arg, "__getitem__") or hasattr(arg, "__iter__")): @@ -45,21 +44,21 @@ def srepr(arg,glue = '\n'): # ----------------------------- def croak(what, newline = True): - """writes formated to stderr""" + """Writes formated to stderr""" sys.stderr.write(srepr(what,glue = '\n') + ('\n' if newline else '')) sys.stderr.flush() # ----------------------------- def report(who = None, what = None): - """reports script and file name""" + """Reports script and file name""" croak( (emph(who)+': ' if who else '') + (what if what else '') ) # ----------------------------- def report_geom(info, what = ['grid','size','origin','homogenization','microstructures']): - """reports (selected) geometry information""" + """Reports (selected) geometry information""" output = { 'grid' : 'grid a b c: {}'.format(' x '.join(map(str,info['grid' ]))), 'size' : 'size x y z: {}'.format(' x '.join(map(str,info['size' ]))), @@ -71,24 +70,24 @@ def report_geom(info, # ----------------------------- def emph(what): - """boldens string""" + """Boldens string""" return bcolors.BOLD+srepr(what)+bcolors.ENDC # ----------------------------- def deemph(what): - """dims string""" + """Dims string""" return bcolors.DIM+srepr(what)+bcolors.ENDC # ----------------------------- def delete(what): - """dims string""" + """Dims string""" return bcolors.DIM+srepr(what)+bcolors.ENDC # ----------------------------- def execute(cmd, streamIn = None, wd = './'): - """executes a command in given directory and returns stdout and stderr for optional stdin""" + """Executes a command in given directory and returns stdout and stderr for optional stdin""" initialPath = os.getcwd() os.chdir(wd) process = subprocess.Popen(shlex.split(cmd), @@ -127,7 +126,7 @@ def gridIndex(location,res): # ----------------------------- class extendableOption(Option): """ - used for definition of new option parser action 'extend', which enables to take multiple option arguments + Used for definition of new option parser action 'extend', which enables to take multiple option arguments taken from online tutorial http://docs.python.org/library/optparse.html """ @@ -146,7 +145,7 @@ class extendableOption(Option): # ----------------------------- class backgroundMessage(threading.Thread): - """reporting with animation to indicate progress""" + """Reporting with animation to indicate progress""" choices = {'bounce': ['_', 'o', 'O', '°', '‾', '‾', '°', 'O', 'o', '_'], 'spin': ['◜', '◝', '◞', '◟'], @@ -168,7 +167,7 @@ class backgroundMessage(threading.Thread): } def __init__(self,symbol = None,wait = 0.1): - """sets animation symbol""" + """Sets animation symbol""" super(backgroundMessage, self).__init__() self._stop = threading.Event() self.message = '' @@ -179,7 +178,7 @@ class backgroundMessage(threading.Thread): self.waittime = wait def __quit__(self): - """cleans output""" + """Cleans output""" length = len(self.symbols[self.counter] + self.gap + self.message) sys.stderr.write(chr(8)*length + ' '*length + chr(8)*length) sys.stderr.write('') @@ -282,7 +281,7 @@ def leastsqBound(func, x0, args=(), bounds=None, Dfun=None, full_output=0, return grad def _int2extFunc(bounds): - """transform internal parameters into external parameters.""" + """Transform internal parameters into external parameters.""" local = [_int2extLocal(b) for b in bounds] def _transform_i2e(p_int): p_ext = np.empty_like(p_int) @@ -291,7 +290,7 @@ def leastsqBound(func, x0, args=(), bounds=None, Dfun=None, full_output=0, return _transform_i2e def _ext2intFunc(bounds): - """transform external parameters into internal parameters.""" + """Transform external parameters into internal parameters.""" local = [_ext2intLocal(b) for b in bounds] def _transform_e2i(p_ext): p_int = np.empty_like(p_ext) @@ -300,7 +299,7 @@ def leastsqBound(func, x0, args=(), bounds=None, Dfun=None, full_output=0, return _transform_e2i def _int2extLocal(bound): - """transform a single internal parameter to an external parameter.""" + """Transform a single internal parameter to an external parameter.""" lower, upper = bound if lower is None and upper is None: # no constraints return lambda x: x @@ -312,7 +311,7 @@ def leastsqBound(func, x0, args=(), bounds=None, Dfun=None, full_output=0, return lambda x: lower + ((upper - lower)/2.0)*(np.sin(x) + 1.0) def _ext2intLocal(bound): - """transform a single external parameter to an internal parameter.""" + """Transform a single external parameter to an internal parameter.""" lower, upper = bound if lower is None and upper is None: # no constraints return lambda x: x @@ -469,4 +468,4 @@ def curve_fit_bound(f, xdata, ydata, p0=None, sigma=None, bounds=None, **kw): else: pcov = np.inf - return (popt, pcov, infodict, errmsg, ier) if return_full else (popt, pcov) \ No newline at end of file + return (popt, pcov, infodict, errmsg, ier) if return_full else (popt, pcov) diff --git a/processing/post/addAPS34IDEstrainCoords.py b/processing/post/addAPS34IDEstrainCoords.py index a630a476b..8a793a8cf 100755 --- a/processing/post/addAPS34IDEstrainCoords.py +++ b/processing/post/addAPS34IDEstrainCoords.py @@ -69,7 +69,7 @@ for name in filenames: if columnMissing: continue # ------------------------------------------ assemble header --------------------------------------- - table.labels_append(['%i_coord'%(i+1) for i in xrange(3)]) # extend ASCII header with new labels + table.labels_append(['%i_coord'%(i+1) for i in range(3)]) # extend ASCII header with new labels table.head_write() # ------------------------------------------ process data ------------------------------------------ @@ -94,4 +94,4 @@ for name in filenames: table.input_close() # close input ASCII table (works for stdin) table.output_close() # close output ASCII table (works for stdout) if file['name'] != 'STDIN': - os.rename(file['name']+'_tmp',file['name']) # overwrite old one with tmp new \ No newline at end of file + os.rename(file['name']+'_tmp',file['name']) # overwrite old one with tmp new diff --git a/processing/post/addCalculation.py b/processing/post/addCalculation.py index 2a728578b..fd8707414 100755 --- a/processing/post/addCalculation.py +++ b/processing/post/addCalculation.py @@ -53,7 +53,7 @@ if options.labels is None or options.formulas is None: if len(options.labels) != len(options.formulas): parser.error('number of labels ({}) and formulas ({}) do not match.'.format(len(options.labels),len(options.formulas))) -for i in xrange(len(options.formulas)): +for i in range(len(options.formulas)): options.formulas[i] = options.formulas[i].replace(';',',') # ------------------------------------- loop over input files -------------------------------------- @@ -154,7 +154,7 @@ for name in filenames: # ----------------------------------- line 1: assemble header -------------------------------------- for newby in newbies: - table.labels_append(['{}_{}'.format(i+1,newby) for i in xrange(resultDim[newby])] + table.labels_append(['{}_{}'.format(i+1,newby) for i in range(resultDim[newby])] if resultDim[newby] > 1 else newby) table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) diff --git a/processing/post/addCauchy.py b/processing/post/addCauchy.py index 2d366b198..ab619722e 100755 --- a/processing/post/addCauchy.py +++ b/processing/post/addCauchy.py @@ -68,7 +68,7 @@ for name in filenames: # ------------------------------------------ assemble header -------------------------------------- table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) - table.labels_append(['{}_Cauchy'.format(i+1) for i in xrange(9)]) # extend ASCII header with new labels + table.labels_append(['{}_Cauchy'.format(i+1) for i in range(9)]) # extend ASCII header with new labels table.head_write() # ------------------------------------------ process data ------------------------------------------ diff --git a/processing/post/addCompatibilityMismatch.py b/processing/post/addCompatibilityMismatch.py index 107d5d3d1..51e5f5eab 100755 --- a/processing/post/addCompatibilityMismatch.py +++ b/processing/post/addCompatibilityMismatch.py @@ -17,7 +17,7 @@ def cell2node(cellData,grid): nodeData = 0.0 datalen = np.array(cellData.shape[3:]).prod() - for i in xrange(datalen): + for i in range(datalen): node = scipy.ndimage.convolve(cellData.reshape(tuple(grid[::-1])+(datalen,))[...,i], np.ones((2,2,2))/8., # 2x2x2 neighborhood of cells mode = 'wrap', @@ -33,7 +33,7 @@ def cell2node(cellData,grid): #-------------------------------------------------------------------------------------------------- def deformationAvgFFT(F,grid,size,nodal=False,transformed=False): - """calculate average cell center (or nodal) deformation for deformation gradient field specified in each grid cell""" + """Calculate average cell center (or nodal) deformation for deformation gradient field specified in each grid cell""" if nodal: x, y, z = np.meshgrid(np.linspace(0,size[2],1+grid[2]), np.linspace(0,size[1],1+grid[1]), @@ -55,7 +55,7 @@ def deformationAvgFFT(F,grid,size,nodal=False,transformed=False): #-------------------------------------------------------------------------------------------------- def displacementFluctFFT(F,grid,size,nodal=False,transformed=False): - """calculate cell center (or nodal) displacement for deformation gradient field specified in each grid cell""" + """Calculate cell center (or nodal) displacement for deformation gradient field specified in each grid cell""" integrator = 0.5j * size / math.pi kk, kj, ki = np.meshgrid(np.where(np.arange(grid[2])>grid[2]//2,np.arange(grid[2])-grid[2],np.arange(grid[2])), @@ -131,7 +131,7 @@ def volTetrahedron(coords): def volumeMismatch(size,F,nodes): """ - calculates the volume mismatch + Calculates the volume mismatch volume mismatch is defined as the difference between volume of reconstructed (compatible) cube and determinant of defgrad at the FP @@ -142,9 +142,9 @@ def volumeMismatch(size,F,nodes): #-------------------------------------------------------------------------------------------------- # calculate actual volume and volume resulting from deformation gradient - for k in xrange(grid[2]): - for j in xrange(grid[1]): - for i in xrange(grid[0]): + for k in range(grid[2]): + for j in range(grid[1]): + for i in range(grid[0]): coords[0,0:3] = nodes[k, j, i ,0:3] coords[1,0:3] = nodes[k ,j, i+1,0:3] coords[2,0:3] = nodes[k ,j+1,i+1,0:3] @@ -190,9 +190,9 @@ def shapeMismatch(size,F,nodes,centres): #-------------------------------------------------------------------------------------------------- # compare deformed original and deformed positions to actual positions - for k in xrange(grid[2]): - for j in xrange(grid[1]): - for i in xrange(grid[0]): + for k in range(grid[2]): + for j in range(grid[1]): + for i in range(grid[0]): sMismatch[k,j,i] = \ + np.linalg.norm(nodes[k, j, i ,0:3] - centres[k,j,i,0:3] - np.dot(F[k,j,i,:,:], coordsInitial[0,0:3]))\ + np.linalg.norm(nodes[k, j, i+1,0:3] - centres[k,j,i,0:3] - np.dot(F[k,j,i,:,:], coordsInitial[1,0:3]))\ @@ -288,7 +288,7 @@ for name in filenames: np.zeros((table.data.shape[0], 3-table.data[:,9:].shape[1]),dtype='f'))) # fill coords up to 3D with zeros - coords = [np.unique(table.data[:,9+i]) for i in xrange(3)] + coords = [np.unique(table.data[:,9+i]) for i in range(3)] mincorner = np.array(map(min,coords)) maxcorner = np.array(map(max,coords)) grid = np.array(map(len,coords),'i') @@ -324,9 +324,9 @@ for name in filenames: volumeMismatch = volumeMismatch(size,table.data[:,:9].reshape(grid[2],grid[1],grid[0],3,3),nodes) # ------------------------------------------ output data ------------------------------------------- - for i in xrange(grid[2]): - for j in xrange(grid[1]): - for k in xrange(grid[0]): + for i in range(grid[2]): + for j in range(grid[1]): + for k in range(grid[0]): table.data_read() if options.shape: table.data_append(shapeMismatch[i,j,k]) if options.volume: table.data_append(volumeMismatch[i,j,k]) diff --git a/processing/post/addCumulative.py b/processing/post/addCumulative.py index 37bd7b5de..71fb1effc 100755 --- a/processing/post/addCumulative.py +++ b/processing/post/addCumulative.py @@ -59,7 +59,7 @@ for name in filenames: dims.append(dim) columns.append(table.label_index(what)) table.labels_append('cum({})'.format(what) if dim == 1 else - ['{}_cum({})'.format(i+1,what) for i in xrange(dim)] ) # extend ASCII header with new labels + ['{}_cum({})'.format(i+1,what) for i in range(dim)] ) # extend ASCII header with new labels if remarks != []: damask.util.croak(remarks) if errors != []: diff --git a/processing/post/addCurl.py b/processing/post/addCurl.py index fab704325..fd358703f 100755 --- a/processing/post/addCurl.py +++ b/processing/post/addCurl.py @@ -24,24 +24,24 @@ def curlFFT(geomdim,field): # differentiation in Fourier space k_s = np.zeros([3],'i') TWOPIIMG = 2.0j*math.pi - for i in xrange(grid[2]): + for i in range(grid[2]): k_s[0] = i if grid[2]%2 == 0 and i == grid[2]//2: k_s[0] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) elif i > grid[2]//2: k_s[0] -= grid[2] - for j in xrange(grid[1]): + for j in range(grid[1]): k_s[1] = j if grid[1]%2 == 0 and j == grid[1]//2: k_s[1] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) elif j > grid[1]//2: k_s[1] -= grid[1] - for k in xrange(grid[0]//2+1): + for k in range(grid[0]//2+1): k_s[2] = k if grid[0]%2 == 0 and k == grid[0]//2: k_s[2] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) xi = (k_s/geomdim)[2::-1].astype('c16') # reversing the field input order if dataType == 'tensor': - for l in xrange(3): + for l in range(3): curl_fourier[i,j,k,0,l] = ( field_fourier[i,j,k,l,2]*xi[1]\ -field_fourier[i,j,k,l,1]*xi[2]) *TWOPIIMG curl_fourier[i,j,k,1,l] = (-field_fourier[i,j,k,l,2]*xi[0]\ @@ -136,14 +136,14 @@ for name in filenames: table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) for type, data in items.iteritems(): for label in data['active']: - table.labels_append(['{}_curlFFT({})'.format(i+1,label) for i in xrange(data['dim'])]) # extend ASCII header with new labels + table.labels_append(['{}_curlFFT({})'.format(i+1,label) for i in range(data['dim'])]) # extend ASCII header with new labels table.head_write() # --------------- figure out size and grid --------------------------------------------------------- table.data_readArray() - coords = [np.unique(table.data[:,colCoord+i]) for i in xrange(3)] + coords = [np.unique(table.data[:,colCoord+i]) for i in range(3)] mincorner = np.array(map(min,coords)) maxcorner = np.array(map(max,coords)) grid = np.array(map(len,coords),'i') diff --git a/processing/post/addDeviator.py b/processing/post/addDeviator.py index 1cf301161..471c2635f 100755 --- a/processing/post/addDeviator.py +++ b/processing/post/addDeviator.py @@ -85,7 +85,7 @@ for name in filenames: table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) for type, data in items.iteritems(): for label in data['active']: - table.labels_append(['{}_dev({})'.format(i+1,label) for i in xrange(data['dim'])] + \ + table.labels_append(['{}_dev({})'.format(i+1,label) for i in range(data['dim'])] + \ (['sph({})'.format(label)] if options.spherical else [])) # extend ASCII header with new labels table.head_write() @@ -101,4 +101,4 @@ for name in filenames: # ------------------------------------------ output finalization ----------------------------------- - table.close() # close input ASCII table (works for stdin) \ No newline at end of file + table.close() # close input ASCII table (works for stdin) diff --git a/processing/post/addDisplacement.py b/processing/post/addDisplacement.py index a791a0e84..611e21db2 100755 --- a/processing/post/addDisplacement.py +++ b/processing/post/addDisplacement.py @@ -17,7 +17,7 @@ def cell2node(cellData,grid): nodeData = 0.0 datalen = np.array(cellData.shape[3:]).prod() - for i in xrange(datalen): + for i in range(datalen): node = scipy.ndimage.convolve(cellData.reshape(tuple(grid[::-1])+(datalen,))[...,i], np.ones((2,2,2))/8., # 2x2x2 neighborhood of cells mode = 'wrap', @@ -33,7 +33,7 @@ def cell2node(cellData,grid): #-------------------------------------------------------------------------------------------------- def displacementAvgFFT(F,grid,size,nodal=False,transformed=False): - """calculate average cell center (or nodal) displacement for deformation gradient field specified in each grid cell""" + """Calculate average cell center (or nodal) displacement for deformation gradient field specified in each grid cell""" if nodal: x, y, z = np.meshgrid(np.linspace(0,size[2],1+grid[2]), np.linspace(0,size[1],1+grid[1]), @@ -55,7 +55,7 @@ def displacementAvgFFT(F,grid,size,nodal=False,transformed=False): #-------------------------------------------------------------------------------------------------- def displacementFluctFFT(F,grid,size,nodal=False,transformed=False): - """calculate cell center (or nodal) displacement for deformation gradient field specified in each grid cell""" + """Calculate cell center (or nodal) displacement for deformation gradient field specified in each grid cell""" integrator = 0.5j * size / math.pi kk, kj, ki = np.meshgrid(np.where(np.arange(grid[2])>grid[2]//2,np.arange(grid[2])-grid[2],np.arange(grid[2])), @@ -167,7 +167,7 @@ for name in filenames: np.zeros((table.data.shape[0], 3-table.data[:,9:].shape[1]),dtype='f'))) # fill coords up to 3D with zeros - coords = [np.unique(table.data[:,9+i]) for i in xrange(3)] + coords = [np.unique(table.data[:,9+i]) for i in range(3)] mincorner = np.array(map(min,coords)) maxcorner = np.array(map(max,coords)) grid = np.array(map(len,coords),'i') @@ -196,16 +196,16 @@ for name in filenames: table.labels_clear() table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) - table.labels_append((['{}_pos' .format(i+1) for i in xrange(3)] if options.nodal else []) + - ['{}_avg({}).{}' .format(i+1,options.defgrad,options.pos) for i in xrange(3)] + - ['{}_fluct({}).{}'.format(i+1,options.defgrad,options.pos) for i in xrange(3)] ) + table.labels_append((['{}_pos' .format(i+1) for i in range(3)] if options.nodal else []) + + ['{}_avg({}).{}' .format(i+1,options.defgrad,options.pos) for i in range(3)] + + ['{}_fluct({}).{}'.format(i+1,options.defgrad,options.pos) for i in range(3)] ) table.head_write() # ------------------------------------------ output data ------------------------------------------- - Zrange = np.linspace(0,size[2],1+grid[2]) if options.nodal else xrange(grid[2]) - Yrange = np.linspace(0,size[1],1+grid[1]) if options.nodal else xrange(grid[1]) - Xrange = np.linspace(0,size[0],1+grid[0]) if options.nodal else xrange(grid[0]) + Zrange = np.linspace(0,size[2],1+grid[2]) if options.nodal else range(grid[2]) + Yrange = np.linspace(0,size[1],1+grid[1]) if options.nodal else range(grid[1]) + Xrange = np.linspace(0,size[0],1+grid[0]) if options.nodal else range(grid[0]) for i,z in enumerate(Zrange): for j,y in enumerate(Yrange): diff --git a/processing/post/addDivergence.py b/processing/post/addDivergence.py index ebd9e70d3..bbb7ac8d4 100755 --- a/processing/post/addDivergence.py +++ b/processing/post/addDivergence.py @@ -21,23 +21,23 @@ def divFFT(geomdim,field): # differentiation in Fourier space k_s = np.zeros([3],'i') TWOPIIMG = 2.0j*math.pi - for i in xrange(grid[2]): + for i in range(grid[2]): k_s[0] = i if grid[2]%2 == 0 and i == grid[2]//2: k_s[0] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) elif i > grid[2]//2: k_s[0] -= grid[2] - for j in xrange(grid[1]): + for j in range(grid[1]): k_s[1] = j if grid[1]%2 == 0 and j == grid[1]//2: k_s[1] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) elif j > grid[1]//2: k_s[1] -= grid[1] - for k in xrange(grid[0]//2+1): + for k in range(grid[0]//2+1): k_s[2] = k if grid[0]%2 == 0 and k == grid[0]//2: k_s[2] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) xi = (k_s/geomdim)[2::-1].astype('c16') # reversing the field input order if n == 9: # tensor, 3x3 -> 3 - for l in xrange(3): + for l in range(3): div_fourier[i,j,k,l] = sum(field_fourier[i,j,k,l,0:3]*xi) *TWOPIIMG elif n == 3: # vector, 3 -> 1 div_fourier[i,j,k] = sum(field_fourier[i,j,k,0:3]*xi) *TWOPIIMG @@ -123,14 +123,14 @@ for name in filenames: for type, data in items.iteritems(): for label in data['active']: table.labels_append(['divFFT({})'.format(label) if type == 'vector' else - '{}_divFFT({})'.format(i+1,label) for i in xrange(data['dim']//3)]) # extend ASCII header with new labels + '{}_divFFT({})'.format(i+1,label) for i in range(data['dim']//3)]) # extend ASCII header with new labels table.head_write() # --------------- figure out size and grid --------------------------------------------------------- table.data_readArray() - coords = [np.unique(table.data[:,colCoord+i]) for i in xrange(3)] + coords = [np.unique(table.data[:,colCoord+i]) for i in range(3)] mincorner = np.array(map(min,coords)) maxcorner = np.array(map(max,coords)) grid = np.array(map(len,coords),'i') diff --git a/processing/post/addEuclideanDistance.py b/processing/post/addEuclideanDistance.py index dad334beb..b83c36b6c 100755 --- a/processing/post/addEuclideanDistance.py +++ b/processing/post/addEuclideanDistance.py @@ -20,13 +20,13 @@ def periodic_3Dpad(array, rimdim=(1,1,1)): rimdim[2]:rimdim[2]+size[2]] = array p = np.zeros(3,'i') - for side in xrange(3): - for p[(side+2)%3] in xrange(padded.shape[(side+2)%3]): - for p[(side+1)%3] in xrange(padded.shape[(side+1)%3]): - for p[side%3] in xrange(rimdim[side%3]): + for side in range(3): + for p[(side+2)%3] in range(padded.shape[(side+2)%3]): + for p[(side+1)%3] in range(padded.shape[(side+1)%3]): + for p[side%3] in range(rimdim[side%3]): spot = (p-rimdim)%size padded[p[0],p[1],p[2]] = array[spot[0],spot[1],spot[2]] - for p[side%3] in xrange(rimdim[side%3]+size[side%3],size[side%3]+2*rimdim[side%3]): + for p[side%3] in range(rimdim[side%3]+size[side%3],size[side%3]+2*rimdim[side%3]): spot = (p-rimdim)%size padded[p[0],p[1],p[2]] = array[spot[0],spot[1],spot[2]] return padded @@ -178,7 +178,7 @@ for name in filenames: table.data_readArray() - coords = [np.unique(table.data[:,coordCol+i]) for i in xrange(coordDim)] + coords = [np.unique(table.data[:,coordCol+i]) for i in range(coordDim)] mincorner = np.array(map(min,coords)) maxcorner = np.array(map(max,coords)) grid = np.array(map(len,coords)+[1]*(3-len(coords)),'i') @@ -215,7 +215,7 @@ for name in filenames: # ...reflects number of unique neighbors uniques = np.where(diffToNeighbor[1:-1,1:-1,1:-1,0] != 0, 1,0) # initialize unique value counter (exclude myself [= 0]) - for i in xrange(1,len(neighborhood)): # check remaining points in neighborhood + for i in range(1,len(neighborhood)): # check remaining points in neighborhood uniques += np.where(np.logical_and( diffToNeighbor[1:-1,1:-1,1:-1,i] != 0, # not myself? diffToNeighbor[1:-1,1:-1,1:-1,i] != diffToNeighbor[1:-1,1:-1,1:-1,i-1], @@ -229,7 +229,7 @@ for name in filenames: distance[i,:,:,:] = ndimage.morphology.distance_transform_edt(distance[i,:,:,:])*[options.scale]*3 distance = distance.reshape([len(feature_list),grid.prod(),1],order='F') - for i in xrange(len(feature_list)): + for i in range(len(feature_list)): stack.append(distance[i,:]) # ------------------------------------------ output result ----------------------------------------- @@ -239,4 +239,4 @@ for name in filenames: # ------------------------------------------ output finalization ----------------------------------- - table.close() # close input ASCII table (works for stdin) \ No newline at end of file + table.close() # close input ASCII table (works for stdin) diff --git a/processing/post/addGradient.py b/processing/post/addGradient.py index b77af853e..da6852ac2 100755 --- a/processing/post/addGradient.py +++ b/processing/post/addGradient.py @@ -24,17 +24,17 @@ def gradFFT(geomdim,field): # differentiation in Fourier space k_s = np.zeros([3],'i') TWOPIIMG = 2.0j*math.pi - for i in xrange(grid[2]): + for i in range(grid[2]): k_s[0] = i if grid[2]%2 == 0 and i == grid[2]//2: k_s[0] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) elif i > grid[2]//2: k_s[0] -= grid[2] - for j in xrange(grid[1]): + for j in range(grid[1]): k_s[1] = j if grid[1]%2 == 0 and j == grid[1]//2: k_s[1] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) elif j > grid[1]//2: k_s[1] -= grid[1] - for k in xrange(grid[0]//2+1): + for k in range(grid[0]//2+1): k_s[2] = k if grid[0]%2 == 0 and k == grid[0]//2: k_s[2] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) @@ -126,14 +126,14 @@ for name in filenames: table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) for type, data in items.iteritems(): for label in data['active']: - table.labels_append(['{}_gradFFT({})'.format(i+1,label) for i in xrange(3 * data['dim'])]) # extend ASCII header with new labels + table.labels_append(['{}_gradFFT({})'.format(i+1,label) for i in range(3 * data['dim'])]) # extend ASCII header with new labels table.head_write() # --------------- figure out size and grid --------------------------------------------------------- table.data_readArray() - coords = [np.unique(table.data[:,colCoord+i]) for i in xrange(3)] + coords = [np.unique(table.data[:,colCoord+i]) for i in range(3)] mincorner = np.array(map(min,coords)) maxcorner = np.array(map(max,coords)) grid = np.array(map(len,coords),'i') diff --git a/processing/post/addIPFcolor.py b/processing/post/addIPFcolor.py index cedd075c1..2fcc000e1 100755 --- a/processing/post/addIPFcolor.py +++ b/processing/post/addIPFcolor.py @@ -108,7 +108,7 @@ for name in filenames: # ------------------------------------------ assemble header --------------------------------------- table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) - table.labels_append(['{}_IPF_{:g}{:g}{:g}_{sym}'.format(i+1,*options.pole,sym = options.symmetry.lower()) for i in xrange(3)]) + table.labels_append(['{}_IPF_{:g}{:g}{:g}_{sym}'.format(i+1,*options.pole,sym = options.symmetry.lower()) for i in range(3)]) table.head_write() # ------------------------------------------ process data ------------------------------------------ diff --git a/processing/post/addOrientations.py b/processing/post/addOrientations.py index c778e67b0..2c70b5db0 100755 --- a/processing/post/addOrientations.py +++ b/processing/post/addOrientations.py @@ -131,9 +131,9 @@ for name in filenames: table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) for output in options.output: - if output == 'quaternion': table.labels_append(['{}_{}_{}({})'.format(i+1,'quat',options.symmetry,label) for i in xrange(4)]) - elif output == 'rodrigues': table.labels_append(['{}_{}_{}({})'.format(i+1,'rodr',options.symmetry,label) for i in xrange(3)]) - elif output == 'eulers': table.labels_append(['{}_{}_{}({})'.format(i+1,'eulr',options.symmetry,label) for i in xrange(3)]) + if output == 'quaternion': table.labels_append(['{}_{}_{}({})'.format(i+1,'quat',options.symmetry,label) for i in range(4)]) + elif output == 'rodrigues': table.labels_append(['{}_{}_{}({})'.format(i+1,'rodr',options.symmetry,label) for i in range(3)]) + elif output == 'eulers': table.labels_append(['{}_{}_{}({})'.format(i+1,'eulr',options.symmetry,label) for i in range(3)]) table.head_write() # ------------------------------------------ process data ------------------------------------------ diff --git a/processing/post/addPK2.py b/processing/post/addPK2.py index 80f5843ec..25fb33c3e 100755 --- a/processing/post/addPK2.py +++ b/processing/post/addPK2.py @@ -69,7 +69,7 @@ for name in filenames: # ------------------------------------------ assemble header -------------------------------------- table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) - table.labels_append(['%i_S'%(i+1) for i in xrange(9)]) # extend ASCII header with new labels + table.labels_append(['%i_S'%(i+1) for i in range(9)]) # extend ASCII header with new labels table.head_write() # ------------------------------------------ process data ------------------------------------------ diff --git a/processing/post/addPole.py b/processing/post/addPole.py index 291c5a712..10c5cce67 100755 --- a/processing/post/addPole.py +++ b/processing/post/addPole.py @@ -113,7 +113,7 @@ for name in filenames: # ------------------------------------------ assemble header --------------------------------------- table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) - table.labels_append(['{}_pole_{}{}{}'.format(i+1,*options.pole) for i in xrange(2)]) + table.labels_append(['{}_pole_{}{}{}'.format(i+1,*options.pole) for i in range(2)]) table.head_write() # ------------------------------------------ process data ------------------------------------------ diff --git a/processing/post/addSchmidfactors.py b/processing/post/addSchmidfactors.py index 067c3036a..4f34621b7 100755 --- a/processing/post/addSchmidfactors.py +++ b/processing/post/addSchmidfactors.py @@ -199,7 +199,7 @@ if options.lattice in latticeChoices[:2]: c_normal = slipSystems[options.lattice][:,3:] elif options.lattice == latticeChoices[2]: # convert 4 Miller index notation of hex to orthogonal 3 Miller index notation - for i in xrange(len(c_direction)): + for i in range(len(c_direction)): c_direction[i] = np.array([slipSystems['hex'][i,0]*1.5, (slipSystems['hex'][i,0] + 2.*slipSystems['hex'][i,1])*0.5*np.sqrt(3), slipSystems['hex'][i,3]*options.CoverA, diff --git a/processing/post/addSpectralDecomposition.py b/processing/post/addSpectralDecomposition.py index f65e8ac76..3c44a16bc 100755 --- a/processing/post/addSpectralDecomposition.py +++ b/processing/post/addSpectralDecomposition.py @@ -57,8 +57,8 @@ for name in filenames: if dim != data['dim']: remarks.append('column {} is not a {}...'.format(what,type)) else: items[type]['column'].append(table.label_index(what)) - table.labels_append(['{}_eigval({})'.format(i+1,what) for i in xrange(3)]) # extend ASCII header with new labels - table.labels_append(['{}_eigvec({})'.format(i+1,what) for i in xrange(9)]) # extend ASCII header with new labels + table.labels_append(['{}_eigval({})'.format(i+1,what) for i in range(3)]) # extend ASCII header with new labels + table.labels_append(['{}_eigvec({})'.format(i+1,what) for i in range(9)]) # extend ASCII header with new labels if remarks != []: damask.util.croak(remarks) if errors != []: diff --git a/processing/post/addStrainTensors.py b/processing/post/addStrainTensors.py index ee760a65b..447ae03ba 100755 --- a/processing/post/addStrainTensors.py +++ b/processing/post/addStrainTensors.py @@ -112,7 +112,7 @@ for name in filenames: table.labels_append(['{}_{}({}){}'.format(i+1, # extend ASCII header with new labels theStrain, theStretch, - what if what != 'f' else '') for i in xrange(9)]) + what if what != 'f' else '') for i in range(9)]) if remarks != []: damask.util.croak(remarks) if errors != []: diff --git a/processing/post/ascii2hdf5.py b/processing/post/ascii2hdf5.py index ea2819592..effac981b 100755 --- a/processing/post/ascii2hdf5.py +++ b/processing/post/ascii2hdf5.py @@ -79,7 +79,7 @@ incNum = int(asciiTable.data[asciiTable.label_index('inc'), 0]) fullTable = np.copy(asciiTable.data) # deep copy all data, just to be safe labels = asciiTable.labels() labels_idx = [asciiTable.label_index(label) for label in labels] -featuresDim = [labels_idx[i+1] - labels_idx[i] for i in xrange(len(labels)-1)] +featuresDim = [labels_idx[i+1] - labels_idx[i] for i in range(len(labels)-1)] featuresDim.append(fullTable.shape[1] - labels_idx[-1]) # ----- figure out size and grid ----- # @@ -113,7 +113,7 @@ h5f.add_data("Vz", Vz, cmd_log=cmd_log) # add the rest of data from table labelsProcessed = ['inc'] -for fi in xrange(len(labels)): +for fi in range(len(labels)): featureName = labels[fi] # remove trouble maker "("" and ")" from label/feature name if "(" in featureName: @@ -136,7 +136,7 @@ for fi in xrange(len(labels)): # mshGridDim[2], # dataset.shape[1])) # write out data - print "adding {}...".format(featureName) + print("adding {}...".format(featureName)) h5f.add_data(featureName, dataset, cmd_log=cmd_log) # write down the processed label labelsProcessed.append(featureName) diff --git a/processing/post/averageDown.py b/processing/post/averageDown.py index 9ad1b7d0b..886083428 100755 --- a/processing/post/averageDown.py +++ b/processing/post/averageDown.py @@ -94,7 +94,7 @@ for name in filenames: table.data_readArray() if (any(options.grid) == 0 or any(options.size) == 0.0): - coords = [np.unique(table.data[:,colCoord+i]) for i in xrange(3)] + coords = [np.unique(table.data[:,colCoord+i]) for i in range(3)] mincorner = np.array(map(min,coords)) maxcorner = np.array(map(max,coords)) grid = np.array(map(len,coords),'i') diff --git a/processing/post/binXY.py b/processing/post/binXY.py index 2c02b8dcb..819e07df5 100755 --- a/processing/post/binXY.py +++ b/processing/post/binXY.py @@ -127,12 +127,12 @@ for name in filenames: weights=None if options.weight is None else table.data[:,2]) if options.normCol: - for x in xrange(options.bins[0]): + for x in range(options.bins[0]): sum = np.sum(grid[x,:]) if sum > 0.0: grid[x,:] /= sum if options.normRow: - for y in xrange(options.bins[1]): + for y in range(options.bins[1]): sum = np.sum(grid[:,y]) if sum > 0.0: grid[:,y] /= sum @@ -150,8 +150,8 @@ for name in filenames: delta[2] = minmax[2,1]-minmax[2,0] - for x in xrange(options.bins[0]): - for y in xrange(options.bins[1]): + for x in range(options.bins[0]): + for y in range(options.bins[1]): result[x,y,:] = [minmax[0,0]+delta[0]/options.bins[0]*(x+0.5), minmax[1,0]+delta[1]/options.bins[1]*(y+0.5), min(1.0,max(0.0,(grid[x,y]-minmax[2,0])/delta[2]))] diff --git a/processing/post/blowUp.py b/processing/post/blowUp.py index 49156c8f4..0642deab1 100755 --- a/processing/post/blowUp.py +++ b/processing/post/blowUp.py @@ -79,7 +79,7 @@ for name in filenames: table.data_readArray(options.pos) table.data_rewind() - coords = [np.unique(table.data[:,i]) for i in xrange(3)] + coords = [np.unique(table.data[:,i]) for i in range(3)] mincorner = np.array(map(min,coords)) maxcorner = np.array(map(max,coords)) grid = np.array(map(len,coords),'i') @@ -99,9 +99,9 @@ for name in filenames: data = np.zeros(outSize.tolist()+[len(table.labels(raw = True))]) p = np.zeros(3,'i') - for p[2] in xrange(grid[2]): - for p[1] in xrange(grid[1]): - for p[0] in xrange(grid[0]): + for p[2] in range(grid[2]): + for p[1] in range(grid[1]): + for p[0] in range(grid[0]): d = p*packing table.data_read() data[d[0]:d[0]+packing[0], @@ -110,9 +110,9 @@ for name in filenames: : ] = np.tile(np.array(table.data_asFloat(),'d'),packing.tolist()+[1]) # tile to match blowUp voxel size elementSize = size/grid/packing elem = 1 - for c in xrange(outSize[2]): - for b in xrange(outSize[1]): - for a in xrange(outSize[0]): + for c in range(outSize[2]): + for b in range(outSize[1]): + for a in range(outSize[0]): data[a,b,c,colCoord:colCoord+3] = [a+0.5,b+0.5,c+0.5]*elementSize if colElem != -1: data[a,b,c,colElem] = elem table.data = data[a,b,c,:].tolist() diff --git a/processing/post/groupTable.py b/processing/post/groupTable.py index a533794e8..a1205eff4 100755 --- a/processing/post/groupTable.py +++ b/processing/post/groupTable.py @@ -110,18 +110,18 @@ for name in filenames: table.data_readArray() rows,cols = table.data.shape - table.data = table.data[np.lexsort([table.data[:,grpColumn]])] # sort data by grpColumn + table.data = table.data[np.lexsort([table.data[:,grpColumn]])] # sort data by grpColumn - values,index = np.unique(table.data[:,grpColumn], return_index = True) # unique grpColumn values and their positions - index = np.append(index,rows) # add termination position - grpTable = np.empty((len(values), cols)) # initialize output + values,index = np.unique(table.data[:,grpColumn], return_index = True) # unique grpColumn values and their positions + index = np.append(index,rows) # add termination position + grpTable = np.empty((len(values), cols)) # initialize output - for i in xrange(len(values)): # iterate over groups (unique values in grpColumn) + for i in range(len(values)): # iterate over groups (unique values in grpColumn) if options.periodic : - grpTable[i] = periodicAverage(table.data[index[i]:index[i+1]],options.boundary) # apply periodicAverage mapping function + grpTable[i] = periodicAverage(table.data[index[i]:index[i+1]],options.boundary) # apply periodicAverage mapping function else : - grpTable[i] = np.apply_along_axis(mapFunction,0,table.data[index[i]:index[i+1]]) # apply mapping function - if not options.all: grpTable[i,grpColumn] = table.data[index[i],grpColumn] # restore grouping column value + grpTable[i] = np.apply_along_axis(mapFunction,0,table.data[index[i]:index[i+1]]) # apply mapping function + if not options.all: grpTable[i,grpColumn] = table.data[index[i],grpColumn] # restore grouping column value table.data = grpTable diff --git a/processing/post/h5_addCalculation.py b/processing/post/h5_addCalculation.py index dc4975dbf..0ce1981a1 100755 --- a/processing/post/h5_addCalculation.py +++ b/processing/post/h5_addCalculation.py @@ -56,7 +56,7 @@ parser.set_defaults(condition=None) (options, filenames) = parser.parse_args() # ----- parse formulas ----- # -for i in xrange(len(options.formulas)): +for i in range(len(options.formulas)): options.formulas[i] = options.formulas[i].replace(';', ',') # ----- loop over input files ----- # @@ -64,7 +64,7 @@ for name in filenames: try: h5f = damask.H5Table(name, new_file=False) except: - print "!!!Cannot process {}".format(name) + print("!!!Cannot process {}".format(name)) continue damask.util.report(scriptName, name) diff --git a/processing/post/h5_addCauchy.py b/processing/post/h5_addCauchy.py index d80492623..84145d99d 100755 --- a/processing/post/h5_addCauchy.py +++ b/processing/post/h5_addCauchy.py @@ -11,7 +11,7 @@ scriptID = ' '.join([scriptName, damask.version]) def getCauchy(f, p): - """return Cauchy stress for given f and p""" + """Return Cauchy stress for given f and p""" # [Cauchy] = (1/det(F)) * [P].[F_transpose] f = f.reshape((3, 3)) p = p.reshape((3, 3)) diff --git a/processing/post/h5_addIPFcolor.py b/processing/post/h5_addIPFcolor.py index e8abc2a0f..c92483fa5 100755 --- a/processing/post/h5_addIPFcolor.py +++ b/processing/post/h5_addIPFcolor.py @@ -119,7 +119,7 @@ for name in filenames: # calculate the IPF color rgbArrays = np.zeros((orieData.shape[0], 3)) - for ci in xrange(rgbArrays.shape[0]): + for ci in range(rgbArrays.shape[0]): if inputtype == 'eulers': o = damask.Orientation(Eulers=np.array(orieData[ci, :])*toRadians, symmetry=options.symmetry).reduced() diff --git a/processing/post/h5_addMises.py b/processing/post/h5_addMises.py index 941a2f5da..99367cd80 100755 --- a/processing/post/h5_addMises.py +++ b/processing/post/h5_addMises.py @@ -14,7 +14,7 @@ scriptID = ' '.join([scriptName, damask.version]) # ----- Helper functions ----- # def calcMises(what, tensor): - """calculate von Mises equivalent""" + """Calculate von Mises equivalent""" dev = tensor - np.trace(tensor)/3.0*np.eye(3) symdev = 0.5*(dev+dev.T) return math.sqrt(np.sum(symdev*symdev.T) * @@ -61,7 +61,7 @@ for name in filenames: # calculate von Mises equivalent row by row vmStress = np.zeros(tnsr.shape[0]) - for ri in xrange(tnsr.shape[0]): + for ri in range(tnsr.shape[0]): stressTnsr = tnsr[ri, :].reshape(3, 3) vmStress[ri] = calcMises('stress', stressTnsr) @@ -77,7 +77,7 @@ for name in filenames: if options.strain is not None: tnsr = h5f.get_data(options.strain) vmStrain = np.zeros(tnsr.shape[0]) - for ri in xrange(tnsr.shape[0]): + for ri in range(tnsr.shape[0]): strainTnsr = tnsr[ri, :].reshape(3, 3) vmStrain[ri] = calcMises('strain', strainTnsr) label = "Mises{}".format(options.strain) diff --git a/processing/post/h5_addStrainTensors.py b/processing/post/h5_addStrainTensors.py index 65f71e50c..9e3f49233 100755 --- a/processing/post/h5_addStrainTensors.py +++ b/processing/post/h5_addStrainTensors.py @@ -25,13 +25,13 @@ def operator(stretch, strain, eigenvalues): def calcEPS(defgrads, stretchType, strainType): - """calculate specific type of strain tensor""" + """Calculate specific type of strain tensor""" eps = np.zeros(defgrads.shape) # initialize container # TODO: # this loop can use some performance boost # (multi-threading?) - for ri in xrange(defgrads.shape[0]): + for ri in range(defgrads.shape[0]): f = defgrads[ri, :].reshape(3, 3) U, S, Vh = np.linalg.svd(f) R = np.dot(U, Vh) # rotation of polar decomposition diff --git a/processing/post/h5_addXdmfWapper.py b/processing/post/h5_addXdmfWapper.py index 2f213ba84..e5588a069 100755 --- a/processing/post/h5_addXdmfWapper.py +++ b/processing/post/h5_addXdmfWapper.py @@ -29,7 +29,7 @@ scriptID = ' '.join([scriptName,damask.version]) # ----- HELPER FUNCTIONS -----# def addTopLvlCmt(xmlstr, topLevelCmt): - """add top level comment to string from ET""" + """Add top level comment to string from ET""" # a quick hack to add the top level comment to XML file # --> somehow Elementtree does not provide this functionality # --> by default @@ -42,7 +42,7 @@ def addTopLvlCmt(xmlstr, topLevelCmt): # MAIN # -------------------------------------------------------------------- -msg = 'generate Xdmf wrapper for HDF5 file.' +msg = 'Generate Xdmf wrapper for HDF5 file.' parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = msg, @@ -108,7 +108,7 @@ labelsProcessed = ['Vx', 'Vy', 'Vz'] # walk through each attributes for label in labels: if label in labelsProcessed: continue - print "adding {}...".format(label) + print("adding {}...".format(label)) attr = ET.SubElement(grid, 'Attribute', Name=label, Type="None", diff --git a/processing/post/h5_vtkRectilinearGrid.py b/processing/post/h5_vtkRectilinearGrid.py index e8a615986..b08070b84 100755 --- a/processing/post/h5_vtkRectilinearGrid.py +++ b/processing/post/h5_vtkRectilinearGrid.py @@ -21,24 +21,24 @@ scriptID = ' '.join([scriptName, damask.version]) # ----- HELPER FUNCTION ----- # def getMeshFromXYZ(xyzArray, mode): - """calc Vx,Vy,Vz vectors for vtk rectangular mesh""" + """Calc Vx,Vy,Vz vectors for vtk rectangular mesh""" # NOTE: # --> np.unique will automatically sort the list # --> although not exactly n(1), but since mesh dimension should # small anyway, so this is still light weight. dim = xyzArray.shape[1] # 2D:2, 3D:3 - coords = [np.unique(xyzArray[:, i]) for i in xrange(dim)] + coords = [np.unique(xyzArray[:, i]) for i in range(dim)] if mode == 'cell': # since x, y, z might now have the same number of elements, # we have to deal with them individually - for ri in xrange(dim): + for ri in range(dim): vctr_pt = coords[ri] vctr_cell = np.empty(len(vctr_pt)+1) # calculate first and last end point vctr_cell[0] = vctr_pt[0] - 0.5*abs(vctr_pt[1] - vctr_pt[0]) vctr_cell[-1] = vctr_pt[-1] + 0.5*abs(vctr_pt[-2] - vctr_pt[-1]) - for cj in xrange(1, len(vctr_cell)-1): + for cj in range(1, len(vctr_cell)-1): vctr_cell[cj] = 0.5*(vctr_pt[cj-1] + vctr_pt[cj]) # update the coords coords[ri] = vctr_cell diff --git a/processing/post/imageDataDeformed.py b/processing/post/imageDataDeformed.py index 14c4df7c2..5436e1fbd 100755 --- a/processing/post/imageDataDeformed.py +++ b/processing/post/imageDataDeformed.py @@ -168,8 +168,8 @@ for name in filenames: im = Image.new('RGBA',imagesize) draw = ImageDraw.Draw(im) - for y in xrange(options.dimension[1]): - for x in xrange(options.dimension[0]): + for y in range(options.dimension[1]): + for x in range(options.dimension[0]): draw.polygon([nodes[0,x ,y ,options.z], nodes[1,x ,y ,options.z], nodes[0,x+1,y ,options.z], diff --git a/processing/post/mentat_colorMap.py b/processing/post/mentat_colorMap.py index d412890b6..4fad5cd8f 100755 --- a/processing/post/mentat_colorMap.py +++ b/processing/post/mentat_colorMap.py @@ -27,9 +27,9 @@ def outStdout(cmd,locals): exec(cmd[3:]) elif cmd[0:3] == '(?)': cmd = eval(cmd[3:]) - print cmd + print(cmd) else: - print cmd + print(cmd) return @@ -121,17 +121,17 @@ if options.inverse: theMap = theMap.invert() if options.palettef: - print theMap.export(format='raw',steps=options.colorcount) + print(theMap.export(format='raw',steps=options.colorcount)) elif options.palette: for theColor in theMap.export(format='list',steps=options.colorcount): - print '\t'.join(map(lambda x: str(int(255*x)),theColor)) + print('\t'.join(map(lambda x: str(int(255*x)),theColor))) else: # connect to Mentat and change colorMap sys.path.append(damask.solver.Marc().libraryPath()) try: import py_mentat - print 'waiting to connect...' + print('waiting to connect...') py_mentat.py_connect('',options.port) - print 'connected...' + print('connected...') mentat = True except: sys.stderr.write('warning: no valid Mentat release found\n') diff --git a/processing/post/postResults.py b/processing/post/postResults.py index fea63fdb2..a3501bc81 100755 --- a/processing/post/postResults.py +++ b/processing/post/postResults.py @@ -150,7 +150,7 @@ class MPIEspectral_result: # mimic py_post result object self.expectedFileSize = self.dataOffset+self.N_increments*(self.tagLen+self.N_elements*self.N_element_scalars*8) if options.legacy: self.expectedFileSize+=self.expectedFileSize//self.fourByteLimit*8 # add extra 8 bytes for additional headers at 4 GB limits if self.expectedFileSize != self.filesize: - print '\n**\n* Unexpected file size. Incomplete simulation or file corrupted!\n**' + print('\n**\n* Unexpected file size. Incomplete simulation or file corrupted!\n**') def __str__(self): """Summary of results file""" @@ -288,8 +288,8 @@ class MPIEspectral_result: # mimic py_post result object self.file.seek(incStart+where) value = struct.unpack('d',self.file.read(8))[0] except: - print 'seeking',incStart+where - print 'e',e,'idx',idx + print('seeking {}'.format(incStart+where)) + print('e {} idx {}'.format(e,idx)) sys.exit(1) else: @@ -304,7 +304,7 @@ class MPIEspectral_result: # mimic py_post result object try: if where%self.fourByteLimit + 8 >= self.fourByteLimit: # danger of reading into fortran record footer at 4 byte limit data='' - for i in xrange(8): + for i in range(8): self.file.seek(incStart+where+(where//self.fourByteLimit)*8+4) data += self.file.read(1) where += 1 @@ -313,8 +313,8 @@ class MPIEspectral_result: # mimic py_post result object self.file.seek(incStart+where+(where//self.fourByteLimit)*8+4) value = struct.unpack('d',self.file.read(8))[0] except: - print 'seeking',incStart+where+(where//self.fourByteLimit)*8+4 - print 'e',e,'idx',idx + print('seeking {}'.format(incStart+where+(where//self.fourByteLimit)*8+4)) + print('e {} idx {}'.format(e,idx)) sys.exit(1) return [elemental_scalar(node,value) for node in self.element(e).items] @@ -327,7 +327,7 @@ class MPIEspectral_result: # mimic py_post result object # ----------------------------- def ipCoords(elemType, nodalCoordinates): - """returns IP coordinates for a given element""" + """Returns IP coordinates for a given element""" nodeWeightsPerNode = { 7: [ [27.0, 9.0, 3.0, 9.0, 9.0, 3.0, 1.0, 3.0], [ 9.0, 27.0, 9.0, 3.0, 3.0, 9.0, 3.0, 1.0], @@ -376,7 +376,7 @@ def ipCoords(elemType, nodalCoordinates): # ----------------------------- def ipIDs(elemType): - """returns IP numbers for given element type""" + """Returns IP numbers for given element type""" ipPerNode = { 7: [ 1, 2, 4, 3, 5, 6, 8, 7 ], 57: [ 1, 2, 4, 3, 5, 6, 8, 7 ], @@ -392,7 +392,7 @@ def ipIDs(elemType): # ----------------------------- def substituteLocation(string, mesh, coords): - """do variable interpolation in group and filter strings""" + """Do variable interpolation in group and filter strings""" substitute = string substitute = substitute.replace('elem', str(mesh[0])) substitute = substitute.replace('node', str(mesh[1])) @@ -407,7 +407,7 @@ def substituteLocation(string, mesh, coords): # ----------------------------- def heading(glue,parts): - """joins pieces from parts by glue. second to last entry in pieces tells multiplicity""" + """Joins pieces from parts by glue. second to last entry in pieces tells multiplicity""" header = [] for pieces in parts: if pieces[-2] == 0: @@ -420,7 +420,7 @@ def heading(glue,parts): # ----------------------------- def mapIncremental(label, mapping, N, base, new): """ - applies the function defined by "mapping" + Applies the function defined by "mapping" (can be either 'min','max','avg', 'sum', or user specified) to a list of data @@ -450,7 +450,7 @@ def mapIncremental(label, mapping, N, base, new): # ----------------------------- def OpenPostfile(name,type,nodal = False): - """open postfile with extrapolation mode 'translate'""" + """Open postfile with extrapolation mode 'translate'""" p = {\ 'spectral': MPIEspectral_result,\ 'marc': post_open,\ @@ -463,7 +463,7 @@ def OpenPostfile(name,type,nodal = False): # ----------------------------- def ParseOutputFormat(filename,what,me): - """parse .output* files in order to get a list of outputs""" + """Parse .output* files in order to get a list of outputs""" content = [] format = {'outputs':{},'specials':{'brothers':[]}} for prefix in ['']+map(str,range(1,17)): @@ -508,7 +508,7 @@ def ParseOutputFormat(filename,what,me): # ----------------------------- def ParsePostfile(p,filename, outputFormat): """ - parse postfile in order to get position and labels of outputs + Parse postfile in order to get position and labels of outputs needs "outputFormat" for mapping of output names to postfile output indices """ @@ -592,7 +592,7 @@ def ParsePostfile(p,filename, outputFormat): try: stat['LabelOfElementalScalar'][startIndex + offset] = label except IndexError: - print 'trying to assign %s at position %i+%i'%(label,startIndex,offset) + print('trying to assign {} at position {}+{}'.format(label,startIndex,offset)) sys.exit(1) offset += 1 @@ -821,8 +821,8 @@ bg.set_message('parsing .output files...') for what in me: outputFormat[what] = ParseOutputFormat(filename, what, me[what]) if '_id' not in outputFormat[what]['specials']: - print "\nsection '%s' not found in <%s>"%(me[what], what) - print '\n'.join(map(lambda x:' [%s]'%x, outputFormat[what]['specials']['brothers'])) + print("\nsection '{}' not found in <{}>".format(me[what], what)) + print('\n'.join(map(lambda x:' [%s]'%x, outputFormat[what]['specials']['brothers']))) bg.set_message('opening result file...') p = OpenPostfile(filename+extension,options.filetype,options.nodal) @@ -851,17 +851,17 @@ for opt in ['nodalScalar','elemScalar','elemTensor','homogenizationResult','crys if options.info: if options.filetype == 'marc': - print '\n\nMentat release %s'%damask.solver.Marc().version('../../') + print('\n\nMentat release {}'.format(damask.solver.Marc().version('../../'))) if options.filetype == 'spectral': - print '\n\n',p + print('\n\n{}'.format(p)) SummarizePostfile(stat) - print '\nUser Defined Outputs' + print('\nUser Defined Outputs') for what in me: - print '\n ',what,':' + print('\n {}:'.format(what)) for output in outputFormat[what]['outputs']: - print ' ',output + print(' {}'.format(output)) sys.exit(0) @@ -869,7 +869,7 @@ if options.info: # --- build connectivity maps elementsOfNode = {} -for e in xrange(stat['NumberOfElements']): +for e in range(stat['NumberOfElements']): if e%1000 == 0: bg.set_message('connect elem %i...'%e) for n in map(p.node_sequence,p.element(e).items): @@ -892,7 +892,7 @@ groupCount = 0 memberCount = 0 if options.nodalScalar: - for n in xrange(stat['NumberOfNodes']): + for n in range(stat['NumberOfNodes']): if n%1000 == 0: bg.set_message('scan node %i...'%n) myNodeID = p.node_id(n) @@ -927,7 +927,7 @@ if options.nodalScalar: memberCount += 1 else: - for e in xrange(stat['NumberOfElements']): + for e in range(stat['NumberOfElements']): if e%1000 == 0: bg.set_message('scan elem %i...'%e) myElemID = p.element_id(e) @@ -947,27 +947,27 @@ else: # --- filter valid locations # generates an expression that is only true for the locations specified by options.filter filter = substituteLocation(options.filter, [myElemID,myNodeID,myIpID,myGrainID], myIpCoordinates[n]) - if filter != '' and not eval(filter): # for all filter expressions that are not true:... - continue # ... ignore this data point and continue with next + if filter != '' and not eval(filter): # for all filter expressions that are not true:... + continue # ... ignore this data point and continue with next # --- group data locations # generates a unique key for a group of separated data based on the separation criterium for the location grp = substituteLocation('#'.join(options.sep), [myElemID,myNodeID,myIpID,myGrainID], myIpCoordinates[n]) - if grp not in index: # create a new group if not yet present + if grp not in index: # create a new group if not yet present index[grp] = groupCount - groups.append([[0,0,0,0,0.0,0.0,0.0]]) # initialize with avg location + groups.append([[0,0,0,0,0.0,0.0,0.0]]) # initialize with avg location groupCount += 1 groups[index[grp]][0][:4] = mapIncremental('','unique', len(groups[index[grp]])-1, groups[index[grp]][0][:4], - [myElemID,myNodeID,myIpID,myGrainID]) # keep only if unique average location + [myElemID,myNodeID,myIpID,myGrainID]) # keep only if unique average location groups[index[grp]][0][4:] = mapIncremental('','avg', len(groups[index[grp]])-1, groups[index[grp]][0][4:], - myIpCoordinates[n]) # incrementally update average location - groups[index[grp]].append([myElemID,myNodeID,myIpID,myGrainID,n]) # append a new list defining each group member + myIpCoordinates[n]) # incrementally update average location + groups[index[grp]].append([myElemID,myNodeID,myIpID,myGrainID,n]) # append a new list defining each group member memberCount += 1 @@ -996,14 +996,14 @@ if 'none' not in map(str.lower, options.sort): sortKeys = eval('lambda x:(%s)'%(','.join(theKeys))) bg.set_message('sorting groups...') -groups.sort(key = sortKeys) # in-place sorting to save mem +groups.sort(key = sortKeys) # in-place sorting to save mem # --------------------------- create output dir -------------------------------- dirname = os.path.abspath(os.path.join(os.path.dirname(filename),options.dir)) if not os.path.isdir(dirname): - os.mkdir(dirname,0755) + os.mkdir(dirname,0o755) fileOpen = False assembleHeader = True @@ -1049,7 +1049,7 @@ for incCount,position in enumerate(locations): # walk through locations if options.separateFiles: if fileOpen: - file.close() + file.close() # noqa fileOpen = False outFilename = eval('"'+eval("'%%s_inc%%0%ii%%s.txt'%(math.log10(max(increments+[1]))+1)")\ +'"%(dirname + os.sep + options.prefix + os.path.split(filename)[1],increments[incCount],options.suffix)') @@ -1070,15 +1070,15 @@ for incCount,position in enumerate(locations): # walk through locations member = 0 for group in groups: - N = 0 # group member counter - for (e,n,i,g,n_local) in group[1:]: # loop over group members + N = 0 # group member counter + for (e,n,i,g,n_local) in group[1:]: # loop over group members member += 1 if member%1000 == 0: time_delta = ((len(locations)*memberCount)/float(member+incCount*memberCount)-1.0)*(time.time()-time_start) bg.set_message('(%02i:%02i:%02i) processing point %i of %i from increment %i (position %i)...' %(time_delta//3600,time_delta%3600//60,time_delta%60,member,memberCount,increments[incCount],position)) - newby = [] # current member's data + newby = [] # current member's data if options.nodalScalar: for label in options.nodalScalar: @@ -1126,7 +1126,7 @@ for incCount,position in enumerate(locations): # walk through locations ['Crystallite']*len(options.crystalliteResult) + ['Constitutive']*len(options.constitutiveResult) ): - outputIndex = list(zip(*outputFormat[resultType]['outputs'])[0]).index(label) # find the position of this output in the outputFormat + outputIndex = list(zip(*outputFormat[resultType]['outputs'])[0]).index(label) # find the position of this output in the outputFormat length = int(outputFormat[resultType]['outputs'][outputIndex][1]) thisHead = heading('_',[[component,''.join( label.split() )] for component in range(int(length>1),length+int(length>1))]) if assembleHeader: header += thisHead @@ -1138,13 +1138,13 @@ for incCount,position in enumerate(locations): # walk through locations 'content':[ p.element_scalar(p.element_sequence(e),stat['IndexOfLabel'][head])[n_local].value for head in thisHead ]}) except KeyError: - print '\nDAMASK outputs seem missing from "post" section of the *.dat file!' + print('\nDAMASK outputs seem missing from "post" section of the *.dat file!') sys.exit() assembleHeader = False if N == 0: - mappedResult = [float(x) for x in xrange(len(header))] # initialize with debug data (should get deleted by *N at N=0) + mappedResult = [float(x) for x in range(len(header))] # init with debug data (should get deleted by *N at N=0) pos = 0 for chunk in newby: diff --git a/processing/post/reLabel.py b/processing/post/reLabel.py index e5979122e..753e1bc1e 100755 --- a/processing/post/reLabel.py +++ b/processing/post/reLabel.py @@ -67,7 +67,7 @@ for name in filenames: if index == -1: remarks.append('label "{}" not present...'.format(options.label[i])) else: m = pattern[dimensions[i]>1].match(table.tags[index]) # isolate label name - for j in xrange(dimensions[i]): + for j in range(dimensions[i]): table.tags[index+j] = table.tags[index+j].replace(m.group(2),options.substitute[i]) # replace name with substitute if remarks != []: damask.util.croak(remarks) diff --git a/processing/post/vtk2ang.py b/processing/post/vtk2ang.py index c315902ef..d38e92fa5 100755 --- a/processing/post/vtk2ang.py +++ b/processing/post/vtk2ang.py @@ -12,7 +12,7 @@ scriptID = ' '.join([scriptName,damask.version]) # ----------------------------- def getHeader(filename,sizeFastIndex,sizeSlowIndex,stepsize): - """returns header for ang file step size in micrometer""" + """Returns header for ang file step size in micrometer""" return '\n'.join([ \ '# TEM_PIXperUM 1.000000', \ '# x-star 1.000000', \ @@ -48,7 +48,7 @@ def getHeader(filename,sizeFastIndex,sizeSlowIndex,stepsize): # ----------------------------- def positiveRadians(angle): - """returns positive angle in radians from angle in degrees""" + """Returns positive angle in radians from angle in degrees""" angle = math.radians(float(angle)) while angle < 0.0: angle += 2.0 * math.pi @@ -59,7 +59,7 @@ def positiveRadians(angle): # ----------------------------- def getDataLine(angles,x,y,validData=True): """ - returns string of one line in ang file + Returns string of one line in ang file convention in ang file: y coordinate comes first and is fastest index positions in micrometer @@ -295,13 +295,13 @@ for filename in filenames: if options.verbose: sys.stdout.write("\nGENERATING POINTS FOR POINT GRID") points = vtk.vtkPoints() - for k in xrange(Npoints[2]): - for j in xrange(Npoints[0]): - for i in xrange(Npoints[1]): # y is fastest index + for k in range(Npoints[2]): + for j in range(Npoints[0]): + for i in range(Npoints[1]): # y is fastest index rotatedpoint = np.array([rotatedbox[0][0] + (float(j) + 0.5) * options.resolution, rotatedbox[1][0] + (float(i) + 0.5) * options.resolution, - rotatedbox[2][0] + (float(k) + 0.5) * options.distance ]) # point in rotated system - point = np.dot(R.T,rotatedpoint) # point in mesh system + rotatedbox[2][0] + (float(k) + 0.5) * options.distance ]) # point in rotated system + point = np.dot(R.T,rotatedpoint) # point in mesh system points.InsertNextPoint(list(point)) if options.verbose: sys.stdout.write("\rGENERATING POINTS FOR POINT GRID %d%%" %(100*(Npoints[1]*(k*Npoints[0]+j)+i+1)/totalNpoints)) @@ -315,7 +315,7 @@ for filename in filenames: if options.verbose: sys.stdout.write("\nGENERATING VERTICES FOR POINT GRID") vertices = vtk.vtkCellArray() - for i in xrange(totalNpoints): + for i in range(totalNpoints): vertex = vtk.vtkVertex() vertex.GetPointIds().SetId(0,i) # each vertex consists of exactly one (index 0) point with ID "i" vertices.InsertNextCell(vertex) @@ -378,7 +378,7 @@ for filename in filenames: with open(angfilename,'w') as angfile: if options.verbose: sys.stdout.write(" %s\n"%angfilename) angfile.write(getHeader(filename,Npoints[1],Npoints[0],options.resolution*options.scale)) - for i in xrange(sliceN*NpointsPerSlice,(sliceN+1)*NpointsPerSlice): # Iterate over points on slice + for i in range(sliceN*NpointsPerSlice,(sliceN+1)*NpointsPerSlice): # Iterate over points on slice # Get euler angles of closest IDs diff --git a/processing/post/vtk_rectilinearGrid.py b/processing/post/vtk_rectilinearGrid.py index dfe376b3f..cc6c01711 100755 --- a/processing/post/vtk_rectilinearGrid.py +++ b/processing/post/vtk_rectilinearGrid.py @@ -76,12 +76,12 @@ for name in filenames: np.zeros((table.data.shape[0], 3-table.data.shape[1]),dtype='f'))) # fill coords up to 3D with zeros - coords = [np.unique(table.data[:,i]) for i in xrange(3)] + coords = [np.unique(table.data[:,i]) for i in range(3)] if options.mode == 'cell': coords = [0.5 * np.array([3.0 * coords[i][0] - coords[i][0 + int(len(coords[i]) > 1)]] + \ - [coords[i][j-1] + coords[i][j] for j in xrange(1,len(coords[i]))] + \ - [3.0 * coords[i][-1] - coords[i][-1 - int(len(coords[i]) > 1)]]) for i in xrange(3)] + [coords[i][j-1] + coords[i][j] for j in range(1,len(coords[i]))] + \ + [3.0 * coords[i][-1] - coords[i][-1 - int(len(coords[i]) > 1)]]) for i in range(3)] grid = np.array(map(len,coords),'i') N = grid.prod() if options.mode == 'point' else (grid-1).prod() diff --git a/processing/pre/abq_addUserOutput.py b/processing/pre/abq_addUserOutput.py index fea8d57b4..80b31f15b 100755 --- a/processing/pre/abq_addUserOutput.py +++ b/processing/pre/abq_addUserOutput.py @@ -3,7 +3,7 @@ import sys,os,re from optparse import OptionParser -import damask +import damask scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptID = ' '.join([scriptName,damask.version]) @@ -14,13 +14,13 @@ def ParseOutputFormat(filename,what,me): outputmetafile = filename+'.output'+what try: - file = open(outputmetafile) + myFile = open(outputmetafile) except: print('Could not open file %s'%outputmetafile) raise else: - content = file.readlines() - file.close() + content = myFile.readlines() + myFile.close() tag = '' tagID = 0 @@ -60,7 +60,7 @@ that are written during the first run of the model. Specify which user block format you want to apply by stating the homogenization, crystallite, and phase identifiers. Or have an existing set of user variables copied over from another *.inp file. -""", version= scriptID) +""", version = scriptID) parser.add_option('-m', dest='number', type='int', metavar = 'int', help='maximum requested User Defined Variable [%default]') @@ -92,15 +92,15 @@ me = { 'Homogenization': options.homog, } -for file in files: - print '\033[1m'+scriptName+'\033[0m: '+file+'\n' +for myFile in files: + print('\033[1m'+scriptName+'\033[0m: '+myFile+'\n') if options.useFile: formatFile = os.path.splitext(options.useFile)[0] else: - formatFile = os.path.splitext(file)[0] - file = os.path.splitext(file)[0]+'.inp' - if not os.path.lexists(file): - print file,'not found' + formatFile = os.path.splitext(myFile)[0] + myFile = os.path.splitext(myFile)[0]+'.inp' + if not os.path.lexists(myFile): + print('{} not found'.format(myFile)) continue print('Scanning format files of: %s'%formatFile) @@ -111,8 +111,8 @@ for file in files: for what in me: outputFormat[what] = ParseOutputFormat(formatFile,what,me[what]) if '_id' not in outputFormat[what]['specials']: - print "'%s' not found in <%s>"%(me[what],what) - print '\n'.join(map(lambda x:' '+x,outputFormat[what]['specials']['brothers'])) + print("'{}' not found in <{}>".format(me[what],what)) + print('\n'.join(map(lambda x:' '+x,outputFormat[what]['specials']['brothers']))) sys.exit(1) UserVars = ['HomogenizationCount'] @@ -140,11 +140,11 @@ for file in files: UserVars += ['%i_%s'%(grain+1,var[0]) for i in range(var[1])] # Now change *.inp file(s) - print('Adding labels to: %s'%file) - inFile = open(file) + print('Adding labels to: %s'%myFile) + inFile = open(myFile) input = inFile.readlines() inFile.close() - output = open(file,'w') + output = open(myFile,'w') thisSection = '' if options.damaskOption: output.write('$damask {0}\n'.format(options.damaskOption)) @@ -165,3 +165,4 @@ for file in files: if (thisSection.upper() != '*DEPVAR' or not re.match('\s*\d',line)): output.write(line) output.close() + diff --git a/processing/pre/geom_canvas.py b/processing/pre/geom_canvas.py index 831a2b251..427ab8cad 100755 --- a/processing/pre/geom_canvas.py +++ b/processing/pre/geom_canvas.py @@ -93,12 +93,12 @@ for name in filenames: microstructure_cropped = np.zeros(newInfo['grid'],datatype) microstructure_cropped.fill(options.fill if options.real or options.fill > 0 else microstructure.max()+1) - xindex = list(set(xrange(options.offset[0],options.offset[0]+newInfo['grid'][0])) & \ - set(xrange(info['grid'][0]))) - yindex = list(set(xrange(options.offset[1],options.offset[1]+newInfo['grid'][1])) & \ - set(xrange(info['grid'][1]))) - zindex = list(set(xrange(options.offset[2],options.offset[2]+newInfo['grid'][2])) & \ - set(xrange(info['grid'][2]))) + xindex = list(set(range(options.offset[0],options.offset[0]+newInfo['grid'][0])) & \ + set(range(info['grid'][0]))) + yindex = list(set(range(options.offset[1],options.offset[1]+newInfo['grid'][1])) & \ + set(range(info['grid'][1]))) + zindex = list(set(range(options.offset[2],options.offset[2]+newInfo['grid'][2])) & \ + set(range(info['grid'][2]))) translate_x = [i - options.offset[0] for i in xindex] translate_y = [i - options.offset[1] for i in yindex] translate_z = [i - options.offset[2] for i in zindex] diff --git a/processing/pre/geom_fromMinimalSurface.py b/processing/pre/geom_fromMinimalSurface.py index a346aa11d..22ab2f53d 100755 --- a/processing/pre/geom_fromMinimalSurface.py +++ b/processing/pre/geom_fromMinimalSurface.py @@ -125,10 +125,10 @@ for name in filenames: Y = options.periods*2.0*math.pi*(np.arange(options.grid[1])+0.5)/options.grid[1] Z = options.periods*2.0*math.pi*(np.arange(options.grid[2])+0.5)/options.grid[2] - for z in xrange(options.grid[2]): - for y in xrange(options.grid[1]): + for z in range(options.grid[2]): + for y in range(options.grid[1]): table.data_clear() - for x in xrange(options.grid[0]): + for x in range(options.grid[0]): table.data_append(options.microstructure[options.threshold < surface[options.type](X[x],Y[y],Z[z])]) table.data_write() diff --git a/processing/pre/geom_fromOsteonGeometry.py b/processing/pre/geom_fromOsteonGeometry.py index 9f85f99aa..716a43615 100755 --- a/processing/pre/geom_fromOsteonGeometry.py +++ b/processing/pre/geom_fromOsteonGeometry.py @@ -105,8 +105,8 @@ microstructure = np.where(radius < float(options.canal),1,0) + np.where(radius > alphaOfGrain = np.zeros(info['grid'][0]*info['grid'][1],'d') betaOfGrain = np.zeros(info['grid'][0]*info['grid'][1],'d') -for y in xrange(info['grid'][1]): - for x in xrange(info['grid'][0]): +for y in range(info['grid'][1]): + for x in range(info['grid'][0]): if microstructure[y,x] == 0: microstructure[y,x] = info['microstructures'] alphaOfGrain[info['microstructures']] = alpha[y,x] @@ -129,7 +129,7 @@ header.append('(constituent)\tphase 1\ttexture 1\tfraction 1.0') header.append('[interstitial]') header.append('crystallite %i'%options.crystallite) header.append('(constituent)\tphase 2\ttexture 2\tfraction 1.0') -for i in xrange(3,info['microstructures']): +for i in range(3,info['microstructures']): header.append('[Grain%s]'%(str(i).zfill(formatwidth))) header.append('crystallite %i'%options.crystallite) header.append('(constituent)\tphase 3\ttexture %s\tfraction 1.0'%(str(i).rjust(formatwidth))) @@ -137,7 +137,7 @@ for i in xrange(3,info['microstructures']): header.append('') header.append('[canal]') header.append('[interstitial]') -for i in xrange(3,info['microstructures']): +for i in range(3,info['microstructures']): header.append('[Grain%s]'%(str(i).zfill(formatwidth))) header.append('(gauss)\tphi1 %g\tPhi %g\tphi2 0\tscatter 0.0\tfraction 1.0'\ %(alphaOfGrain[i],betaOfGrain[i])) diff --git a/processing/pre/geom_fromTable.py b/processing/pre/geom_fromTable.py index 4f786af9e..9af92888d 100755 --- a/processing/pre/geom_fromTable.py +++ b/processing/pre/geom_fromTable.py @@ -163,7 +163,7 @@ for name in filenames: # --------------- figure out size and grid --------------------------------------------------------- - coords = [np.unique(table.data[:,i]) for i in xrange(3)] + coords = [np.unique(table.data[:,i]) for i in range(3)] mincorner = np.array(map(min,coords)) maxcorner = np.array(map(max,coords)) grid = np.array(map(len,coords),'i') @@ -217,9 +217,9 @@ for name in filenames: tick = time.clock() if options.verbose: bg.set_message('assigning grain IDs...') - for z in xrange(grid[2]): - for y in xrange(grid[1]): - for x in xrange(grid[0]): + for z in range(grid[2]): + for y in range(grid[1]): + for x in range(grid[0]): if (myPos+1)%(N/500.) < 1: time_delta = (time.clock()-tick) * (N - myPos) / myPos if options.verbose: bg.set_message('(%02i:%02i:%02i) processing point %i of %i (grain count %i)...' diff --git a/processing/pre/geom_fromVoronoiTessellation.py b/processing/pre/geom_fromVoronoiTessellation.py index d18e38b9c..dfb68d896 100755 --- a/processing/pre/geom_fromVoronoiTessellation.py +++ b/processing/pre/geom_fromVoronoiTessellation.py @@ -13,7 +13,7 @@ scriptID = ' '.join([scriptName,damask.version]) def meshgrid2(*arrs): - """code inspired by http://stackoverflow.com/questions/1827489/numpy-meshgrid-in-3d""" + """Code inspired by http://stackoverflow.com/questions/1827489/numpy-meshgrid-in-3d""" arrs = tuple(reversed(arrs)) arrs = tuple(arrs) lens = np.array(map(len, arrs)) @@ -240,7 +240,7 @@ for name in filenames: if np.any(info['size'] <= 0.0) \ and np.all(info['grid'] < 1): errors.append('invalid size x y z.') else: - for i in xrange(3): + for i in range(3): if info['size'][i] <= 0.0: # any invalid size? info['size'][i] = float(info['grid'][i])/max(info['grid']) # normalize to grid remarks.append('rescaling size {} to {}...'.format({0:'x',1:'y',2:'z'}[i],info['size'][i])) diff --git a/processing/pre/geom_grainGrowth.py b/processing/pre/geom_grainGrowth.py index 55b98e627..b6c1953c4 100755 --- a/processing/pre/geom_grainGrowth.py +++ b/processing/pre/geom_grainGrowth.py @@ -95,7 +95,7 @@ for name in filenames: struc = ndimage.generate_binary_structure(3,1) # 3D von Neumann neighborhood - for smoothIter in xrange(options.N): + for smoothIter in range(options.N): periodic_microstructure = np.tile(microstructure,(3,3,3))[grid[0]/2:-grid[0]/2, grid[1]/2:-grid[1]/2, grid[2]/2:-grid[2]/2] # periodically extend the microstructure diff --git a/processing/pre/geom_pack.py b/processing/pre/geom_pack.py index cfa329698..0ade124e7 100755 --- a/processing/pre/geom_pack.py +++ b/processing/pre/geom_pack.py @@ -76,7 +76,7 @@ for name in filenames: items = table.data if len(items) > 2: if items[1].lower() == 'of': items = [int(items[2])]*int(items[0]) - elif items[1].lower() == 'to': items = xrange(int(items[0]),1+int(items[2])) + elif items[1].lower() == 'to': items = range(int(items[0]),1+int(items[2])) else: items = map(int,items) else: items = map(int,items) diff --git a/processing/pre/geom_rescale.py b/processing/pre/geom_rescale.py index f2d9966d6..976db9d5c 100755 --- a/processing/pre/geom_rescale.py +++ b/processing/pre/geom_rescale.py @@ -92,10 +92,10 @@ for name in filenames: newInfo['size'] = np.where(newInfo['size'] <= 0.0, info['size'],newInfo['size']) multiplicity = [] - for j in xrange(3): + for j in range(3): multiplicity.append([]) last = 0 - for i in xrange(info['grid'][j]): + for i in range(info['grid'][j]): this = int((i+1)*float(newInfo['grid'][j])/info['grid'][j]) multiplicity[j].append(this-last) last = this diff --git a/processing/pre/geom_toTable.py b/processing/pre/geom_toTable.py index d34d101e0..beb4987d8 100755 --- a/processing/pre/geom_toTable.py +++ b/processing/pre/geom_toTable.py @@ -63,7 +63,7 @@ for name in filenames: table.info_clear() table.info_append(extra_header + [scriptID + '\t' + ' '.join(sys.argv[1:])]) table.labels_clear() - table.labels_append(['{}_{}'.format(1+i,'pos') for i in xrange(3)]+['microstructure']) + table.labels_append(['{}_{}'.format(1+i,'pos') for i in range(3)]+['microstructure']) table.head_write() table.output_flush() diff --git a/processing/pre/geom_translate.py b/processing/pre/geom_translate.py index f0d39e66f..260f8326f 100755 --- a/processing/pre/geom_translate.py +++ b/processing/pre/geom_translate.py @@ -46,7 +46,7 @@ parser.set_defaults(origin = (0.0,0.0,0.0), datatype = 'f' if options.real else 'i' sub = {} -for i in xrange(len(options.substitute)/2): # split substitution list into "from" -> "to" +for i in range(len(options.substitute)/2): # split substitution list into "from" -> "to" sub[int(options.substitute[i*2])] = int(options.substitute[i*2+1]) # --- loop over input files ---------------------------------------------------------------------- @@ -82,7 +82,7 @@ for name in filenames: # --- read data ---------------------------------------------------------------------------------- - microstructure = table.microstructure_read(info['grid'],datatype) # read microstructure + microstructure = table.microstructure_read(info['grid'],datatype) # read microstructure # --- do work ------------------------------------------------------------------------------------ diff --git a/processing/pre/hybridIA_linODFsampling.py b/processing/pre/hybridIA_linODFsampling.py index a04b28e38..128d054e1 100755 --- a/processing/pre/hybridIA_linODFsampling.py +++ b/processing/pre/hybridIA_linODFsampling.py @@ -19,7 +19,7 @@ def integerFactorization(i): return j def binAsBins(bin,intervals): - """explode compound bin into 3D bins list""" + """Explode compound bin into 3D bins list""" bins = [0]*3 bins[0] = (bin//(intervals[1] * intervals[2])) % intervals[0] bins[1] = (bin//intervals[2]) % intervals[1] @@ -27,17 +27,17 @@ def binAsBins(bin,intervals): return bins def binsAsBin(bins,intervals): - """implode 3D bins into compound bin""" + """Implode 3D bins into compound bin""" return (bins[0]*intervals[1] + bins[1])*intervals[2] + bins[2] def EulersAsBins(Eulers,intervals,deltas,center): - """return list of Eulers translated into 3D bins list""" + """Return list of Eulers translated into 3D bins list""" return [int((euler+(0.5-center)*delta)//delta)%interval \ for euler,delta,interval in zip(Eulers,deltas,intervals) \ ] def binAsEulers(bin,intervals,deltas,center): - """compound bin number translated into list of Eulers""" + """Compound bin number translated into list of Eulers""" Eulers = [0.0]*3 Eulers[2] = (bin%intervals[2] + center)*deltas[2] Eulers[1] = (bin//intervals[2]%intervals[1] + center)*deltas[1] @@ -45,7 +45,7 @@ def binAsEulers(bin,intervals,deltas,center): return Eulers def directInvRepetitions(probability,scale): - """calculate number of samples drawn by direct inversion""" + """Calculate number of samples drawn by direct inversion""" nDirectInv = 0 for bin in range(len(probability)): # loop over bins nDirectInv += int(round(probability[bin]*scale)) # calc repetition @@ -270,7 +270,7 @@ for name in filenames: ODF['limit'] = np.radians(limits[1,:]) # right hand limits in radians ODF['center'] = 0.0 if all(limits[0,:]<1e-8) else 0.5 # vertex or cell centered - ODF['interval'] = np.array(map(len,[np.unique(table.data[:,i]) for i in xrange(3)]),'i') # steps are number of distict values + ODF['interval'] = np.array(map(len,[np.unique(table.data[:,i]) for i in range(3)]),'i') # steps are number of distict values ODF['nBins'] = ODF['interval'].prod() ODF['delta'] = np.radians(np.array(limits[1,0:3]-limits[0,0:3])/(ODF['interval']-1)) # step size @@ -349,7 +349,7 @@ for name in filenames: '#-------------------#', ] - for i,ID in enumerate(xrange(nSamples)): + for i,ID in enumerate(range(nSamples)): materialConfig += ['[Grain%s]'%(str(ID+1).zfill(formatwidth)), 'crystallite %i'%options.crystallite, '(constituent) phase %i texture %s fraction 1.0'%(options.phase,str(ID+1).rjust(formatwidth)), @@ -361,7 +361,7 @@ for name in filenames: '#-------------------#', ] - for ID in xrange(nSamples): + for ID in range(nSamples): eulers = Orientations[ID] materialConfig += ['[Grain%s]'%(str(ID+1).zfill(formatwidth)), diff --git a/processing/pre/marc_addUserOutput.py b/processing/pre/marc_addUserOutput.py index 9bc336fd6..048f5330a 100755 --- a/processing/pre/marc_addUserOutput.py +++ b/processing/pre/marc_addUserOutput.py @@ -1,13 +1,6 @@ #!/usr/bin/env python2.7 # -*- coding: UTF-8 no BOM -*- -""" -Writes meaningful labels to the marc input file (*.dat) - -output is based on the files -.output -that are written during the first run of the model. -""" import sys,os,re from optparse import OptionParser import damask @@ -21,13 +14,13 @@ def ParseOutputFormat(filename,what,me): outputmetafile = filename+'.output'+what try: - file = open(outputmetafile) + myFile = open(outputmetafile) except: print('Could not open file %s'%outputmetafile) raise else: - content = file.readlines() - file.close() + content = myFile.readlines() + myFile.close() tag = '' tagID = 0 @@ -109,15 +102,15 @@ me = { 'Homogenization': options.homog, } -for file in files: - print '\033[1m'+scriptName+'\033[0m: '+file+'\n' +for myFile in files: + print('\033[1m'+scriptName+'\033[0m: '+myFile+'\n') if options.useFile != '': formatFile = os.path.splitext(options.useFile)[0] else: - formatFile = os.path.splitext(file)[0] - file = os.path.splitext(file)[0]+'.dat' - if not os.path.lexists(file): - print file,'not found' + formatFile = os.path.splitext(myFile)[0] + myFile = os.path.splitext(myFile)[0]+'.dat' + if not os.path.lexists(myFile): + print('{} not found'.format(myFile)) continue print('Scanning format files of: %s'%formatFile) @@ -128,8 +121,8 @@ for file in files: for what in me: outputFormat[what] = ParseOutputFormat(formatFile,what,me[what]) if '_id' not in outputFormat[what]['specials']: - print "'%s' not found in <%s>"%(me[what],what) - print '\n'.join(map(lambda x:' '+x,outputFormat[what]['specials']['brothers'])) + print("'{}' not found in <{}>"%(me[what],what)) + print('\n'.join(map(lambda x:' '+x,outputFormat[what]['specials']['brothers']))) sys.exit(1) UserVars = ['HomogenizationCount'] @@ -157,11 +150,11 @@ for file in files: UserVars += ['%i_%s'%(grain+1,var[0]) for i in range(var[1])] # Now change *.dat file(s) - print('Adding labels to: %s'%file) - inFile = open(file) + print('Adding labels to: %s'%myFile) + inFile = open(myFile) input = inFile.readlines() inFile.close() - output = open(file,'w') + output = open(myFile,'w') thisSection = '' if options.damaskOption: output.write('$damask {0}\n'.format(options.damaskOption)) diff --git a/processing/pre/mentat_pbcOnBoxMesh.py b/processing/pre/mentat_pbcOnBoxMesh.py index 07f8e4b70..71bc0d121 100755 --- a/processing/pre/mentat_pbcOnBoxMesh.py +++ b/processing/pre/mentat_pbcOnBoxMesh.py @@ -58,14 +58,14 @@ def servoLink(): } Nnodes = py_mentat.py_get_int("nnodes()") NodeCoords = np.zeros((Nnodes,3),dtype='d') - for node in xrange(Nnodes): + for node in range(Nnodes): NodeCoords[node,0] = py_mentat.py_get_float("node_x(%i)"%(node+1)) NodeCoords[node,1] = py_mentat.py_get_float("node_y(%i)"%(node+1)) NodeCoords[node,2] = py_mentat.py_get_float("node_z(%i)"%(node+1)) - box['min'] = NodeCoords.min(axis=0) # find the bounding box + box['min'] = NodeCoords.min(axis=0) # find the bounding box box['max'] = NodeCoords.max(axis=0) box['delta'] = box['max']-box['min'] - for coord in xrange(3): # calc the dimension of the bounding box + for coord in range(3): # calc the dimension of the bounding box if box['delta'][coord] != 0.0: for extremum in ['min','max']: rounded = round(box[extremum][coord]*1e+15/box['delta'][coord]) * \ @@ -76,12 +76,12 @@ def servoLink(): #------------------------------------------------------------------------------------------------- # loop over all nodes - for node in xrange(Nnodes): + for node in range(Nnodes): key = {} maxFlag = [False, False, False] Nmax = 0 Nmin = 0 - for coord in xrange(3): # for each direction + for coord in range(3): # for each direction if box['delta'][coord] != 0.0: rounded = round(NodeCoords[node,coord]*1e+15/box['delta'][coord]) * \ 1e-15*box['delta'][coord] # rounding to 1e-15 of dimension @@ -102,18 +102,18 @@ def servoLink(): if key['z'] not in baseNode[key['x']][key['y']].keys(): baseNode[key['x']][key['y']][key['z']] = 0 - baseNode[key['x']][key['y']][key['z']] = node+1 # remember the base node id + baseNode[key['x']][key['y']][key['z']] = node+1 # remember the base node id - if Nmax > 0 and Nmax >= Nmin: # node is on at least as many front than back faces - if any([maxFlag[i] and active[i] for i in xrange(3)]): - linkNodes.append({'id': node+1,'coord': NodeCoords[node], 'faceMember': [maxFlag[i] and active[i] for i in xrange(3)]}) + if Nmax > 0 and Nmax >= Nmin: # node is on at least as many front than back faces + if any([maxFlag[i] and active[i] for i in range(3)]): + linkNodes.append({'id': node+1,'coord': NodeCoords[node], 'faceMember': [maxFlag[i] and active[i] for i in range(3)]}) baseCorner = baseNode["%.8e"%box['min'][0]]["%.8e"%box['min'][1]]["%.8e"%box['min'][2]] # detect ultimate base node for node in linkNodes: # loop over all linked nodes linkCoord = [node['coord']] # start list of control node coords with my coords - for dir in xrange(3): # check for each direction + for dir in range(3): # check for each direction if node['faceMember'][dir]: # me on this front face linkCoord[0][dir] = box['min'][dir] # project me onto rear face along dir linkCoord.append(np.array(box['min'])) # append base corner diff --git a/processing/pre/patchFromReconstructedBoundaries.py b/processing/pre/patchFromReconstructedBoundaries.py index 572c929fa..d9861619e 100755 --- a/processing/pre/patchFromReconstructedBoundaries.py +++ b/processing/pre/patchFromReconstructedBoundaries.py @@ -42,9 +42,9 @@ def outStdout(cmd,locals): exec(cmd[3:]) elif cmd[0:3] == '(?)': cmd = eval(cmd[3:]) - print cmd + print(cmd) else: - print cmd + print(cmd) return @@ -84,7 +84,7 @@ def rcbOrientationParser(content,idcolumn): return grains def rcbParser(content,M,size,tolerance,idcolumn,segmentcolumn): - """parser for TSL-OIM reconstructed boundary files""" + """Parser for TSL-OIM reconstructed boundary files""" # find bounding box boxX = [1.*sys.maxint,-1.*sys.maxint] boxY = [1.*sys.maxint,-1.*sys.maxint] @@ -333,21 +333,21 @@ def rcbParser(content,M,size,tolerance,idcolumn,segmentcolumn): for neighbors in grainNeighbors: rcData['neighbors'].append(neighbors) - for legs in grains['legs']: # loop over grains - rcData['grain'].append(legs) # store list of boundary segments + for legs in grains['legs']: # loop over grains + rcData['grain'].append(legs) # store list of boundary segments myNeighbors = {} - for leg in legs: # test each boundary segment - if leg < len(grainNeighbors): # a valid segment index? - for side in range(2): # look at both sides of the segment - if grainNeighbors[leg][side] in myNeighbors: # count occurrence of grain IDs + for leg in legs: # test each boundary segment + if leg < len(grainNeighbors): # a valid segment index? + for side in range(2): # look at both sides of the segment + if grainNeighbors[leg][side] in myNeighbors: # count occurrence of grain IDs myNeighbors[grainNeighbors[leg][side]] += 1 else: myNeighbors[grainNeighbors[leg][side]] = 1 - if myNeighbors: # do I have any neighbors (i.e., non-bounding box segment) - candidateGrains = sorted(myNeighbors.iteritems(), key=lambda (k,v): (v,k), reverse=True) # sort grain counting - # most frequent one not yet seen? + if myNeighbors: # do I have any neighbors (i.e., non-bounding box segment) + candidateGrains = sorted(myNeighbors.items(), key=lambda (k,v): (v,k), reverse=True) # sort grain counting + # most frequent one not yet seen? rcData['grainMapping'].append(candidateGrains[0 if candidateGrains[0][0] not in rcData['grainMapping'] else 1][0]) # must be me then - # special case of bi-crystal situation... + # special case of bi-crystal situation... damask.util.croak(' found {} grains'.format(len(rcData['grain']))) @@ -729,7 +729,7 @@ def image(name,imgsize,marginX,marginY,rcData): # ------------------------- def inside(x,y,points): - """tests whether point(x,y) is within polygon described by points""" + """Tests whether point(x,y) is within polygon described by points""" inside = False npoints=len(points) (x1,y1) = points[npoints-1] # start with last point of points @@ -751,7 +751,7 @@ def inside(x,y,points): # ------------------------- def fftbuild(rcData,height,xframe,yframe,resolution,extrusion): - """build array of grain numbers""" + """Build array of grain numbers""" maxX = -1.*sys.maxint maxY = -1.*sys.maxint for line in rcData['point']: # find data range diff --git a/processing/pre/seeds_fromDistribution.py b/processing/pre/seeds_fromDistribution.py index 18b2712e7..d66f0bedd 100755 --- a/processing/pre/seeds_fromDistribution.py +++ b/processing/pre/seeds_fromDistribution.py @@ -4,7 +4,6 @@ import threading,time,os,sys,random import numpy as np from optparse import OptionParser -from operator import mul from cStringIO import StringIO import damask @@ -65,7 +64,7 @@ class myThread (threading.Thread): NmoveGrains = random.randrange(1,maxSeeds) selectedMs = [] direction = [] - for i in xrange(NmoveGrains): + for i in range(NmoveGrains): selectedMs.append(random.randrange(1,nMicrostructures)) direction.append(np.array(((random.random()-0.5)*delta[0], @@ -110,7 +109,7 @@ class myThread (threading.Thread): currentData=np.bincount(perturbedGeomTable.data.astype(int).ravel())[1:]/points currentError=[] currentHist=[] - for i in xrange(nMicrostructures): # calculate the deviation in all bins per histogram + for i in range(nMicrostructures): # calculate the deviation in all bins per histogram currentHist.append(np.histogram(currentData,bins=target[i]['bins'])[0]) currentError.append(np.sqrt(np.square(np.array(target[i]['histogram']-currentHist[i])).sum())) @@ -122,12 +121,12 @@ class myThread (threading.Thread): bestMatch = match #--- count bin classes with no mismatch ---------------------------------------------------------------------- myMatch=0 - for i in xrange(nMicrostructures): + for i in range(nMicrostructures): if currentError[i] > 0.0: break myMatch = i+1 if myNmicrostructures == nMicrostructures: - for i in xrange(min(nMicrostructures,myMatch+options.bins)): + for i in range(min(nMicrostructures,myMatch+options.bins)): if currentError[i] > target[i]['error']: # worse fitting, next try randReset = True break @@ -146,7 +145,7 @@ class myThread (threading.Thread): for line in perturbedSeedsVFile: currentSeedsFile.write(line) bestSeedsVFile.write(line) - for j in xrange(nMicrostructures): # save new errors for all bins + for j in range(nMicrostructures): # save new errors for all bins target[j]['error'] = currentError[j] if myMatch > match: # one or more new bins have no deviation damask.util.croak( 'Stage {:d} cleared'.format(myMatch)) @@ -160,7 +159,7 @@ class myThread (threading.Thread): bestSeedsVFile = StringIO() for line in perturbedSeedsVFile: bestSeedsVFile.write(line) - for j in xrange(nMicrostructures): + for j in range(nMicrostructures): target[j]['error'] = currentError[j] randReset = True else: #--- not all grains are tessellated @@ -219,8 +218,7 @@ if options.randomSeed is None: damask.util.croak(options.randomSeed) delta = (options.scale/options.grid[0],options.scale/options.grid[1],options.scale/options.grid[2]) baseFile=os.path.splitext(os.path.basename(options.seedFile))[0] -points = float(reduce(mul,options.grid)) - +points = np.array(options.grid).prod().astype('float') # ----------- calculate target distribution and bin edges targetGeomFile = os.path.splitext(os.path.basename(options.target))[0]+'.geom' @@ -231,7 +229,7 @@ nMicrostructures = info['microstructures'] targetVolFrac = np.bincount(targetGeomTable.microstructure_read(info['grid']))[1:nMicrostructures+1]/\ float(info['grid'].prod()) target=[] -for i in xrange(1,nMicrostructures+1): +for i in range(1,nMicrostructures+1): targetHist,targetBins = np.histogram(targetVolFrac,bins=i) #bin boundaries target.append({'histogram':targetHist,'bins':targetBins}) @@ -260,7 +258,7 @@ info,devNull = initialGeomTable.head_getGeom() if info['microstructures'] != nMicrostructures: damask.util.croak('error. Microstructure count mismatch') initialData = np.bincount(initialGeomTable.microstructure_read(info['grid']))/points -for i in xrange(nMicrostructures): +for i in range(nMicrostructures): initialHist = np.histogram(initialData,bins=target[i]['bins'])[0] target[i]['error']=np.sqrt(np.square(np.array(target[i]['histogram']-initialHist)).sum()) @@ -269,7 +267,7 @@ if target[0]['error'] > 0.0: target[0]['error'] *=((target[0]['bins'][0]-np.min(initialData))**2.0+ (target[0]['bins'][1]-np.max(initialData))**2.0)**0.5 match=0 -for i in xrange(nMicrostructures): +for i in range(nMicrostructures): if target[i]['error'] > 0.0: break match = i+1 diff --git a/processing/pre/seeds_fromPokes.py b/processing/pre/seeds_fromPokes.py index 5d2cc212f..d3ea632fc 100755 --- a/processing/pre/seeds_fromPokes.py +++ b/processing/pre/seeds_fromPokes.py @@ -105,12 +105,12 @@ for name in filenames: grid = np.zeros(3,'i') n = 0 - for i in xrange(Nx): - for j in xrange(Ny): + for i in range(Nx): + for j in range(Ny): grid[0] = round((i+0.5)*box[0]*info['grid'][0]/Nx-0.5)+offset[0] grid[1] = round((j+0.5)*box[1]*info['grid'][1]/Ny-0.5)+offset[1] damask.util.croak('x,y coord on surface: {},{}...'.format(*grid[:2])) - for k in xrange(Nz): + for k in range(Nz): grid[2] = k + offset[2] grid %= info['grid'] seeds[n,0:3] = (0.5+grid)/info['grid'] # normalize coordinates to box diff --git a/processing/pre/seeds_fromRandom.py b/processing/pre/seeds_fromRandom.py index f25f210e9..0df292ed2 100755 --- a/processing/pre/seeds_fromRandom.py +++ b/processing/pre/seeds_fromRandom.py @@ -14,12 +14,12 @@ scriptID = ' '.join([scriptName,damask.version]) # ------------------------------------------ aux functions --------------------------------- def kdtree_search(cloud, queryPoints): - """find distances to nearest neighbor among cloud (N,d) for each of the queryPoints (n,d)""" + """Find distances to nearest neighbor among cloud (N,d) for each of the queryPoints (n,d)""" n = queryPoints.shape[0] distances = np.zeros(n,dtype=float) tree = spatial.cKDTree(cloud) - for i in xrange(n): + for i in range(n): distances[i], index = tree.query(queryPoints[i]) return distances @@ -227,8 +227,8 @@ for name in filenames: "randomSeed\t{}".format(options.randomSeed), ]) table.labels_clear() - table.labels_append( ['{dim}_{label}'.format(dim = 1+k,label = 'pos') for k in xrange(3)] + - ['{dim}_{label}'.format(dim = 1+k,label = 'euler') for k in xrange(3)] + + table.labels_append( ['{dim}_{label}'.format(dim = 1+k,label = 'pos') for k in range(3)] + + ['{dim}_{label}'.format(dim = 1+k,label = 'euler') for k in range(3)] + ['microstructure'] + (['weight'] if options.weights else [])) table.head_write() From 95fb50272fc15f1a120367fd60dd61b03b0682c1 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 25 Oct 2016 06:51:40 +0200 Subject: [PATCH 326/412] adopted to python 3. for replacement of cmp function, see https://docs.python.org/3.0/whatsnew/3.0.html it's recommended to remove it completely --- lib/damask/orientation.py | 68 ++++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/lib/damask/orientation.py b/lib/damask/orientation.py index d5274571b..898a431bb 100644 --- a/lib/damask/orientation.py +++ b/lib/damask/orientation.py @@ -42,7 +42,7 @@ class Quaternion: def __init__(self, quatArray = [1.0,0.0,0.0,0.0]): - """initializes to identity if not given""" + """Initializes to identity if not given""" self.w, \ self.x, \ self.y, \ @@ -50,23 +50,23 @@ class Quaternion: self.homomorph() def __iter__(self): - """components""" + """Components""" return iter([self.w,self.x,self.y,self.z]) def __copy__(self): - """create copy""" + """Create copy""" Q = Quaternion([self.w,self.x,self.y,self.z]) return Q copy = __copy__ def __repr__(self): - """readbable string""" + """Readbable string""" return 'Quaternion(real=%+.6f, imag=<%+.6f, %+.6f, %+.6f>)' % \ (self.w, self.x, self.y, self.z) def __pow__(self, exponent): - """power""" + """Power""" omega = math.acos(self.w) vRescale = math.sin(exponent*omega)/math.sin(omega) Q = Quaternion() @@ -77,7 +77,7 @@ class Quaternion: return Q def __ipow__(self, exponent): - """in place power""" + """In place power""" omega = math.acos(self.w) vRescale = math.sin(exponent*omega)/math.sin(omega) self.w = np.cos(exponent*omega) @@ -87,7 +87,7 @@ class Quaternion: return self def __mul__(self, other): - """multiplication""" + """Multiplication""" try: # quaternion Aw = self.w Ax = self.x @@ -135,7 +135,7 @@ class Quaternion: return self.copy() def __imul__(self, other): - """in place multiplication""" + """In place multiplication""" try: # Quaternion Ax = self.x Ay = self.y @@ -153,7 +153,7 @@ class Quaternion: return self def __div__(self, other): - """division""" + """Division""" if isinstance(other, (int,float)): w = self.w / other x = self.x / other @@ -164,7 +164,7 @@ class Quaternion: return NotImplemented def __idiv__(self, other): - """in place division""" + """In place division""" if isinstance(other, (int,float)): self.w /= other self.x /= other @@ -173,7 +173,7 @@ class Quaternion: return self def __add__(self, other): - """addition""" + """Addition""" if isinstance(other, Quaternion): w = self.w + other.w x = self.x + other.x @@ -184,7 +184,7 @@ class Quaternion: return NotImplemented def __iadd__(self, other): - """in place division""" + """In place division""" if isinstance(other, Quaternion): self.w += other.w self.x += other.x @@ -193,7 +193,7 @@ class Quaternion: return self def __sub__(self, other): - """subtraction""" + """Subtraction""" if isinstance(other, Quaternion): Q = self.copy() Q.w -= other.w @@ -205,7 +205,7 @@ class Quaternion: return self.copy() def __isub__(self, other): - """in place subtraction""" + """In place subtraction""" if isinstance(other, Quaternion): self.w -= other.w self.x -= other.x @@ -214,7 +214,7 @@ class Quaternion: return self def __neg__(self): - """additive inverse""" + """Additive inverse""" self.w = -self.w self.x = -self.x self.y = -self.y @@ -222,7 +222,7 @@ class Quaternion: return self def __abs__(self): - """norm""" + """Norm""" return math.sqrt(self.w ** 2 + \ self.x ** 2 + \ self.y ** 2 + \ @@ -231,7 +231,7 @@ class Quaternion: magnitude = __abs__ def __eq__(self,other): - """equal at e-8 precision""" + """Equal at e-8 precision""" return (abs(self.w-other.w) < 1e-8 and \ abs(self.x-other.x) < 1e-8 and \ abs(self.y-other.y) < 1e-8 and \ @@ -243,12 +243,12 @@ class Quaternion: abs(-self.z-other.z) < 1e-8) def __ne__(self,other): - """not equal at e-8 precision""" + """Not equal at e-8 precision""" return not self.__eq__(self,other) def __cmp__(self,other): - """linear ordering""" - return cmp(self.Rodrigues(),other.Rodrigues()) + """Linear ordering""" + return (self.Rodrigues()>other.Rodrigues()) - (self.Rodrigues() otherOrder) - (myOrder < otherOrder) def symmetryQuats(self,who = []): """List of symmetry operations as quaternions.""" @@ -845,14 +847,14 @@ class Orientation: self.symmetry = Symmetry(symmetry) def __copy__(self): - """copy""" + """Copy""" return self.__class__(quaternion=self.quaternion,symmetry=self.symmetry.lattice) copy = __copy__ def __repr__(self): - """value as all implemented representations""" + """Value as all implemented representations""" return 'Symmetry: %s\n' % (self.symmetry) + \ 'Quaternion: %s\n' % (self.quaternion) + \ 'Matrix:\n%s\n' % ( '\n'.join(['\t'.join(map(str,self.asMatrix()[i,:])) for i in range(3)]) ) + \ @@ -937,7 +939,7 @@ class Orientation: axis, proper = False, SST = True): - """axis rotated according to orientation (using crystal symmetry to ensure location falls into SST)""" + """Axis rotated according to orientation (using crystal symmetry to ensure location falls into SST)""" if SST: # pole requested to be within SST for i,q in enumerate(self.symmetry.equivalentQuaternions(self.quaternion)): # test all symmetric equivalent quaternions pole = q.conjugated()*axis # align crystal direction to axis @@ -963,7 +965,7 @@ class Orientation: orientations, multiplicity = []): """ - average orientation + Average orientation ref: F. Landis Markley, Yang Cheng, John Lucas Crassidis, and Yaakov Oshman. Averaging Quaternions, @@ -996,7 +998,7 @@ class Orientation: direction, targetSymmetry = None): """ - orientation relationship + Orientation relationship positive number: fcc --> bcc negative number: bcc --> fcc From b74db4e3018d0f0883f372dbd02e9e9ced3b45d8 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 25 Oct 2016 19:30:13 +0200 Subject: [PATCH 327/412] bug fix for potentially undefined variable --- lib/damask/colormaps.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/damask/colormaps.py b/lib/damask/colormaps.py index 6e33613e0..f87af676d 100644 --- a/lib/damask/colormaps.py +++ b/lib/damask/colormaps.py @@ -85,7 +85,7 @@ class Color(): def _HSL2RGB(self): """ - convert H(ue) S(aturation) L(uminance) to R(red) G(reen) B(lue) + Convert H(ue) S(aturation) L(uminance) to R(red) G(reen) B(lue) with S,L,H,R,G,B running from 0 to 1 from http://en.wikipedia.org/wiki/HSL_and_HSV @@ -111,7 +111,7 @@ class Color(): def _RGB2HSL(self): """ - convert R(ed) G(reen) B(lue) to H(ue) S(aturation) L(uminance) + Convert R(ed) G(reen) B(lue) to H(ue) S(aturation) L(uminance) with S,L,H,R,G,B running from 0 to 1 from http://130.113.54.154/~monger/hsl-rgb.html @@ -151,7 +151,7 @@ class Color(): def _RGB2XYZ(self): """ - convert R(ed) G(reen) B(lue) to CIE XYZ + Convert R(ed) G(reen) B(lue) to CIE XYZ with all values in the range of 0 to 1 from http://www.cs.rit.edu/~ncs/color/t_convert.html @@ -180,12 +180,13 @@ class Color(): def _XYZ2RGB(self): """ - convert CIE XYZ to R(ed) G(reen) B(lue) + Convert CIE XYZ to R(ed) G(reen) B(lue) with all values in the range of 0 to 1 from http://www.cs.rit.edu/~ncs/color/t_convert.html """ - if self.model != 'XYZ': return + if self.model != 'XYZ': + return convert = np.array([[ 3.240479,-1.537150,-0.498535], [-0.969256, 1.875992, 0.041556], @@ -211,7 +212,7 @@ class Color(): def _CIELAB2XYZ(self): """ - convert CIE Lab to CIE XYZ + Convert CIE Lab to CIE XYZ with XYZ in the range of 0 to 1 from http://www.easyrgb.com/index.php?X=MATH&H=07#text7 @@ -235,7 +236,7 @@ class Color(): def _XYZ2CIELAB(self): """ - convert CIE XYZ to CIE Lab + Convert CIE XYZ to CIE Lab with XYZ in the range of 0 to 1 from http://en.wikipedia.org/wiki/Lab_color_space, http://www.cs.rit.edu/~ncs/color/t_convert.html @@ -258,7 +259,7 @@ class Color(): def _CIELAB2MSH(self): """ - convert CIE Lab to Msh colorspace + Convert CIE Lab to Msh colorspace from http://www.cs.unm.edu/~kmorel/documents/ColorMaps/DivergingColorMapWorkshop.xls """ @@ -278,7 +279,7 @@ class Color(): def _MSH2CIELAB(self): """ - convert Msh colorspace to CIE Lab + Convert Msh colorspace to CIE Lab s,h in radians from http://www.cs.unm.edu/~kmorel/documents/ColorMaps/DivergingColorMapWorkshop.xls @@ -296,7 +297,7 @@ class Color(): class Colormap(): - """perceptually uniform diverging or sequential colormaps.""" + """Perceptually uniform diverging or sequential colormaps.""" __slots__ = [ 'left', @@ -371,7 +372,7 @@ class Colormap(): # ------------------------------------------------------------------ def __repr__(self): - """left and right value of colormap""" + """Left and right value of colormap""" return 'Left: %s Right: %s'%(self.left,self.right) @@ -416,7 +417,7 @@ class Colormap(): def interpolate_linear(lo, hi, frac): """ - linearly interpolate color at given fraction between lower and + Linearly interpolate color at given fraction between lower and higher color in model of lower color """ @@ -456,9 +457,8 @@ class Colormap(): colormap = ['[\n {{\n "ColorSpace" : "RGB", "Name" : "{}",\n "RGBPoints" : ['.format(name)] \ + [' {:4d},{:8.6f},{:8.6f},{:8.6f},'.format(i,color[0],color[1],color[2],) for i,color in enumerate(colors[:-1])]\ - + [' {:4d},{:8.6f},{:8.6f},{:8.6f} '.format(i+1,colors[-1][0],colors[-1][1],colors[-1][2],)]\ + + [' {:4d},{:8.6f},{:8.6f},{:8.6f} '.format(len(colors),colors[-1][0],colors[-1][1],colors[-1][2],)]\ + [' ]\n }\n]'] - elif format == 'gmsh': colormap = ['View.ColorTable = {'] \ + [',\n'.join(['{%s}'%(','.join([str(x*255.0) for x in color])) for color in colors])] \ From ac5f19f1f62c0763cc57f2c10914e7ce5ac1826c Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 25 Oct 2016 21:19:05 +0200 Subject: [PATCH 328/412] docstring fixes --- lib/damask/colormaps.py | 3 ++- lib/damask/h5table.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/damask/colormaps.py b/lib/damask/colormaps.py index f87af676d..4466840cc 100644 --- a/lib/damask/colormaps.py +++ b/lib/damask/colormaps.py @@ -5,7 +5,8 @@ import math,numpy as np ### --- COLOR CLASS -------------------------------------------------- class Color(): - """Conversion of colors between different color-spaces. + """ + Conversion of colors between different color-spaces. Colors should be given in the form Color('model',[vector]).To convert and copy color from one space to other, use the methods diff --git a/lib/damask/h5table.py b/lib/damask/h5table.py index 095146d09..bf8069e37 100644 --- a/lib/damask/h5table.py +++ b/lib/damask/h5table.py @@ -48,7 +48,8 @@ def lables_to_path(label, dsXMLPath=None): class H5Table(object): - """Light weight interface class for h5py + """ + Light weight interface class for h5py DESCRIPTION ----------- From a62ab3b5d4851d905ac2678098da4b4b7b733b60 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 25 Oct 2016 21:52:51 +0200 Subject: [PATCH 329/412] fixes (mainly tuple arguments for functions and lambda functions) --- processing/misc/yieldSurface.py | 103 ++++++++++++++++---------------- 1 file changed, 52 insertions(+), 51 deletions(-) diff --git a/processing/misc/yieldSurface.py b/processing/misc/yieldSurface.py index 15f97113a..f3b6f0425 100755 --- a/processing/misc/yieldSurface.py +++ b/processing/misc/yieldSurface.py @@ -28,7 +28,7 @@ def runFit(exponent, eqStress, dimension, criterion): nParas = nParas-nExpo fitCriteria[criterion]['bound'][dDim] = fitCriteria[criterion]['bound'][dDim][:nParas] - for i in xrange(nParas): + for i in range(nParas): temp = fitCriteria[criterion]['bound'][dDim][i] if fitCriteria[criterion]['bound'][dDim][i] == (None,None): Guess.append(1.0) @@ -42,8 +42,8 @@ def runFit(exponent, eqStress, dimension, criterion): myLoad = Loadcase(options.load[0],options.load[1],options.load[2], nSet = 10, dimension = dimension, vegter = options.criterion=='vegter') - stressAll= [np.zeros(0,'d').reshape(0,0) for i in xrange(int(options.yieldValue[2]))] - strainAll= [np.zeros(0,'d').reshape(0,0) for i in xrange(int(options.yieldValue[2]))] + stressAll= [np.zeros(0,'d').reshape(0,0) for i in range(int(options.yieldValue[2]))] + strainAll= [np.zeros(0,'d').reshape(0,0) for i in range(int(options.yieldValue[2]))] myFit = Criterion(exponent,eqStress, dimension, criterion) for t in range(options.threads): @@ -57,12 +57,12 @@ def runFit(exponent, eqStress, dimension, criterion): def principalStresses(sigmas): """ - computes principal stresses (i.e. eigenvalues) for a set of Cauchy stresses. + Computes principal stresses (i.e. eigenvalues) for a set of Cauchy stresses. sorted in descending order. """ lambdas=np.zeros(0,'d') - for i in xrange(np.shape(sigmas)[1]): + for i in range(np.shape(sigmas)[1]): eigenvalues = np.linalg.eigvalsh(sym6toT33(sigmas[:,i])) lambdas = np.append(lambdas,np.sort(eigenvalues)[::-1]) #append eigenvalues in descending order lambdas = np.transpose(lambdas.reshape(np.shape(sigmas)[1],3)) @@ -82,7 +82,7 @@ def principalStress(p): t1 + t2*np.cos(phi+np.pi*2.0/3.0), t1 + t2*np.cos(phi+np.pi*4.0/3.0)]) -def principalStrs_Der(p, (s1, s2, s3, s4, s5, s6), dim, Karafillis=False): +def principalStrs_Der(p, s, dim, Karafillis=False): """Derivative of principal stress with respect to stress""" third = 1.0/3.0 third2 = 2.0*third @@ -111,31 +111,31 @@ def principalStrs_Der(p, (s1, s2, s3, s4, s5, s6), dim, Karafillis=False): dSdI = np.array([dSidIj(phi),dSidIj(phi+np.pi*2.0/3.0),dSidIj(phi+np.pi*4.0/3.0)]) # i=1,2,3; j=1,2,3 # calculate the derivation of principal stress with regards to the anisotropic coefficients - one = np.ones_like(s1); zero = np.zeros_like(s1); num = len(s1) + one = np.ones_like(s); zero = np.zeros_like(s); num = len(s) dIdp = np.array([[one, one, one, zero, zero, zero], [p[1]+p[2], p[2]+p[0], p[0]+p[1], -2.0*p[3], -2.0*p[4], -2.0*p[5]], [p[1]*p[2]-p[4]**2, p[2]*p[0]-p[5]**2, p[0]*p[1]-p[3]**2, -2.0*p[3]*p[2]+2.0*p[4]*p[5], -2.0*p[4]*p[0]+2.0*p[5]*p[3], -2.0*p[5]*p[1]+2.0*p[3]*p[4]] ]) if Karafillis: - dpdc = np.array([[zero,s1-s3,s1-s2], [s2-s3,zero,s2-s1], [s3-s2,s3-s1,zero]])/3.0 - dSdp = np.array([np.dot(dSdI[:,:,i],dIdp[:,:,i]).T for i in xrange(num)]).T + dpdc = np.array([[zero,s[0]-s[2],s[0]-s[1]], [s[1]-s[2],zero,s[1]-s[0]], [s[2]-s[1],s[2]-s[0],zero]])/3.0 + dSdp = np.array([np.dot(dSdI[:,:,i],dIdp[:,:,i]).T for i in range(num)]).T if dim == 2: - temp = np.vstack([dSdp[:,3]*s4]).T.reshape(num,1,3).T + temp = np.vstack([dSdp[:,3]*s[3]]).T.reshape(num,1,3).T else: - temp = np.vstack([dSdp[:,3]*s4,dSdp[:,4]*s5,dSdp[:,5]*s6]).T.reshape(num,3,3).T + temp = np.vstack([dSdp[:,3]*s[3],dSdp[:,4]*s[4],dSdp[:,5]*s[5]]).T.reshape(num,3,3).T - return np.concatenate((np.array([np.dot(dSdp[:,0:3,i], dpdc[:,:,i]).T for i in xrange(num)]).T, + return np.concatenate((np.array([np.dot(dSdp[:,0:3,i], dpdc[:,:,i]).T for i in range(num)]).T, temp), axis=1) else: if dim == 2: - dIdc=np.array([[-dIdp[i,0]*s2, -dIdp[i,1]*s1, -dIdp[i,1]*s3, - -dIdp[i,2]*s2, -dIdp[i,2]*s1, -dIdp[i,0]*s3, - dIdp[i,3]*s4 ] for i in xrange(3)]) + dIdc=np.array([[-dIdp[i,0]*s[1], -dIdp[i,1]*s[0], -dIdp[i,1]*s[2], + -dIdp[i,2]*s[1], -dIdp[i,2]*s[0], -dIdp[i,0]*s[2], + dIdp[i,3]*s[3] ] for i in range(3)]) else: - dIdc=np.array([[-dIdp[i,0]*s2, -dIdp[i,1]*s1, -dIdp[i,1]*s3, - -dIdp[i,2]*s2, -dIdp[i,2]*s1, -dIdp[i,0]*s3, - dIdp[i,3]*s4, dIdp[i,4]*s5, dIdp[i,5]*s6 ] for i in xrange(3)]) - return np.array([np.dot(dSdI[:,:,i],dIdc[:,:,i]).T for i in xrange(num)]).T + dIdc=np.array([[-dIdp[i,0]*s[1], -dIdp[i,1]*s[0], -dIdp[i,1]*s[2], + -dIdp[i,2]*s[1], -dIdp[i,2]*s[0], -dIdp[i,0]*s[2], + dIdp[i,3]*s[3], dIdp[i,4]*s[4], dIdp[i,5]*s[5] ] for i in range(3)]) + return np.array([np.dot(dSdI[:,:,i],dIdc[:,:,i]).T for i in range(num)]).T def invariant(sigmas): I = np.zeros(3) @@ -194,7 +194,7 @@ class Vegter(object): refNormals = np.empty([13,2]) refPts[12] = refPtsQtr[0] refNormals[12] = refNormalsQtr[0] - for i in xrange(3): + for i in range(3): refPts[i] = refPtsQtr[i] refPts[i+3] = refPtsQtr[3-i][::-1] refPts[i+6] =-refPtsQtr[i] @@ -207,7 +207,7 @@ class Vegter(object): def _getHingePoints(self): """ - calculate the hinge point B according to the reference points A,C and the normals n,m + Calculate the hinge point B according to the reference points A,C and the normals n,m refPoints = np.array([[p1_x, p1_y], [p2_x, p2_y]]); refNormals = np.array([[n1_x, n1_y], [n2_x, n2_y]]) @@ -220,7 +220,7 @@ class Vegter(object): B1 = (m2*(n1*A1 + n2*A2) - n2*(m1*C1 + m2*C2))/(n1*m2-m1*n2) B2 = (n1*(m1*C1 + m2*C2) - m1*(n1*A1 + n2*A2))/(n1*m2-m1*n2) return np.array([B1,B2]) - return np.array([hingPoint(self.refPts[i:i+2],self.refNormals[i:i+2]) for i in xrange(len(self.refPts)-1)]) + return np.array([hingPoint(self.refPts[i:i+2],self.refNormals[i:i+2]) for i in range(len(self.refPts)-1)]) def getBezier(self): def bezier(R,H): @@ -228,7 +228,7 @@ class Vegter(object): for mu in np.linspace(0.0,1.0,self.nspace): b.append(np.array(R[0]*np.ones_like(mu) + 2.0*mu*(H - R[0]) + mu**2*(R[0]+R[1] - 2.0*H))) return b - return np.array([bezier(self.refPts[i:i+2],self.hingePts[i]) for i in xrange(len(self.refPts)-1)]) + return np.array([bezier(self.refPts[i:i+2],self.hingePts[i]) for i in range(len(self.refPts)-1)]) def VetgerCriterion(stress,lankford, rhoBi0, theta=0.0): """0-pure shear; 1-uniaxial; 2-plane strain; 3-equi-biaxial""" @@ -238,7 +238,7 @@ def VetgerCriterion(stress,lankford, rhoBi0, theta=0.0): lmatrix = np.empty([nset,nset]) theta = np.linspace(0.0,np.pi/2,nset) for i,th in enumerate(theta): - lmatrix[i] = np.array([np.cos(2*j*th) for j in xrange(nset)]) + lmatrix[i] = np.array([np.cos(2*j*th) for j in range(nset)]) return np.linalg.solve(lmatrix, r) nps = len(stress) @@ -250,10 +250,10 @@ def VetgerCriterion(stress,lankford, rhoBi0, theta=0.0): strsSet = stress.reshape(nset,4,2) refPts = np.empty([4,2]) - fouriercoeffs = np.array([np.cos(2.0*i*theta) for i in xrange(nset)]) - for i in xrange(2): + fouriercoeffs = np.array([np.cos(2.0*i*theta) for i in range(nset)]) + for i in range(2): refPts[3,i] = sum(strsSet[:,3,i])/nset - for j in xrange(3): + for j in range(3): refPts[j,i] = np.dot(getFourierParas(strsSet[:,j,i]), fouriercoeffs) @@ -752,9 +752,9 @@ def Yld2000(eqStress, paras, sigmas, mFix, criteria, dim, Jac=False): (4.0*D[0]-4.0*D[2]-4.0*D[1]+ D[3])*s11 + (8.0*D[1]-2.0*D[3]-2.0*D[0]+2.0*D[2])*s22, 9.0*D[4]*s12 ])/9.0 - def priStrs((sx,sy,sxy)): - temp = np.sqrt( (sx-sy)**2 + 4.0*sxy**2 ) - return 0.5*(sx+sy + temp), 0.5*(sx+sy - temp) + def priStrs(s): + temp = np.sqrt( (s[0]-s[1])**2 + 4.0*s[2]**2 ) + return 0.5*(s[0]+s[1] + temp), 0.5*(s[0]+s[1] - temp) m2 = m/2.0; m21 = m2 - 1.0 (X1,X2), (Y1,Y2) = priStrs(X), priStrs(Y) # Principal values of X, Y phi1s, phi21s, phi22s = (X1-X2)**2, (2.0*Y2+Y1)**2, (2.0*Y1+Y2)**2 @@ -768,10 +768,11 @@ def Yld2000(eqStress, paras, sigmas, mFix, criteria, dim, Jac=False): drdl, drdm = r/m/left, r*math_ln(0.5*left)*(-1.0/m/m) #/(-m*m) dldm = ( phi1*math_ln(phi1s) + phi21*math_ln(phi21s) + phi22*math_ln(phi22s) )*0.5 zero = np.zeros_like(s11); num = len(s11) - def dPrincipalds((X1,X2,X12)): # derivative of principla with respect to stress - temp = 1.0/np.sqrt( (X1-X2)**2 + 4.0*X12**2 ) - dP1dsi = 0.5*np.array([ 1.0+temp*(X1-X2), 1.0-temp*(X1-X2), temp*4.0*X12]) - dP2dsi = 0.5*np.array([ 1.0-temp*(X1-X2), 1.0+temp*(X1-X2), -temp*4.0*X12]) + def dPrincipalds(X): + """Derivative of principla with respect to stress""" + temp = 1.0/np.sqrt( (X[0]-X[1])**2 + 4.0*X[2]**2 ) + dP1dsi = 0.5*np.array([ 1.0+temp*(X[0]-X[1]), 1.0-temp*(X[0]-X[1]), temp*4.0*X[2]]) + dP2dsi = 0.5*np.array([ 1.0-temp*(X[0]-X[1]), 1.0+temp*(X[0]-X[1]), -temp*4.0*X[2]]) return np.array([dP1dsi, dP2dsi]) dXdXi, dYdYi = dPrincipalds(X), dPrincipalds(Y) @@ -782,14 +783,14 @@ def Yld2000(eqStress, paras, sigmas, mFix, criteria, dim, Jac=False): [ 4.0*s11-2.0*s22, -4.0*s11+8.0*s22, -4.0*s11+2.0*s22, s11-2.0*s22, zero ], #dY22dD [ zero, zero, zero, zero, 9.0*s12 ] ])/9.0 #dY12dD - dXdC=np.array([np.dot(dXdXi[:,:,i], dXidC[:,:,i]).T for i in xrange(num)]).T - dYdD=np.array([np.dot(dYdYi[:,:,i], dYidD[:,:,i]).T for i in xrange(num)]).T + dXdC=np.array([np.dot(dXdXi[:,:,i], dXidC[:,:,i]).T for i in range(num)]).T + dYdD=np.array([np.dot(dYdYi[:,:,i], dYidD[:,:,i]).T for i in range(num)]).T dldX = m*np.array([ phi1s**m21*(X1-X2), phi1s**m21*(X2-X1)]) dldY = m*np.array([phi21s**m21*(2.0*Y2+Y1) + 2.0*phi22s**m21*(2.0*Y1+Y2), \ phi22s**m21*(2.0*Y1+Y2) + 2.0*phi21s**m21*(2.0*Y2+Y1) ]) - jC = drdl*np.array([np.dot(dldX[:,i], dXdC[:,:,i]) for i in xrange(num)]).T - jD = drdl*np.array([np.dot(dldY[:,i], dYdD[:,:,i]) for i in xrange(num)]).T + jC = drdl*np.array([np.dot(dldX[:,i], dXdC[:,:,i]) for i in range(num)]).T + jD = drdl*np.array([np.dot(dldY[:,i], dYdD[:,:,i]) for i in range(num)]).T jm = drdl*dldm + drdm if mFix[0]: return np.vstack((jC,jD)).T @@ -817,7 +818,7 @@ def Yld200418p(eqStress, paras, sigmas, mFix, criteria, dim, Jac=False): p,q = ys(sdev, C), ys(sdev, D) pLambdas, qLambdas = principalStress(p), principalStress(q) # no sort - m2 = m/2.0; x3 = xrange(3); num = len(sv) + m2 = m/2.0; x3 = range(3); num = len(sv) PiQj = np.array([(pLambdas[i,:]-qLambdas[j,:]) for i in x3 for j in x3]) QiPj = np.array([(qLambdas[i,:]-pLambdas[j,:]) for i in x3 for j in x3]).reshape(3,3,num) PiQjs = PiQj**2 @@ -831,8 +832,8 @@ def Yld200418p(eqStress, paras, sigmas, mFix, criteria, dim, Jac=False): dldm = np.sum(PiQjs**m2*math_ln(PiQjs),axis=0)*0.5 dPdc, dQdd = principalStrs_Der(p, sdev, dim), principalStrs_Der(q, sdev, dim) PiQjs3d = ( PiQjs**(m2-1.0) ).reshape(3,3,num) - dldP = -m*np.array([np.diag(np.dot(PiQjs3d[:,:,i], QiPj [:,:,i])) for i in xrange(num)]).T - dldQ = m*np.array([np.diag(np.dot(QiPj [:,:,i], PiQjs3d[:,:,i])) for i in xrange(num)]).T + dldP = -m*np.array([np.diag(np.dot(PiQjs3d[:,:,i], QiPj [:,:,i])) for i in range(num)]).T + dldQ = m*np.array([np.diag(np.dot(QiPj [:,:,i], PiQjs3d[:,:,i])) for i in range(num)]).T jm = drdl*dldm + drdm jc = drdl*np.sum([dldP[i]*dPdc[i] for i in x3],axis=0) @@ -851,9 +852,9 @@ def KarafillisBoyce(eqStress, paras, sigmas, mFix, criteria, dim, Jac=False): 0 Date: Tue, 25 Oct 2016 21:53:32 +0200 Subject: [PATCH 330/412] proper capitalization --- processing/post/vtk2ang.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/processing/post/vtk2ang.py b/processing/post/vtk2ang.py index d38e92fa5..6da07bc02 100755 --- a/processing/post/vtk2ang.py +++ b/processing/post/vtk2ang.py @@ -59,9 +59,9 @@ def positiveRadians(angle): # ----------------------------- def getDataLine(angles,x,y,validData=True): """ - Returns string of one line in ang file + Returns string of one line in ang file. - convention in ang file: y coordinate comes first and is fastest index + Convention in ang file: y coordinate comes first and is fastest index positions in micrometer """ info = {True: (9999.9, 1.0, 0,99999,0.0), From 2b50494951b6ff3b3eb19bce99339d53fe73765b Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 25 Oct 2016 22:54:32 +0200 Subject: [PATCH 331/412] following philips suggestion for 8c1fe4fff065d2b3fe9de73619139b68ff3b2788 and removing unneeded if statements for worldrank --- code/DAMASK_spectral.f90 | 38 +++++----- code/kinematics_hydrogen_strain.f90 | 8 +-- code/porosity_none.f90 | 10 +-- code/spectral_damage.f90 | 6 +- code/spectral_mech_AL.f90 | 106 +++++++++++++--------------- code/spectral_mech_Basic.f90 | 95 +++++++++++-------------- code/spectral_mech_Polarisation.f90 | 102 ++++++++++++-------------- code/spectral_utilities.f90 | 4 +- code/thermal_adiabatic.f90 | 8 +-- code/thermal_conduction.f90 | 8 +-- code/thermal_isothermal.f90 | 10 +-- code/vacancyflux_cahnhilliard.f90 | 8 +-- code/vacancyflux_isochempot.f90 | 8 +-- code/vacancyflux_isoconc.f90 | 10 +-- 14 files changed, 179 insertions(+), 242 deletions(-) diff --git a/code/DAMASK_spectral.f90 b/code/DAMASK_spectral.f90 index 122e126ea..6f1794e35 100644 --- a/code/DAMASK_spectral.f90 +++ b/code/DAMASK_spectral.f90 @@ -192,7 +192,7 @@ program DAMASK_spectral if ((N_def /= N_n) .or. (N_n /= N_t) .or. N_n < 1_pInt) & ! sanity check call IO_error(error_ID=837_pInt,ext_msg = trim(loadCaseFile)) ! error message for incomplete loadcase allocate (loadCases(N_n)) ! array of load cases - loadCases%P%myType='p' + loadCases%stress%myType='stress' do i = 1, size(loadCases) allocate(loadCases(i)%ID(nActiveFields)) @@ -244,10 +244,10 @@ program DAMASK_spectral temp_maskVector(j) = IO_stringValue(line,chunkPos,i+j) /= '*' ! true if not an asterisk if (temp_maskVector(j)) temp_valueVector(j) = IO_floatValue(line,chunkPos,i+j) ! read value where applicable enddo - loadCases(currentLoadCase)%P%maskLogical = transpose(reshape(temp_maskVector,[ 3,3])) - loadCases(currentLoadCase)%P%maskFloat = merge(ones,zeros,& - loadCases(currentLoadCase)%P%maskLogical) - loadCases(currentLoadCase)%P%values = math_plain9to33(temp_valueVector) + loadCases(currentLoadCase)%stress%maskLogical = transpose(reshape(temp_maskVector,[ 3,3])) + loadCases(currentLoadCase)%stress%maskFloat = merge(ones,zeros,& + loadCases(currentLoadCase)%stress%maskLogical) + loadCases(currentLoadCase)%stress%values = math_plain9to33(temp_valueVector) case('t','time','delta') ! increment time loadCases(currentLoadCase)%time = IO_floatValue(line,chunkPos,i+1_pInt) case('n','incs','increments','steps') ! number of increments @@ -318,16 +318,16 @@ program DAMASK_spectral endif enddo; write(6,'(/)',advance='no') enddo - if (any(loadCases(currentLoadCase)%P%maskLogical .eqv. & + if (any(loadCases(currentLoadCase)%stress%maskLogical .eqv. & loadCases(currentLoadCase)%deformation%maskLogical)) errorID = 831_pInt ! exclusive or masking only - if (any(loadCases(currentLoadCase)%P%maskLogical .and. & - transpose(loadCases(currentLoadCase)%P%maskLogical) .and. & + if (any(loadCases(currentLoadCase)%stress%maskLogical .and. & + transpose(loadCases(currentLoadCase)%stress%maskLogical) .and. & reshape([ .false.,.true.,.true.,.true.,.false.,.true.,.true.,.true.,.false.],[ 3,3]))) & errorID = 838_pInt ! no rotation is allowed by stress BC write(6,'(2x,a)') 'stress / GPa:' do i = 1_pInt, 3_pInt; do j = 1_pInt, 3_pInt - if(loadCases(currentLoadCase)%P%maskLogical(i,j)) then - write(6,'(2x,f12.7)',advance='no') loadCases(currentLoadCase)%P%values(i,j)*1e-9_pReal + if(loadCases(currentLoadCase)%stress%maskLogical(i,j)) then + write(6,'(2x,f12.7)',advance='no') loadCases(currentLoadCase)%stress%values(i,j)*1e-9_pReal else write(6,'(2x,12a)',advance='no') ' * ' endif @@ -524,20 +524,20 @@ program DAMASK_spectral case (DAMASK_spectral_SolverBasicPETSc_label) call BasicPETSc_forward (& guess,timeinc,timeIncOld,remainingLoadCaseTime, & - F_BC = loadCases(currentLoadCase)%deformation, & - P_BC = loadCases(currentLoadCase)%P, & + deformation_BC = loadCases(currentLoadCase)%deformation, & + stress_BC = loadCases(currentLoadCase)%stress, & rotation_BC = loadCases(currentLoadCase)%rotation) case (DAMASK_spectral_SolverAL_label) call AL_forward (& guess,timeinc,timeIncOld,remainingLoadCaseTime, & - F_BC = loadCases(currentLoadCase)%deformation, & - P_BC = loadCases(currentLoadCase)%P, & + deformation_BC = loadCases(currentLoadCase)%deformation, & + stress_BC = loadCases(currentLoadCase)%stress, & rotation_BC = loadCases(currentLoadCase)%rotation) case (DAMASK_spectral_SolverPolarisation_label) call Polarisation_forward (& guess,timeinc,timeIncOld,remainingLoadCaseTime, & - F_BC = loadCases(currentLoadCase)%deformation, & - P_BC = loadCases(currentLoadCase)%P, & + deformation_BC = loadCases(currentLoadCase)%deformation, & + stress_BC = loadCases(currentLoadCase)%stress, & rotation_BC = loadCases(currentLoadCase)%rotation) end select @@ -558,19 +558,19 @@ program DAMASK_spectral case (DAMASK_spectral_SolverBasicPETSc_label) solres(field) = BasicPETSC_solution (& incInfo,timeinc,timeIncOld, & - P_BC = loadCases(currentLoadCase)%P, & + stress_BC = loadCases(currentLoadCase)%stress, & rotation_BC = loadCases(currentLoadCase)%rotation) case (DAMASK_spectral_SolverAL_label) solres(field) = AL_solution (& incInfo,timeinc,timeIncOld, & - P_BC = loadCases(currentLoadCase)%P, & + stress_BC = loadCases(currentLoadCase)%stress, & rotation_BC = loadCases(currentLoadCase)%rotation) case (DAMASK_spectral_SolverPolarisation_label) solres(field) = Polarisation_solution (& incInfo,timeinc,timeIncOld, & - P_BC = loadCases(currentLoadCase)%P, & + stress_BC = loadCases(currentLoadCase)%stress, & rotation_BC = loadCases(currentLoadCase)%rotation) end select diff --git a/code/kinematics_hydrogen_strain.f90 b/code/kinematics_hydrogen_strain.f90 index 154b97e79..7a33d1a5f 100644 --- a/code/kinematics_hydrogen_strain.f90 +++ b/code/kinematics_hydrogen_strain.f90 @@ -67,8 +67,6 @@ subroutine kinematics_hydrogen_strain_init(fileUnit) KINEMATICS_hydrogen_strain_ID, & material_Nphase, & MATERIAL_partPhase - use numerics,only: & - worldrank implicit none integer(pInt), intent(in) :: fileUnit @@ -79,11 +77,9 @@ subroutine kinematics_hydrogen_strain_init(fileUnit) tag = '', & line = '' - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- kinematics_'//KINEMATICS_hydrogen_strain_LABEL//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- kinematics_'//KINEMATICS_hydrogen_strain_LABEL//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess maxNinstance = int(count(phase_kinematics == KINEMATICS_hydrogen_strain_ID),pInt) if (maxNinstance == 0_pInt) return diff --git a/code/porosity_none.f90 b/code/porosity_none.f90 index 92d4d9fe5..1e6ea9dc9 100644 --- a/code/porosity_none.f90 +++ b/code/porosity_none.f90 @@ -23,21 +23,17 @@ subroutine porosity_none_init() use IO, only: & IO_timeStamp use material - use numerics, only: & - worldrank implicit none integer(pInt) :: & homog, & NofMyHomog - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- porosity_'//POROSITY_none_label//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- porosity_'//POROSITY_none_label//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess - initializeInstances: do homog = 1_pInt, material_Nhomogenization + initializeInstances: do homog = 1_pInt, material_Nhomogenization myhomog: if (porosity_type(homog) == POROSITY_none_ID) then NofMyHomog = count(material_homog == homog) diff --git a/code/spectral_damage.f90 b/code/spectral_damage.f90 index 0c03c3b85..9c259a2fb 100644 --- a/code/spectral_damage.f90 +++ b/code/spectral_damage.f90 @@ -98,11 +98,9 @@ subroutine spectral_damage_init() DMRestoreGlobalVector, & SNESVISetVariableBounds - mainProcess: if (worldrank == 0_pInt) then - write(6,'(/,a)') ' <<<+- spectral_damage init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- spectral_damage init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess !-------------------------------------------------------------------------------------------------- ! initialize solver specific parts of PETSc diff --git a/code/spectral_mech_AL.f90 b/code/spectral_mech_AL.f90 index 6272c1493..951ab2521 100644 --- a/code/spectral_mech_AL.f90 +++ b/code/spectral_mech_AL.f90 @@ -49,7 +49,7 @@ module spectral_mech_AL F_av = 0.0_pReal, & !< average incompatible def grad field P_av = 0.0_pReal, & !< average 1st Piola--Kirchhoff stress P_avLastEval = 0.0_pReal !< average 1st Piola--Kirchhoff stress last call of CPFEM_general - character(len=1024), private :: incInfo !< time and increment information + character(len=1024), private :: incInfo !< time and increment information real(pReal), private, dimension(3,3,3,3) :: & C_volAvg = 0.0_pReal, & !< current volume average stiffness C_volAvgLastInc = 0.0_pReal, & !< previous volume average stiffness @@ -57,7 +57,7 @@ module spectral_mech_AL S = 0.0_pReal, & !< current compliance (filled up with zeros) C_scale = 0.0_pReal, & S_scale = 0.0_pReal - + real(pReal), private :: & err_BC, & !< deviation from stress BC err_curl, & !< RMS of curl of F @@ -132,11 +132,9 @@ subroutine AL_init SNESSetConvergenceTest, & SNESSetFromOptions - mainProcess: if (worldrank == 0_pInt) then - write(6,'(/,a)') ' <<<+- DAMASK_spectral_solverAL init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- DAMASK_spectral_solverAL init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess !-------------------------------------------------------------------------------------------------- ! allocate global fields @@ -244,7 +242,7 @@ end subroutine AL_init !> @brief solution for the AL scheme with internal iterations !-------------------------------------------------------------------------------------------------- type(tSolutionState) function & - AL_solution(incInfoIn,timeinc,timeinc_old,P_BC,rotation_BC) + AL_solution(incInfoIn,timeinc,timeinc_old,stress_BC,rotation_BC) use IO, only: & IO_error use numerics, only: & @@ -267,7 +265,7 @@ type(tSolutionState) function & timeinc, & !< increment in time for current solution timeinc_old !< increment in time of last increment type(tBoundaryCondition), intent(in) :: & - P_BC + stress_BC character(len=*), intent(in) :: & incInfoIn real(pReal), dimension(3,3), intent(in) :: rotation_BC @@ -285,7 +283,7 @@ type(tSolutionState) function & !-------------------------------------------------------------------------------------------------- ! update stiffness (and gamma operator) - S = Utilities_maskedCompliance(rotation_BC,P_BC%maskLogical,C_volAvg) + S = Utilities_maskedCompliance(rotation_BC,stress_BC%maskLogical,C_volAvg) if (update_gamma) then call Utilities_updateGamma(C_minMaxAvg,restartWrite) C_scale = C_minMaxAvg @@ -294,11 +292,11 @@ type(tSolutionState) function & !-------------------------------------------------------------------------------------------------- ! set module wide availabe data - mask_stress = P_BC%maskFloat - params%P_BC = P_BC%values + mask_stress = stress_BC%maskFloat + params%stress_BC = stress_BC%values params%rotation_BC = rotation_BC - params%timeinc = timeinc - params%timeincOld = timeinc_old + params%timeinc = timeinc + params%timeincOld = timeinc_old !-------------------------------------------------------------------------------------------------- ! solve BVP @@ -326,8 +324,7 @@ subroutine AL_formResidual(in,x_scal,f_scal,dummy,ierr) itmax, & itmin, & polarAlpha, & - polarBeta, & - worldrank + polarBeta use mesh, only: & grid3, & grid @@ -406,16 +403,14 @@ subroutine AL_formResidual(in,x_scal,f_scal,dummy,ierr) !-------------------------------------------------------------------------------------------------- ! report begin of new iteration totalIter = totalIter + 1_pInt - if (worldrank == 0_pInt) then - write(6,'(1x,a,3(a,'//IO_intOut(itmax)//'))') trim(incInfo), & - ' @ Iteration ', itmin, '≤',totalIter, '≤', itmax - if (iand(debug_level(debug_spectral),debug_spectralRotation) /= 0) & - write(6,'(/,a,/,3(3(f12.7,1x)/))',advance='no') ' deformation gradient aim (lab) =', & - math_transpose33(math_rotate_backward33(F_aim,params%rotation_BC)) - write(6,'(/,a,/,3(3(f12.7,1x)/))',advance='no') ' deformation gradient aim =', & - math_transpose33(F_aim) - flush(6) - endif + write(6,'(1x,a,3(a,'//IO_intOut(itmax)//'))') trim(incInfo), & + ' @ Iteration ', itmin, '≤',totalIter, '≤', itmax + if (iand(debug_level(debug_spectral),debug_spectralRotation) /= 0) & + write(6,'(/,a,/,3(3(f12.7,1x)/))',advance='no') ' deformation gradient aim (lab) =', & + math_transpose33(math_rotate_backward33(F_aim,params%rotation_BC)) + write(6,'(/,a,/,3(3(f12.7,1x)/))',advance='no') ' deformation gradient aim =', & + math_transpose33(F_aim) + flush(6) endif newIteration !-------------------------------------------------------------------------------------------------- @@ -490,8 +485,7 @@ subroutine AL_converged(snes_local,PETScIter,xnorm,snorm,fnorm,reason,dummy,ierr err_curl_tolRel, & err_curl_tolAbs, & err_stress_tolAbs, & - err_stress_tolRel, & - worldrank + err_stress_tolRel use math, only: & math_mul3333xx33 use FEsolving, only: & @@ -514,9 +508,9 @@ subroutine AL_converged(snes_local,PETScIter,xnorm,snorm,fnorm,reason,dummy,ierr !-------------------------------------------------------------------------------------------------- ! stress BC handling - F_aim = F_aim - math_mul3333xx33(S, ((P_av - params%P_BC))) ! S = 0.0 for no bc + F_aim = F_aim - math_mul3333xx33(S, ((P_av - params%stress_BC))) ! S = 0.0 for no bc err_BC = maxval(abs((-mask_stress+1.0_pReal)*math_mul3333xx33(C_scale,F_aim-F_av) + & - mask_stress *(P_av - params%P_BC))) ! mask = 0.0 for no bc + mask_stress *(P_av - params%stress_BC))) ! mask = 0.0 for no bc !-------------------------------------------------------------------------------------------------- ! error calculation @@ -538,24 +532,22 @@ subroutine AL_converged(snes_local,PETScIter,xnorm,snorm,fnorm,reason,dummy,ierr !-------------------------------------------------------------------------------------------------- ! report - if (worldrank == 0_pInt) then - write(6,'(1/,a)') ' ... reporting .............................................................' - write(6,'(/,a,f12.2,a,es8.2,a,es9.2,a)') ' error curl = ', & - err_curl/curlTol,' (',err_curl,' -, tol =',curlTol,')' - write(6,' (a,f12.2,a,es8.2,a,es9.2,a)') ' error divergence = ', & - err_div/divTol, ' (',err_div, ' / m, tol =',divTol,')' - write(6,' (a,f12.2,a,es8.2,a,es9.2,a)') ' error BC = ', & - err_BC/BC_tol, ' (',err_BC, ' Pa, tol =',BC_tol,')' - write(6,'(/,a)') ' ===========================================================================' - flush(6) - endif + write(6,'(1/,a)') ' ... reporting .............................................................' + write(6,'(/,a,f12.2,a,es8.2,a,es9.2,a)') ' error curl = ', & + err_curl/curlTol,' (',err_curl,' -, tol =',curlTol,')' + write(6,' (a,f12.2,a,es8.2,a,es9.2,a)') ' error divergence = ', & + err_div/divTol, ' (',err_div, ' / m, tol =',divTol,')' + write(6,' (a,f12.2,a,es8.2,a,es9.2,a)') ' error BC = ', & + err_BC/BC_tol, ' (',err_BC, ' Pa, tol =',BC_tol,')' + write(6,'(/,a)') ' ===========================================================================' + flush(6) end subroutine AL_converged !-------------------------------------------------------------------------------------------------- !> @brief forwarding routine !-------------------------------------------------------------------------------------------------- -subroutine AL_forward(guess,timeinc,timeinc_old,loadCaseTime,F_BC,P_BC,rotation_BC) +subroutine AL_forward(guess,timeinc,timeinc_old,loadCaseTime,deformation_BC,stress_BC,rotation_BC) use math, only: & math_mul33x33, & math_mul3333xx33, & @@ -583,8 +575,8 @@ subroutine AL_forward(guess,timeinc,timeinc_old,loadCaseTime,F_BC,P_BC,rotation_ timeinc, & loadCaseTime !< remaining time of current load case type(tBoundaryCondition), intent(in) :: & - P_BC, & - F_BC + stress_BC, & + deformation_BC real(pReal), dimension(3,3), intent(in) :: rotation_BC logical, intent(in) :: & guess @@ -600,21 +592,19 @@ subroutine AL_forward(guess,timeinc,timeinc_old,loadCaseTime,F_BC,P_BC,rotation_ F => xx_psc(0:8,:,:,:) F_lambda => xx_psc(9:17,:,:,:) if (restartWrite) then - if (worldrank == 0_pInt) then - write(6,'(/,a)') ' writing converged results for restart' - flush(6) - endif + write(6,'(/,a)') ' writing converged results for restart' + flush(6) write(rankStr,'(a1,i0)')'_',worldrank - call IO_write_jobRealFile(777,'F'//trim(rankStr),size(F)) ! writing deformation gradient field to file + call IO_write_jobRealFile(777,'F'//trim(rankStr),size(F)) ! writing deformation gradient field to file write (777,rec=1) F close (777) - call IO_write_jobRealFile(777,'F_lastInc'//trim(rankStr),size(F_lastInc)) ! writing F_lastInc field to file + call IO_write_jobRealFile(777,'F_lastInc'//trim(rankStr),size(F_lastInc)) ! writing F_lastInc field to file write (777,rec=1) F_lastInc close (777) - call IO_write_jobRealFile(777,'F_lambda'//trim(rankStr),size(F_lambda)) ! writing deformation gradient field to file + call IO_write_jobRealFile(777,'F_lambda'//trim(rankStr),size(F_lambda)) ! writing deformation gradient field to file write (777,rec=1) F_lambda close (777) - call IO_write_jobRealFile(777,'F_lambda_lastInc'//trim(rankStr),size(F_lambda_lastInc)) ! writing F_lastInc field to file + call IO_write_jobRealFile(777,'F_lambda_lastInc'//trim(rankStr),size(F_lambda_lastInc)) ! writing F_lastInc field to file write (777,rec=1) F_lambda_lastInc close (777) if (worldrank == 0_pInt) then @@ -648,14 +638,14 @@ subroutine AL_forward(guess,timeinc,timeinc_old,loadCaseTime,F_BC,P_BC,rotation_ C_volAvgLastInc = C_volAvg !-------------------------------------------------------------------------------------------------- ! calculate rate for aim - if (F_BC%myType=='l') then ! calculate f_aimDot from given L and current F - f_aimDot = F_BC%maskFloat * math_mul33x33(F_BC%values, F_aim) - elseif(F_BC%myType=='fdot') then ! f_aimDot is prescribed - f_aimDot = F_BC%maskFloat * F_BC%values - elseif(F_BC%myType=='f') then ! aim at end of load case is prescribed - f_aimDot = F_BC%maskFloat * (F_BC%values -F_aim)/loadCaseTime + if (deformation_BC%myType=='l') then ! calculate f_aimDot from given L and current F + f_aimDot = deformation_BC%maskFloat * math_mul33x33(deformation_BC%values, F_aim) + elseif(deformation_BC%myType=='fdot') then ! f_aimDot is prescribed + f_aimDot = deformation_BC%maskFloat * deformation_BC%values + elseif(deformation_BC%myType=='f') then ! aim at end of load case is prescribed + f_aimDot = deformation_BC%maskFloat * (deformation_BC%values -F_aim)/loadCaseTime endif - if (guess) f_aimDot = f_aimDot + P_BC%maskFloat * (F_aim - F_aim_lastInc)/timeinc_old + if (guess) f_aimDot = f_aimDot + stress_BC%maskFloat * (F_aim - F_aim_lastInc)/timeinc_old F_aim_lastInc = F_aim !-------------------------------------------------------------------------------------------------- diff --git a/code/spectral_mech_Basic.f90 b/code/spectral_mech_Basic.f90 index 8bac5bd76..e20ed6761 100644 --- a/code/spectral_mech_Basic.f90 +++ b/code/spectral_mech_Basic.f90 @@ -122,11 +122,9 @@ subroutine basicPETSc_init SNESSetConvergenceTest, & SNESSetFromOptions - mainProcess: if (worldrank == 0_pInt) then - write(6,'(/,a)') ' <<<+- DAMASK_spectral_solverBasicPETSc init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- DAMASK_spectral_solverBasicPETSc init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess !-------------------------------------------------------------------------------------------------- ! allocate global fields @@ -164,7 +162,7 @@ subroutine basicPETSc_init call DMDAVecGetArrayF90(da,solution_vec,F,ierr); CHKERRQ(ierr) ! get the data out of PETSc to work with restart: if (restartInc > 1_pInt) then - if (iand(debug_level(debug_spectral),debug_spectralRestart)/= 0 .and. worldrank == 0_pInt) & + if (iand(debug_level(debug_spectral),debug_spectralRestart)/= 0) & write(6,'(/,a,'//IO_intOut(restartInc-1_pInt)//',a)') & 'reading values of increment ', restartInc - 1_pInt, ' from file' flush(6) @@ -219,7 +217,7 @@ end subroutine basicPETSc_init !> @brief solution for the Basic PETSC scheme with internal iterations !-------------------------------------------------------------------------------------------------- type(tSolutionState) function & - basicPETSc_solution(incInfoIn,timeinc,timeinc_old,P_BC,rotation_BC) + basicPETSc_solution(incInfoIn,timeinc,timeinc_old,stress_BC,rotation_BC) use IO, only: & IO_error use numerics, only: & @@ -240,7 +238,7 @@ type(tSolutionState) function & timeinc, & !< increment in time for current solution timeinc_old !< increment in time of last increment type(tBoundaryCondition), intent(in) :: & - P_BC + stress_BC character(len=*), intent(in) :: & incInfoIn real(pReal), dimension(3,3), intent(in) :: rotation_BC @@ -258,17 +256,17 @@ type(tSolutionState) function & !-------------------------------------------------------------------------------------------------- ! update stiffness (and gamma operator) - S = Utilities_maskedCompliance(rotation_BC,P_BC%maskLogical,C_volAvg) + S = Utilities_maskedCompliance(rotation_BC,stress_BC%maskLogical,C_volAvg) if (update_gamma) call Utilities_updateGamma(C_minmaxAvg,restartWrite) !-------------------------------------------------------------------------------------------------- ! set module wide availabe data - mask_stress = P_BC%maskFloat - params%P_BC = P_BC%values + mask_stress = stress_BC%maskFloat + params%stress_BC = stress_BC%values params%rotation_BC = rotation_BC - params%timeinc = timeinc - params%timeincOld = timeinc_old + params%timeinc = timeinc + params%timeincOld = timeinc_old !-------------------------------------------------------------------------------------------------- ! solve BVP @@ -296,8 +294,6 @@ subroutine BasicPETSC_formResidual(in,x_scal,f_scal,dummy,ierr) use numerics, only: & itmax, & itmin - use numerics, only: & - worldrank use mesh, only: & grid, & grid3 @@ -349,16 +345,14 @@ subroutine BasicPETSC_formResidual(in,x_scal,f_scal,dummy,ierr) !-------------------------------------------------------------------------------------------------- ! report begin of new iteration totalIter = totalIter + 1_pInt - if (worldrank == 0_pInt) then - write(6,'(1x,a,3(a,'//IO_intOut(itmax)//'))') trim(incInfo), & - ' @ Iteration ', itmin, '≤',totalIter, '≤', itmax - if (iand(debug_level(debug_spectral),debug_spectralRotation) /= 0) & - write(6,'(/,a,/,3(3(f12.7,1x)/))',advance='no') ' deformation gradient aim (lab) =', & - math_transpose33(math_rotate_backward33(F_aim,params%rotation_BC)) - write(6,'(/,a,/,3(3(f12.7,1x)/))',advance='no') ' deformation gradient aim =', & - math_transpose33(F_aim) - flush(6) - endif + write(6,'(1x,a,3(a,'//IO_intOut(itmax)//'))') trim(incInfo), & + ' @ Iteration ', itmin, '≤',totalIter, '≤', itmax + if (iand(debug_level(debug_spectral),debug_spectralRotation) /= 0) & + write(6,'(/,a,/,3(3(f12.7,1x)/))',advance='no') ' deformation gradient aim (lab) =', & + math_transpose33(math_rotate_backward33(F_aim,params%rotation_BC)) + write(6,'(/,a,/,3(3(f12.7,1x)/))',advance='no') ' deformation gradient aim =', & + math_transpose33(F_aim) + flush(6) endif newIteration !-------------------------------------------------------------------------------------------------- @@ -371,8 +365,8 @@ subroutine BasicPETSC_formResidual(in,x_scal,f_scal,dummy,ierr) !-------------------------------------------------------------------------------------------------- ! stress BC handling F_aim_lastIter = F_aim - F_aim = F_aim - math_mul3333xx33(S, ((P_av - params%P_BC))) ! S = 0.0 for no bc - err_stress = maxval(abs(mask_stress * (P_av - params%P_BC))) ! mask = 0.0 for no bc + F_aim = F_aim - math_mul3333xx33(S, ((P_av - params%stress_BC))) ! S = 0.0 for no bc + err_stress = maxval(abs(mask_stress * (P_av - params%stress_BC))) ! mask = 0.0 for no bc !-------------------------------------------------------------------------------------------------- ! updated deformation gradient using fix point algorithm of basic scheme @@ -400,8 +394,7 @@ subroutine BasicPETSc_converged(snes_local,PETScIter,xnorm,snorm,fnorm,reason,du err_div_tolRel, & err_div_tolAbs, & err_stress_tolRel, & - err_stress_tolAbs, & - worldrank + err_stress_tolAbs use FEsolving, only: & terminallyIll @@ -435,22 +428,20 @@ subroutine BasicPETSc_converged(snes_local,PETScIter,xnorm,snorm,fnorm,reason,du !-------------------------------------------------------------------------------------------------- ! report - if (worldrank == 0_pInt) then - write(6,'(1/,a)') ' ... reporting .............................................................' - write(6,'(1/,a,f12.2,a,es8.2,a,es9.2,a)') ' error divergence = ', & - err_div/divTol, ' (',err_div,' / m, tol =',divTol,')' - write(6,'(a,f12.2,a,es8.2,a,es9.2,a)') ' error stress BC = ', & - err_stress/stressTol, ' (',err_stress, ' Pa, tol =',stressTol,')' - write(6,'(/,a)') ' ===========================================================================' - flush(6) - endif + write(6,'(1/,a)') ' ... reporting .............................................................' + write(6,'(1/,a,f12.2,a,es8.2,a,es9.2,a)') ' error divergence = ', & + err_div/divTol, ' (',err_div,' / m, tol =',divTol,')' + write(6,'(a,f12.2,a,es8.2,a,es9.2,a)') ' error stress BC = ', & + err_stress/stressTol, ' (',err_stress, ' Pa, tol =',stressTol,')' + write(6,'(/,a)') ' ===========================================================================' +flush(6) end subroutine BasicPETSc_converged !-------------------------------------------------------------------------------------------------- !> @brief forwarding routine !-------------------------------------------------------------------------------------------------- -subroutine BasicPETSc_forward(guess,timeinc,timeinc_old,loadCaseTime,F_BC,P_BC,rotation_BC) +subroutine BasicPETSc_forward(guess,timeinc,timeinc_old,loadCaseTime,deformation_BC,stress_BC,rotation_BC) use math, only: & math_mul33x33 ,& math_rotate_backward33 @@ -476,8 +467,8 @@ subroutine BasicPETSc_forward(guess,timeinc,timeinc_old,loadCaseTime,F_BC,P_BC,r timeinc, & loadCaseTime !< remaining time of current load case type(tBoundaryCondition), intent(in) :: & - P_BC, & - F_BC + stress_BC, & + deformation_BC real(pReal), dimension(3,3), intent(in) :: rotation_BC logical, intent(in) :: & guess @@ -490,10 +481,8 @@ subroutine BasicPETSc_forward(guess,timeinc,timeinc_old,loadCaseTime,F_BC,P_BC,r !-------------------------------------------------------------------------------------------------- ! restart information for spectral solver if (restartWrite) then - if (worldrank == 0_pInt) then - write(6,'(/,a)') ' writing converged results for restart' - flush(6) - endif + write(6,'(/,a)') ' writing converged results for restart' + flush(6) write(rankStr,'(a1,i0)')'_',worldrank call IO_write_jobRealFile(777,'F'//trim(rankStr),size(F)) ! writing deformation gradient field to file write (777,rec=1) F @@ -525,14 +514,14 @@ subroutine BasicPETSc_forward(guess,timeinc,timeinc_old,loadCaseTime,F_BC,P_BC,r C_volAvgLastInc = C_volAvg !-------------------------------------------------------------------------------------------------- ! calculate rate for aim - if (F_BC%myType=='l') then ! calculate f_aimDot from given L and current F - f_aimDot = F_BC%maskFloat * math_mul33x33(F_BC%values, F_aim) - elseif(F_BC%myType=='fdot') then ! f_aimDot is prescribed - f_aimDot = F_BC%maskFloat * F_BC%values - elseif(F_BC%myType=='f') then ! aim at end of load case is prescribed - f_aimDot = F_BC%maskFloat * (F_BC%values -F_aim)/loadCaseTime + if (deformation_BC%myType=='l') then ! calculate f_aimDot from given L and current F + f_aimDot = deformation_BC%maskFloat * math_mul33x33(deformation_BC%values, F_aim) + elseif(deformation_BC%myType=='fdot') then ! f_aimDot is prescribed + f_aimDot = deformation_BC%maskFloat * deformation_BC%values + elseif(deformation_BC%myType=='f') then ! aim at end of load case is prescribed + f_aimDot = deformation_BC%maskFloat * (deformation_BC%values -F_aim)/loadCaseTime endif - if (guess) f_aimDot = f_aimDot + P_BC%maskFloat * (F_aim - F_aim_lastInc)/timeinc_old + if (guess) f_aimDot = f_aimDot + stress_BC%maskFloat * (F_aim - F_aim_lastInc)/timeinc_old F_aim_lastInc = F_aim !-------------------------------------------------------------------------------------------------- @@ -547,8 +536,8 @@ subroutine BasicPETSc_forward(guess,timeinc,timeinc_old,loadCaseTime,F_BC,P_BC,r !-------------------------------------------------------------------------------------------------- ! update local deformation gradient - F = reshape(Utilities_forwardField(timeinc,F_lastInc,Fdot, & ! ensure that it matches rotated F_aim - math_rotate_backward33(F_aim,rotation_BC)),[9,grid(1),grid(2),grid3]) + F = reshape(Utilities_forwardField(timeinc,F_lastInc,Fdot, & ! ensure that it matches rotated F_aim + math_rotate_backward33(F_aim,rotation_BC)),[9,grid(1),grid(2),grid3]) call DMDAVecRestoreArrayF90(da,solution_vec,F,ierr); CHKERRQ(ierr) end subroutine BasicPETSc_forward diff --git a/code/spectral_mech_Polarisation.f90 b/code/spectral_mech_Polarisation.f90 index 35048f37c..ed44793bb 100644 --- a/code/spectral_mech_Polarisation.f90 +++ b/code/spectral_mech_Polarisation.f90 @@ -132,11 +132,9 @@ subroutine Polarisation_init SNESSetConvergenceTest, & SNESSetFromOptions - mainProcess: if (worldrank == 0_pInt) then - write(6,'(/,a)') ' <<<+- DAMASK_spectral_solverPolarisation init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- DAMASK_spectral_solverPolarisation init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess !-------------------------------------------------------------------------------------------------- ! allocate global fields @@ -176,7 +174,7 @@ subroutine Polarisation_init F => xx_psc(0:8,:,:,:) F_tau => xx_psc(9:17,:,:,:) restart: if (restartInc > 1_pInt) then - if (iand(debug_level(debug_spectral),debug_spectralRestart)/= 0 .and. worldrank == 0_pInt) & + if (iand(debug_level(debug_spectral),debug_spectralRestart)/= 0) & write(6,'(/,a,'//IO_intOut(restartInc-1_pInt)//',a)') & 'reading values of increment ', restartInc - 1_pInt, ' from file' flush(6) @@ -244,7 +242,7 @@ end subroutine Polarisation_init !> @brief solution for the Polarisation scheme with internal iterations !-------------------------------------------------------------------------------------------------- type(tSolutionState) function & - Polarisation_solution(incInfoIn,timeinc,timeinc_old,P_BC,rotation_BC) + Polarisation_solution(incInfoIn,timeinc,timeinc_old,stress_BC,rotation_BC) use IO, only: & IO_error use numerics, only: & @@ -267,7 +265,7 @@ type(tSolutionState) function & timeinc, & !< increment in time for current solution timeinc_old !< increment in time of last increment type(tBoundaryCondition), intent(in) :: & - P_BC + stress_BC character(len=*), intent(in) :: & incInfoIn real(pReal), dimension(3,3), intent(in) :: rotation_BC @@ -285,7 +283,7 @@ type(tSolutionState) function & !-------------------------------------------------------------------------------------------------- ! update stiffness (and gamma operator) - S = Utilities_maskedCompliance(rotation_BC,P_BC%maskLogical,C_volAvg) + S = Utilities_maskedCompliance(rotation_BC,stress_BC%maskLogical,C_volAvg) if (update_gamma) then call Utilities_updateGamma(C_minMaxAvg,restartWrite) C_scale = C_minMaxAvg @@ -294,11 +292,11 @@ type(tSolutionState) function & !-------------------------------------------------------------------------------------------------- ! set module wide availabe data - mask_stress = P_BC%maskFloat - params%P_BC = P_BC%values + mask_stress = stress_BC%maskFloat + params%stress_BC = stress_BC%values params%rotation_BC = rotation_BC - params%timeinc = timeinc - params%timeincOld = timeinc_old + params%timeinc = timeinc + params%timeincOld = timeinc_old !-------------------------------------------------------------------------------------------------- ! solve BVP @@ -326,8 +324,7 @@ subroutine Polarisation_formResidual(in,x_scal,f_scal,dummy,ierr) itmax, & itmin, & polarAlpha, & - polarBeta, & - worldrank + polarBeta use mesh, only: & grid3, & grid @@ -406,16 +403,14 @@ subroutine Polarisation_formResidual(in,x_scal,f_scal,dummy,ierr) !-------------------------------------------------------------------------------------------------- ! report begin of new iteration totalIter = totalIter + 1_pInt - if (worldrank == 0_pInt) then - write(6,'(1x,a,3(a,'//IO_intOut(itmax)//'))') trim(incInfo), & - ' @ Iteration ', itmin, '≤',totalIter, '≤', itmax - if (iand(debug_level(debug_spectral),debug_spectralRotation) /= 0) & - write(6,'(/,a,/,3(3(f12.7,1x)/))',advance='no') ' deformation gradient aim (lab) =', & - math_transpose33(math_rotate_backward33(F_aim,params%rotation_BC)) - write(6,'(/,a,/,3(3(f12.7,1x)/))',advance='no') ' deformation gradient aim =', & - math_transpose33(F_aim) - flush(6) - endif + write(6,'(1x,a,3(a,'//IO_intOut(itmax)//'))') trim(incInfo), & + ' @ Iteration ', itmin, '≤',totalIter, '≤', itmax + if (iand(debug_level(debug_spectral),debug_spectralRotation) /= 0) & + write(6,'(/,a,/,3(3(f12.7,1x)/))',advance='no') ' deformation gradient aim (lab) =', & + math_transpose33(math_rotate_backward33(F_aim,params%rotation_BC)) + write(6,'(/,a,/,3(3(f12.7,1x)/))',advance='no') ' deformation gradient aim =', & + math_transpose33(F_aim) + flush(6) endif newIteration !-------------------------------------------------------------------------------------------------- @@ -489,8 +484,7 @@ subroutine Polarisation_converged(snes_local,PETScIter,xnorm,snorm,fnorm,reason, err_curl_tolRel, & err_curl_tolAbs, & err_stress_tolAbs, & - err_stress_tolRel, & - worldrank + err_stress_tolRel use math, only: & math_mul3333xx33 use FEsolving, only: & @@ -513,9 +507,9 @@ subroutine Polarisation_converged(snes_local,PETScIter,xnorm,snorm,fnorm,reason, !-------------------------------------------------------------------------------------------------- ! stress BC handling - F_aim = F_aim - math_mul3333xx33(S, ((P_av - params%P_BC))) ! S = 0.0 for no bc + F_aim = F_aim - math_mul3333xx33(S, ((P_av - params%stress_BC))) ! S = 0.0 for no bc err_BC = maxval(abs((-mask_stress+1.0_pReal)*math_mul3333xx33(C_scale,F_aim-F_av) + & - mask_stress *(P_av - params%P_BC))) ! mask = 0.0 for no bc + mask_stress *(P_av - params%stress_BC))) ! mask = 0.0 for no bc !-------------------------------------------------------------------------------------------------- ! error calculation @@ -537,31 +531,29 @@ subroutine Polarisation_converged(snes_local,PETScIter,xnorm,snorm,fnorm,reason, !-------------------------------------------------------------------------------------------------- ! report -if (worldrank == 0_pInt) then - write(6,'(1/,a)') ' ... reporting .............................................................' - write(6,'(/,a,f12.2,a,es8.2,a,es9.2,a)') ' error curl = ', & - err_curl/curlTol,' (',err_curl,' -, tol =',curlTol,')' - write(6,' (a,f12.2,a,es8.2,a,es9.2,a)') ' error divergence = ', & - err_div/divTol, ' (',err_div, ' / m, tol =',divTol,')' - write(6,' (a,f12.2,a,es8.2,a,es9.2,a)') ' error BC = ', & - err_BC/BC_tol, ' (',err_BC, ' Pa, tol =',BC_tol,')' - write(6,'(/,a)') ' ===========================================================================' - flush(6) -endif + write(6,'(1/,a)') ' ... reporting .............................................................' + write(6,'(/,a,f12.2,a,es8.2,a,es9.2,a)') ' error curl = ', & + err_curl/curlTol,' (',err_curl,' -, tol =',curlTol,')' + write(6,' (a,f12.2,a,es8.2,a,es9.2,a)') ' error divergence = ', & + err_div/divTol, ' (',err_div, ' / m, tol =',divTol,')' + write(6,' (a,f12.2,a,es8.2,a,es9.2,a)') ' error BC = ', & + err_BC/BC_tol, ' (',err_BC, ' Pa, tol =',BC_tol,')' + write(6,'(/,a)') ' ===========================================================================' + flush(6) end subroutine Polarisation_converged !-------------------------------------------------------------------------------------------------- !> @brief forwarding routine !-------------------------------------------------------------------------------------------------- -subroutine Polarisation_forward(guess,timeinc,timeinc_old,loadCaseTime,F_BC,P_BC,rotation_BC) +subroutine Polarisation_forward(guess,timeinc,timeinc_old,loadCaseTime,deformation_BC,stress_BC,rotation_BC) use math, only: & math_mul33x33, & math_mul3333xx33, & math_transpose33, & math_rotate_backward33 use numerics, only: & - worldrank + worldrank use mesh, only: & grid3, & grid @@ -582,8 +574,8 @@ subroutine Polarisation_forward(guess,timeinc,timeinc_old,loadCaseTime,F_BC,P_BC timeinc, & loadCaseTime !< remaining time of current load case type(tBoundaryCondition), intent(in) :: & - P_BC, & - F_BC + stress_BC, & + deformation_BC real(pReal), dimension(3,3), intent(in) :: rotation_BC logical, intent(in) :: & guess @@ -599,19 +591,19 @@ subroutine Polarisation_forward(guess,timeinc,timeinc_old,loadCaseTime,F_BC,P_BC F => xx_psc(0:8,:,:,:) F_tau => xx_psc(9:17,:,:,:) if (restartWrite) then - if (worldrank == 0_pInt) write(6,'(/,a)') ' writing converged results for restart' + write(6,'(/,a)') ' writing converged results for restart' flush(6) write(rankStr,'(a1,i0)')'_',worldrank - call IO_write_jobRealFile(777,'F'//trim(rankStr),size(F)) ! writing deformation gradient field to file + call IO_write_jobRealFile(777,'F'//trim(rankStr),size(F)) ! writing deformation gradient field to file write (777,rec=1) F close (777) - call IO_write_jobRealFile(777,'F_lastInc'//trim(rankStr),size(F_lastInc)) ! writing F_lastInc field to file + call IO_write_jobRealFile(777,'F_lastInc'//trim(rankStr),size(F_lastInc)) ! writing F_lastInc field to file write (777,rec=1) F_lastInc close (777) - call IO_write_jobRealFile(777,'F_tau'//trim(rankStr),size(F_tau)) ! writing deformation gradient field to file + call IO_write_jobRealFile(777,'F_tau'//trim(rankStr),size(F_tau)) ! writing deformation gradient field to file write (777,rec=1) F_tau close (777) - call IO_write_jobRealFile(777,'F_tau_lastInc'//trim(rankStr),size(F_tau_lastInc)) ! writing F_lastInc field to file + call IO_write_jobRealFile(777,'F_tau_lastInc'//trim(rankStr),size(F_tau_lastInc)) ! writing F_lastInc field to file write (777,rec=1) F_tau_lastInc close (777) if (worldrank == 0_pInt) then @@ -645,14 +637,14 @@ subroutine Polarisation_forward(guess,timeinc,timeinc_old,loadCaseTime,F_BC,P_BC C_volAvgLastInc = C_volAvg !-------------------------------------------------------------------------------------------------- ! calculate rate for aim - if (F_BC%myType=='l') then ! calculate f_aimDot from given L and current F - f_aimDot = F_BC%maskFloat * math_mul33x33(F_BC%values, F_aim) - elseif(F_BC%myType=='fdot') then ! f_aimDot is prescribed - f_aimDot = F_BC%maskFloat * F_BC%values - elseif(F_BC%myType=='f') then ! aim at end of load case is prescribed - f_aimDot = F_BC%maskFloat * (F_BC%values -F_aim)/loadCaseTime + if (deformation_BC%myType=='l') then ! calculate f_aimDot from given L and current F + f_aimDot = deformation_BC%maskFloat * math_mul33x33(deformation_BC%values, F_aim) + elseif(deformation_BC%myType=='fdot') then ! f_aimDot is prescribed + f_aimDot = deformation_BC%maskFloat * deformation_BC%values + elseif(deformation_BC%myType=='f') then ! aim at end of load case is prescribed + f_aimDot = deformation_BC%maskFloat * (deformation_BC%values -F_aim)/loadCaseTime endif - if (guess) f_aimDot = f_aimDot + P_BC%maskFloat * (F_aim - F_aim_lastInc)/timeinc_old + if (guess) f_aimDot = f_aimDot + stress_BC%maskFloat * (F_aim - F_aim_lastInc)/timeinc_old F_aim_lastInc = F_aim !-------------------------------------------------------------------------------------------------- diff --git a/code/spectral_utilities.f90 b/code/spectral_utilities.f90 index e42f1ef5d..34eb0eab0 100644 --- a/code/spectral_utilities.f90 +++ b/code/spectral_utilities.f90 @@ -85,7 +85,7 @@ module spectral_utilities type, public :: tLoadCase real(pReal), dimension (3,3) :: rotation = math_I3 !< rotation of BC - type(tBoundaryCondition) :: P, & !< stress BC + type(tBoundaryCondition) :: stress, & !< stress BC deformation !< deformation BC (Fdot or L) real(pReal) :: time = 0.0_pReal !< length of increment integer(pInt) :: incs = 0_pInt, & !< number of increments @@ -97,7 +97,7 @@ module spectral_utilities end type tLoadCase type, public :: tSolutionParams !< @todo use here the type definition for a full loadcase including mask - real(pReal), dimension(3,3) :: P_BC, rotation_BC + real(pReal), dimension(3,3) :: stress_BC, rotation_BC real(pReal) :: timeinc real(pReal) :: timeincOld real(pReal) :: density diff --git a/code/thermal_adiabatic.f90 b/code/thermal_adiabatic.f90 index f4f01f3c3..a0626af62 100644 --- a/code/thermal_adiabatic.f90 +++ b/code/thermal_adiabatic.f90 @@ -74,8 +74,6 @@ subroutine thermal_adiabatic_init(fileUnit) temperature, & temperatureRate, & material_partHomogenization - use numerics,only: & - worldrank implicit none integer(pInt), intent(in) :: fileUnit @@ -88,11 +86,9 @@ subroutine thermal_adiabatic_init(fileUnit) tag = '', & line = '' - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- thermal_'//THERMAL_ADIABATIC_label//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- thermal_'//THERMAL_ADIABATIC_label//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess maxNinstance = int(count(thermal_type == THERMAL_adiabatic_ID),pInt) if (maxNinstance == 0_pInt) return diff --git a/code/thermal_conduction.f90 b/code/thermal_conduction.f90 index 38e642be4..973ae2d03 100644 --- a/code/thermal_conduction.f90 +++ b/code/thermal_conduction.f90 @@ -75,8 +75,6 @@ subroutine thermal_conduction_init(fileUnit) temperature, & temperatureRate, & material_partHomogenization - use numerics,only: & - worldrank implicit none integer(pInt), intent(in) :: fileUnit @@ -89,11 +87,9 @@ subroutine thermal_conduction_init(fileUnit) tag = '', & line = '' - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- thermal_'//THERMAL_CONDUCTION_label//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- thermal_'//THERMAL_CONDUCTION_label//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess maxNinstance = int(count(thermal_type == THERMAL_conduction_ID),pInt) if (maxNinstance == 0_pInt) return diff --git a/code/thermal_isothermal.f90 b/code/thermal_isothermal.f90 index a3ac8f685..30ca7562a 100644 --- a/code/thermal_isothermal.f90 +++ b/code/thermal_isothermal.f90 @@ -23,8 +23,6 @@ subroutine thermal_isothermal_init() use IO, only: & IO_timeStamp use material - use numerics, only: & - worldrank implicit none integer(pInt) :: & @@ -32,13 +30,11 @@ subroutine thermal_isothermal_init() NofMyHomog, & sizeState - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- thermal_'//THERMAL_isothermal_label//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- thermal_'//THERMAL_isothermal_label//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess - initializeInstances: do homog = 1_pInt, material_Nhomogenization + initializeInstances: do homog = 1_pInt, material_Nhomogenization myhomog: if (thermal_type(homog) == THERMAL_isothermal_ID) then NofMyHomog = count(material_homog == homog) diff --git a/code/vacancyflux_cahnhilliard.f90 b/code/vacancyflux_cahnhilliard.f90 index 5abc923dc..f73f66631 100644 --- a/code/vacancyflux_cahnhilliard.f90 +++ b/code/vacancyflux_cahnhilliard.f90 @@ -90,8 +90,6 @@ subroutine vacancyflux_cahnhilliard_init(fileUnit) vacancyflux_initialCv, & material_partHomogenization, & material_partPhase - use numerics,only: & - worldrank implicit none integer(pInt), intent(in) :: fileUnit @@ -104,11 +102,9 @@ subroutine vacancyflux_cahnhilliard_init(fileUnit) tag = '', & line = '' - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- vacancyflux_'//VACANCYFLUX_cahnhilliard_label//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- vacancyflux_'//VACANCYFLUX_cahnhilliard_label//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess maxNinstance = int(count(vacancyflux_type == VACANCYFLUX_cahnhilliard_ID),pInt) if (maxNinstance == 0_pInt) return diff --git a/code/vacancyflux_isochempot.f90 b/code/vacancyflux_isochempot.f90 index b5b060a18..642d5a2e0 100644 --- a/code/vacancyflux_isochempot.f90 +++ b/code/vacancyflux_isochempot.f90 @@ -72,8 +72,6 @@ subroutine vacancyflux_isochempot_init(fileUnit) vacancyConcRate, & vacancyflux_initialCv, & material_partHomogenization - use numerics,only: & - worldrank implicit none integer(pInt), intent(in) :: fileUnit @@ -86,11 +84,9 @@ subroutine vacancyflux_isochempot_init(fileUnit) tag = '', & line = '' - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- vacancyflux_'//VACANCYFLUX_isochempot_label//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- vacancyflux_'//VACANCYFLUX_isochempot_label//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess maxNinstance = int(count(vacancyflux_type == VACANCYFLUX_isochempot_ID),pInt) if (maxNinstance == 0_pInt) return diff --git a/code/vacancyflux_isoconc.f90 b/code/vacancyflux_isoconc.f90 index c32cb648d..e4c20b246 100644 --- a/code/vacancyflux_isoconc.f90 +++ b/code/vacancyflux_isoconc.f90 @@ -23,21 +23,17 @@ subroutine vacancyflux_isoconc_init() use IO, only: & IO_timeStamp use material - use numerics, only: & - worldrank implicit none integer(pInt) :: & homog, & NofMyHomog - mainProcess: if (worldrank == 0) then - write(6,'(/,a)') ' <<<+- vacancyflux_'//VACANCYFLUX_isoconc_label//' init -+>>>' - write(6,'(a15,a)') ' Current time: ',IO_timeStamp() + write(6,'(/,a)') ' <<<+- vacancyflux_'//VACANCYFLUX_isoconc_label//' init -+>>>' + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" - endif mainProcess - initializeInstances: do homog = 1_pInt, material_Nhomogenization + initializeInstances: do homog = 1_pInt, material_Nhomogenization myhomog: if (vacancyflux_type(homog) == VACANCYFLUX_isoconc_ID) then NofMyHomog = count(material_homog == homog) From f32e1900f657bbbd4bed3b746adce46ea5c4faef Mon Sep 17 00:00:00 2001 From: Test User Date: Wed, 26 Oct 2016 16:35:16 +0200 Subject: [PATCH 332/412] updated version information after successful test of v2.0.1-259-g2b50494 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index a1ebc5acf..e7567dc3a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-257-g68006f0 +v2.0.1-259-g2b50494 From e43e37aae1a50f857acded15ab185befb90dcaa1 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 27 Oct 2016 23:06:17 +0200 Subject: [PATCH 333/412] new style option setting --- processing/pre/seeds_fromDistribution.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/processing/pre/seeds_fromDistribution.py b/processing/pre/seeds_fromDistribution.py index 18b2712e7..b37634c19 100755 --- a/processing/pre/seeds_fromDistribution.py +++ b/processing/pre/seeds_fromDistribution.py @@ -200,15 +200,15 @@ parser.add_option('--bins', dest='bins', type='int', metavar='int', parser.add_option('--maxseeds', dest='maxseeds', type='int', metavar='int', help='maximum number of seeds to move simulateneously [number of seeds]') -parser.set_defaults(seedFile = 'seeds') -parser.set_defaults(grid = (64,64,64)) -parser.set_defaults(threads = 2) -parser.set_defaults(randomSeed = None) -parser.set_defaults(target = 'geom') -parser.set_defaults(threshold = 20) -parser.set_defaults(bins = 15) -parser.set_defaults(scale = 1.0) -parser.set_defaults(maxseeds = 0) +parser.set_defaults(seedFile = 'seeds', + grid = (64,64,64), + threads = 2, + randomSeed = None, + target = 'geom', + threshold = 20, + bins = 15, + scale = 1.0, + maxseeds = 0) options = parser.parse_args()[0] From d49529d46e229583e7072ca8d9fc0ba06bfb09c6 Mon Sep 17 00:00:00 2001 From: Test User Date: Fri, 28 Oct 2016 04:35:28 +0200 Subject: [PATCH 334/412] updated version information after successful test of v2.0.1-261-ge43e37a --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index e7567dc3a..f1fec661a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-259-g2b50494 +v2.0.1-261-ge43e37a From b34a60d2f4ab55f1777c05a7deffffe5d8932237 Mon Sep 17 00:00:00 2001 From: Franz Roters Date: Fri, 28 Oct 2016 09:16:20 +0200 Subject: [PATCH 335/412] added support for Marc2016 --- code/DAMASK_marc.f90 | 16 +- .../Mentat_bin/{submit1 => submit1.original} | 0 .../2016/Marc_tools/comp_damask | 52 + .../2016/Marc_tools/comp_damask_h | 52 + .../2016/Marc_tools/comp_damask_hmp | 52 + .../2016/Marc_tools/comp_damask_l | 52 + .../2016/Marc_tools/comp_damask_lmp | 52 + .../2016/Marc_tools/comp_damask_mp | 52 + .../Marc_tools/comp_user.original} | 0 .../2016/Marc_tools/include_linux64 | 777 +++ .../2016/Marc_tools/include_linux64.original | 714 +++ .../2016/Marc_tools/run_damask | 4096 ++++++++++++++++ .../2016/Marc_tools/run_damask_h | 4096 ++++++++++++++++ .../2016/Marc_tools/run_damask_hmp | 4096 ++++++++++++++++ .../2016/Marc_tools/run_damask_l | 4096 ++++++++++++++++ .../2016/Marc_tools/run_damask_lmp | 4096 ++++++++++++++++ .../2016/Marc_tools/run_damask_mp | 4096 ++++++++++++++++ .../2016/Marc_tools/run_marc.original | 4193 +++++++++++++++++ .../2016/Mentat_bin/edit_window | 5 + .../2016/Mentat_bin/edit_window.original | 18 + .../2016/Mentat_bin/kill1.original | 8 + .../mods_MarcMentat/2016/Mentat_bin/kill4 | 8 + .../mods_MarcMentat/2016/Mentat_bin/kill5 | 8 + .../mods_MarcMentat/2016/Mentat_bin/kill6 | 8 + .../mods_MarcMentat/2016/Mentat_bin/kill7 | 8 + .../mods_MarcMentat/2016/Mentat_bin/kill8 | 8 + .../mods_MarcMentat/2016/Mentat_bin/kill9 | 8 + .../2016/Mentat_bin/submit1.original | 186 + .../mods_MarcMentat/2016/Mentat_bin/submit4 | 187 + .../mods_MarcMentat/2016/Mentat_bin/submit5 | 187 + .../mods_MarcMentat/2016/Mentat_bin/submit6 | 187 + .../mods_MarcMentat/2016/Mentat_bin/submit7 | 187 + .../mods_MarcMentat/2016/Mentat_bin/submit8 | 187 + .../mods_MarcMentat/2016/Mentat_bin/submit9 | 187 + .../2016/Mentat_menus/job_run.ms | 2659 +++++++++++ .../2016/Mentat_menus/job_run.ms.original | 2522 ++++++++++ installation/symlink_Code.py | 1 + lib/MarcInclude/concom2016 | 417 ++ lib/MarcInclude/creeps2016 | 66 + lib/damask/solver/marc.py | 1 + 40 files changed, 37633 insertions(+), 8 deletions(-) rename installation/mods_MarcMentat/2015/Mentat_bin/{submit1 => submit1.original} (100%) create mode 100644 installation/mods_MarcMentat/2016/Marc_tools/comp_damask create mode 100644 installation/mods_MarcMentat/2016/Marc_tools/comp_damask_h create mode 100644 installation/mods_MarcMentat/2016/Marc_tools/comp_damask_hmp create mode 100644 installation/mods_MarcMentat/2016/Marc_tools/comp_damask_l create mode 100644 installation/mods_MarcMentat/2016/Marc_tools/comp_damask_lmp create mode 100644 installation/mods_MarcMentat/2016/Marc_tools/comp_damask_mp rename installation/mods_MarcMentat/{2015/Marc_tools/comp_user => 2016/Marc_tools/comp_user.original} (100%) create mode 100644 installation/mods_MarcMentat/2016/Marc_tools/include_linux64 create mode 100644 installation/mods_MarcMentat/2016/Marc_tools/include_linux64.original create mode 100644 installation/mods_MarcMentat/2016/Marc_tools/run_damask create mode 100644 installation/mods_MarcMentat/2016/Marc_tools/run_damask_h create mode 100644 installation/mods_MarcMentat/2016/Marc_tools/run_damask_hmp create mode 100644 installation/mods_MarcMentat/2016/Marc_tools/run_damask_l create mode 100644 installation/mods_MarcMentat/2016/Marc_tools/run_damask_lmp create mode 100644 installation/mods_MarcMentat/2016/Marc_tools/run_damask_mp create mode 100644 installation/mods_MarcMentat/2016/Marc_tools/run_marc.original create mode 100644 installation/mods_MarcMentat/2016/Mentat_bin/edit_window create mode 100644 installation/mods_MarcMentat/2016/Mentat_bin/edit_window.original create mode 100644 installation/mods_MarcMentat/2016/Mentat_bin/kill1.original create mode 100644 installation/mods_MarcMentat/2016/Mentat_bin/kill4 create mode 100644 installation/mods_MarcMentat/2016/Mentat_bin/kill5 create mode 100644 installation/mods_MarcMentat/2016/Mentat_bin/kill6 create mode 100644 installation/mods_MarcMentat/2016/Mentat_bin/kill7 create mode 100644 installation/mods_MarcMentat/2016/Mentat_bin/kill8 create mode 100644 installation/mods_MarcMentat/2016/Mentat_bin/kill9 create mode 100644 installation/mods_MarcMentat/2016/Mentat_bin/submit1.original create mode 100644 installation/mods_MarcMentat/2016/Mentat_bin/submit4 create mode 100644 installation/mods_MarcMentat/2016/Mentat_bin/submit5 create mode 100644 installation/mods_MarcMentat/2016/Mentat_bin/submit6 create mode 100644 installation/mods_MarcMentat/2016/Mentat_bin/submit7 create mode 100644 installation/mods_MarcMentat/2016/Mentat_bin/submit8 create mode 100644 installation/mods_MarcMentat/2016/Mentat_bin/submit9 create mode 100644 installation/mods_MarcMentat/2016/Mentat_menus/job_run.ms create mode 100644 installation/mods_MarcMentat/2016/Mentat_menus/job_run.ms.original create mode 100644 lib/MarcInclude/concom2016 create mode 100644 lib/MarcInclude/creeps2016 diff --git a/code/DAMASK_marc.f90 b/code/DAMASK_marc.f90 index a4542f96a..50bc82f76 100644 --- a/code/DAMASK_marc.f90 +++ b/code/DAMASK_marc.f90 @@ -244,13 +244,13 @@ subroutine hypela2(d,g,e,de,s,t,dt,ngens,m,nn,kcus,matus,ndi,nshear,disp, & if (iand(debug_level(debug_MARC),debug_LEVELBASIC) /= 0_pInt) then write(6,'(a,/,i8,i8,i2)') ' MSC.MARC information on shape of element(2), IP:', m, nn - write(6,'(a,2(1i))'), ' Jacobian: ', ngens,ngens - write(6,'(a,1i)'), ' Direct stress: ', ndi - write(6,'(a,1i)'), ' Shear stress: ', nshear - write(6,'(a,1i)'), ' DoF: ', ndeg - write(6,'(a,1i)'), ' Coordinates: ', ncrd - write(6,'(a,1i)'), ' Nodes: ', nnode - write(6,'(a,1i)'), ' Deformation gradient: ', itel + write(6,'(a,2(i1))') ' Jacobian: ', ngens,ngens + write(6,'(a,i1)') ' Direct stress: ', ndi + write(6,'(a,i1)') ' Shear stress: ', nshear + write(6,'(a,i2)') ' DoF: ', ndeg + write(6,'(a,i2)') ' Coordinates: ', ncrd + write(6,'(a,i12)') ' Nodes: ', nnode + write(6,'(a,i1)') ' Deformation gradient: ', itel write(6,'(/,a,/,3(3(f12.7,1x)/))',advance='no') ' Deformation gradient at t=n:', & math_transpose33(ffn) write(6,'(/,a,/,3(3(f12.7,1x)/))',advance='no') ' Deformation gradient at t=n+1:', & @@ -421,4 +421,4 @@ subroutine plotv(v,s,sp,etot,eplas,ecreep,t,m,nn,layer,ndi,nshear,jpltcd) if (jpltcd > materialpoint_sizeResults) call IO_error(700_pInt,jpltcd) ! complain about out of bounds error v = materialpoint_results(jpltcd,nn,mesh_FEasCP('elem', m)) -end subroutine plotv \ No newline at end of file +end subroutine plotv diff --git a/installation/mods_MarcMentat/2015/Mentat_bin/submit1 b/installation/mods_MarcMentat/2015/Mentat_bin/submit1.original similarity index 100% rename from installation/mods_MarcMentat/2015/Mentat_bin/submit1 rename to installation/mods_MarcMentat/2015/Mentat_bin/submit1.original diff --git a/installation/mods_MarcMentat/2016/Marc_tools/comp_damask b/installation/mods_MarcMentat/2016/Marc_tools/comp_damask new file mode 100644 index 000000000..2d144b8a4 --- /dev/null +++ b/installation/mods_MarcMentat/2016/Marc_tools/comp_damask @@ -0,0 +1,52 @@ +#!/bin/ksh +# 1st arg: $DIR +# 2nd arg: $DIRJOB +# 3rd arg: $user +# 4th arg: $program +DIR=$1 +user=$3 +program=$4 +usernoext=$user +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + +# add BLAS options for linking + BLAS="%BLAS%" + +. $DIR/tools/include +DIRJOB=$2 +cd $DIRJOB +echo "Compiling and linking user subroutine $user on host `hostname`" +echo "program: $program" + $DFORTRAN $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + userobj=$usernoext.o + + + $LOAD ${program} $DIR/lib/main.o\ + $DIR/lib/blkdta.o $DIR/lib/comm?.o \ + ${userobj-} \ + $DIR/lib/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ../lib/mdsrc.a \ + ../lib/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $BLAS \ + $SYSLIBS || \ + { + echo "$0: link failed for $usernoext.o on host `hostname`" + exit 1 + } + /bin/rm $userobj + /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2016/Marc_tools/comp_damask_h b/installation/mods_MarcMentat/2016/Marc_tools/comp_damask_h new file mode 100644 index 000000000..01464f095 --- /dev/null +++ b/installation/mods_MarcMentat/2016/Marc_tools/comp_damask_h @@ -0,0 +1,52 @@ +#!/bin/ksh +# 1st arg: $DIR +# 2nd arg: $DIRJOB +# 3rd arg: $user +# 4th arg: $program +DIR=$1 +user=$3 +program=$4 +usernoext=$user +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + +# add BLAS options for linking + BLAS="%BLAS%" + +. $DIR/tools/include +DIRJOB=$2 +cd $DIRJOB +echo "Compiling and linking user subroutine $user on host `hostname`" +echo "program: $program" + $DFORTHIGH $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + userobj=$usernoext.o + + + $LOAD ${program} $DIR/lib/main.o\ + $DIR/lib/blkdta.o $DIR/lib/comm?.o \ + ${userobj-} \ + $DIR/lib/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ../lib/mdsrc.a \ + ../lib/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $BLAS \ + $SYSLIBS || \ + { + echo "$0: link failed for $usernoext.o on host `hostname`" + exit 1 + } + /bin/rm $userobj + /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2016/Marc_tools/comp_damask_hmp b/installation/mods_MarcMentat/2016/Marc_tools/comp_damask_hmp new file mode 100644 index 000000000..36ced6543 --- /dev/null +++ b/installation/mods_MarcMentat/2016/Marc_tools/comp_damask_hmp @@ -0,0 +1,52 @@ +#!/bin/ksh +# 1st arg: $DIR +# 2nd arg: $DIRJOB +# 3rd arg: $user +# 4th arg: $program +DIR=$1 +user=$3 +program=$4 +usernoext=$user +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + +# add BLAS options for linking + BLAS="%BLAS%" + +. $DIR/tools/include +DIRJOB=$2 +cd $DIRJOB +echo "Compiling and linking user subroutine $user on host `hostname`" +echo "program: $program" + $DFORTHIGHMP $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + userobj=$usernoext.o + + + $LOAD ${program} $DIR/lib/main.o\ + $DIR/lib/blkdta.o $DIR/lib/comm?.o \ + ${userobj-} \ + $DIR/lib/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ../lib/mdsrc.a \ + ../lib/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $BLAS \ + $SYSLIBS || \ + { + echo "$0: link failed for $usernoext.o on host `hostname`" + exit 1 + } + /bin/rm $userobj + /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2016/Marc_tools/comp_damask_l b/installation/mods_MarcMentat/2016/Marc_tools/comp_damask_l new file mode 100644 index 000000000..31b5cd175 --- /dev/null +++ b/installation/mods_MarcMentat/2016/Marc_tools/comp_damask_l @@ -0,0 +1,52 @@ +#!/bin/ksh +# 1st arg: $DIR +# 2nd arg: $DIRJOB +# 3rd arg: $user +# 4th arg: $program +DIR=$1 +user=$3 +program=$4 +usernoext=$user +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + +# add BLAS options for linking + BLAS="%BLAS%" + +. $DIR/tools/include +DIRJOB=$2 +cd $DIRJOB +echo "Compiling and linking user subroutine $user on host `hostname`" +echo "program: $program" + $DFORTLOW $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + userobj=$usernoext.o + + + $LOAD ${program} $DIR/lib/main.o\ + $DIR/lib/blkdta.o $DIR/lib/comm?.o \ + ${userobj-} \ + $DIR/lib/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ../lib/mdsrc.a \ + ../lib/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $BLAS \ + $SYSLIBS || \ + { + echo "$0: link failed for $usernoext.o on host `hostname`" + exit 1 + } + /bin/rm $userobj + /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2016/Marc_tools/comp_damask_lmp b/installation/mods_MarcMentat/2016/Marc_tools/comp_damask_lmp new file mode 100644 index 000000000..8a0c1255d --- /dev/null +++ b/installation/mods_MarcMentat/2016/Marc_tools/comp_damask_lmp @@ -0,0 +1,52 @@ +#!/bin/ksh +# 1st arg: $DIR +# 2nd arg: $DIRJOB +# 3rd arg: $user +# 4th arg: $program +DIR=$1 +user=$3 +program=$4 +usernoext=$user +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + +# add BLAS options for linking + BLAS="%BLAS%" + +. $DIR/tools/include +DIRJOB=$2 +cd $DIRJOB +echo "Compiling and linking user subroutine $user on host `hostname`" +echo "program: $program" + $DFORTRANLOWMP $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + userobj=$usernoext.o + + + $LOAD ${program} $DIR/lib/main.o\ + $DIR/lib/blkdta.o $DIR/lib/comm?.o \ + ${userobj-} \ + $DIR/lib/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ../lib/mdsrc.a \ + ../lib/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $BLAS \ + $SYSLIBS || \ + { + echo "$0: link failed for $usernoext.o on host `hostname`" + exit 1 + } + /bin/rm $userobj + /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2016/Marc_tools/comp_damask_mp b/installation/mods_MarcMentat/2016/Marc_tools/comp_damask_mp new file mode 100644 index 000000000..986d9ae04 --- /dev/null +++ b/installation/mods_MarcMentat/2016/Marc_tools/comp_damask_mp @@ -0,0 +1,52 @@ +#!/bin/ksh +# 1st arg: $DIR +# 2nd arg: $DIRJOB +# 3rd arg: $user +# 4th arg: $program +DIR=$1 +user=$3 +program=$4 +usernoext=$user +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` +usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + +# add BLAS options for linking + BLAS="%BLAS%" + +. $DIR/tools/include +DIRJOB=$2 +cd $DIRJOB +echo "Compiling and linking user subroutine $user on host `hostname`" +echo "program: $program" + $DFORTRANMP $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + userobj=$usernoext.o + + + $LOAD ${program} $DIR/lib/main.o\ + $DIR/lib/blkdta.o $DIR/lib/comm?.o \ + ${userobj-} \ + $DIR/lib/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ../lib/mdsrc.a \ + ../lib/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $BLAS \ + $SYSLIBS || \ + { + echo "$0: link failed for $usernoext.o on host `hostname`" + exit 1 + } + /bin/rm $userobj + /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2015/Marc_tools/comp_user b/installation/mods_MarcMentat/2016/Marc_tools/comp_user.original similarity index 100% rename from installation/mods_MarcMentat/2015/Marc_tools/comp_user rename to installation/mods_MarcMentat/2016/Marc_tools/comp_user.original diff --git a/installation/mods_MarcMentat/2016/Marc_tools/include_linux64 b/installation/mods_MarcMentat/2016/Marc_tools/include_linux64 new file mode 100644 index 000000000..c939bbd9d --- /dev/null +++ b/installation/mods_MarcMentat/2016/Marc_tools/include_linux64 @@ -0,0 +1,777 @@ +# +# General definitions for the Marc 2016 version +# +# EM64T +# +# Linux RedHat 6.3 / SuSE 11 +# +# 64 bit MPI version +# +# Intel(R) Fortran Intel(R) 64 Compiler XE for applications +# running on Intel(R) 64, Version 15.0.0.090 Build 20140723 +# +# Intel(R) C Intel(R) 64 Compiler XE for applications +# running on Intel(R) 64, Version 15.0.0.090 Build 20140723 +# +# To check the O/S level, type: +# uname -a +# +# Distributed parallel MPI libraries: +# 1) HP MPI 2.3 +# To check the mpi version, type: +# mpirun -version +# 2) Intel MPI 5.1.3 +# To check the mpi version, type: +# mpiexec.hydra -version +# +# To check the Compiler level, type using the compiler +# installation path: +# ifort -V +# icc -V +# +# REMARKS : This file contains the definitions of variables used during +# compilation loading and use of the MARC programmes . The +# current machine type is identified by means of the variable +# MACHINE , defined below. +# +# +# MPI_ROOT: root directory in which mpi shared libraries, etc. are located +# DIRJOB : directory in which spawned jobs should look for Marc input +# MPI_ARCH: system architecture +# MPI_EPATH: path where executable resides +# +REVISION="VERSION, BUILD" +HOSTNAME=`hostname` + +# find available memory in Mbyte on the machine +# can be set explicitly +MEMLIMIT=`free -m | awk '/Mem:/ {print $2}'` + +# set _OEM_NASTRAN to 1 for MD Nastran build +# override _OEM_NASTRAN setting with MARC_MD_NASTRAN environment variable +_OEM_NASTRAN="${MARC_MD_NASTRAN:-0}" + +# uncomment the following line for an autoforge build +#AUTOFORGE=1 +AUTOFORGE=0 +export AUTOFORGE + +# integer size +if test "$MARC_INTEGER_SIZE" = "" ; then + INTEGER_PATH= +else + INTEGER_PATH=/$MARC_INTEGER_SIZE +fi + +FCOMP=ifort +INTELPATH="/opt/intel/composer_xe_2015.0.090" + +# find the root directory of the compiler installation: +# - if ifort is found in $PATH, then the root directory is derived +# from the path to ifort +# - if ifort is not found in $PATH, the root directory is assumed +# to be $INTELPATH and the directory in which ifort is found is +# added to $PATH +FCOMPPATH=`which "$FCOMP" 2>/dev/null` +if test -n "$FCOMPPATH"; then + # derive the root directory from $FCOMPPATH + FCOMPROOT="${FCOMPPATH%/bin/intel64/$FCOMP}" + if test "$FCOMPROOT" = "$FCOMPPATH"; then + FCOMPROOT="${FCOMPPATH%/bin/$FCOMP}" + fi + if test "$FCOMPROOT" = "$FCOMPPATH"; then + FCOMPROOT= + fi +elif test -d "$INTELPATH"; then + # check for compiler in $INTELPATH + if test -d "$INTELPATH/bin/intel64" -a \ + -x "$INTELPATH/bin/intel64/$FCOMP" ; then + FCOMPROOT="$INTELPATH" + PATH="$INTELPATH/bin/intel64:$PATH" + elif test -d "$INTELPATH/bin" -a \ + -x "$INTELPATH/bin/$FCOMP"; then + FCOMPROOT="$INTELPATH" + PATH="$INTELPATH/bin:$PATH" + else + FCOMPROOT= + fi +else + FCOMPROOT= +fi + +# settings for MKL +MARC_MKL="$FCOMPROOT/mkl/lib/intel64" + +# +# settings for Metis +# +METIS="-I$METIS_SOURCE/include" +METISLIBS="$MARC_LIB/metis.a " + +# +# settings for MPI +# +# RCP and RSH are used for parallel network runs +# replace with similar commands like rsh if needed +RCP=/usr/bin/scp +RSH=/usr/bin/ssh +# + + +MPI_DEFAULT=intelmpi +MPI_OTHER=hpmpi + +MPITYPE=$MPI_DEFAULT + +if test $AUTOFORGE +then + if test $AUTOFORGE = 1 + then + MPITYPE=none + fi +fi + + +# overrule MPITYPE setting with environmental variable MARC_MPITYPE +if test $MARC_MPITYPE +then + MPITYPE=$MARC_MPITYPE +fi + +# always set MPITYPE to none for MD Nastran +if test "$_OEM_NASTRAN" -ne 0 +then + MPITYPE=none +fi + +# Edit following lines to build with GPGPU version of BCS Solver for +# NVIDIA platforms +#BCSGPUSOLVER=NONE +BCSGPUSOLVER=BCSGPU + +SOLVERFLAGS= +if test "$BCSGPUSOLVER" = BCSGPU +then + SOLVERFLAGS="$SOLVERFLAGS -DBCSGPU -DCUDA" + BCS_DIR=bcsgpusolver + export PATH=$MARC_CUDA/bin:$MARC_CUDA/nvvm:$PATH + export LD_LIBRARY_PATH=$MARC_CUDA/lib64:$LD_LIBRARY_PATH +else + BCS_DIR=bcssolver +fi +# +# settings for MPI +# +DDM= +if test $MPITYPE != none +then + if test $MPITYPE = hpmpi + then + FCOMPMPI=mpif90 + export MPI_ROOT=$MARC_HPMPI + export MPI_REMSH=$RSH + export MPI_F77=$FCOMP + ARCHITECTURE=linux_amd64 + DDM="-I$MPI_ROOT/include/64 -DDDM -DHPMPI" + MPI_CLEAN= + export MPI_EPATH=$MARC_BIN + export LD_LIBRARY_PATH=$MPI_ROOT/lib/$ARCHITECTURE:$MARC_LIB:$MARC_LIB_SHARED:$LD_LIBRARY_PATH + export MPIHPSPECIAL="-e MPI_FLAGS=E,T,y1" +# Below line is moved in run_marc file +# export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" + export MPIHPSPECIAL="$MPIHPSPECIAL -e BINDIR=$MARC_BIN" + if test -n "$MSC_LICENSE_FILE" + then + export MPIHPSPECIAL="$MPIHPSPECIAL -e MSC_LICENSE_FILE=$MSC_LICENSE_FILE" + fi + if test -n "$LM_LICENSE_FILE" + then + export MPIHPSPECIAL="$MPIHPSPECIAL -e LM_LICENSE_FILE=$LM_LICENSE_FILE" + fi + export MPIHPSPECIAL="$MPIHPSPECIAL -e MPI_LIC_CHECKER=$MPI_ROOT/bin/licensing/amd64_s8/lichk.x" + RUN_JOB2="$MPI_ROOT/bin/mpirun ${MPIRUNOPTIONS} -prot -f " + RUN_JOB1="$MPI_ROOT/bin/mpirun ${MPIRUNOPTIONS} -prot -w $MPIHPSPECIAL -np " + RUN_JOB0= + fi + if test $MPITYPE = intelmpi + then + INTELMPI_VERSION=HYDRA + FCOMPMPI=mpiifort + MPI_ROOT=$MARC_INTELMPI + DDM="-I${MPI_ROOT}/include64 -DDDM" + PATH=$MPI_ROOT/bin64:$PATH + export PATH + LD_LIBRARY_PATH=$MPI_ROOT/lib64:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH + if test $INTELMPI_VERSION = HYDRA + then + RUN_JOB1="${MPI_ROOT}/bin64/mpiexec.hydra -genvall -n " + RUN_JOB2="${MPI_ROOT}/bin64/mpiexec.hydra -genvall" + else + RUN_JOB1="${MPI_ROOT}/bin64/mpiexec -n " + RUN_JOB2="${MPI_ROOT}/bin64/mpiexec -configfile " + fi + RUN_JOB0= + MPI_CLEAN= + MPI_EPATH=$MARC_BIN + MPIR_HOME=$MPI_ROOT + MPICH_F77=$FCOMP + MPICH_F77LINKER=$FCOMP + export MPI_ROOT MPI_EPATH MPIR_HOME MPICH_F77 MPICH_F77LINKER + I_MPI_PIN_DOMAIN=node + export I_MPI_PIN_DOMAIN + fi +else + MPI_ROOT=$MARC_DUMMYMPI + export MPI_ROOT=$MARC_DUMMYMPI + DDM="-I$MPI_ROOT/include" +fi + +# +# variables for the "maintain" script +# + +MACHINENAME=LINUX +MACHINE64BIT=yes +MACHINE=Linux_EM64T +DEV=/dev/tape +GETLOG="whoami" +CLEAR="clear" +MY_UNAME=`uname -a` + +# Edit following 2 lines to build with VKI Solver +#VKISOLVER=VKI +VKISOLVER=NONE + +# Edit following 2 lines to build with CASI Solver +CASISOLVER=CASI +if test "$MARC_CASISOLVER" = "NONE" ; then + CASISOLVER=NONE +fi +#CASISOLVER=NONE + +# Edit following 2 lines to build with MF2 Solver +MF2SOLVER=NONE +#MF2SOLVER=SERIAL +#MF2SOLVER=MF2PARALLEL + +# Edit following lines to build with Intel(c) Multithreaded solver (PARDISO) +#INTELSOLVER=NONE +INTELSOLVER=PARDISO + +# Edit following lines to build with MUMPS +if test "$MARC_INTEGER_SIZE" = "i4" ; then + #MUMPSSOLVER=NONE + MUMPSSOLVER=MUMPS +else + #MUMPSSOLVER=NONE + MUMPSSOLVER=MUMPS +fi + +# Edit following 2 lines to build MARC dynamic shared library +MARC_DLL=MARC_DLL +MARC_DLL=NONE + +# always set VKISOLVER, CASISOLVER, BCSGPUSOLVER, and MARC_DLL to NONE for MD Nastran +if test "$_OEM_NASTRAN" -ne 0 +then + VKISOLVER=NONE + CASISOLVER=NONE + MF2SOLVER=NONE + INTELSOLVER=NONE + MUMPSSOLVER=NONE + BCSGPUSOLVER=NONE + MARC_DLL=NONE +fi + +# +# define Fortran and C compile syntax +# +if test "$VKISOLVER" = VKI +then + SOLVERFLAGS="$SOLVERFLAGS -DVKI" +fi + +if test "$CASISOLVER" = CASI +then + SOLVERFLAGS="$SOLVERFLAGS -DCASI" +fi + +if test "$MF2SOLVER" = MF2PARALLEL +then + SOLVERFLAGS="$SOLVERFLAGS -DMF2PARALLEL" +fi +if test "$MF2SOLVER" = MF2SERIAL +then + SOLVERFLAGS="$SOLVERFLAGS -DMF2SERIAL" +fi + +if test "$INTELSOLVER" = PARDISO +then + SOLVERFLAGS="$SOLVERFLAGS -DPARDISO" +fi + +if test "$MUMPSSOLVER" = MUMPS +then + SOLVERFLAGS="$SOLVERFLAGS -DMUMPS" +fi + + +if test "$MARC_DLL" = MARC_DLL +then + SOLVERFLAGS="$SOLVERFLAGS -DMARC_DLL" +fi + +LINK_OPT= +DEBUG_OPT= +C_DEBUG_OPT= + +#Uncomment following line to build Marc in debuggable mode +MARCDEBUG= +#MARCDEBUG="ON" + +if test "$MARCDEBUG" = "ON" +then + LINK_OPT="-debug -traceback" + DEBUG_OPT="-debug -traceback" + C_DEBUG_OPT="-debug -traceback" +fi + + +MARCCHECK= +#MARCCHECK="ON" +if test "$MARCCHECK" = "ON" +then + DEBUG_OPT="$DEBUG_OPT -fpe0 -fp-stack-check -check all -ftrapuv " + C_DEBUG_OPT="$C_DEBUG_OPT -fp-stack-check -check-uninit -Wformat -ftrapuv " +fi + +MARCCODECOV= +#MARCCODECOV="ON" + +MARCCODEPROF= +#MARCCODEPROF="ON" + +if test "$MARC_INTEGER_SIZE" = "i4" ; then + I8FFLAGS="-real-size 64 -integer-size 32" + I8DEFINES="-DFLOAT=8 -DINT=4" + I8CDEFINES= + I8CASIDEFS= +else + I8FFLAGS="-i8 -real-size 64 -integer-size 64" + I8DEFINES="-DI64 -DFLOAT=8 -DINT=8" + I8CDEFINES="-U_DOUBLE -D_SINGLE" + I8CASIDEFS="-DCASI_64BIT_INT=1" +fi + +MTHREAD=OPENMP +if test "$MARC_OPENMP" = "NONE" ; then + MTHREAD=NONE +fi +#MTHREAD=NONE +if test "$_OEM_NASTRAN" -ne 0 +then +MTHREAD=NONE +fi + +OMP_COMPAT=NO +OMP_COMPAT=YES +if test "$MTHREAD" = "NONE" +then +OMP_COMPAT=NO +fi + +CDEFINES= +FDEFINES= + +if test "$_OEM_NASTRAN" -ne 0 +then + CDEFINES="$CDEFINES -D_OEM_NASTRAN" + FDEFINES="$FDEFINES -D_OEM_NASTRAN" +fi + +FDEFINES="$FDEFINES -D_IMPLICITNONE" + +if test "$_OEM_NASTRAN" -eq 0 +then + FDEFINES="$FDEFINES -DMKL -DOPENMP" +fi + +if test "$OMP_COMPAT" = "YES" +then + FDEFINES="$FDEFINES -DOMP_COMPAT" +fi + +# -D_MSCMARC +FDEFINES="$FDEFINES -D_MSCMARC $DEBUG_OPT $MARC_SIMUFACT" +CDEFINES="$CDEFINES -D_MSCMARC $C_DEBUG_OPT $I8CDEFINES" + +CINCL="-I$MARC_SOURCE/mdsrc -I$MARC_SOURCE/csource $METIS" +if test "$_OEM_NASTRAN" -ne 0 +then + CINCL="$CINCL -I../../include" +fi + +CC="icc -c -O1 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " +CCLOW="icc -c -O0 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " +CCHIGH="icc -c -O3 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " + +if test "$MARCDEBUG" = "ON" +then + CC="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " + CCLOW="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " + CCHIGH="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " +fi + +LOAD_CC="icc -O1 -DLinux -DLINUX -DLinux_intel" +CCT="$CC" +CCTLOW="$CCLOW" +CCTHIGH="$CCHIGH" + +CC_CASI="$CC -std=c99 $I8CASIDEFS" +CCLOW_CASI="$CCLOW -std=c99 $I8CASIDEFS" +CCHIGH_CASI="$CCHIGH -std=c99 $I8CASIDEFS" + +CCT_CASI="$CCT -std=c99 $I8CASIDEFS" +CCTLOW_CASI="$CCLOW -std=c99 $I8CASIDEFS" +CCTHIGH_CASI="$CCHIGH -std=c99 $I8CASIDEFS" + +#PROFILE="-Mprof=func" +#PROFILE="-Mprof=lines" +#PROFILE="-Mprof=func,mpi" +PROFILE= +if test "$MARCCODECOV" = "ON" +then +PROFILE="-prof-gen=srcpos" +fi +if test "$MARCCODEPROF" = "ON" +then +PROFILE=" $PROFILE -pg" +fi + +FORT_OPT="-c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr -mp1 -WB -fp-model source" +if test "$MTHREAD" = "OPENMP" +then + FORT_OPT=" $FORT_OPT -openmp" + if test "$OMP_COMPAT" = "YES" + then + FORT_OPT=" $FORT_OPT -openmp-threadprivate=compat" + fi +else +# FORT_OPT=" $FORT_OPT -auto " + FORT_OPT=" $FORT_OPT -save -zero" +fi + +FORTLOW="$FCOMP $FORT_OPT $PROFILE -O0 $I8FFLAGS -I$MARC_SOURCE/common \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" +FORTRAN="$FCOMP $FORT_OPT $PROFILE -O1 $I8FFLAGS -I$MARC_SOURCE/common \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" +FORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" +FORTNA="$FCOMP $FORT_OPT -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" + + # determine DAMASK version +HIT=0 +for arg in "$@" +do + if [ $HIT = 1 ] + then + DAMASKPATH=`dirname $arg` + break + elif [ ${arg:0:2} = -u -o ${arg:0:2} = -U ] + then + HIT=1 + fi +done +read DAMASKVERSION < $DAMASKPATH/../VERSION +DAMASKVERSION="'"$DAMASKVERSION"'" + +# DAMASK compiler calls: additional flags are in line 2 OpenMP flags in line 3 +DFORTLOW="$FCOMP $FORT_OPT $PROFILE -O0 $I8FFLAGS -I$MARC_SOURCE/common \ + -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2016 -DDAMASKVERSION=$DAMASKVERSION \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" +DFORTLOWMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB -O0 $I8FFLAGS -I$MARC_SOURCE/common \ + -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2016 -DDAMASKVERSION=$DAMASKVERSION \ + -openmp -openmp_report2 -openmp-threadprivate=compat\ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" +DFORTRAN="$FCOMP $FORT_OPT $PROFILE -O1 $I8FFLAGS -I$MARC_SOURCE/common \ + -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2016 -DDAMASKVERSION=$DAMASKVERSION \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" +DFORTRANMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB -O1 $I8FFLAGS -I$MARC_SOURCE/common \ + -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2016 -DDAMASKVERSION=$DAMASKVERSION \ + -openmp -openmp_report2 -openmp-threadprivate=compat\ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" +DFORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias -O2 $I8FFLAGS -I$MARC_SOURCE/common \ + -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2016 -DDAMASKVERSION=$DAMASKVERSION \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" +DFORTHIGHMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB -fno-alias -O2 $I8FFLAGS -I$MARC_SOURCE/common \ + -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2016 -DDAMASKVERSION=$DAMASKVERSION \ + -openmp -openmp_report2 -openmp-threadprivate=compat\ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" + +if test "$MARCDEBUG" = "ON" +then + FORTLOW="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" + FORTRAN="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" + FORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" + FORTNA="$FCOMP $FORT_OPT -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" + + # DAMASK compiler calls: additional flags are in line 2 OpenMP flags in line 3 + DFORTLOW="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \ + -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2016 -DDAMASKVERSION=$DAMASKVERSION \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" + DFORTLOWMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ + -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2016 -DDAMASKVERSION=$DAMASKVERSION \ + -openmp -openmp_report2 -openmp-threadprivate=compat\ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" + DFORTRAN="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \ + -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2016 -DDAMASKVERSION=$DAMASKVERSION \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" + DFORTRANMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ + -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2016 -DDAMASKVERSION=$DAMASKVERSION \ + -openmp -openmp_report2 -openmp-threadprivate=compat\ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" + DFORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ + -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2016 -DDAMASKVERSION=$DAMASKVERSION \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" + DFORTHIGHMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ + -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2016 -DDAMASKVERSION=$DAMASKVERSION \ + -openmp -openmp_report2 -openmp-threadprivate=compat\ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" + +fi + +FORTLOWT="$FORTLOW" +FORTRANT="$FORTRAN" +FORTHIGHT="$FORTHIGH" + +FORTRANMNF="$FCOMP -c $FDEFINES " +CCMNF="icc -c -O1 -DLinux -DLINUX -DLinux_intel -Dport2egcs -I$MARC_SOURCE/marctoadams/mnf/include -D_LARGEFILE64_SOURCE" + +FORTRANMUMPS="$FCOMP -fpp $FORT_OPT $PROFILE -fno-alias -O1 -fp-model precise $FDEFINES -D_IMPLICITNONE $I8FFLAGS $I8DEFINES $DDM -I$MARC_SOURCE/mumpssolver/include -Dintel_ -DALLOW_NON_INIT -Dmetis -nofor_main" +CCMUMPS="icc -c -DAdd_ -Dmetis -I$MARC_SOURCE/mumpssolver/include" + + +BCSCC="icc -c -O3 -DLOWERCASE_ -I${MARC_SOURCE}/${BCS_DIR}/bcslib_csrc $CDEFINES $CINCL" +NVCC="nvcc -c -O3 -arch sm_20 -DLOWERCASE_ -I${MARC_SOURCE}/${BCS_DIR}/bcslib_cuda/include -I${MARC_CUDA}/include -I$MARC_SOURCE/mdsrc $I8DEFINES -Xcompiler -fvisibility=hidden -Xcompiler -fPIC $I8DEFINES " +NVCCLIB="ar rvl" +NVCCLD=icc +BCSFORTLOW="$FORTLOW -I${MARC_SOURCE}/${BCS_DIR}/common" +BCSFORTRAN="$FORTRAN -I${MARC_SOURCE}/${BCS_DIR}/common" +BCSFORTHIGH="$FORTHIGH -I${MARC_SOURCE}/${BCS_DIR}/common" +BCSFORT90HIGH="$BCSFORTHIGH" +if test "$MARCDEBUG" = "ON" +then + BCSFORTRAN=$BCSFORTLOW + BCSFORTHIGH=$BCSFORTLOW + BCSFORT90HIGH=$BCSFORTLOW +fi + +if test $MPITYPE != none +then + if test $MPITYPE = hpmpi + then + LOAD="$MPI_ROOT/bin/$FCOMPMPI ${LOADOPTIONS} -L$MPI_ROOT/lib/$ARCHITECTURE $PROFILE $LINK_OPT -o " + LOADT="$MPI_ROOT/bin/$FCOMPMPI ${LOADOPTIONS} -L$MPI_ROOT/lib/$ARCHITECTURE $PROFILE $LINK_OPT -o " + fi +# Uncomment the following lines to turn on the tracer and commnet out the next 5 lines +# if test $MPITYPE = intelmpi +# then +# INCLUDEMPI="-I$MPI_ROOT/include64 -I$VT_ROOT/include" +# LOAD="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " +# LOADT="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " +# fi + if test $MPITYPE = intelmpi + then + LOAD="ifort $PROFILE $LINK_OPT -o " + LOADT="ifort $PROFILE $LINK_OPT -o " + fi +else + LOAD="$FCOMP $LINK_OPT -o " + LOADT="$FCOMP $LINK_OPT -o " +fi + +if test "$MARC_DLL" = MARC_DLL +then + FORTLOW="$FORTLOW -fpp -fPIC" + FORTRAN="$FORTRAN -fpp -fPIC" + FORTHIGH="$FORTHIGH -fpp -fPIC" + FORTRANMNF="$FORTRANMNF -fpp -fPIC" + CC="$CC -fPIC" + CCMNF="$CCMNF -fPIC" + CC_CASI="$CC_CASI -fPIC" + CCLOW_CASI="$CCLOW_CASI -fPIC" + CCHIGH_CASI="$CCHIGH_CASI -fPIC" + LINK_EXE_MARC="-L$MARC_LIB -lmarc -L$MARC_LIB_SHARED -lguide -lpthread" + LINK_MARC_DLL="-shared -fPIC" + LOAD_DLL=$LOAD + LOADT_DLL=$LOADT + EXT_DLL="so" +fi + + +XLIBS="-L/usr/X11/lib -lX11 " + +# +# define archive and ranlib syntax +# + +ARC="ar rvl" +ARD="ar dvl" +ARX="ar xl" +RAN="" + +# +# choose which libraries you want to use ( e.g. blas ) +# + +if test "$VKISOLVER" = VKI +then + VKISOLVERLIBS="$MARC_LIB/vkisolver.a" +else + VKISOLVERLIBS= +fi + +if test "$CASISOLVER" = CASI +then + CASISOLVERLIBS="$MARC_CASI/casilib.a" +else + CASISOLVERLIBS= +fi + +MF2SOLVERLIBS= +if test "$MF2SOLVER" = MF2PARALLEL +then + MF2SOLVERLIBS="$MARC_LIB/mf2parallel/libseq.a \ + $MARC_LIB/mf2parallel/libsym.a \ + $MARC_LIB/mf2parallel/libmet.a \ + $MARC_LIB/mf2parallel/libmf2.a \ + $MARC_LIB/mf2parallel/libgauss.a \ + $MARC_LIB/mf2parallel/libmf2.a \ + $MARC_LIB/mf2parallel/libgauss.a \ + $MARC_LIB/mf2parallel/libnum.a \ + $MARC_LIB/mf2parallel/libutl.a \ + $MARC_LIB/mf2parallel/libr8.a \ + $MARC_LIB/mf2parallel/libz.a " +fi + +if test "$MUMPSSOLVER" = MUMPS +then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" + if test $MPITYPE = none + then + MUMPSSOLVERLIBS2= + echo hello > /dev/null + fi + if test $MPITYPE = intelmpi + then + if test "$MARC_INTEGER_SIZE" = "i4" ; then + MUMPSSOLVERLIBS2=" $MARC_MKL/libmkl_blacs_intelmpi_lp64.a " + else + MUMPSSOLVERLIBS2=" $MARC_MKL/libmkl_blacs_intelmpi_ilp64.a " + fi + fi + if test $MPITYPE = hpmpi + then + if test "$MARC_INTEGER_SIZE" = "i4" ; then + MUMPSSOLVERLIBS2=" $MARC_MKL/libmkl_blacs_lp64.a" + else + MUMPSSOLVERLIBS2=" $MARC_MKL/libmkl_blacs_ilp64.a" + fi + fi +else + MUMPSSOLVERLIBS= + MUMPSSOLVERLIBS2= +fi + +if test "$BCSGPUSOLVER" = BCSGPU +then + BCSSOLVERLIBS="${MARC_LIB}/bcsgpulib.a " + MARCCUDALIBS1="-L${MARC_LIB}/cuda_dummy -lmarccuda " + MARCCUDALIBS2="-L${MARC_LIB}/cuda -lmarccuda " + MARCCUDALIBS=$MARCCUDALIBS1 + CUDALIBS="-L$MARC_CUDA/lib64 -lcudart -lcublas -L/usr/lib64 -lcuda " +else + BCSSOLVERLIBS="${MARC_LIB}/bcslib.a " +fi + +if test "$MARC_INTEGER_SIZE" = "i4" ; then + MKLLIB="$MARC_MKL/libmkl_scalapack_lp64.a $MARC_MKL/libmkl_blacs_lp64.a -Wl,--start-group $MARC_MKL/libmkl_intel_lp64.a $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_core.a -Wl,--end-group" +else + MKLLIB="$MARC_MKL/libmkl_scalapack_ilp64.a $MARC_MKL/libmkl_blacs_ilp64.a -Wl,--start-group $MARC_MKL/libmkl_intel_ilp64.a $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_core.a -Wl,--end-group" +fi + +SECLIBS="-L$MARC_LIB -llapi" + +SOLVERLIBS="${BCSSOLVERLIBS} ${VKISOLVERLIBS} ${CASISOLVERLIBS} ${MF2SOLVERLIBS} ${MUMPSSOLVERLIBS2} \ + $MKLLIB -L$MARC_MKL -liomp5 \ + $MARC_LIB/blas_src.a ${ACSI_LIB}/ACSI_MarcLib.a " + +SOLVERLIBS_DLL=${SOLVERLIBS} + +MRCLIBS="$MARC_LIB/clib.a ${CASISOLVERLIBS}" +MRCLIBSPAR="$MARC_LIB/clib.a" +STUBS="$MARC_LIB/stubs.a " +MNFLIBS="$MARC_LIB/libmnf.a" +MDUSER="$MARC_LIB/md_user.a" +if test "X$MARC_SIMUFACT" != "X" +then + SFLIB="-L$SFMATDIR -lMBA_Grain $SFMATDIR/sfclib.a " +else + SFLIB=" " +fi + +OPENMP="-openmp" + +SYSLIBS=" $OPENMP -lpthread " + +# Uncomment the following lines to turn on the trace and comment out the next 4 lines +# if test $MPITYPE = intelmpi +# then +# SYSLIBS="-L${VT_ROOT}/lib -lVT -ldwarf -lelf -lm -lpthread \ +# -L${MPI_ROOT}/lib64 -lmpi -lmpiif -lmpigi -lrt" +# fi +if test $MPITYPE = intelmpi +then + SYSLIBS="-L${MPI_ROOT}/lib64 -lmpi_mt -lmpifort -lrt $OPENMP -threads -lpthread " +fi + + +SYSLIBSPAR=" " + +MARC_DLL_CODES="runmarc.f" + + +BLAS_SRC="dzero.f icopy.f izero.f" +if test "$_OEM_NASTRAN" -ne 0 +then + if test "$MARC_INTEGER_SIZE" = "i4" ; then + BLAS_SRC="$BLAS_SRC dsctr.f zsctr.f dzasum.f daxpyi.f zaxpyi.f dgthr.f zgthr.f" + else + BLAS_SRC="ALL" + fi +fi + +LOW_OPT_CODES="are163.f contro.f ndext.f omarc.f omarca.f omarcb.f omarcc.f \ + omars.f fixbc.f triang.f bet049.f norst3.f eldata.f \ + elec*.f elct*.f fmeig.f oada00.f ogeig.f updtrbe2.f cycrota.f \ + cordef.f ogpk.f ogtan.f eldam.f formrbe3.f \ + inertie.f em_sso072.f cn_fol3d_qpatch6.f cosim_begin.f" +if test "$MARC_INTEGER_SIZE" = "i8" ; then + LOW_OPT_CODES="$LOW_OPT_CODES bbcseg.f" +fi +LOW_OPT_CODES_CASI="" + +HIGH_OPT_CODES="dpsmsa1.f dpsmsa2.f dpsmsa3.f dpsmsa4.f dpsmsa5.f dpsmsa6.f \ + dpsmsa7.f dpsmsa8.f dpsmsa9.f dpsmsa10.f dpsmsa11.f dpsmsa12.f \ + dpsmsa13.f dpsmsa14.f dpsmsa15.f dpsmsa16.f dpsmsah.f tpsmsah.f cn_qsort4_11.f " + + +HIGH_OPT_CODES_CASI="arithkernels.c blockedroutines.c blockedroutines_fd.c elemmatgenkernels.c longvecroutines.c sfmultutils.c solvewithbd.c" + +MAXNUM=1000000 diff --git a/installation/mods_MarcMentat/2016/Marc_tools/include_linux64.original b/installation/mods_MarcMentat/2016/Marc_tools/include_linux64.original new file mode 100644 index 000000000..4b3e54e90 --- /dev/null +++ b/installation/mods_MarcMentat/2016/Marc_tools/include_linux64.original @@ -0,0 +1,714 @@ +# +# General definitions for the Marc 2016 version +# +# EM64T +# +# Linux RedHat 6.3 / SuSE 11 +# +# 64 bit MPI version +# +# Intel(R) Fortran Intel(R) 64 Compiler XE for applications +# running on Intel(R) 64, Version 15.0.0.090 Build 20140723 +# +# Intel(R) C Intel(R) 64 Compiler XE for applications +# running on Intel(R) 64, Version 15.0.0.090 Build 20140723 +# +# To check the O/S level, type: +# uname -a +# +# Distributed parallel MPI libraries: +# 1) HP MPI 2.3 +# To check the mpi version, type: +# mpirun -version +# 2) Intel MPI 5.1.3 +# To check the mpi version, type: +# mpiexec.hydra -version +# +# To check the Compiler level, type using the compiler +# installation path: +# ifort -V +# icc -V +# +# REMARKS : This file contains the definitions of variables used during +# compilation loading and use of the MARC programmes . The +# current machine type is identified by means of the variable +# MACHINE , defined below. +# +# +# MPI_ROOT: root directory in which mpi shared libraries, etc. are located +# DIRJOB : directory in which spawned jobs should look for Marc input +# MPI_ARCH: system architecture +# MPI_EPATH: path where executable resides +# +REVISION="VERSION, BUILD" +HOSTNAME=`hostname` + +# find available memory in Mbyte on the machine +# can be set explicitly +MEMLIMIT=`free -m | awk '/Mem:/ {print $2}'` + +# set _OEM_NASTRAN to 1 for MD Nastran build +# override _OEM_NASTRAN setting with MARC_MD_NASTRAN environment variable +_OEM_NASTRAN="${MARC_MD_NASTRAN:-0}" + +# uncomment the following line for an autoforge build +#AUTOFORGE=1 +AUTOFORGE=0 +export AUTOFORGE + +# integer size +if test "$MARC_INTEGER_SIZE" = "" ; then + INTEGER_PATH= +else + INTEGER_PATH=/$MARC_INTEGER_SIZE +fi + +FCOMP=ifort +INTELPATH="/opt/intel/composer_xe_2015.0.090" + +# find the root directory of the compiler installation: +# - if ifort is found in $PATH, then the root directory is derived +# from the path to ifort +# - if ifort is not found in $PATH, the root directory is assumed +# to be $INTELPATH and the directory in which ifort is found is +# added to $PATH +FCOMPPATH=`which "$FCOMP" 2>/dev/null` +if test -n "$FCOMPPATH"; then + # derive the root directory from $FCOMPPATH + FCOMPROOT="${FCOMPPATH%/bin/intel64/$FCOMP}" + if test "$FCOMPROOT" = "$FCOMPPATH"; then + FCOMPROOT="${FCOMPPATH%/bin/$FCOMP}" + fi + if test "$FCOMPROOT" = "$FCOMPPATH"; then + FCOMPROOT= + fi +elif test -d "$INTELPATH"; then + # check for compiler in $INTELPATH + if test -d "$INTELPATH/bin/intel64" -a \ + -x "$INTELPATH/bin/intel64/$FCOMP" ; then + FCOMPROOT="$INTELPATH" + PATH="$INTELPATH/bin/intel64:$PATH" + elif test -d "$INTELPATH/bin" -a \ + -x "$INTELPATH/bin/$FCOMP"; then + FCOMPROOT="$INTELPATH" + PATH="$INTELPATH/bin:$PATH" + else + FCOMPROOT= + fi +else + FCOMPROOT= +fi + +# settings for MKL +MARC_MKL="$FCOMPROOT/mkl/lib/intel64" + +# +# settings for Metis +# +METIS="-I$METIS_SOURCE/include" +METISLIBS="$MARC_LIB/metis.a " + +# +# settings for MPI +# +# RCP and RSH are used for parallel network runs +# replace with similar commands like rsh if needed +RCP=/usr/bin/scp +RSH=/usr/bin/ssh +# + + +MPI_DEFAULT=intelmpi +MPI_OTHER=hpmpi + +MPITYPE=$MPI_DEFAULT + +if test $AUTOFORGE +then + if test $AUTOFORGE = 1 + then + MPITYPE=none + fi +fi + + +# overrule MPITYPE setting with environmental variable MARC_MPITYPE +if test $MARC_MPITYPE +then + MPITYPE=$MARC_MPITYPE +fi + +# always set MPITYPE to none for MD Nastran +if test "$_OEM_NASTRAN" -ne 0 +then + MPITYPE=none +fi + +# Edit following lines to build with GPGPU version of BCS Solver for +# NVIDIA platforms +#BCSGPUSOLVER=NONE +BCSGPUSOLVER=BCSGPU + +SOLVERFLAGS= +if test "$BCSGPUSOLVER" = BCSGPU +then + SOLVERFLAGS="$SOLVERFLAGS -DBCSGPU -DCUDA" + BCS_DIR=bcsgpusolver + export PATH=$MARC_CUDA/bin:$MARC_CUDA/nvvm:$PATH + export LD_LIBRARY_PATH=$MARC_CUDA/lib64:$LD_LIBRARY_PATH +else + BCS_DIR=bcssolver +fi +# +# settings for MPI +# +DDM= +if test $MPITYPE != none +then + if test $MPITYPE = hpmpi + then + FCOMPMPI=mpif90 + export MPI_ROOT=$MARC_HPMPI + export MPI_REMSH=$RSH + export MPI_F77=$FCOMP + ARCHITECTURE=linux_amd64 + DDM="-I$MPI_ROOT/include/64 -DDDM -DHPMPI" + MPI_CLEAN= + export MPI_EPATH=$MARC_BIN + export LD_LIBRARY_PATH=$MPI_ROOT/lib/$ARCHITECTURE:$MARC_LIB:$MARC_LIB_SHARED:$LD_LIBRARY_PATH + export MPIHPSPECIAL="-e MPI_FLAGS=E,T,y1" +# Below line is moved in run_marc file +# export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" + export MPIHPSPECIAL="$MPIHPSPECIAL -e BINDIR=$MARC_BIN" + if test -n "$MSC_LICENSE_FILE" + then + export MPIHPSPECIAL="$MPIHPSPECIAL -e MSC_LICENSE_FILE=$MSC_LICENSE_FILE" + fi + if test -n "$LM_LICENSE_FILE" + then + export MPIHPSPECIAL="$MPIHPSPECIAL -e LM_LICENSE_FILE=$LM_LICENSE_FILE" + fi + export MPIHPSPECIAL="$MPIHPSPECIAL -e MPI_LIC_CHECKER=$MPI_ROOT/bin/licensing/amd64_s8/lichk.x" + RUN_JOB2="$MPI_ROOT/bin/mpirun ${MPIRUNOPTIONS} -prot -f " + RUN_JOB1="$MPI_ROOT/bin/mpirun ${MPIRUNOPTIONS} -prot -w $MPIHPSPECIAL -np " + RUN_JOB0= + fi + if test $MPITYPE = intelmpi + then + INTELMPI_VERSION=HYDRA + FCOMPMPI=mpiifort + MPI_ROOT=$MARC_INTELMPI + DDM="-I${MPI_ROOT}/include64 -DDDM" + PATH=$MPI_ROOT/bin64:$PATH + export PATH + LD_LIBRARY_PATH=$MPI_ROOT/lib64:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH + if test $INTELMPI_VERSION = HYDRA + then + RUN_JOB1="${MPI_ROOT}/bin64/mpiexec.hydra -genvall -n " + RUN_JOB2="${MPI_ROOT}/bin64/mpiexec.hydra -genvall" + else + RUN_JOB1="${MPI_ROOT}/bin64/mpiexec -n " + RUN_JOB2="${MPI_ROOT}/bin64/mpiexec -configfile " + fi + RUN_JOB0= + MPI_CLEAN= + MPI_EPATH=$MARC_BIN + MPIR_HOME=$MPI_ROOT + MPICH_F77=$FCOMP + MPICH_F77LINKER=$FCOMP + export MPI_ROOT MPI_EPATH MPIR_HOME MPICH_F77 MPICH_F77LINKER + I_MPI_PIN_DOMAIN=node + export I_MPI_PIN_DOMAIN + fi +else + MPI_ROOT=$MARC_DUMMYMPI + export MPI_ROOT=$MARC_DUMMYMPI + DDM="-I$MPI_ROOT/include" +fi + +# +# variables for the "maintain" script +# + +MACHINENAME=LINUX +MACHINE64BIT=yes +MACHINE=Linux_EM64T +DEV=/dev/tape +GETLOG="whoami" +CLEAR="clear" +MY_UNAME=`uname -a` + +# Edit following 2 lines to build with VKI Solver +#VKISOLVER=VKI +VKISOLVER=NONE + +# Edit following 2 lines to build with CASI Solver +CASISOLVER=CASI +if test "$MARC_CASISOLVER" = "NONE" ; then + CASISOLVER=NONE +fi +#CASISOLVER=NONE + +# Edit following 2 lines to build with MF2 Solver +MF2SOLVER=NONE +#MF2SOLVER=SERIAL +#MF2SOLVER=MF2PARALLEL + +# Edit following lines to build with Intel(c) Multithreaded solver (PARDISO) +#INTELSOLVER=NONE +INTELSOLVER=PARDISO + +# Edit following lines to build with MUMPS +if test "$MARC_INTEGER_SIZE" = "i4" ; then + #MUMPSSOLVER=NONE + MUMPSSOLVER=MUMPS +else + #MUMPSSOLVER=NONE + MUMPSSOLVER=MUMPS +fi + +# Edit following 2 lines to build MARC dynamic shared library +MARC_DLL=MARC_DLL +MARC_DLL=NONE + +# always set VKISOLVER, CASISOLVER, BCSGPUSOLVER, and MARC_DLL to NONE for MD Nastran +if test "$_OEM_NASTRAN" -ne 0 +then + VKISOLVER=NONE + CASISOLVER=NONE + MF2SOLVER=NONE + INTELSOLVER=NONE + MUMPSSOLVER=NONE + BCSGPUSOLVER=NONE + MARC_DLL=NONE +fi + +# +# define Fortran and C compile syntax +# +if test "$VKISOLVER" = VKI +then + SOLVERFLAGS="$SOLVERFLAGS -DVKI" +fi + +if test "$CASISOLVER" = CASI +then + SOLVERFLAGS="$SOLVERFLAGS -DCASI" +fi + +if test "$MF2SOLVER" = MF2PARALLEL +then + SOLVERFLAGS="$SOLVERFLAGS -DMF2PARALLEL" +fi +if test "$MF2SOLVER" = MF2SERIAL +then + SOLVERFLAGS="$SOLVERFLAGS -DMF2SERIAL" +fi + +if test "$INTELSOLVER" = PARDISO +then + SOLVERFLAGS="$SOLVERFLAGS -DPARDISO" +fi + +if test "$MUMPSSOLVER" = MUMPS +then + SOLVERFLAGS="$SOLVERFLAGS -DMUMPS" +fi + + +if test "$MARC_DLL" = MARC_DLL +then + SOLVERFLAGS="$SOLVERFLAGS -DMARC_DLL" +fi + +LINK_OPT= +DEBUG_OPT= +C_DEBUG_OPT= + +#Uncomment following line to build Marc in debuggable mode +MARCDEBUG= +#MARCDEBUG="ON" + +if test "$MARCDEBUG" = "ON" +then + LINK_OPT="-debug -traceback" + DEBUG_OPT="-debug -traceback" + C_DEBUG_OPT="-debug -traceback" +fi + + +MARCCHECK= +#MARCCHECK="ON" +if test "$MARCCHECK" = "ON" +then + DEBUG_OPT="$DEBUG_OPT -fpe0 -fp-stack-check -check all -ftrapuv " + C_DEBUG_OPT="$C_DEBUG_OPT -fp-stack-check -check-uninit -Wformat -ftrapuv " +fi + +MARCCODECOV= +#MARCCODECOV="ON" + +MARCCODEPROF= +#MARCCODEPROF="ON" + +if test "$MARC_INTEGER_SIZE" = "i4" ; then + I8FFLAGS= + I8DEFINES= + I8CDEFINES= + I8CASIDEFS= +else + I8FFLAGS="-i8" + I8DEFINES="-DI64" + I8CDEFINES="-U_DOUBLE -D_SINGLE" + I8CASIDEFS="-DCASI_64BIT_INT=1" +fi + +MTHREAD=OPENMP +if test "$MARC_OPENMP" = "NONE" ; then + MTHREAD=NONE +fi +#MTHREAD=NONE +if test "$_OEM_NASTRAN" -ne 0 +then +MTHREAD=NONE +fi + +OMP_COMPAT=NO +OMP_COMPAT=YES +if test "$MTHREAD" = "NONE" +then +OMP_COMPAT=NO +fi + +CDEFINES= +FDEFINES= + +if test "$_OEM_NASTRAN" -ne 0 +then + CDEFINES="$CDEFINES -D_OEM_NASTRAN" + FDEFINES="$FDEFINES -D_OEM_NASTRAN" +fi + +FDEFINES="$FDEFINES -D_IMPLICITNONE" + +if test "$_OEM_NASTRAN" -eq 0 +then + FDEFINES="$FDEFINES -DMKL -DOPENMP" +fi + +if test "$OMP_COMPAT" = "YES" +then + FDEFINES="$FDEFINES -DOMP_COMPAT" +fi + +# -D_MSCMARC +FDEFINES="$FDEFINES -D_MSCMARC $DEBUG_OPT $MARC_SIMUFACT" +CDEFINES="$CDEFINES -D_MSCMARC $C_DEBUG_OPT $I8CDEFINES" + +CINCL="-I$MARC_SOURCE/mdsrc -I$MARC_SOURCE/csource $METIS" +if test "$_OEM_NASTRAN" -ne 0 +then + CINCL="$CINCL -I../../include" +fi + +CC="icc -c -O1 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " +CCLOW="icc -c -O0 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " +CCHIGH="icc -c -O3 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " + +if test "$MARCDEBUG" = "ON" +then + CC="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " + CCLOW="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " + CCHIGH="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " +fi + +LOAD_CC="icc -O1 -DLinux -DLINUX -DLinux_intel" +CCT="$CC" +CCTLOW="$CCLOW" +CCTHIGH="$CCHIGH" + +CC_CASI="$CC -std=c99 $I8CASIDEFS" +CCLOW_CASI="$CCLOW -std=c99 $I8CASIDEFS" +CCHIGH_CASI="$CCHIGH -std=c99 $I8CASIDEFS" + +CCT_CASI="$CCT -std=c99 $I8CASIDEFS" +CCTLOW_CASI="$CCLOW -std=c99 $I8CASIDEFS" +CCTHIGH_CASI="$CCHIGH -std=c99 $I8CASIDEFS" + +#PROFILE="-Mprof=func" +#PROFILE="-Mprof=lines" +#PROFILE="-Mprof=func,mpi" +PROFILE= +if test "$MARCCODECOV" = "ON" +then +PROFILE="-prof-gen=srcpos" +fi +if test "$MARCCODEPROF" = "ON" +then +PROFILE=" $PROFILE -pg" +fi + +FORT_OPT="-c -assume byterecl -safe_cray_ptr -mp1 -WB -fp-model source" +if test "$MTHREAD" = "OPENMP" +then + FORT_OPT=" $FORT_OPT -openmp" + if test "$OMP_COMPAT" = "YES" + then + FORT_OPT=" $FORT_OPT -openmp-threadprivate=compat" + fi +else +# FORT_OPT=" $FORT_OPT -auto " + FORT_OPT=" $FORT_OPT -save -zero" +fi + +FORTLOW="$FCOMP $FORT_OPT $PROFILE -O0 $I8FFLAGS -I$MARC_SOURCE/common \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" +FORTRAN="$FCOMP $FORT_OPT $PROFILE -O1 $I8FFLAGS -I$MARC_SOURCE/common \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" +FORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" +FORTNA="$FCOMP $FORT_OPT -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" + +if test "$MARCDEBUG" = "ON" +then + FORTLOW="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" + FORTRAN="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" + FORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" + FORTNA="$FCOMP $FORT_OPT -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ + -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" +fi + +FORTLOWT="$FORTLOW" +FORTRANT="$FORTRAN" +FORTHIGHT="$FORTHIGH" + +FORTRANMNF="$FCOMP -c $FDEFINES " +CCMNF="icc -c -O1 -DLinux -DLINUX -DLinux_intel -Dport2egcs -I$MARC_SOURCE/marctoadams/mnf/include -D_LARGEFILE64_SOURCE" + +FORTRANMUMPS="$FCOMP -fpp $FORT_OPT $PROFILE -fno-alias -O1 -fp-model precise $FDEFINES -D_IMPLICITNONE $I8FFLAGS $I8DEFINES $DDM -I$MARC_SOURCE/mumpssolver/include -Dintel_ -DALLOW_NON_INIT -Dmetis -nofor_main" +CCMUMPS="icc -c -DAdd_ -Dmetis -I$MARC_SOURCE/mumpssolver/include" + + +BCSCC="icc -c -O3 -DLOWERCASE_ -I${MARC_SOURCE}/${BCS_DIR}/bcslib_csrc $CDEFINES $CINCL" +NVCC="nvcc -c -O3 -arch sm_20 -DLOWERCASE_ -I${MARC_SOURCE}/${BCS_DIR}/bcslib_cuda/include -I${MARC_CUDA}/include -I$MARC_SOURCE/mdsrc $I8DEFINES -Xcompiler -fvisibility=hidden -Xcompiler -fPIC $I8DEFINES " +NVCCLIB="ar rvl" +NVCCLD=icc +BCSFORTLOW="$FORTLOW -I${MARC_SOURCE}/${BCS_DIR}/common" +BCSFORTRAN="$FORTRAN -I${MARC_SOURCE}/${BCS_DIR}/common" +BCSFORTHIGH="$FORTHIGH -I${MARC_SOURCE}/${BCS_DIR}/common" +BCSFORT90HIGH="$BCSFORTHIGH" +if test "$MARCDEBUG" = "ON" +then + BCSFORTRAN=$BCSFORTLOW + BCSFORTHIGH=$BCSFORTLOW + BCSFORT90HIGH=$BCSFORTLOW +fi + +if test $MPITYPE != none +then + if test $MPITYPE = hpmpi + then + LOAD="$MPI_ROOT/bin/$FCOMPMPI ${LOADOPTIONS} -L$MPI_ROOT/lib/$ARCHITECTURE $PROFILE $LINK_OPT -o " + LOADT="$MPI_ROOT/bin/$FCOMPMPI ${LOADOPTIONS} -L$MPI_ROOT/lib/$ARCHITECTURE $PROFILE $LINK_OPT -o " + fi +# Uncomment the following lines to turn on the tracer and commnet out the next 5 lines +# if test $MPITYPE = intelmpi +# then +# INCLUDEMPI="-I$MPI_ROOT/include64 -I$VT_ROOT/include" +# LOAD="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " +# LOADT="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " +# fi + if test $MPITYPE = intelmpi + then + LOAD="ifort $PROFILE $LINK_OPT -o " + LOADT="ifort $PROFILE $LINK_OPT -o " + fi +else + LOAD="$FCOMP $LINK_OPT -o " + LOADT="$FCOMP $LINK_OPT -o " +fi + +if test "$MARC_DLL" = MARC_DLL +then + FORTLOW="$FORTLOW -fpp -fPIC" + FORTRAN="$FORTRAN -fpp -fPIC" + FORTHIGH="$FORTHIGH -fpp -fPIC" + FORTRANMNF="$FORTRANMNF -fpp -fPIC" + CC="$CC -fPIC" + CCMNF="$CCMNF -fPIC" + CC_CASI="$CC_CASI -fPIC" + CCLOW_CASI="$CCLOW_CASI -fPIC" + CCHIGH_CASI="$CCHIGH_CASI -fPIC" + LINK_EXE_MARC="-L$MARC_LIB -lmarc -L$MARC_LIB_SHARED -lguide -lpthread" + LINK_MARC_DLL="-shared -fPIC" + LOAD_DLL=$LOAD + LOADT_DLL=$LOADT + EXT_DLL="so" +fi + + +XLIBS="-L/usr/X11/lib -lX11 " + +# +# define archive and ranlib syntax +# + +ARC="ar rvl" +ARD="ar dvl" +ARX="ar xl" +RAN="" + +# +# choose which libraries you want to use ( e.g. blas ) +# + +if test "$VKISOLVER" = VKI +then + VKISOLVERLIBS="$MARC_LIB/vkisolver.a" +else + VKISOLVERLIBS= +fi + +if test "$CASISOLVER" = CASI +then + CASISOLVERLIBS="$MARC_CASI/casilib.a" +else + CASISOLVERLIBS= +fi + +MF2SOLVERLIBS= +if test "$MF2SOLVER" = MF2PARALLEL +then + MF2SOLVERLIBS="$MARC_LIB/mf2parallel/libseq.a \ + $MARC_LIB/mf2parallel/libsym.a \ + $MARC_LIB/mf2parallel/libmet.a \ + $MARC_LIB/mf2parallel/libmf2.a \ + $MARC_LIB/mf2parallel/libgauss.a \ + $MARC_LIB/mf2parallel/libmf2.a \ + $MARC_LIB/mf2parallel/libgauss.a \ + $MARC_LIB/mf2parallel/libnum.a \ + $MARC_LIB/mf2parallel/libutl.a \ + $MARC_LIB/mf2parallel/libr8.a \ + $MARC_LIB/mf2parallel/libz.a " +fi + +if test "$MUMPSSOLVER" = MUMPS +then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" + if test $MPITYPE = none + then + MUMPSSOLVERLIBS2= + echo hello > /dev/null + fi + if test $MPITYPE = intelmpi + then + if test "$MARC_INTEGER_SIZE" = "i4" ; then + MUMPSSOLVERLIBS2=" $MARC_MKL/libmkl_blacs_intelmpi_lp64.a " + else + MUMPSSOLVERLIBS2=" $MARC_MKL/libmkl_blacs_intelmpi_ilp64.a " + fi + fi + if test $MPITYPE = hpmpi + then + if test "$MARC_INTEGER_SIZE" = "i4" ; then + MUMPSSOLVERLIBS2=" $MARC_MKL/libmkl_blacs_lp64.a" + else + MUMPSSOLVERLIBS2=" $MARC_MKL/libmkl_blacs_ilp64.a" + fi + fi +else + MUMPSSOLVERLIBS= + MUMPSSOLVERLIBS2= +fi + +if test "$BCSGPUSOLVER" = BCSGPU +then + BCSSOLVERLIBS="${MARC_LIB}/bcsgpulib.a " + MARCCUDALIBS1="-L${MARC_LIB}/cuda_dummy -lmarccuda " + MARCCUDALIBS2="-L${MARC_LIB}/cuda -lmarccuda " + MARCCUDALIBS=$MARCCUDALIBS1 + CUDALIBS="-L$MARC_CUDA/lib64 -lcudart -lcublas -L/usr/lib64 -lcuda " +else + BCSSOLVERLIBS="${MARC_LIB}/bcslib.a " +fi + +if test "$MARC_INTEGER_SIZE" = "i4" ; then + MKLLIB="$MARC_MKL/libmkl_scalapack_lp64.a $MARC_MKL/libmkl_blacs_lp64.a -Wl,--start-group $MARC_MKL/libmkl_intel_lp64.a $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_core.a -Wl,--end-group" +else + MKLLIB="$MARC_MKL/libmkl_scalapack_ilp64.a $MARC_MKL/libmkl_blacs_ilp64.a -Wl,--start-group $MARC_MKL/libmkl_intel_ilp64.a $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_core.a -Wl,--end-group" +fi + +SECLIBS="-L$MARC_LIB -llapi" + +SOLVERLIBS="${BCSSOLVERLIBS} ${VKISOLVERLIBS} ${CASISOLVERLIBS} ${MF2SOLVERLIBS} ${MUMPSSOLVERLIBS2} \ + $MKLLIB -L$MARC_MKL -liomp5 \ + $MARC_LIB/blas_src.a ${ACSI_LIB}/ACSI_MarcLib.a " + +SOLVERLIBS_DLL=${SOLVERLIBS} + +MRCLIBS="$MARC_LIB/clib.a ${CASISOLVERLIBS}" +MRCLIBSPAR="$MARC_LIB/clib.a" +STUBS="$MARC_LIB/stubs.a " +MNFLIBS="$MARC_LIB/libmnf.a" +MDUSER="$MARC_LIB/md_user.a" +if test "X$MARC_SIMUFACT" != "X" +then + SFLIB="-L$SFMATDIR -lMBA_Grain $SFMATDIR/sfclib.a " +else + SFLIB=" " +fi + +OPENMP="-openmp" + +SYSLIBS=" $OPENMP -lpthread -shared-intel " + +# Uncomment the following lines to turn on the trace and comment out the next 4 lines +# if test $MPITYPE = intelmpi +# then +# SYSLIBS="-L${VT_ROOT}/lib -lVT -ldwarf -lelf -lm -lpthread \ +# -L${MPI_ROOT}/lib64 -lmpi -lmpiif -lmpigi -lrt" +# fi +if test $MPITYPE = intelmpi +then + SYSLIBS="-L${MPI_ROOT}/lib64 -lmpi_mt -lmpifort -lrt $OPENMP -threads -lpthread -shared-intel " +fi + + +SYSLIBSPAR=" " + +MARC_DLL_CODES="runmarc.f" + + +BLAS_SRC="dzero.f icopy.f izero.f" +if test "$_OEM_NASTRAN" -ne 0 +then + if test "$MARC_INTEGER_SIZE" = "i4" ; then + BLAS_SRC="$BLAS_SRC dsctr.f zsctr.f dzasum.f daxpyi.f zaxpyi.f dgthr.f zgthr.f" + else + BLAS_SRC="ALL" + fi +fi + +LOW_OPT_CODES="are163.f contro.f ndext.f omarc.f omarca.f omarcb.f omarcc.f \ + omars.f fixbc.f triang.f bet049.f norst3.f eldata.f \ + elec*.f elct*.f fmeig.f oada00.f ogeig.f updtrbe2.f cycrota.f \ + cordef.f ogpk.f ogtan.f eldam.f formrbe3.f \ + inertie.f em_sso072.f cn_fol3d_qpatch6.f cosim_begin.f" +if test "$MARC_INTEGER_SIZE" = "i8" ; then + LOW_OPT_CODES="$LOW_OPT_CODES bbcseg.f" +fi +LOW_OPT_CODES_CASI="" + +HIGH_OPT_CODES="dpsmsa1.f dpsmsa2.f dpsmsa3.f dpsmsa4.f dpsmsa5.f dpsmsa6.f \ + dpsmsa7.f dpsmsa8.f dpsmsa9.f dpsmsa10.f dpsmsa11.f dpsmsa12.f \ + dpsmsa13.f dpsmsa14.f dpsmsa15.f dpsmsa16.f dpsmsah.f tpsmsah.f cn_qsort4_11.f " + + +HIGH_OPT_CODES_CASI="arithkernels.c blockedroutines.c blockedroutines_fd.c elemmatgenkernels.c longvecroutines.c sfmultutils.c solvewithbd.c" + +MAXNUM=1000000 diff --git a/installation/mods_MarcMentat/2016/Marc_tools/run_damask b/installation/mods_MarcMentat/2016/Marc_tools/run_damask new file mode 100644 index 000000000..e3d746b55 --- /dev/null +++ b/installation/mods_MarcMentat/2016/Marc_tools/run_damask @@ -0,0 +1,4096 @@ +#!/bin/ksh +############################################################################## +# # +# run_marc - run a marc job # +# ------------------------- # +# # +# usage: run_marc -j jid { options } # +# # +# where standard options are: required: defaults: # +# -------------------------- # +# # +# -j* jid job id number. ** YES ** . # +# -pr* prog program name. . marc # +# -v* y|n do or do not verify inputs. . yes # +# -q* s|l|v|b|f batch queue name or background, . short # +# foreground. # +# -b* as alternative to option -q* # +# # +# ( batch queues only : # +# -pq* intra queue priority. . . # +# -at DATE/TIME delay start of job. . . # +# format : January,1,1990,12:31 # +# or : today,5pm # +# -cpu* secs job CPU limit . . ) # +# # +# -r* rid restart file job id. . . # +# -si* sid substructure file id. . . # +# -pi* post post file job id. . . # +# -de* did defaults file . no # +# -vf vid viewfactor . no # +# # +# -u* user user subroutine. . . # +# -obj obj user objects or libraries. . . # +# -sa* y|n do or do not save load module. . no # +# -autorst auto restart flag for auto forge . no # +# -me manual remeshing control . no # +# -ml memory limit in Mbyte # +# -mo This option is deprecated. As of Marc 2015, only # +# the integer*8 version is available. # +# -mpi selects MPI version # +# each platform has a default MPI version and some # +# have an alternative version. see the include file # +# for the respective platform # +# MPI_DEFAULT defines the default MPI version # +# MPI_OTHER defines versions one can switch to # +# -dcoup for contact decoupling # +# currently not supported # +# -dir directory where the job i/o should take place. # +# defaults to current directory. # +# -sdir directory where scratch files are created # +# defaults to current directory. # +# # +# -alloc only perform memory allocation test, no analysis # +# -list y only list options in the input file, no analysis # +# -fe num set feature number "num" for the run. only one allowed # +# -dytran flag to switch from Dytran to Marc # +# dytran = 0, program will run w/o Marc-Dytran Switch # +# = 1, program will restart Marc after Dytran run # +# >= 2, Not supported yet. # +# currently not supported # +# -ou force analysis to use out-of-core control # +# =0, not used # +# =1, element storage out-of-core # +# -dll run marc using shared library libmarc.so and exe_marc # +# =1, used # +# =2, do not free streaming input memory # +# =3, run with marc input deck # +# -trk run marc for post-tracking # +# -gpuid run marc using GPGPU capability # +# specify gpuid on to be used in the analysis. Multiple # +# IDs may be assigned for DDM runs. # +# Separate a list of IDs with a colon. Each DMP # +# process will be assigned a GPU ID in round robin fastion# +# = 0 # +# = 0:1 etc... # +# # +# where parallel options are: # +# -------------------------- # +# # +# itree, host, and comp options are available for the domain # +# decomposition only. # +# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # +# # +# # +# -nprocd number of domains. # +# defaults to single domain solution. # +# -nprocds number of domains if single input file. # +# defaults to single domain solution. # +# -nps same as -nprocds. # +# -nsolver number of solver tasks for solver types 12 and 13 # +# these are distributed tasks operating via MPI # +# -nthread_elem number of threads for element assembly and recovery # +# = 0: use defaults. # +# defaults to 1 for single domain solution. # +# defaults to number of domains for multi-domain # +# solution. # +# > 1: number of threads to be used by element assembly # +# recovery. # +# Also can be set through MARC_NUMBER_OF_THREADS # +# environment variable. # +# if both specified, -nthread_elem option will be used. # +# defaults if neither MARC_NUMBER_OF_THREADS environment # +# variable set nor -nthread_elem specified. # +# -nthread_solver number of threads for solver types 6, 8, and 11 # +# = 0: use defaults. # +# defaults to 1 for single domain solution. # +# defaults to number of domains for multi-domain # +# solution. # +# > 1: number of threads to be used by 6, 8, and 11 # +# Also can be set through MARC_NUMBER_OF_THREADS # +# environment variable. # +# if both specified, -nthread_solver option will be used. # +# defaults if neither MARC_NUMBER_OF_THREADS environment # +# variable set nor -nthread_solver specified. # +# -nthread Same as -nthread_solver. # +# -itree message passing tree type for domain decomposition. # +# for debugging purposes; should not normally be used. # +# -host hostfile name for distributed execution on network. # +# defaults to no hostfile, unless jobid.defhost exists. # +# if jobid.defhost exists, only -np(s) necessary # +# -comp* y|n to be used with user routines on a network of # +# incompatible machines. # +# if set to no, a separate executable will be created # +# for each machine on the network. # +# if set to yes, the executable located on the machine # +# from which marc is started will be used on all machines.# +# defaults to no if O/S versions different on machines. # +# # +# -ci y|n copy input files to remote hosts (default: yes) # +# if "yes", input files are automatically copied to # +# remote hosts for a network run if necessary. # +# -cr y|n copy post files from remote hosts (default: yes) # +# if "yes", post files are automatically copied back from # +# remote hosts for a network run if necessary. # +############################################################################## +# set DIR to the directory in which this script is +REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" +DIR=`dirname $REALCOM` +# make sure DIR has an absolute path +case $DIR in + \/*) + ;; + *) + DIR=`pwd`/$DIR + ;; +esac +DIRSCRIPT=$DIR +AWK=awk +ARCH=`uname -a | cut -f 1 -d " "` +# Sun has a bad awk, use nawk instead +if test $ARCH = "SunOS" +then + AWK=nawk +fi +BASENAME=basename +# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists +if test $ARCH = "SunOS" +then + if test -x /usr/ucb/basename + then + BASENAME=/usr/ucb/basename + fi +fi + +# echo command line in the case of ECHO_COMMAND is true +if test "$ECHO_COMMAND" = true ; then + echo command "$0" "$@" +fi + +# +# "mode" selects version, i4 or i8 +# default is i4 +# this can be changed by a file run_marc_defaults +# located in the tools directory of the Marc installation +# or in the user's home directory +# format: +# MARC_MODE i8 +# it can also be set by the environmental variable MARC_INTEGER_SIZE +# and by the command line option "-mo" +# +mode= +modeerror= +modeoption= +if test -f $DIRSCRIPT/run_marc_defaults; then + line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $DIRSCRIPT/run_marc_defaults` + if test "$line" = "MARC_MODE"; then + echo + echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available + echo + line= + fi + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + modeerror="defaults file $DIRSCRIPT/run_marc_defaults used mode $line ; this must be i8" + modeoption=error + echo $modeerror + fi + if test "$line" = "i8"; then + mode=i8 + fi +fi +if test -f $HOME/run_marc_defaults; then + line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $HOME/run_marc_defaults` + if test "$line" = "MARC_MODE"; then + echo + echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available + echo + line= + fi + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + modeerror="defaults file $HOME/run_marc_defaults used mode $line ; this must be i8" + modeoption=error + echo $modeerror + fi + if test "$line" = "i8"; then + mode=i8 + fi +fi +if test -n "$MARC_INTEGER_SIZE" ; then + mode=$MARC_INTEGER_SIZE +fi +if test -z "$mode" ; then + mode=i8 +fi +case $mode in + i4) + modeerror="bad value for MARC_INTEGER_SIZE variable; only i8 is supported." + modeoption=error + echo $modeerror + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo "bad value for MARC_INTEGER_SIZE variable; only i8 is supported." + exit + ;; +esac + +setmode=false +for arg in $* ; do + if $setmode ; then + mode=$arg + case $mode in + i4) + modeerror="bad value for mode option; only i8 is supported." + modeoption=error + echo + echo $modeerror + echo + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo " " + echo "error, version mode must be i8" + echo " " + echo " use -mo i8 " + echo " " + exit + ;; + esac + setmode=false + fi + if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then + echo + echo warning: the option -mo is deprecated, as of Marc 2015, only the integer*8 version is available + echo + setmode=true + fi + if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + fi + if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then + modeerror="bad value for mode option; only i8 is supported." + modeoption=error + echo + echo $modeerror + echo + fi +done + +# set to i4 version for 32 bit Linux +if test "`uname -s`" = "Linux"; then + if test "`uname -m`" = "i686"; then + mode=i4 + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + fi +fi + + +. "$DIR/getarch" + +. $MARC_INCLUDE +# + +# +# Dynamically determine the echo syntax +# + +case "`echo '\c'`" in + '\c') + ECHO='echo -n' + ECHOTXT=' ' + ;; + *) + ECHO='echo' + ECHOTXT=' \c' + ;; +esac + +# +# Variables for the MARC environment +# + +PRODUCT="Marc" +EXITMSG=$MARC_TOOLS/MESSAGES +export EXITMSG +FLEXDIR=$DIR/../flexlm/licenses +export FLEXDIR +TIMCHK=3600 +export TIMCHK +BINDIR=$MARC_BIN +export BINDIR +AFMATDAT=$MARC_RUNTIME/AF_flowmat/ +export AFMATDAT +export MESHERDIR +MSC_LICENSE_FINPROC=1 +export MSC_LICENSE_FINPROC +# +# define directory path to global unified material database +# +MATFILE= +export MATFILE + +# +# define memory limit +# first set to MEMLIMIT from include +# -ml option overrules if specified +memlimit=$MEMLIMIT +# +# Define share library path based on platforms +# This is required for using the Patran Mesher +# +if test $MACHINENAME = "HP" +then + SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH + export SHLIB_PATH +fi +# the one for IBM is defined futher down + +LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$MESHERDIR:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$SFMATDIR:$LD_LIBRARY_PATH +LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH +LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH +export LD_LIBRARY_PATH +export LD_LIBRARY64_PATH +export LD_LIBRARYN32_PATH + +atexit() { +kill -15 $$ +# +if test $MPITYPE = "myrinet" +then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi +fi +} + +trap "atexit" 2 + +# +# defaults +# + +prog=marc +exefile=marc +jid= +rid= +pid= +sid= +did= +vid= +user= +usernoext= +objs= +qid=background +cpu= +priority= +att= +trk= +verify=yes +prgsav=no +rmdll=no +cpdll=no +progdll= +pathdll= +error= +nprocd=0 +nprocdddm=1 +nprocdddmprint= +icreated=0 +nprocdarg= +nsolver=0 +nsolverarg=-ns +if test $nprocds +then + if test $nprocds -gt 1 + then + nprocdddm=$nprocds + nprocdddmprint=$nprocds + icreated=1 + nprocdarg=-nprocds + fi +fi +ntprint=0 +nt=-1 +nte=-1 +nts=-1 +ntarg=-nt +ntearg=-nte +ntsarg=-nts +nteprint= +ntsprint= +gpuids= +nauto=0 +ndcoup=0 +ndytran=0 +noutcore=0 +dllrun=0 +mesh=0 +itree=0 +iam= +ddm_arc=0 +link= +trkrun=0 +DIRJOB=`pwd` +DIRSCR=$DIRJOB +DIRSCRSET= +autoforge=0 +dotdat=.dat +dotdefhost=.defhost +host= +numhost= +mfile= +userhost= +makebdf= +cpinput=yes +cpresults=yes +marcdll=libmarc.$EXT_DLL +# define hostname and strip off extensions (alpha.aaa.com) +thishost=`hostname` +thishost=${thishost%%.*} +compatible=unknown +numfield=1 +justlist= +feature= +mpioption=false +iprintsimufact= +MDSRCLIB=$MARC_LIB/mdsrc.a +# +# check run_marc_defaults file for default MPI setting +# located in the tools directory of the Marc installation +# or in the user's home directory +# format: +# MARC_MPI +# +value= +file= +if test -f $DIRSCRIPT/run_marc_defaults; then + value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` + value=`echo $value | $AWK '{print $NF}'` + if test -n "$value"; then + file=$DIRSCRIPT/run_marc_defaults + fi +fi +if test -f $HOME/run_marc_defaults; then + value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` + value=`echo $value | $AWK '{print $NF}'` + if test -n "$value"; then + file=$HOME/run_marc_defaults + fi +fi +if test -n "$value"; then + MARC_MPITYPE=$value + notok=true + for i in "$MPI_OTHER"; do + if test "$MARC_MPITYPE" = "$i"; then + notok=false + fi + done + if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then + notok=false + fi + if $notok; then + echo " " + echo " error, incorrect option for MARC_MPI" + echo " defined in $file: $MARC_MPITYPE" + echo " valid options: $MPI_DEFAULT $MPI_OTHER" + echo " " + exit + fi + if test "$value" != "$MPI_DEFAULT"; then + exefile=marc_$value + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a_$value + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" + fi + fi +fi +# +# +# allow scratch directory to be specified with environmental variable +# MARCSCRATCH +if test $MARCSCRATCH +then + if test -d $MARCSCRATCH + then + DIRSCR=$MARCSCRATCH + else + echo "error, scratch directory '$MARCSCRATCH'" + echo " specified via environmental variable MARCSCRATCH does not exist" + exit + fi +fi +# +############################################################################## +# parse input - arguments always come in pairs # +############################################################################## + +arg=$1 +if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then + shift + arg=$1 +fi +while [ -n "$arg" ] +do + shift + value=$1 + case $arg in + -al* | -AL*) + LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH + $MARC_BIN/marc -alloc 1 + exit + ;; + -li* | -LI*) + justlist=yes + ;; + -fe* | -FE*) + feature=$value + + ;; + -pr* | -PR*) + if test `dirname $value` = '.' + then + prog=`$BASENAME $value .marc` + progdll=`$BASENAME $value` + else + prog=`dirname $value`/`$BASENAME $value .marc` + progdll=`dirname $value`/`$BASENAME $value` + fi + prdir=`dirname $value` + case $prdir in + \/*) + ;; + *) + prog=`pwd`/$prdir/$prog + ;; + esac + ;; + -j* | -J*) + jid=`$BASENAME $value $dotdat` + DIRJID=`dirname $value` + case $DIRJID in + \/*) + ;; + *) + DIRJID=`pwd`/$DIRJID + ;; + esac + ;; + -r* | -R*) + rid=`$BASENAME $value .t08` + DIRRID=`dirname $value` + case $DIRRID in + \/*) + ;; + *) + DIRRID=`pwd`/$DIRRID + ;; + esac + ;; + -si* | -SI*) + sid=$value + DIRSID=`dirname $value` + case $DIRSID in + \/*) + ;; + *) + DIRSID=`pwd`/$DIRSID + ;; + esac + ;; + -pi* | -PI*) + if test -f $value.t19 + then + pid=`$BASENAME $value .t19` + else + pid=`$BASENAME $value .t16` + fi + DIRPID=`dirname $value` + case $DIRPID in + \/*) + ;; + *) + DIRPID=`pwd`/$DIRPID + ;; + esac + ;; + -bdf | -BDF) + makebdf=1 + ;; + -de* | -DE*) + did=`$BASENAME $value $dotdat` + DIRDID=`dirname $value` + case $DIRDID in + \/*) + ;; + *) + DIRDID=`pwd`/$DIRDID + ;; + esac + ;; + -vf | -VF) + vid=`$BASENAME $value .vfs` + DIRVID=`dirname $value` + case $DIRVID in + \/*) + ;; + *) + DIRVID=`pwd`/$DIRVID + ;; + esac + ;; + -u* | -U*) + user=$value + case $user in + \/*) + ;; + *) + user=`pwd`/$user + ;; + esac + usernoext=$user + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + ;; + -obj | -OBJ) + objs="$value" + ;; + -q* | -Q*) + qid=$value + ;; + -b* | -B*) + case $value in + y* | Y*) + qid=background + ;; + n* | N*) + qid=foreground + ;; + *) + ;; + esac + ;; + -at | -AT) + att=$value + ;; + -cpu* | -CPU*) + cpu=$value + ;; + -pq | -PQ*) + priority=$value + ;; + -v* | -V*) + verify=$value + ;; + -sa* | -SA*) + prgsav=$value + ;; + -np* | -NP*) + nprocdddm=$value + nprocdddmprint=$value + case $arg in + -nps* | -NPS* | -nprocds* | -NPROCDS*) + icreated=1 + nprocdarg=-nprocds + ;; + esac + case $arg in + -np | -NP | -nprocd | -NPROCD) + icreated=0 + nprocdarg=-nprocd + ;; + esac + ;; + -ns* | -NS*) + nsolver=$value + ;; + -nt* | -NT*) + case $arg in + -nte | -NTE | -nthread_e* | -NTHREAD_E*) + nte=$value + ;; + esac + case $arg in + -nts | -NTS | -nthread_s* | -NTHREAD_S*) + nts=$value + ;; + esac + case $arg in + -nt | -NT | -nth* | -NTH* | -nthread* | -NTHREAD*) + nt=$value + ;; + esac + ;; + -gp* | -GP*) + gpuids=$value + ;; + -it* | -IT*) + itree=$value + ;; + -iam | -IAM) + iam=$value + case $value in + sfg | sfm | sim) + iprintsimufact=true + ;; + esac + ;; + -au* | -AU*) + nauto=$value + ;; + -dc* | -DC*) + ndcoup=$value + ;; + -dy* | -DY*) + ndytran=$value + ;; + -ou* | -OU*) + noutcore=$value + ;; + -dll | -DLL) + dllrun=$value + ;; + -trk | -TRK) + trkrun=$value + ;; + -ddm | -DDM) + ddm_arc=$value + ;; + -me | -ME ) + mesh=$value + ;; + -ml | -ML ) + memlimit=$value + ;; + -mo | -MO ) + ;; + -mpi | -MPI ) + mpioption=true + MARC_MPITYPE=$value + if test "$value" != "$MPI_DEFAULT"; then + exefile=marc_$value + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a_$value + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" + fi + else + exefile=marc + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" + fi + fi + ;; + -dir* | -DIR*) + DIRJOB=$value + case $DIRJOB in + \/*) + ;; + *) + DIRJOB=`pwd`/$DIRJOB + ;; + esac + if test -z "$DIRSCRSET" + then + DIRSCR=$DIRJOB + fi + ;; + -sd* | -SD*) + DIRSCR=$value + DIRSCRSET=yes + case $DIRSCR in + \/*) + ;; + *) + DIRSCR=`pwd`/$DIRSCR + ;; + esac + ;; + -ho* | -HO*) + host=$value + ;; + -co* | -CO*) + compatible=$value + ;; + -ci* | -CI*) + cpinput=$value + ;; + -cr* | -CR*) + cpresults=$value + ;; + *) + error="$error +$arg: invalid option" + break + ;; + esac + case $value in + -*) + error="$error +$arg: invalid name $value" + break + ;; + esac + shift + arg=$1 + if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then + shift + arg=$1 + fi +done +argc=`expr $# % 2` +if test $argc -eq 1 +then +# +# odd number of arguments +# + error="$error +argument list incomplete" +fi + +if test $nprocdddm -gt 0 +then +nprocd=$nprocdddm +fi + +if test $nsolver -gt 0 +then + if test $nsolver -gt $nprocd + then + nprocd=$nsolver + fi +fi +# Set defaults +if test $nt -eq -1 +then +nt=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nt -lt 0 +then +nt=0 +fi +if test $nte -eq -1 +then +nte=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nte -lt 0 +then +nte=0 +fi +if test $nts -eq -1 +then +nts=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nts -lt 0 +then +nts=0 +fi +# +# set number of element loop threads +# +ntprint=$nt +nteprint=$nte +# copy from -nprocd[s] +if test $nprocdddm -gt 1 +then + nteprint=$nprocdddm +fi +# override with -nthread_elem option +if test $nte -ne 0 +then +nteprint=$nte +fi +# check for minimum 1 threads per processes for DDM +if test $nprocdddm -gt 1 +then + if test $nteprint -lt $nprocdddm + then + nteprint=$nprocdddm + fi +fi +nte=$nteprint +# +# set number of Solver threads +# +ntsprint=$nts +# copy from -nthread or -nprocd[s] +if test $ntprint -ne 0 +then + ntsprint=$ntprint +else + if test $nprocdddm -gt 1 + then + ntsprint=$nprocdddm + fi +fi +# override with -nthread_solver option +if test $nts -ne 0 +then + ntsprint=$nts +fi +# check for minimum 1 threads per solver process. +if test $nsolver -lt $nprocdddm +then + if test $ntsprint -lt $nsolver + then + ntsprint=$nsolver + fi +else + if test $ntsprint -lt $nprocdddm + then + ntsprint=$nprocdddm + fi +fi +if test $ntsprint -eq 1 +then + set ntsprint=0 +fi +nts=$ntsprint + +# set stack size for multi-threading. +export KMP_MONITOR_STACKSIZE=7M +export OMP_STACKSIZE=7M + +# +# deprecate -nthread option at arugment of marc +nt=0 +# Reset nprocdddmm, nsolver and threads if not given. +if test $nprocdddm -eq 0 +then + nprocdarg= +fi +if test $nprocdddm -eq 0 +then + nprocdddmprint= +fi +if test $nprocdddm -eq 0 +then + nprocdddm= +fi + +if test $nsolver -eq 0 +then + nsolverprint= +fi +# end of threads setting. +gpuoption= +if test "$gpuids" = "" ; then + gpuoption= +else + gpuoption="-gp $gpuids" +fi + +if test "$gpuids" = "" ; then + export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH +else + MARCCUDALIBS=$MARCCUDALIBS2 + export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH +fi +# Linux 64 + HPMPI, Below code is taken from include_linux64 +if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" +then + export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" +fi + +if test $nprocd -gt 1; then + if test -f $jid$dotdefhost; then + if test "$host" = ""; then + host=$jid$dotdefhost + fi + fi + if test -f hostfile_qa_$nprocd; then + if test "$host" = ""; then + host=hostfile_qa_$nprocd + fi + fi +fi + +if test "$dllrun" -gt 0; then + exefile=exe_marc + prog=exe_marc + program=$exefile + bd=$MARC_BIN/ + if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then + dotdat=.inp + fi + + if test "$progdll"; then + /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll + rmdll=yes + pathdll=yes + progdll=${progdll}_$marcdll + else + progdll=$marcdll + fi + + if test "$user"; then + . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user + user= + if test $prgsav = no; then + rmdll=yes + fi + if test $prgsav = yes; then + cpdll=yes + rmdll=yes + fi + pathdll=yes + fi +fi + +############################################################################## +# check parameter validity # +############################################################################## + +while test forever; do + +# +# check for input file existence +# +if test $nprocdddm -gt 1 -a $icreated -eq 0; then + if test ! -f $DIRJID/1$jid$dotdat; then + if test "$jid" != "" ; then + error="$error +input file $DIRJID/1$jid$dotdat not accessible" + fi + fi +else + if test ! -f $DIRJID/$jid$dotdat; then + if test "$jid" != "" ; then + error="$error +input file $DIRJID/$jid$dotdat not accessible" + fi + fi +fi + if test $nprocd -gt 1; then + if test "$host" ; then + if test ! -f $host; then + error="$error +host name file $host not accessible" + fi + fi + fi + +# +# check if the job is already running in the background +# +if test -f $DIRJOB/$jid.pid; then + error="$error +job is already running (the file $jid.pid exists)" +fi + +# +# if the program name is other than marc, then +# assume that this is a program in the users local directory +# + +bd=$MARC_BIN/ + +case $prog in + marc | MARC | $exefile) + program=$exefile + if test "$rid" + then + if test ! -f $DIRRID/$rid.t08 + then + error="$error +restart file $DIRRID/$rid.t08 not accessible" + fi + fi + if test "$pid" + then + if test ! -f $DIRPID/$pid.t16 + then + if test ! -f $DIRPID/$pid.t19 + then + error="$error +post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" + fi + fi + fi + if test "$user" + then + if test ! -f $user + then + error="$error +user subroutine file $user not accessible" + fi + fi + if test "$objs" + then + missingobjs= + for o in $objs + do + if test ! -f "$o" + then + if test -z "$missingobjs" + then + missingobjs="$o" + else + missingobjs="$missingobjs $o" + fi + fi + done + if test -n "$missingobjs" + then + error="$error +user object/library file(s) $missingobjs not accessible" + fi + fi + if test "$did" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRDID/1$did$dotdat + then + error="$error +defaults file $DIRDID/1$did$dotdat not accessible" + fi + else + if test ! -f $DIRDID/$did$dotdat + then + error="$error +defaults file $DIRDID/$did$dotdat not accessible" + fi + fi + fi + if test "$vid" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRVID/1$vid.vfs + then + error="$error +view factor file $DIRVID/1$vid.vfs not accessible" + fi + else + if test ! -f $DIRVID/$vid.vfs + then + error="$error +view factor file $DIRVID/$vid.vfs not accessible" + fi + fi + fi + if $mpioption + then + notok=true + for i in "$MPI_OTHER"; do + if test "$MARC_MPITYPE" = "$i"; then + notok=false + fi + done + if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then + notok=false + fi + if $notok; then + error="$error +incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" + fi + fi + ;; + *) + program=$prog.marc + case $prog in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + if test "$rid" + then + if test ! -f $DIRRID/$rid.t08 + then + error="$error +restart file $DIRRID/$rid.t08 not accessible" + fi + fi + if test "$pid" + then + if test ! -f $DIRPID/$pid.t16 + then + if test ! -f $DIRPID/$pid.t19 + then + error="$error +post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" + fi + fi + fi + if test "$user" + then + error="$error +program option may not be used with user subroutine" + fi + if test "$objs" + then + error="$error +program option may not be used with user objects or libraries" + fi + if test "$did" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRDID/1$did$dotdat + then + error="$error +defaults file $DIRDID/1$did$dotdat not accessible" + fi + else + if test ! -f $DIRDID/$did$dotdat + then + error="$error +defaults file $DIRDID/$did$dotdat not accessible" + fi + fi + fi + if test "$nauto" + then + if test $nauto -gt 2 + then + error="$error +incorrect option for auto restart " + fi + fi + if test "$ndcoup" + then + if test $ndcoup -gt 3 + then + error="$error +incorrect option for contact decoupling " + fi + fi + if test "$ndytran" + then + if test $ndytran -gt 1 + then + error="$error +incorrect option for Marc-Dytran Switch " + fi + fi + if $mpioption + then + if test ! -x $MARC_BIN/$exefile + then + error="$error +incorrect option for -mpi option: $MARC_MPITYPE " + fi + fi + ;; +esac + +############################################################################## +# check argument integrity # +############################################################################## + +if test "$jid" +then + : +else + if test "$user" + then +# allow user sub without giving job id + qid=foreground + verify=no + else + error="$error +job id required" +fi +fi + +if test $nprocd -gt 1 +then + if test $nauto -gt 0 + then + error="$error +cannot run DDM job with auto restart (-au) option " + fi +fi +case $qid in + S* | s*) + qid=short + ;; + L* | l*) + qid=long + ;; + V* | v*) + qid=verylong + ;; + B* | b*) + qid=background + ;; + F* | f*) + qid=foreground + ;; + A* | a*) + qid=at + ;; + *) + error="$error +bad value for queue_id option" + ;; +esac + +case $prgsav in + N* | n*) + prgsav=no + ;; + Y* | y*) + prgsav=yes + ;; + *) + error="$error +bad value for save option" + ;; +esac + +case $verify in + N* | n*) + verify=no + ;; + Y* | y*) + verify=yes + ;; + *) + error="$error +bad value for verify option" + ;; +esac + +case $nprocdddm in + -* ) + error="$error +bad value for nprocd option" + ;; +esac + +case $nt in + -* ) + error="$error +bad value for nt option" + ;; +esac + +case $itree in + -* ) + error="$error +bad value for itree option" + ;; +esac +case $iam in + -* ) + error="$error +bad value for iam option" + ;; +esac +case $compatible in + N* | n*) + compatible=no + ;; + Y* | y*) + compatible=yes + ;; + unknown) + ;; + *) + error="$error +bad value for comp option" + ;; +esac +case $cpinput in + N* | n*) + cpinput=no + ;; + Y* | y*) + cpinput=yes + ;; + *) + error="$error +bad value for copy input option" + ;; +esac +case $cpresults in + N* | n*) + cpresults=no + ;; + Y* | y*) + cpresults=yes + ;; + *) + error="$error +bad value for copy results option" + ;; +esac + +# +# check for external file to run +# +if test -f $MARC_TOOLS/run_marc_check +then + . $MARC_TOOLS/run_marc_check +fi + +############################################################################## +# interact with the user to get the required information to run marc or # +# other marc system program # +############################################################################## + +deletelog=yes +if test $qid = background -a $verify = no +then +echo \ +" +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid +User subroutine name : $user +User objects/libs : $objs +Restart file job ID : $rid +Substructure file ID : $sid +Post file job ID : $pid +Defaults file ID : $did +View Factor file ID : $vid +Save generated module: $prgsav +MPI library : $MPITYPE +DDM processes : $nprocdddmprint +Element loop threads : $nteprint +Solver processes : $nsolverprint +Solver threads : $ntsprint +GPGPU option : $gpuids +Host file name : $host" > $jid.log +if test "$iprintsimufact" = true ; then + echo "DDM with ARC Mapper : $ddm_arc" >> $jid.log +fi +echo \ +"Message passing type : $itree +Run job in queue : $qid +Run directory : $DIRJOB +Scratch directory : $DIRSCR +Memory limit in Mbyte: $memlimit +Auto Restart : $nauto " >> $jid.log +deletelog=no +fi +echo \ +" +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid +User subroutine name : $user +User objects/libs : $objs +Restart file job ID : $rid +Substructure file ID : $sid +Post file job ID : $pid +Defaults file ID : $did +View Factor file ID : $vid +Save generated module: $prgsav +MPI library : $MPITYPE +DDM processes : $nprocdddmprint +Element loop threads : $nteprint +Solver processes : $nsolverprint +Solver threads : $ntsprint" +if test "$iprintsimufact" = true ; then + echo "DDM with ARC Mapper : $ddm_arc" +fi +echo \ +"GPGPU option : $gpuids +Host file name : $host +Message passing type : $itree +Run job in queue : $qid +Run directory : $DIRJOB +Scratch directory : $DIRSCR +Memory limit in Mbyte: $memlimit +Auto Restart : $nauto" + + +case $qid in + s* | S* | l* | L* | v* | V* ) + echo \ +"Queue priority : $priority +Queue CPU limit : $cpu +Queue start time : $att" + ;; +# * ) +# echo \ +#" " +# ;; +esac + +if test "$modeoption" +then + error=$modeerror +fi + +if test "$error" +then + if test $verify = yes + then + $ECHO "$error + +Please correct or quit(correct,quit,): $ECHOTXT" + error= + read answer + case $answer in + q* | Q*) + answer=quit + ;; + *) + answer=correct + ;; + esac + else + $ECHO "$error + $ECHOTXT" + echo " " + if test "$deletelog" = no + then + $ECHO "$error + $ECHOTXT" >> $jid.log + echo " " >> $jid.log + fi + answer=quit + fi +else + if test $verify = yes + then + $ECHO " +Are these parameters correct (yes,no,quit,)? $ECHOTXT" + read answer + case $answer in + q* | Q*) + answer=quit + ;; + y* | Y*) + answer=yes + ;; + *) + answer=no + ;; + esac + else + answer=yes + fi +fi + +case $answer in + no | correct) + +############################################################################## +# prompt for each value # +############################################################################## + + $ECHO " +Program name ($prog)? $ECHOTXT" + read value + if test "$value" + then + prog=$value + fi + $ECHO "Job ID ($jid)? $ECHOTXT" + read value + if test "$value" + then + jid=`$BASENAME $value $dotdat` + DIRJID=`dirname $value` + case $DIRJID in + \/*) + ;; + *) + DIRJID=`pwd`/$DIRJID + ;; + esac + fi + $ECHO "User subroutine name ($user)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + user= + ;; + *) + user=$value + case $user in + \/*) + ;; + *) + user=`pwd`/$user + ;; + esac + usernoext=$user + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + ;; + esac + fi + $ECHO "User objects or libraries ($objs)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + objs= + ;; + *) + objs="$value" + ;; + esac + fi + $ECHO "Restart File Job ID ($rid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + rid= + ;; + *) + rid=`$BASENAME $value .t08` + DIRRID=`dirname $value` + case $DIRRID in + \/*) + ;; + *) + DIRRID=`pwd`/$DIRRID + ;; + esac + ;; + esac + fi + $ECHO "Substructure File ID ($sid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + sid= + ;; + *) + sid=$value + DIRSID=`dirname $value` + case $DIRSID in + \/*) + ;; + *) + DIRSID=`pwd`/$DIRSID + ;; + esac + ;; + esac + fi + $ECHO "Post File Job ID ($pid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + pid= + ;; + *) + pid=$value + DIRPID=`dirname $value` + case $DIRPID in + \/*) + ;; + *) + DIRPID=`pwd`/$DIRPID + ;; + esac + ;; + esac + fi + $ECHO "Defaults File ID ($did)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + did= + ;; + *) + did=`$BASENAME $value $dotdat` + DIRDID=`dirname $value` + case $DIRDID in + \/*) + ;; + *) + DIRDID=`pwd`/$DIRDID + ;; + esac + ;; + esac + fi + $ECHO "View Factor File ID ($vid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + vid= + ;; + *) + vid=`$BASENAME $value .vfs` + DIRVID=`dirname $value` + case $DIRVID in + \/*) + ;; + *) + DIRVID=`pwd`/$DIRVID + ;; + esac + ;; + esac + fi + $ECHO "Save generated module ($prgsav)? $ECHOTXT" + read value + if test "$value" + then + prgsav=$value + fi + $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" + read value + if test "$value" + then + nprocdddm=$value + nprocdddmprint=$value + fi + $ECHO "Run on ($nte) Element loop threads ? $ECHOTXT" + read value + if test "$value" + then + nte=$value + fi + $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" + read value + if test "$value" + then + nsolver=$value + fi + $ECHO "Run on ($nts) Solver threads ? $ECHOTXT" + read value + if test "$value" + then + nts=$value + fi +# + if test $nprocdddm -gt 0 + then + nprocd=$nprocdddm + fi + if test $nsolver -gt 0 + then + if test $nsolver -gt $nprocd + then + nprocd=$nsolver + fi + fi +# Element loop threads. + if test $nte -eq -1 + then + nte=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nte -lt 0 + then + nte=0 + fi + nteprint=$nte +# Copy from ddm + if test $nprocdddm -gt 1 + then + nteprint=$nprocdddm + fi +# override with -nthread_elem option + if test $nte -ne 0 + then + nteprint=$nte + fi +# check for minimum 1 threads per processes for DDM + if test $nprocdddm -ne 0 + then + if test $nteprint -lt $nprocdddm + then + nteprint=$nprocdddm + fi + fi + nte=$nteprint +# Solver threads. + if test $nts -eq -1 + then + nts=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nts -lt 0 + then + nts=0 + fi + ntsprint=$nts +# Copy from ddm + if test $nprocdddm -gt 1 + then + ntsprint=$nprocdddm + fi +# override with -nthread_solver option + if test $nts -ne 0 + then + ntsprint=$nts + fi +# check for minimum 1 threads per solver process. + if test $nsolver -lt $nprocdddm + then + if test $ntsprint -lt $nsolver + then + ntsprint=$nsolver + fi + else + if test $ntsprint -lt $nprocdddm + then + ntsprint=$nprocdddm + fi + fi + if test $ntsprint -eq 1 + then + set ntsprint=0 + fi + nts=$ntsprint + $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" + read value + if test "$value" + then + gpuids=$value + fi + if test "$gpuids" = "" ; then + gpuoption= + else + gpuoption="-gp $gpuids" + fi + if test "$gpuids" = "" ; then + export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH + else + MARCCUDALIBS=$MARCCUDALIBS2 + export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH + fi + if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" + then + export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" + fi +# + if test $nprocd -gt 1 + then + $ECHO "Message passing type ($itree)? $ECHOTXT" + read value + if test "$value" + then + itree=$value + fi + $ECHO "Host file name ($host)? $ECHOTXT" + read value + if test "$value" + then + host=$value + fi + if test $nprocdddm -gt 1 + then + $ECHO "Single input file? $ECHOTXT" + read value + case $value in + y* | Y*) + icreated=1 + nprocdarg=-nprocds + ;; + esac + $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" + read value + if test "$value" + then + compatible=$value + fi + $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" + read value + if test "$value" + then + cpinput=$value + fi + $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" + read value + if test "$value" + then + cpresults=$value + fi + fi + fi + $ECHO "Run the job in the queue ($qid)? $ECHOTXT" + read value + if test "$value" + then + qid=$value + fi + case $qid in + s* | S* | l* | L* | v* | V* ) + $ECHO "Queue priority ($priority)? $ECHOTXT" + read value + if test "$value" + then + priority=$value + fi + $ECHO "Job starts at ($att)? $ECHOTXT" + read value + if test "$value" + then + att=$value + fi + $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" + read value + if test "$value" + then + cpu=$value + fi + ;; + * ) + ;; + esac + $ECHO "Auto Restart option ($nauto)? $ECHOTXT" + read value + if test "$value" + then + nauto=$value + fi + $ECHO "Run directory ($DIRJOB)? $ECHOTXT" + read value + if test "$value" + then + DIRJOB=$value + DIRSCR=$DIRJOB + fi + $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" + read value + if test "$value" + then + DIRSCR=$value + fi + ;; + quit) + exit 1 + ;; + *) + break + ;; + +esac + + if test $nt -eq -1 + then + nt=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nt -lt 0 + then + nt=0 + fi + +done +# +if test $nt -eq 0 +then + ntarg= +fi +if test $nt -eq 0 +then + ntprint= +fi +if test $nt -eq 0 +then + nt= +fi + +if test $nte -eq 0 +then + ntearg= +fi +if test $nte -eq 0 +then + nteprint= +fi +if test $nte -eq 0 +then + nte= +fi + +if test $nts -eq 0 +then + ntsarg= +fi +if test $nts -eq 0 +then + ntsprint= +fi +if test $nts -eq 0 +then + nts= +fi +# +if test "$dllrun" -gt 0; then + exefile=exe_marc + prog=exe_marc + program=$exefile + bd=$MARC_BIN/ + if test "$user"; then + . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user + user= + pathdll=yes + if test $prgsav = no; then + rmdll=yes + fi + if test $prgsav = yes; then + cpdll=yes + rmdll=yes + fi + fi + + if test "$pathdll"; then +# +# reset share lib path +# + if test $MACHINENAME = "HP" + then + SHLIB_PATH=$DIRJOB:$SHLIB_PATH + export SHLIB_PATH + fi + if test $MACHINENAME = "IBM" + then + LIBPATH=$DIRJOB:$LIBPATH + export LIBPATH + fi +# + LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH + LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH + LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH + export LD_LIBRARY_PATH + export LD_LIBRARY64_PATH + export LD_LIBRARYN32_PATH + fi +fi +# end of dllrun>0 + + +if test $program = $exefile -o $program = $prog.marc +then + +# delete the old .log file unless we run in the background +if test "$deletelog" = yes +then + if test "$jid" + then + /bin/rm $jid.log 2>/dev/null + fi +else + echo + echo running the job in the background, see $jid.log + echo +fi + +# +# check if this is an autoforge or rezoning or radiation job +# +if test $nprocd -eq 1 -a "$jid" + +then + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` + if test "$line" + then + autoforge=1 + fi + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` + if test "$line" + then + autoforge=1 + fi + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` + if test "$line" + then + autoforge=1 + fi +fi +# +# check that jobname for restarted run is not the same +# as restart file basename +# +if test "$rid" +then + if test "$jid" = "$rid" + then + echo " " + echo "ERROR: job name of current run is the same as job name" + echo " of the restarted job" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "ERROR: job name of current run is the same as job name" >> $jid.log + echo " of the restarted job" >> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi +fi + +# +# user objects/libraries used +# + + if test "$objs" + then + program="$DIRJOB/$jid.marc" + case $program in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + link=yes + fi + +# +# user subroutine used +# +# add DAMASK options for linking + DAMASK="-lstdc++" + + if test "$user" + then + program=$usernoext.marc + case $program in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + link=yes + fi + +# +# Special case for IBM using POE but not an SP machine +# in this case we always need a host file, also for serial jobs. +# +if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP +then + MP_HOSTFILE=${jid}.host + if test -f $jid.host + then + /bin/rm $jid.host 2> /dev/null + fi + if test $nprocd -gt 1 + then + numdom=$nprocd + while test $numdom -gt 0 + do + hostname -s >> $MP_HOSTFILE + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + else + hostname -s > $MP_HOSTFILE + fi +fi +# +# check ssh for all hosts in host file +# +if test $nprocd -gt 1 +then +if test $MPITYPE = "intelmpi" -a "$INTELMPI_VERSION" = "HYDRA" + then +# get host list + if test "$host" + then + line=`grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' | uniq` +# count failing hosts + counter=0 + for i in $line + do + $RSH -o BatchMode=yes -o ConnectTimeout=10 $i uname -n + status=$? + if [[ $status != 0 ]] ; then + counter=$((counter+1)) + if [ "$counter" = "1" ]; then + echo " " + echo " error - connection test failed... " + echo " " + fi + echo " " + echo " connection test with ssh failed on host $i" + echo " check the following command: ssh $i uname -n " + echo " " + fi + done +# echo error message and quit + if test $counter -ne 0 + then + echo " " + echo " A parallel job using IntelMPI cannot be started. " + echo " The ssh command must be working correctly between " + echo " the computers used in the analysis. Furthermore, " + echo " it must be set up such that it does not prompt the " + echo " user for a password. " + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo " A parallel job using IntelMPI cannot be started. ">> $jid.log + echo " The ssh command must be working correctly between ">> $jid.log + echo " the computers used in the analysis. Furthermore, ">> $jid.log + echo " it must be set up such that it does not prompt the ">> $jid.log + echo " user for a password. ">> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + fi +fi +fi +# +# check correctness of host file; fix for user sub +# + if test $nprocd -gt 1 + then + +# construct the path name to the executable (execpath) + execpath=$MARC_BIN/$exefile + usersub=0 + if test $program = $prog.marc + then + execpath=$prog.marc + usersub=1 + fi + if test "$objs" + then + execpath="$DIRJOB/$jid.marc" + usersub=1 + fi + if test "$user" + then + execpath=$usernoext.marc + usersub=1 + fi + export execpath + execname=`$BASENAME $execpath` + + if test "$host" + then + userhost=$host + case $userhost in + \/* | \.\/*) + ;; + *) + userhost=`pwd`/$userhost + ;; + esac + +# check that the number of processes specified in the hostfile is +# equal to nprocd specified by -nprocd. + numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` + if test $nprocd -ne $numproc + then + echo " " + echo "error, the number of processes specified in the host file" + echo "must be equal to the number of processes given by -nprocd/-nsolver" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, the number of processes specified in the host file" >> $jid.log + echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + +# check for Myrinet that the number of processes per host is +# less than number of available user ports, 5 +# .gmpi directory must exist in user's home directory +# and must have write permission from remote hosts + if test $MPITYPE = "myrinet" + then + numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` + if test $numproc -gt 5 + then + echo " " + echo "error, for Myrinet the number of processes specified " + echo "in the hostfile must not exceed 5 for a hostname" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet the number of processes specified " >> $jid.log + echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + if test ! -d ~/.gmpi + then + echo " " + echo "error, for Myrinet a .gmpi directory must exist " + echo "under the user's home directory" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log + echo "under the user's home directory" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + homedir=`echo ~` + for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ + if test -s tmp.$$ + then + echo " " + echo "error, for Myrinet a shared .gmpi directory must exist " + echo "under the user's home directory " + echo "with remote write permission" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log + echo "under the user's home directory " >> $jid.log + echo "with remote write permission" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + else + /bin/rm tmp.$$ + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + fi + fi + done + fi + fi + +# construct the host file $jid.host which is used by mpirun +# skip lines starting with # and only consider lines with more than +# one word in them. Note that the hostfile given to this script +# has two columns: the host name and the number of shared processes +# to run on this host. mpirun wants the number of _other_ +# processes to run in addition to the one being run on the machine +# on which the job is started. hence the $2-1 for fnr == 1. + if test -f $jid.host + then + /bin/rm $jid.host 2> /dev/null + fi + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then +# HPMPI or HP hardware MPI + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ + -v mpihpspecial="$MPIHPSPECIAL" \ +'{if ( NF > 0) {\ + fnr++ ; \ + printf("-h %s -np %s",$1,$2); \ + printf(" %s",mpihpspecial); \ + if ( NF == 2 ) printf(" %s\n",path);\ + if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ + if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ + }\ + }' > $jid.host +# end HPMPI or HP hardware MPI + elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP + then +# IBM using hardware MPI (POE) + MP_HOSTFILE=$jid.host + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host +# end IBM using hardware MPI (POE) +# for Intel MPI, need to create a machinefile for DMP + elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then +# Intel MPI + if test -f $jid.mfile + then + /bin/rm $jid.mfile 2> /dev/null + fi + /bin/cp $host $jid.host + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile +# end Intel MPI for DMP +# for Solaris HPC 7.1, need to create a machinefile for DMP + elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" + then +# Solaris HPC 7.1 + if test -f $jid.mfile + then + /bin/rm $jid.mfile 2> /dev/null + fi + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile +# end Solaris HPC 7.1 for DMP +# for Myrinet, construct a configuration file in ~/.gmpi +# this must be readable by each process +# format is (hostname) (port number) for each process + elif test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + echo $nprocd > ~/.gmpi/$jid.host + grep -v '^#' $host | $AWK \ +'BEGIN {iport[0] = 2; \ + iport[1] = 4; \ + iport[2] = 5; \ + iport[3] = 6; \ + iport[4] = 7 \ + } \ +{if ( NF > 0 ) \ + for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ +}' >> ~/.gmpi/$jid.host + else +# this is for mpich-1.2.5 and later, using the -pg option +# format: host nproc executable user arguments +# the arguments are added later + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ +'{if ( NF > 0) {\ + fnr++ ; \ + if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ + else printf("%s %s",$1,$2); \ + if ( NF == 2 ) printf(" %s %s\n",path,user);\ + if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ + if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ + }\ + }' > $jid.host + fi +# end Myrinet + elif test $MACHINENAME = DEC -a $MPITYPE = hardware + then +# Compaq MPI via Memory Channel + grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host +# end Compaq MPI + else +# MPICH + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ +'{if ( NF > 0) {\ + fnr++ ; \ + if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ + else printf("%s %s",$1,$2); \ + if ( NF == 2 ) printf(" %s\n",path);\ + if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ + if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ + }\ + }' > $jid.host + fi +# define the variable host and host_filt +# host_filt is used for loops over hosts +# for Myrinet we need to use a filtered variant of userhost +# for others we can use $host + if test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + host=~/.gmpi/$jid.host + host_filt=$jid.host_tMp + grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt + else + host=$jid.host + host_filt=$host + fi + else + host=$jid.host + host_filt=$host + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + host_filt=$jid.mfile + fi + fi +# figure out if the machines in the hostfile are nfs mounted +# or distributed and set the variable "dirstatus" accordingly. +# only perform the check if user subroutine is used +# or a user subroutine executable is used + + numfield=1 + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then + numfield=2 + fi + DIR1=$DIRJOB + if test $program = $prog.marc -o -n "$user" -o -n "$objs" + then + counter=0 + echo " " + echo "checking if local or shared directories for host" + if test "$deletelog" = no + then + echo "checking if local or shared directories for host" >> $jid.log + fi + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + dirstatus[$counter]="shared" + $ECHO " $i $ECHOTXT" + if test "$deletelog" = no + then + $ECHO " $i $ECHOTXT" >> $jid.log + fi + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ + if test -s tmp.$$ + then + dirstatus[$counter]="local" + /bin/rm tmp.$$ + else + if test ! -f $jid.$$ + then + dirstatus[$counter]="local" + $RSH $i /bin/rm $DIR1/$jid.$$ + else + /bin/rm $jid.$$ + fi + fi + if test -f tmp.$$ + then + /bin/rm tmp.$$ + fi + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + echo " ${dirstatus[$counter]}" + if test "$deletelog" = no + then + echo " ${dirstatus[$counter]}" >> $jid.log + fi + fi + done + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + fi + fi + +# figure out if this is a compatible set of machines +# unless explicitly specified with flag -comp +# only perform the check if user subroutine is used +# or a user subroutine executable is used +# Myrinet does not support heterogeneous + if test $program = $prog.marc -o -n "$user" -o -n "$objs" + then + if test $compatible = "unknown" + then + thisname=$ARCH + compatible=yes + counter=0 + echo "checking if machines are compatible for host" + if test "$deletelog" = no + then + echo "checking if machines are compatible for host" >> $jid.log + fi + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + compstatus[$counter]="yes" + $ECHO " $i $ECHOTXT" + if test "$deletelog" = no + then + $ECHO " $i $ECHOTXT" >> $jid.log + fi + othername=`$RSH $i uname -a | cut -f 1 -d " "` + if test $thisname != $othername + then + compatible=no + compstatus[$counter]="no" + fi + fi + echo " ${compstatus[$counter]}" + if test "$deletelog" = no + then + echo " ${compstatus[$counter]}" >> $jid.log + fi + done + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + fi + else + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + compstatus[$counter]=$compatible + fi + done + if test $compatible = "no" + then + echo "all machines assumed incompatible" + if test "$deletelog" = no + then + echo "all machines assumed incompatible" >> $jid.log + fi + else + echo "all machines compatible" + if test "$deletelog" = no + then + echo "all machines compatible" >> $jid.log + fi + fi + fi +# error out if user objects or libraries are used on incompatible machines + if test "$compatible" = "no" -a -n "$objs" + then + echo "User object/libraries cannot be used in a parallel job on incompatible machines" + if test "$deletelog" = no + then + echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log + fi + exit 1 + fi +# modify new host file if NFS mounted heterogeneous machine + doit= + if test $program = $prog.marc + then + doit=yes + fi + if test "$user" + then + doit=yes + fi + if test "$doit" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + $AWK -v hst=$i '{fnr++ ; \ +if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ +printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} + /bin/mv $jid.host{$$} $jid.host + host=$jid.host + fi + fi + done + fi + fi # if test $program = $prog.marc -o $user -o $obj + + else # if test $host + # assume shared memory machine if no hostfile given and + # MPITYPE is set to mpich or Myrinet + # check for Myrinet that the total number of processes is + # less than number of available user ports, 5 + if test $MPITYPE = "mpich" -o $MPITYPE = "scali" + then + numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` + echo `hostname` $numproc $execpath > $jid.host + host=$jid.host + elif test $MPITYPE = "myrinet" + then + if test $nprocd -gt 5 + then + echo " " + echo "error, for Myrinet the number of processes " + echo "must not exceed 5 for a hostname" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet the number of processes " >> $jid.log + echo "must not exceed 5 for a hostname" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + echo $nprocd > ~/.gmpi/$jid.host + echo `hostname` $nprocd | $AWK \ +'BEGIN {iport[0] = 2; \ + iport[1] = 4; \ + iport[2] = 5; \ + iport[3] = 6; \ + iport[4] = 7 \ + } \ + {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ +' >> ~/.gmpi/$jid.host + host=~/.gmpi/$jid.host + else + numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` + echo `hostname` $numproc $execpath > $jid.host + + fi + fi # if test myrinet + + fi # if test $host + + fi # if test $nprocd -gt 1 + +fi # if test $program = $exefile -o $program = $prog.marc + +############################################################################## +# construct run stream (Marc only) # +############################################################################## + +# set maximum message length for ddm to a large number +# for vendor provided mpi +if test $itree -eq 0 -a $MPITYPE = hardware +then + itree=100000000 + if test $MACHINENAME = SGI + then + itree=100000001 + fi +fi +if test $itree -eq 0 -a $MPITYPE = hpmpi +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = myrinet +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = nec +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = scali +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = intelmpi +then + itree=100000000 +fi +if test $nprocdddm -lt 2 +then + nprocdarg= +else + nprocdarg="$nprocdarg $nprocdddm" +fi +if test $nsolver -eq 0 +then + nsolverarg= +else + nsolverarg="$nsolverarg $nsolver" +fi +if test $nprocdddm -lt 2 -a $nsolver -eq 0 +then +nprocd=0 +fi +if test $nprocd -gt 0 +then + if test "$host" + then + if test -z "$RUN_JOB2" + then + echo " " + echo "error: parallel job attempted on non-parallel version," + echo " or, if parallel version is installed, the include " + echo " file is probably corrupted" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error: parallel job attempted on non-parallel version," >> $jid.log + echo " or, if parallel version is installed, the include " >> $jid.log + echo " file is probably corrupted" >> $jid.log + echo " " >> $jid.log + fi + exit + fi + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then + RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP + then + RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" + RUN_JOB=" -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + elif test $MACHINENAME = DEC -a $MPITYPE = hardware + then + RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + numhost=`uniq $jid.mfile | wc -l` + if test "$INTELMPI_VERSION" = "HYDRA" + then + RUN_JOB_TMP="$RUN_JOB2 -configfile $jid.cfile" + else + export I_MPI_JOB_CONTEXT=$$ + mpdboot -n $numhost -r $RSH -f $jid.mfile + RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" + fi + +# intelmpi uses configfile. format: +# -host host1 -n n1 executable marcargs +# one such line per host +# collect the marcargs in RUN_JOB and construct the config file later +# collect the run stream in RUN_JOB_TMP + RUN_JOB="-jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + + + elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" + then + RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + if test "$userhost" + then + RUN_JOB="$RUN_JOB -mhost $userhost" + fi + if test $MPITYPE = "scali" + then +# set default working directory to /tmp to allow +# different directory names + SCAMPI_WORKING_DIRECTORY=/tmp + export SCAMPI_WORKING_DIRECTORY + fi + else + if test -z "$RUN_JOB1" + then + echo " " + echo "error: parallel job attempted on non-parallel version," + echo " or, if parallel version is installed, the include " + echo " file is probably corrupted" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error: parallel job attempted on non-parallel version," >> $jid.log + echo " or, if parallel version is installed, the include " >> $jid.log + echo " file is probably corrupted" >> $jid.log + echo " " >> $jid.log + fi + exit + fi + RUNNPROCD=$nprocd + if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" + then + RUNNPROCD= + MP_PROCS=$nprocd + export MP_PROCS + fi + if test $MPITYPE = "myrinet" + then + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + echo " " > /dev/null + else + export I_MPI_JOB_CONTEXT=$$ + mpdboot -n 1 -f $jid.hosts + fi + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + fi +else + if test $nauto -gt 0 -o $ndcoup -gt 0 + then + RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ +-maxnum $MAXNUM \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else +# this is for a serial job without auto restart: + RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ +-maxnum $MAXNUM \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi +fi +if test "$rid" +then + RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" +fi +if test "$pid" +then + RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" +fi +if test "$sid" +then + RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" +fi +if test "$did" +then + RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" +fi +if test "$vid" +then + RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" +fi +if test $nauto -gt 0 +then + RUN_JOB="$RUN_JOB -autorst $nauto " +fi +if test $ndcoup -gt 0 +then + RUN_JOB="$RUN_JOB -dcoup $ndcoup " +fi +if test $ndytran -gt 0 +then + RUN_JOB="$RUN_JOB -dytran $ndytran " +fi +if test $mesh -gt 0 +then + RUN_JOB="$RUN_JOB -me $mesh " +fi +if test $noutcore -gt 0 +then + RUN_JOB="$RUN_JOB -outcore $noutcore " +fi +if test "$dllrun" -gt 0 +then + RUN_JOB="$RUN_JOB -dll $dllrun " +fi +if test "$trkrun" -gt 0 +then + RUN_JOB="$RUN_JOB -trk $trkrun " +fi +if test "$iam" +then + RUN_JOB="$RUN_JOB -iam $iam " +fi +if test "$justlist" +then + RUN_JOB="$RUN_JOB -list 1 " +fi +if test "$feature" +then + RUN_JOB="$RUN_JOB -feature $feature " +fi +if test "$memlimit" -ne 0 +then + RUN_JOB="$RUN_JOB -ml $memlimit " +fi +if test "$cpinput" +then + RUN_JOB="$RUN_JOB -ci $cpinput " +fi +if test "$cpresults" +then + RUN_JOB="$RUN_JOB -cr $cpresults " +fi +if test "$DIRSCR" != "$DIRJOB" +then + RUN_JOB="$RUN_JOB -dirscr $DIRSCR" +else + DIRSCR=$DIRJOB +fi +if test "$makebdf" +then + RUN_JOB="$RUN_JOB -bdf $makebdf " +fi +if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" +then + # append $RUN_JOB to all lines of the host file + # and set RUN_JOB + $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ + /bin/mv $host.$$ $host + RUN_JOB=$RUN_JOB_TMP +fi +if test $MPITYPE = "intelmpi" -a "$host" +then + # construct config file, append $RUN_JOB to all lines of the config file + # and set RUN_JOB + if test "$INTELMPI_VERSION" = "HYDRA" + then + grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ + '{if ( NF > 0) {\ + printf(" -host %s",$1); \ + printf(" -n %s",$2); \ + if ( NF == 2 ) printf(" %s",path);\ + if ( NF >= 3 ) printf(" -wdir %s ",$3); \ + if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ + printf(" %s\n",args); \ + }\ + }' > $jid.cfile + else + grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ + '{if ( NF > 0) {\ + printf("-host %s -n %s",$1,$2); \ + if ( NF == 2 ) printf(" %s",path);\ + if ( NF >= 3 ) printf(" -wdir %s ",$3); \ + if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ + printf(" %s\n",args); \ + }\ + }' > $jid.cfile + fi + RUN_JOB=$RUN_JOB_TMP +fi +echo " " +echo "Final run stream value" +echo " RUNJOB="$RUN_JOB +if test "$deletelog" = no +then +echo " " >> $jid.log +echo "Final run stream value" >> $jid.log +echo " RUNJOB="$RUN_JOB >> $jid.log +fi + + +############################################################################## +# run marc using valgrind # +############################################################################## +#RUN_JOB="valgrind $RUN_JOB" +#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" +#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" +#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" +############################################################################## + + +############################################################################## +# run the requested program in a queue # +############################################################################## + +if test "$deletelog" = yes +then + echo + date +else + echo >> $jid.log + date >> $jid.log +fi +if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] +then + +/bin/rm -f $jid.runmarcscript + + +# +# compile user subroutine if present +# +if test "$link" +then + if test -z "$FCOMPROOT"; then + echo "$0: No compiler available" + echo + echo " $PRODUCT Exit number 3" + exit 1 + fi + echo + echo "Using compiler from: $FCOMPROOT" + echo + if test "$user" + then + userobj=$usermoext.o + fi + cat > $jid.runmarcscript << END4 + if test "$user" + then + if test $MACHINENAME = "CRAY" + then + $DFORTRAN $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTRAN $user -o $userobj || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + $SOLVERLIBS \ + $MARCCUDALIBS \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $DAMASK \ + $SYSLIBS \ + $SFLIB \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 + } +END4 +else + prgsav=yes +fi +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null + +# +# run marc +# + +cat >> $jid.runmarcscript << END5 + +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi + +# first remove all .out files and incremental restart files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test \$numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null + numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null + /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null +fi + +if test $nprocdddm -gt 1 +then + $RUN_JOB 2>>$jid.log +else + $RUN_JOB 2>>$jid.log +fi + +if test $dllrun -eq 0; then + if test $prgsav = no + then + /bin/rm -f $bd$program 2>/dev/null + fi +else + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes + then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi + +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test \$numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +fi +END5 + + +# Submit to marc batch queue +# +if [ $qid = at ] +then +QUENAME=at +SUBMCMD= +else +# +# Submit to qsub queue +# +QUENAME=qsub +SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" +if test "$priority" +then + SUBMCMD=$SUBMCMD" -p $priority" +fi +if test "$att" +then + SUBMCMD=$SUBMCMD" -a $att" +fi +if test "$cpu" +then + SUBMCMD=$SUBMCMD" -lt $cpu" +fi + +fi +echo $QUENAME $SUBMCMD +#cat $jid.runmarcscript +$QUENAME $SUBMCMD < $jid.runmarcscript + +/bin/rm -f $jid.runmarcscript + +############################################################################## +# run the requested program in the background # +############################################################################## + +else +if test $qid = background +then + +# +# first remove all old .out files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null +fi +# +# compile user subroutine if present +# +( +if test "$link" +then + if test -z "$FCOMPROOT"; then + echo "$0: No compiler available" + echo + echo " $PRODUCT Exit number 3" + exit 1 + fi + echo + echo "Using compiler from: $FCOMPROOT" + echo + if test "$user" + then + # compile and link on other hosts in $host if compstatus=no + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${compstatus[$counter]} = "no" + then + DIR1=$DIRJOB + DIR2=$DIR + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + marcdir=`echo $line | $AWK '{print $4}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -n "$marcdir" + then + DIR2=$marcdir + fi + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then + $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" + then + hname=_$ibase + else + hname= + fi + remoteprog=$DIR1/${execname}$hname + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo + $RSH $i $DIR2/tools/comp_damask $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else + echo "$0: compile failed for $user on host $i" + echo " $PRODUCT Exit number 3" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi + done + fi + fi + if test "$userhost" + then + echo + echo "Compiling and linking user subroutine $user on host `hostname`" + fi + userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then + $DFORTRAN $user || \ + { + echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTRAN $user -o $userobj || \ + { + echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi # if test $user + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $DAMASK \ + $SYSLIBS \ + $SFLIB \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + echo " $PRODUCT Exit number 3" + exit 1 + } + # copy user subroutine executable for hosts using local working dir + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" + then + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + echo "Copying executable to host ${i}" + $RCP $program ${i}:${DIR1}/ + fi + fi + done + fi + fi +else # if test $link + prgsav=yes +fi # if test $link +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null + +# +# run marc + +# + +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi + +# for DDM with ARC support + +if test $ddm_arc -gt 0; then + RUN_JOB="$MESHERDIR/sf_exeddm $RUN_JOB -ddm $ddm_arc " +fi + + +$RUN_JOB & + +marcpid=$! +echo $marcpid > $DIRJOB/$jid.pid +wait $marcpid + +if test $nprocd -gt 1 +then + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + if test "$host" + then + /bin/rm $jid.mfile 2> /dev/null + /bin/rm $jid.hosts 2> /dev/null + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.cfile 2> /dev/null + fi + fi + fi +fi + + +if test $dllrun -eq 0; then +if test $prgsav = no +then + /bin/rm -f $bd$program 2>/dev/null + # for network run, remove executable on remote machines + # and executables with modified name + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + if test -f "$host_filt" + then + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + # if an incompatible host uses shared directory, + # then the root machine deletes the executable + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + hname=_$ibase + /bin/rm ${execname}$hname + fi + # if local directory used, the remote machine + # deletes the executable + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null + fi + fi + done + fi + fi +fi +fi +else +#dllrun >0 + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sin 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + if test $MPITYPE = "myrinet" + then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi + fi +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + /bin/rm $DIRJOB/$jid.sle 2>/dev/null + /bin/rm $DIRJOB/$jid.sin 2>/dev/null +fi +) 1>>$jid.log 2>&1 & + + +############################################################################## +# run the requested program in the foreground # +############################################################################## + +else + +# +# compile user subroutine if present +# +if test "$link" +then + if test -z "$FCOMPROOT"; then + echo "$0: No compiler available" + echo + echo " $PRODUCT Exit number 3" + exit 1 + fi + echo + echo "Using compiler from: $FCOMPROOT" + echo + if test "$user" + then + # compile and link on other hosts in $host if compstatus=no + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${compstatus[$counter]} = "no" + then + DIR1=$DIRJOB + DIR2=$DIR + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + marcdir=`echo $line | $AWK '{print $4}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -n "$marcdir" + then + DIR2=$marcdir + fi + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then + $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" + then + hname=_$ibase + else + hname= + fi + remoteprog=$DIR1/${execname}$hname + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo + $RSH $i $DIR2/tools/comp_damask $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else + echo "$0: compile failed for $user on host $i" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi + done + fi + fi + if test "$userhost" + then + echo + echo "Compiling and linking user subroutine $user on host `hostname`" + fi + userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then + $DFORTRAN $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTRAN $user -o $userobj || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi # if test $user + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $DAMASK \ + $SYSLIBS \ + $SFLIB \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 + } + # copy user subroutine executable for hosts using local working dir + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" + then + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + echo "Copying executable to host ${i}" + $RCP $program ${i}:${DIR1}/ + fi + fi + done + fi + fi +else # if test $link + prgsav=yes +fi # if test $link +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null +# done if no job id given +if test -z "$jid" +then + echo + echo only compilation requested + echo + exit +fi +# +# run marc +# +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi +# first remove all .out files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null +fi + +# for DDM with ARC support + +if test $ddm_arc -gt 0; then + RUN_JOB="$MESHERDIR/sf_exeddm $RUN_JOB -ddm $ddm_arc " +fi + + $RUN_JOB + +if test $nprocd -gt 1 +then + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + if test "$host" + then + /bin/rm $jid.mfile 2> /dev/null + /bin/rm $jid.hosts 2> /dev/null + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.cfile 2> /dev/null + else + echo " " > /dev/null + fi + else + if test "$host" + then + mpdcleanup -a -f $jid.mfile + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.mfile 2> /dev/null + else + mpdcleanup -a -f $jid.hosts + /bin/rm $jid.hosts 2> /dev/null + fi + fi + fi +fi + +if test $dllrun -eq 0; then +if test $prgsav = no +then + /bin/rm -f $bd$program 2>/dev/null + # for network run, remove executable on remote machines + # and executables with modified name + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + if test -f "$host_filt" + then + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + # if an incompatible host uses shared directory, + # then the root machine deletes the executable + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + hname=_$ibase + /bin/rm ${execname}$hname + fi + # if local directory used, the remote machine + # deletes the executable + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null + fi + fi + done + fi + fi +fi +fi +else +#dllrun >0 + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi + +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sin 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + if test $MPITYPE = "myrinet" + then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi + fi +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + /bin/rm $DIRJOB/$jid.sle 2>/dev/null + /bin/rm $DIRJOB/$jid.sin 2>/dev/null +fi + + +fi +fi diff --git a/installation/mods_MarcMentat/2016/Marc_tools/run_damask_h b/installation/mods_MarcMentat/2016/Marc_tools/run_damask_h new file mode 100644 index 000000000..9ca45c335 --- /dev/null +++ b/installation/mods_MarcMentat/2016/Marc_tools/run_damask_h @@ -0,0 +1,4096 @@ +#!/bin/ksh +############################################################################## +# # +# run_marc - run a marc job # +# ------------------------- # +# # +# usage: run_marc -j jid { options } # +# # +# where standard options are: required: defaults: # +# -------------------------- # +# # +# -j* jid job id number. ** YES ** . # +# -pr* prog program name. . marc # +# -v* y|n do or do not verify inputs. . yes # +# -q* s|l|v|b|f batch queue name or background, . short # +# foreground. # +# -b* as alternative to option -q* # +# # +# ( batch queues only : # +# -pq* intra queue priority. . . # +# -at DATE/TIME delay start of job. . . # +# format : January,1,1990,12:31 # +# or : today,5pm # +# -cpu* secs job CPU limit . . ) # +# # +# -r* rid restart file job id. . . # +# -si* sid substructure file id. . . # +# -pi* post post file job id. . . # +# -de* did defaults file . no # +# -vf vid viewfactor . no # +# # +# -u* user user subroutine. . . # +# -obj obj user objects or libraries. . . # +# -sa* y|n do or do not save load module. . no # +# -autorst auto restart flag for auto forge . no # +# -me manual remeshing control . no # +# -ml memory limit in Mbyte # +# -mo This option is deprecated. As of Marc 2015, only # +# the integer*8 version is available. # +# -mpi selects MPI version # +# each platform has a default MPI version and some # +# have an alternative version. see the include file # +# for the respective platform # +# MPI_DEFAULT defines the default MPI version # +# MPI_OTHER defines versions one can switch to # +# -dcoup for contact decoupling # +# currently not supported # +# -dir directory where the job i/o should take place. # +# defaults to current directory. # +# -sdir directory where scratch files are created # +# defaults to current directory. # +# # +# -alloc only perform memory allocation test, no analysis # +# -list y only list options in the input file, no analysis # +# -fe num set feature number "num" for the run. only one allowed # +# -dytran flag to switch from Dytran to Marc # +# dytran = 0, program will run w/o Marc-Dytran Switch # +# = 1, program will restart Marc after Dytran run # +# >= 2, Not supported yet. # +# currently not supported # +# -ou force analysis to use out-of-core control # +# =0, not used # +# =1, element storage out-of-core # +# -dll run marc using shared library libmarc.so and exe_marc # +# =1, used # +# =2, do not free streaming input memory # +# =3, run with marc input deck # +# -trk run marc for post-tracking # +# -gpuid run marc using GPGPU capability # +# specify gpuid on to be used in the analysis. Multiple # +# IDs may be assigned for DDM runs. # +# Separate a list of IDs with a colon. Each DMP # +# process will be assigned a GPU ID in round robin fastion# +# = 0 # +# = 0:1 etc... # +# # +# where parallel options are: # +# -------------------------- # +# # +# itree, host, and comp options are available for the domain # +# decomposition only. # +# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # +# # +# # +# -nprocd number of domains. # +# defaults to single domain solution. # +# -nprocds number of domains if single input file. # +# defaults to single domain solution. # +# -nps same as -nprocds. # +# -nsolver number of solver tasks for solver types 12 and 13 # +# these are distributed tasks operating via MPI # +# -nthread_elem number of threads for element assembly and recovery # +# = 0: use defaults. # +# defaults to 1 for single domain solution. # +# defaults to number of domains for multi-domain # +# solution. # +# > 1: number of threads to be used by element assembly # +# recovery. # +# Also can be set through MARC_NUMBER_OF_THREADS # +# environment variable. # +# if both specified, -nthread_elem option will be used. # +# defaults if neither MARC_NUMBER_OF_THREADS environment # +# variable set nor -nthread_elem specified. # +# -nthread_solver number of threads for solver types 6, 8, and 11 # +# = 0: use defaults. # +# defaults to 1 for single domain solution. # +# defaults to number of domains for multi-domain # +# solution. # +# > 1: number of threads to be used by 6, 8, and 11 # +# Also can be set through MARC_NUMBER_OF_THREADS # +# environment variable. # +# if both specified, -nthread_solver option will be used. # +# defaults if neither MARC_NUMBER_OF_THREADS environment # +# variable set nor -nthread_solver specified. # +# -nthread Same as -nthread_solver. # +# -itree message passing tree type for domain decomposition. # +# for debugging purposes; should not normally be used. # +# -host hostfile name for distributed execution on network. # +# defaults to no hostfile, unless jobid.defhost exists. # +# if jobid.defhost exists, only -np(s) necessary # +# -comp* y|n to be used with user routines on a network of # +# incompatible machines. # +# if set to no, a separate executable will be created # +# for each machine on the network. # +# if set to yes, the executable located on the machine # +# from which marc is started will be used on all machines.# +# defaults to no if O/S versions different on machines. # +# # +# -ci y|n copy input files to remote hosts (default: yes) # +# if "yes", input files are automatically copied to # +# remote hosts for a network run if necessary. # +# -cr y|n copy post files from remote hosts (default: yes) # +# if "yes", post files are automatically copied back from # +# remote hosts for a network run if necessary. # +############################################################################## +# set DIR to the directory in which this script is +REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" +DIR=`dirname $REALCOM` +# make sure DIR has an absolute path +case $DIR in + \/*) + ;; + *) + DIR=`pwd`/$DIR + ;; +esac +DIRSCRIPT=$DIR +AWK=awk +ARCH=`uname -a | cut -f 1 -d " "` +# Sun has a bad awk, use nawk instead +if test $ARCH = "SunOS" +then + AWK=nawk +fi +BASENAME=basename +# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists +if test $ARCH = "SunOS" +then + if test -x /usr/ucb/basename + then + BASENAME=/usr/ucb/basename + fi +fi + +# echo command line in the case of ECHO_COMMAND is true +if test "$ECHO_COMMAND" = true ; then + echo command "$0" "$@" +fi + +# +# "mode" selects version, i4 or i8 +# default is i4 +# this can be changed by a file run_marc_defaults +# located in the tools directory of the Marc installation +# or in the user's home directory +# format: +# MARC_MODE i8 +# it can also be set by the environmental variable MARC_INTEGER_SIZE +# and by the command line option "-mo" +# +mode= +modeerror= +modeoption= +if test -f $DIRSCRIPT/run_marc_defaults; then + line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $DIRSCRIPT/run_marc_defaults` + if test "$line" = "MARC_MODE"; then + echo + echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available + echo + line= + fi + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + modeerror="defaults file $DIRSCRIPT/run_marc_defaults used mode $line ; this must be i8" + modeoption=error + echo $modeerror + fi + if test "$line" = "i8"; then + mode=i8 + fi +fi +if test -f $HOME/run_marc_defaults; then + line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $HOME/run_marc_defaults` + if test "$line" = "MARC_MODE"; then + echo + echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available + echo + line= + fi + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + modeerror="defaults file $HOME/run_marc_defaults used mode $line ; this must be i8" + modeoption=error + echo $modeerror + fi + if test "$line" = "i8"; then + mode=i8 + fi +fi +if test -n "$MARC_INTEGER_SIZE" ; then + mode=$MARC_INTEGER_SIZE +fi +if test -z "$mode" ; then + mode=i8 +fi +case $mode in + i4) + modeerror="bad value for MARC_INTEGER_SIZE variable; only i8 is supported." + modeoption=error + echo $modeerror + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo "bad value for MARC_INTEGER_SIZE variable; only i8 is supported." + exit + ;; +esac + +setmode=false +for arg in $* ; do + if $setmode ; then + mode=$arg + case $mode in + i4) + modeerror="bad value for mode option; only i8 is supported." + modeoption=error + echo + echo $modeerror + echo + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo " " + echo "error, version mode must be i8" + echo " " + echo " use -mo i8 " + echo " " + exit + ;; + esac + setmode=false + fi + if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then + echo + echo warning: the option -mo is deprecated, as of Marc 2015, only the integer*8 version is available + echo + setmode=true + fi + if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + fi + if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then + modeerror="bad value for mode option; only i8 is supported." + modeoption=error + echo + echo $modeerror + echo + fi +done + +# set to i4 version for 32 bit Linux +if test "`uname -s`" = "Linux"; then + if test "`uname -m`" = "i686"; then + mode=i4 + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + fi +fi + + +. "$DIR/getarch" + +. $MARC_INCLUDE +# + +# +# Dynamically determine the echo syntax +# + +case "`echo '\c'`" in + '\c') + ECHO='echo -n' + ECHOTXT=' ' + ;; + *) + ECHO='echo' + ECHOTXT=' \c' + ;; +esac + +# +# Variables for the MARC environment +# + +PRODUCT="Marc" +EXITMSG=$MARC_TOOLS/MESSAGES +export EXITMSG +FLEXDIR=$DIR/../flexlm/licenses +export FLEXDIR +TIMCHK=3600 +export TIMCHK +BINDIR=$MARC_BIN +export BINDIR +AFMATDAT=$MARC_RUNTIME/AF_flowmat/ +export AFMATDAT +export MESHERDIR +MSC_LICENSE_FINPROC=1 +export MSC_LICENSE_FINPROC +# +# define directory path to global unified material database +# +MATFILE= +export MATFILE + +# +# define memory limit +# first set to MEMLIMIT from include +# -ml option overrules if specified +memlimit=$MEMLIMIT +# +# Define share library path based on platforms +# This is required for using the Patran Mesher +# +if test $MACHINENAME = "HP" +then + SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH + export SHLIB_PATH +fi +# the one for IBM is defined futher down + +LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$MESHERDIR:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$SFMATDIR:$LD_LIBRARY_PATH +LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH +LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH +export LD_LIBRARY_PATH +export LD_LIBRARY64_PATH +export LD_LIBRARYN32_PATH + +atexit() { +kill -15 $$ +# +if test $MPITYPE = "myrinet" +then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi +fi +} + +trap "atexit" 2 + +# +# defaults +# + +prog=marc +exefile=marc +jid= +rid= +pid= +sid= +did= +vid= +user= +usernoext= +objs= +qid=background +cpu= +priority= +att= +trk= +verify=yes +prgsav=no +rmdll=no +cpdll=no +progdll= +pathdll= +error= +nprocd=0 +nprocdddm=1 +nprocdddmprint= +icreated=0 +nprocdarg= +nsolver=0 +nsolverarg=-ns +if test $nprocds +then + if test $nprocds -gt 1 + then + nprocdddm=$nprocds + nprocdddmprint=$nprocds + icreated=1 + nprocdarg=-nprocds + fi +fi +ntprint=0 +nt=-1 +nte=-1 +nts=-1 +ntarg=-nt +ntearg=-nte +ntsarg=-nts +nteprint= +ntsprint= +gpuids= +nauto=0 +ndcoup=0 +ndytran=0 +noutcore=0 +dllrun=0 +mesh=0 +itree=0 +iam= +ddm_arc=0 +link= +trkrun=0 +DIRJOB=`pwd` +DIRSCR=$DIRJOB +DIRSCRSET= +autoforge=0 +dotdat=.dat +dotdefhost=.defhost +host= +numhost= +mfile= +userhost= +makebdf= +cpinput=yes +cpresults=yes +marcdll=libmarc.$EXT_DLL +# define hostname and strip off extensions (alpha.aaa.com) +thishost=`hostname` +thishost=${thishost%%.*} +compatible=unknown +numfield=1 +justlist= +feature= +mpioption=false +iprintsimufact= +MDSRCLIB=$MARC_LIB/mdsrc.a +# +# check run_marc_defaults file for default MPI setting +# located in the tools directory of the Marc installation +# or in the user's home directory +# format: +# MARC_MPI +# +value= +file= +if test -f $DIRSCRIPT/run_marc_defaults; then + value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` + value=`echo $value | $AWK '{print $NF}'` + if test -n "$value"; then + file=$DIRSCRIPT/run_marc_defaults + fi +fi +if test -f $HOME/run_marc_defaults; then + value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` + value=`echo $value | $AWK '{print $NF}'` + if test -n "$value"; then + file=$HOME/run_marc_defaults + fi +fi +if test -n "$value"; then + MARC_MPITYPE=$value + notok=true + for i in "$MPI_OTHER"; do + if test "$MARC_MPITYPE" = "$i"; then + notok=false + fi + done + if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then + notok=false + fi + if $notok; then + echo " " + echo " error, incorrect option for MARC_MPI" + echo " defined in $file: $MARC_MPITYPE" + echo " valid options: $MPI_DEFAULT $MPI_OTHER" + echo " " + exit + fi + if test "$value" != "$MPI_DEFAULT"; then + exefile=marc_$value + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a_$value + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" + fi + fi +fi +# +# +# allow scratch directory to be specified with environmental variable +# MARCSCRATCH +if test $MARCSCRATCH +then + if test -d $MARCSCRATCH + then + DIRSCR=$MARCSCRATCH + else + echo "error, scratch directory '$MARCSCRATCH'" + echo " specified via environmental variable MARCSCRATCH does not exist" + exit + fi +fi +# +############################################################################## +# parse input - arguments always come in pairs # +############################################################################## + +arg=$1 +if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then + shift + arg=$1 +fi +while [ -n "$arg" ] +do + shift + value=$1 + case $arg in + -al* | -AL*) + LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH + $MARC_BIN/marc -alloc 1 + exit + ;; + -li* | -LI*) + justlist=yes + ;; + -fe* | -FE*) + feature=$value + + ;; + -pr* | -PR*) + if test `dirname $value` = '.' + then + prog=`$BASENAME $value .marc` + progdll=`$BASENAME $value` + else + prog=`dirname $value`/`$BASENAME $value .marc` + progdll=`dirname $value`/`$BASENAME $value` + fi + prdir=`dirname $value` + case $prdir in + \/*) + ;; + *) + prog=`pwd`/$prdir/$prog + ;; + esac + ;; + -j* | -J*) + jid=`$BASENAME $value $dotdat` + DIRJID=`dirname $value` + case $DIRJID in + \/*) + ;; + *) + DIRJID=`pwd`/$DIRJID + ;; + esac + ;; + -r* | -R*) + rid=`$BASENAME $value .t08` + DIRRID=`dirname $value` + case $DIRRID in + \/*) + ;; + *) + DIRRID=`pwd`/$DIRRID + ;; + esac + ;; + -si* | -SI*) + sid=$value + DIRSID=`dirname $value` + case $DIRSID in + \/*) + ;; + *) + DIRSID=`pwd`/$DIRSID + ;; + esac + ;; + -pi* | -PI*) + if test -f $value.t19 + then + pid=`$BASENAME $value .t19` + else + pid=`$BASENAME $value .t16` + fi + DIRPID=`dirname $value` + case $DIRPID in + \/*) + ;; + *) + DIRPID=`pwd`/$DIRPID + ;; + esac + ;; + -bdf | -BDF) + makebdf=1 + ;; + -de* | -DE*) + did=`$BASENAME $value $dotdat` + DIRDID=`dirname $value` + case $DIRDID in + \/*) + ;; + *) + DIRDID=`pwd`/$DIRDID + ;; + esac + ;; + -vf | -VF) + vid=`$BASENAME $value .vfs` + DIRVID=`dirname $value` + case $DIRVID in + \/*) + ;; + *) + DIRVID=`pwd`/$DIRVID + ;; + esac + ;; + -u* | -U*) + user=$value + case $user in + \/*) + ;; + *) + user=`pwd`/$user + ;; + esac + usernoext=$user + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + ;; + -obj | -OBJ) + objs="$value" + ;; + -q* | -Q*) + qid=$value + ;; + -b* | -B*) + case $value in + y* | Y*) + qid=background + ;; + n* | N*) + qid=foreground + ;; + *) + ;; + esac + ;; + -at | -AT) + att=$value + ;; + -cpu* | -CPU*) + cpu=$value + ;; + -pq | -PQ*) + priority=$value + ;; + -v* | -V*) + verify=$value + ;; + -sa* | -SA*) + prgsav=$value + ;; + -np* | -NP*) + nprocdddm=$value + nprocdddmprint=$value + case $arg in + -nps* | -NPS* | -nprocds* | -NPROCDS*) + icreated=1 + nprocdarg=-nprocds + ;; + esac + case $arg in + -np | -NP | -nprocd | -NPROCD) + icreated=0 + nprocdarg=-nprocd + ;; + esac + ;; + -ns* | -NS*) + nsolver=$value + ;; + -nt* | -NT*) + case $arg in + -nte | -NTE | -nthread_e* | -NTHREAD_E*) + nte=$value + ;; + esac + case $arg in + -nts | -NTS | -nthread_s* | -NTHREAD_S*) + nts=$value + ;; + esac + case $arg in + -nt | -NT | -nth* | -NTH* | -nthread* | -NTHREAD*) + nt=$value + ;; + esac + ;; + -gp* | -GP*) + gpuids=$value + ;; + -it* | -IT*) + itree=$value + ;; + -iam | -IAM) + iam=$value + case $value in + sfg | sfm | sim) + iprintsimufact=true + ;; + esac + ;; + -au* | -AU*) + nauto=$value + ;; + -dc* | -DC*) + ndcoup=$value + ;; + -dy* | -DY*) + ndytran=$value + ;; + -ou* | -OU*) + noutcore=$value + ;; + -dll | -DLL) + dllrun=$value + ;; + -trk | -TRK) + trkrun=$value + ;; + -ddm | -DDM) + ddm_arc=$value + ;; + -me | -ME ) + mesh=$value + ;; + -ml | -ML ) + memlimit=$value + ;; + -mo | -MO ) + ;; + -mpi | -MPI ) + mpioption=true + MARC_MPITYPE=$value + if test "$value" != "$MPI_DEFAULT"; then + exefile=marc_$value + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a_$value + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" + fi + else + exefile=marc + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" + fi + fi + ;; + -dir* | -DIR*) + DIRJOB=$value + case $DIRJOB in + \/*) + ;; + *) + DIRJOB=`pwd`/$DIRJOB + ;; + esac + if test -z "$DIRSCRSET" + then + DIRSCR=$DIRJOB + fi + ;; + -sd* | -SD*) + DIRSCR=$value + DIRSCRSET=yes + case $DIRSCR in + \/*) + ;; + *) + DIRSCR=`pwd`/$DIRSCR + ;; + esac + ;; + -ho* | -HO*) + host=$value + ;; + -co* | -CO*) + compatible=$value + ;; + -ci* | -CI*) + cpinput=$value + ;; + -cr* | -CR*) + cpresults=$value + ;; + *) + error="$error +$arg: invalid option" + break + ;; + esac + case $value in + -*) + error="$error +$arg: invalid name $value" + break + ;; + esac + shift + arg=$1 + if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then + shift + arg=$1 + fi +done +argc=`expr $# % 2` +if test $argc -eq 1 +then +# +# odd number of arguments +# + error="$error +argument list incomplete" +fi + +if test $nprocdddm -gt 0 +then +nprocd=$nprocdddm +fi + +if test $nsolver -gt 0 +then + if test $nsolver -gt $nprocd + then + nprocd=$nsolver + fi +fi +# Set defaults +if test $nt -eq -1 +then +nt=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nt -lt 0 +then +nt=0 +fi +if test $nte -eq -1 +then +nte=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nte -lt 0 +then +nte=0 +fi +if test $nts -eq -1 +then +nts=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nts -lt 0 +then +nts=0 +fi +# +# set number of element loop threads +# +ntprint=$nt +nteprint=$nte +# copy from -nprocd[s] +if test $nprocdddm -gt 1 +then + nteprint=$nprocdddm +fi +# override with -nthread_elem option +if test $nte -ne 0 +then +nteprint=$nte +fi +# check for minimum 1 threads per processes for DDM +if test $nprocdddm -gt 1 +then + if test $nteprint -lt $nprocdddm + then + nteprint=$nprocdddm + fi +fi +nte=$nteprint +# +# set number of Solver threads +# +ntsprint=$nts +# copy from -nthread or -nprocd[s] +if test $ntprint -ne 0 +then + ntsprint=$ntprint +else + if test $nprocdddm -gt 1 + then + ntsprint=$nprocdddm + fi +fi +# override with -nthread_solver option +if test $nts -ne 0 +then + ntsprint=$nts +fi +# check for minimum 1 threads per solver process. +if test $nsolver -lt $nprocdddm +then + if test $ntsprint -lt $nsolver + then + ntsprint=$nsolver + fi +else + if test $ntsprint -lt $nprocdddm + then + ntsprint=$nprocdddm + fi +fi +if test $ntsprint -eq 1 +then + set ntsprint=0 +fi +nts=$ntsprint + +# set stack size for multi-threading. +export KMP_MONITOR_STACKSIZE=7M +export OMP_STACKSIZE=7M + +# +# deprecate -nthread option at arugment of marc +nt=0 +# Reset nprocdddmm, nsolver and threads if not given. +if test $nprocdddm -eq 0 +then + nprocdarg= +fi +if test $nprocdddm -eq 0 +then + nprocdddmprint= +fi +if test $nprocdddm -eq 0 +then + nprocdddm= +fi + +if test $nsolver -eq 0 +then + nsolverprint= +fi +# end of threads setting. +gpuoption= +if test "$gpuids" = "" ; then + gpuoption= +else + gpuoption="-gp $gpuids" +fi + +if test "$gpuids" = "" ; then + export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH +else + MARCCUDALIBS=$MARCCUDALIBS2 + export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH +fi +# Linux 64 + HPMPI, Below code is taken from include_linux64 +if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" +then + export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" +fi + +if test $nprocd -gt 1; then + if test -f $jid$dotdefhost; then + if test "$host" = ""; then + host=$jid$dotdefhost + fi + fi + if test -f hostfile_qa_$nprocd; then + if test "$host" = ""; then + host=hostfile_qa_$nprocd + fi + fi +fi + +if test "$dllrun" -gt 0; then + exefile=exe_marc + prog=exe_marc + program=$exefile + bd=$MARC_BIN/ + if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then + dotdat=.inp + fi + + if test "$progdll"; then + /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll + rmdll=yes + pathdll=yes + progdll=${progdll}_$marcdll + else + progdll=$marcdll + fi + + if test "$user"; then + . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user + user= + if test $prgsav = no; then + rmdll=yes + fi + if test $prgsav = yes; then + cpdll=yes + rmdll=yes + fi + pathdll=yes + fi +fi + +############################################################################## +# check parameter validity # +############################################################################## + +while test forever; do + +# +# check for input file existence +# +if test $nprocdddm -gt 1 -a $icreated -eq 0; then + if test ! -f $DIRJID/1$jid$dotdat; then + if test "$jid" != "" ; then + error="$error +input file $DIRJID/1$jid$dotdat not accessible" + fi + fi +else + if test ! -f $DIRJID/$jid$dotdat; then + if test "$jid" != "" ; then + error="$error +input file $DIRJID/$jid$dotdat not accessible" + fi + fi +fi + if test $nprocd -gt 1; then + if test "$host" ; then + if test ! -f $host; then + error="$error +host name file $host not accessible" + fi + fi + fi + +# +# check if the job is already running in the background +# +if test -f $DIRJOB/$jid.pid; then + error="$error +job is already running (the file $jid.pid exists)" +fi + +# +# if the program name is other than marc, then +# assume that this is a program in the users local directory +# + +bd=$MARC_BIN/ + +case $prog in + marc | MARC | $exefile) + program=$exefile + if test "$rid" + then + if test ! -f $DIRRID/$rid.t08 + then + error="$error +restart file $DIRRID/$rid.t08 not accessible" + fi + fi + if test "$pid" + then + if test ! -f $DIRPID/$pid.t16 + then + if test ! -f $DIRPID/$pid.t19 + then + error="$error +post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" + fi + fi + fi + if test "$user" + then + if test ! -f $user + then + error="$error +user subroutine file $user not accessible" + fi + fi + if test "$objs" + then + missingobjs= + for o in $objs + do + if test ! -f "$o" + then + if test -z "$missingobjs" + then + missingobjs="$o" + else + missingobjs="$missingobjs $o" + fi + fi + done + if test -n "$missingobjs" + then + error="$error +user object/library file(s) $missingobjs not accessible" + fi + fi + if test "$did" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRDID/1$did$dotdat + then + error="$error +defaults file $DIRDID/1$did$dotdat not accessible" + fi + else + if test ! -f $DIRDID/$did$dotdat + then + error="$error +defaults file $DIRDID/$did$dotdat not accessible" + fi + fi + fi + if test "$vid" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRVID/1$vid.vfs + then + error="$error +view factor file $DIRVID/1$vid.vfs not accessible" + fi + else + if test ! -f $DIRVID/$vid.vfs + then + error="$error +view factor file $DIRVID/$vid.vfs not accessible" + fi + fi + fi + if $mpioption + then + notok=true + for i in "$MPI_OTHER"; do + if test "$MARC_MPITYPE" = "$i"; then + notok=false + fi + done + if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then + notok=false + fi + if $notok; then + error="$error +incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" + fi + fi + ;; + *) + program=$prog.marc + case $prog in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + if test "$rid" + then + if test ! -f $DIRRID/$rid.t08 + then + error="$error +restart file $DIRRID/$rid.t08 not accessible" + fi + fi + if test "$pid" + then + if test ! -f $DIRPID/$pid.t16 + then + if test ! -f $DIRPID/$pid.t19 + then + error="$error +post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" + fi + fi + fi + if test "$user" + then + error="$error +program option may not be used with user subroutine" + fi + if test "$objs" + then + error="$error +program option may not be used with user objects or libraries" + fi + if test "$did" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRDID/1$did$dotdat + then + error="$error +defaults file $DIRDID/1$did$dotdat not accessible" + fi + else + if test ! -f $DIRDID/$did$dotdat + then + error="$error +defaults file $DIRDID/$did$dotdat not accessible" + fi + fi + fi + if test "$nauto" + then + if test $nauto -gt 2 + then + error="$error +incorrect option for auto restart " + fi + fi + if test "$ndcoup" + then + if test $ndcoup -gt 3 + then + error="$error +incorrect option for contact decoupling " + fi + fi + if test "$ndytran" + then + if test $ndytran -gt 1 + then + error="$error +incorrect option for Marc-Dytran Switch " + fi + fi + if $mpioption + then + if test ! -x $MARC_BIN/$exefile + then + error="$error +incorrect option for -mpi option: $MARC_MPITYPE " + fi + fi + ;; +esac + +############################################################################## +# check argument integrity # +############################################################################## + +if test "$jid" +then + : +else + if test "$user" + then +# allow user sub without giving job id + qid=foreground + verify=no + else + error="$error +job id required" +fi +fi + +if test $nprocd -gt 1 +then + if test $nauto -gt 0 + then + error="$error +cannot run DDM job with auto restart (-au) option " + fi +fi +case $qid in + S* | s*) + qid=short + ;; + L* | l*) + qid=long + ;; + V* | v*) + qid=verylong + ;; + B* | b*) + qid=background + ;; + F* | f*) + qid=foreground + ;; + A* | a*) + qid=at + ;; + *) + error="$error +bad value for queue_id option" + ;; +esac + +case $prgsav in + N* | n*) + prgsav=no + ;; + Y* | y*) + prgsav=yes + ;; + *) + error="$error +bad value for save option" + ;; +esac + +case $verify in + N* | n*) + verify=no + ;; + Y* | y*) + verify=yes + ;; + *) + error="$error +bad value for verify option" + ;; +esac + +case $nprocdddm in + -* ) + error="$error +bad value for nprocd option" + ;; +esac + +case $nt in + -* ) + error="$error +bad value for nt option" + ;; +esac + +case $itree in + -* ) + error="$error +bad value for itree option" + ;; +esac +case $iam in + -* ) + error="$error +bad value for iam option" + ;; +esac +case $compatible in + N* | n*) + compatible=no + ;; + Y* | y*) + compatible=yes + ;; + unknown) + ;; + *) + error="$error +bad value for comp option" + ;; +esac +case $cpinput in + N* | n*) + cpinput=no + ;; + Y* | y*) + cpinput=yes + ;; + *) + error="$error +bad value for copy input option" + ;; +esac +case $cpresults in + N* | n*) + cpresults=no + ;; + Y* | y*) + cpresults=yes + ;; + *) + error="$error +bad value for copy results option" + ;; +esac + +# +# check for external file to run +# +if test -f $MARC_TOOLS/run_marc_check +then + . $MARC_TOOLS/run_marc_check +fi + +############################################################################## +# interact with the user to get the required information to run marc or # +# other marc system program # +############################################################################## + +deletelog=yes +if test $qid = background -a $verify = no +then +echo \ +" +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid +User subroutine name : $user +User objects/libs : $objs +Restart file job ID : $rid +Substructure file ID : $sid +Post file job ID : $pid +Defaults file ID : $did +View Factor file ID : $vid +Save generated module: $prgsav +MPI library : $MPITYPE +DDM processes : $nprocdddmprint +Element loop threads : $nteprint +Solver processes : $nsolverprint +Solver threads : $ntsprint +GPGPU option : $gpuids +Host file name : $host" > $jid.log +if test "$iprintsimufact" = true ; then + echo "DDM with ARC Mapper : $ddm_arc" >> $jid.log +fi +echo \ +"Message passing type : $itree +Run job in queue : $qid +Run directory : $DIRJOB +Scratch directory : $DIRSCR +Memory limit in Mbyte: $memlimit +Auto Restart : $nauto " >> $jid.log +deletelog=no +fi +echo \ +" +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid +User subroutine name : $user +User objects/libs : $objs +Restart file job ID : $rid +Substructure file ID : $sid +Post file job ID : $pid +Defaults file ID : $did +View Factor file ID : $vid +Save generated module: $prgsav +MPI library : $MPITYPE +DDM processes : $nprocdddmprint +Element loop threads : $nteprint +Solver processes : $nsolverprint +Solver threads : $ntsprint" +if test "$iprintsimufact" = true ; then + echo "DDM with ARC Mapper : $ddm_arc" +fi +echo \ +"GPGPU option : $gpuids +Host file name : $host +Message passing type : $itree +Run job in queue : $qid +Run directory : $DIRJOB +Scratch directory : $DIRSCR +Memory limit in Mbyte: $memlimit +Auto Restart : $nauto" + + +case $qid in + s* | S* | l* | L* | v* | V* ) + echo \ +"Queue priority : $priority +Queue CPU limit : $cpu +Queue start time : $att" + ;; +# * ) +# echo \ +#" " +# ;; +esac + +if test "$modeoption" +then + error=$modeerror +fi + +if test "$error" +then + if test $verify = yes + then + $ECHO "$error + +Please correct or quit(correct,quit,): $ECHOTXT" + error= + read answer + case $answer in + q* | Q*) + answer=quit + ;; + *) + answer=correct + ;; + esac + else + $ECHO "$error + $ECHOTXT" + echo " " + if test "$deletelog" = no + then + $ECHO "$error + $ECHOTXT" >> $jid.log + echo " " >> $jid.log + fi + answer=quit + fi +else + if test $verify = yes + then + $ECHO " +Are these parameters correct (yes,no,quit,)? $ECHOTXT" + read answer + case $answer in + q* | Q*) + answer=quit + ;; + y* | Y*) + answer=yes + ;; + *) + answer=no + ;; + esac + else + answer=yes + fi +fi + +case $answer in + no | correct) + +############################################################################## +# prompt for each value # +############################################################################## + + $ECHO " +Program name ($prog)? $ECHOTXT" + read value + if test "$value" + then + prog=$value + fi + $ECHO "Job ID ($jid)? $ECHOTXT" + read value + if test "$value" + then + jid=`$BASENAME $value $dotdat` + DIRJID=`dirname $value` + case $DIRJID in + \/*) + ;; + *) + DIRJID=`pwd`/$DIRJID + ;; + esac + fi + $ECHO "User subroutine name ($user)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + user= + ;; + *) + user=$value + case $user in + \/*) + ;; + *) + user=`pwd`/$user + ;; + esac + usernoext=$user + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + ;; + esac + fi + $ECHO "User objects or libraries ($objs)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + objs= + ;; + *) + objs="$value" + ;; + esac + fi + $ECHO "Restart File Job ID ($rid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + rid= + ;; + *) + rid=`$BASENAME $value .t08` + DIRRID=`dirname $value` + case $DIRRID in + \/*) + ;; + *) + DIRRID=`pwd`/$DIRRID + ;; + esac + ;; + esac + fi + $ECHO "Substructure File ID ($sid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + sid= + ;; + *) + sid=$value + DIRSID=`dirname $value` + case $DIRSID in + \/*) + ;; + *) + DIRSID=`pwd`/$DIRSID + ;; + esac + ;; + esac + fi + $ECHO "Post File Job ID ($pid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + pid= + ;; + *) + pid=$value + DIRPID=`dirname $value` + case $DIRPID in + \/*) + ;; + *) + DIRPID=`pwd`/$DIRPID + ;; + esac + ;; + esac + fi + $ECHO "Defaults File ID ($did)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + did= + ;; + *) + did=`$BASENAME $value $dotdat` + DIRDID=`dirname $value` + case $DIRDID in + \/*) + ;; + *) + DIRDID=`pwd`/$DIRDID + ;; + esac + ;; + esac + fi + $ECHO "View Factor File ID ($vid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + vid= + ;; + *) + vid=`$BASENAME $value .vfs` + DIRVID=`dirname $value` + case $DIRVID in + \/*) + ;; + *) + DIRVID=`pwd`/$DIRVID + ;; + esac + ;; + esac + fi + $ECHO "Save generated module ($prgsav)? $ECHOTXT" + read value + if test "$value" + then + prgsav=$value + fi + $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" + read value + if test "$value" + then + nprocdddm=$value + nprocdddmprint=$value + fi + $ECHO "Run on ($nte) Element loop threads ? $ECHOTXT" + read value + if test "$value" + then + nte=$value + fi + $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" + read value + if test "$value" + then + nsolver=$value + fi + $ECHO "Run on ($nts) Solver threads ? $ECHOTXT" + read value + if test "$value" + then + nts=$value + fi +# + if test $nprocdddm -gt 0 + then + nprocd=$nprocdddm + fi + if test $nsolver -gt 0 + then + if test $nsolver -gt $nprocd + then + nprocd=$nsolver + fi + fi +# Element loop threads. + if test $nte -eq -1 + then + nte=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nte -lt 0 + then + nte=0 + fi + nteprint=$nte +# Copy from ddm + if test $nprocdddm -gt 1 + then + nteprint=$nprocdddm + fi +# override with -nthread_elem option + if test $nte -ne 0 + then + nteprint=$nte + fi +# check for minimum 1 threads per processes for DDM + if test $nprocdddm -ne 0 + then + if test $nteprint -lt $nprocdddm + then + nteprint=$nprocdddm + fi + fi + nte=$nteprint +# Solver threads. + if test $nts -eq -1 + then + nts=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nts -lt 0 + then + nts=0 + fi + ntsprint=$nts +# Copy from ddm + if test $nprocdddm -gt 1 + then + ntsprint=$nprocdddm + fi +# override with -nthread_solver option + if test $nts -ne 0 + then + ntsprint=$nts + fi +# check for minimum 1 threads per solver process. + if test $nsolver -lt $nprocdddm + then + if test $ntsprint -lt $nsolver + then + ntsprint=$nsolver + fi + else + if test $ntsprint -lt $nprocdddm + then + ntsprint=$nprocdddm + fi + fi + if test $ntsprint -eq 1 + then + set ntsprint=0 + fi + nts=$ntsprint + $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" + read value + if test "$value" + then + gpuids=$value + fi + if test "$gpuids" = "" ; then + gpuoption= + else + gpuoption="-gp $gpuids" + fi + if test "$gpuids" = "" ; then + export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH + else + MARCCUDALIBS=$MARCCUDALIBS2 + export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH + fi + if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" + then + export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" + fi +# + if test $nprocd -gt 1 + then + $ECHO "Message passing type ($itree)? $ECHOTXT" + read value + if test "$value" + then + itree=$value + fi + $ECHO "Host file name ($host)? $ECHOTXT" + read value + if test "$value" + then + host=$value + fi + if test $nprocdddm -gt 1 + then + $ECHO "Single input file? $ECHOTXT" + read value + case $value in + y* | Y*) + icreated=1 + nprocdarg=-nprocds + ;; + esac + $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" + read value + if test "$value" + then + compatible=$value + fi + $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" + read value + if test "$value" + then + cpinput=$value + fi + $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" + read value + if test "$value" + then + cpresults=$value + fi + fi + fi + $ECHO "Run the job in the queue ($qid)? $ECHOTXT" + read value + if test "$value" + then + qid=$value + fi + case $qid in + s* | S* | l* | L* | v* | V* ) + $ECHO "Queue priority ($priority)? $ECHOTXT" + read value + if test "$value" + then + priority=$value + fi + $ECHO "Job starts at ($att)? $ECHOTXT" + read value + if test "$value" + then + att=$value + fi + $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" + read value + if test "$value" + then + cpu=$value + fi + ;; + * ) + ;; + esac + $ECHO "Auto Restart option ($nauto)? $ECHOTXT" + read value + if test "$value" + then + nauto=$value + fi + $ECHO "Run directory ($DIRJOB)? $ECHOTXT" + read value + if test "$value" + then + DIRJOB=$value + DIRSCR=$DIRJOB + fi + $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" + read value + if test "$value" + then + DIRSCR=$value + fi + ;; + quit) + exit 1 + ;; + *) + break + ;; + +esac + + if test $nt -eq -1 + then + nt=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nt -lt 0 + then + nt=0 + fi + +done +# +if test $nt -eq 0 +then + ntarg= +fi +if test $nt -eq 0 +then + ntprint= +fi +if test $nt -eq 0 +then + nt= +fi + +if test $nte -eq 0 +then + ntearg= +fi +if test $nte -eq 0 +then + nteprint= +fi +if test $nte -eq 0 +then + nte= +fi + +if test $nts -eq 0 +then + ntsarg= +fi +if test $nts -eq 0 +then + ntsprint= +fi +if test $nts -eq 0 +then + nts= +fi +# +if test "$dllrun" -gt 0; then + exefile=exe_marc + prog=exe_marc + program=$exefile + bd=$MARC_BIN/ + if test "$user"; then + . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user + user= + pathdll=yes + if test $prgsav = no; then + rmdll=yes + fi + if test $prgsav = yes; then + cpdll=yes + rmdll=yes + fi + fi + + if test "$pathdll"; then +# +# reset share lib path +# + if test $MACHINENAME = "HP" + then + SHLIB_PATH=$DIRJOB:$SHLIB_PATH + export SHLIB_PATH + fi + if test $MACHINENAME = "IBM" + then + LIBPATH=$DIRJOB:$LIBPATH + export LIBPATH + fi +# + LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH + LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH + LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH + export LD_LIBRARY_PATH + export LD_LIBRARY64_PATH + export LD_LIBRARYN32_PATH + fi +fi +# end of dllrun>0 + + +if test $program = $exefile -o $program = $prog.marc +then + +# delete the old .log file unless we run in the background +if test "$deletelog" = yes +then + if test "$jid" + then + /bin/rm $jid.log 2>/dev/null + fi +else + echo + echo running the job in the background, see $jid.log + echo +fi + +# +# check if this is an autoforge or rezoning or radiation job +# +if test $nprocd -eq 1 -a "$jid" + +then + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` + if test "$line" + then + autoforge=1 + fi + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` + if test "$line" + then + autoforge=1 + fi + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` + if test "$line" + then + autoforge=1 + fi +fi +# +# check that jobname for restarted run is not the same +# as restart file basename +# +if test "$rid" +then + if test "$jid" = "$rid" + then + echo " " + echo "ERROR: job name of current run is the same as job name" + echo " of the restarted job" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "ERROR: job name of current run is the same as job name" >> $jid.log + echo " of the restarted job" >> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi +fi + +# +# user objects/libraries used +# + + if test "$objs" + then + program="$DIRJOB/$jid.marc" + case $program in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + link=yes + fi + +# +# user subroutine used +# +# add DAMASK options for linking + DAMASK="-lstdc++" + + if test "$user" + then + program=$usernoext.marc + case $program in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + link=yes + fi + +# +# Special case for IBM using POE but not an SP machine +# in this case we always need a host file, also for serial jobs. +# +if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP +then + MP_HOSTFILE=${jid}.host + if test -f $jid.host + then + /bin/rm $jid.host 2> /dev/null + fi + if test $nprocd -gt 1 + then + numdom=$nprocd + while test $numdom -gt 0 + do + hostname -s >> $MP_HOSTFILE + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + else + hostname -s > $MP_HOSTFILE + fi +fi +# +# check ssh for all hosts in host file +# +if test $nprocd -gt 1 +then +if test $MPITYPE = "intelmpi" -a "$INTELMPI_VERSION" = "HYDRA" + then +# get host list + if test "$host" + then + line=`grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' | uniq` +# count failing hosts + counter=0 + for i in $line + do + $RSH -o BatchMode=yes -o ConnectTimeout=10 $i uname -n + status=$? + if [[ $status != 0 ]] ; then + counter=$((counter+1)) + if [ "$counter" = "1" ]; then + echo " " + echo " error - connection test failed... " + echo " " + fi + echo " " + echo " connection test with ssh failed on host $i" + echo " check the following command: ssh $i uname -n " + echo " " + fi + done +# echo error message and quit + if test $counter -ne 0 + then + echo " " + echo " A parallel job using IntelMPI cannot be started. " + echo " The ssh command must be working correctly between " + echo " the computers used in the analysis. Furthermore, " + echo " it must be set up such that it does not prompt the " + echo " user for a password. " + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo " A parallel job using IntelMPI cannot be started. ">> $jid.log + echo " The ssh command must be working correctly between ">> $jid.log + echo " the computers used in the analysis. Furthermore, ">> $jid.log + echo " it must be set up such that it does not prompt the ">> $jid.log + echo " user for a password. ">> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + fi +fi +fi +# +# check correctness of host file; fix for user sub +# + if test $nprocd -gt 1 + then + +# construct the path name to the executable (execpath) + execpath=$MARC_BIN/$exefile + usersub=0 + if test $program = $prog.marc + then + execpath=$prog.marc + usersub=1 + fi + if test "$objs" + then + execpath="$DIRJOB/$jid.marc" + usersub=1 + fi + if test "$user" + then + execpath=$usernoext.marc + usersub=1 + fi + export execpath + execname=`$BASENAME $execpath` + + if test "$host" + then + userhost=$host + case $userhost in + \/* | \.\/*) + ;; + *) + userhost=`pwd`/$userhost + ;; + esac + +# check that the number of processes specified in the hostfile is +# equal to nprocd specified by -nprocd. + numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` + if test $nprocd -ne $numproc + then + echo " " + echo "error, the number of processes specified in the host file" + echo "must be equal to the number of processes given by -nprocd/-nsolver" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, the number of processes specified in the host file" >> $jid.log + echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + +# check for Myrinet that the number of processes per host is +# less than number of available user ports, 5 +# .gmpi directory must exist in user's home directory +# and must have write permission from remote hosts + if test $MPITYPE = "myrinet" + then + numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` + if test $numproc -gt 5 + then + echo " " + echo "error, for Myrinet the number of processes specified " + echo "in the hostfile must not exceed 5 for a hostname" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet the number of processes specified " >> $jid.log + echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + if test ! -d ~/.gmpi + then + echo " " + echo "error, for Myrinet a .gmpi directory must exist " + echo "under the user's home directory" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log + echo "under the user's home directory" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + homedir=`echo ~` + for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ + if test -s tmp.$$ + then + echo " " + echo "error, for Myrinet a shared .gmpi directory must exist " + echo "under the user's home directory " + echo "with remote write permission" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log + echo "under the user's home directory " >> $jid.log + echo "with remote write permission" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + else + /bin/rm tmp.$$ + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + fi + fi + done + fi + fi + +# construct the host file $jid.host which is used by mpirun +# skip lines starting with # and only consider lines with more than +# one word in them. Note that the hostfile given to this script +# has two columns: the host name and the number of shared processes +# to run on this host. mpirun wants the number of _other_ +# processes to run in addition to the one being run on the machine +# on which the job is started. hence the $2-1 for fnr == 1. + if test -f $jid.host + then + /bin/rm $jid.host 2> /dev/null + fi + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then +# HPMPI or HP hardware MPI + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ + -v mpihpspecial="$MPIHPSPECIAL" \ +'{if ( NF > 0) {\ + fnr++ ; \ + printf("-h %s -np %s",$1,$2); \ + printf(" %s",mpihpspecial); \ + if ( NF == 2 ) printf(" %s\n",path);\ + if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ + if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ + }\ + }' > $jid.host +# end HPMPI or HP hardware MPI + elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP + then +# IBM using hardware MPI (POE) + MP_HOSTFILE=$jid.host + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host +# end IBM using hardware MPI (POE) +# for Intel MPI, need to create a machinefile for DMP + elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then +# Intel MPI + if test -f $jid.mfile + then + /bin/rm $jid.mfile 2> /dev/null + fi + /bin/cp $host $jid.host + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile +# end Intel MPI for DMP +# for Solaris HPC 7.1, need to create a machinefile for DMP + elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" + then +# Solaris HPC 7.1 + if test -f $jid.mfile + then + /bin/rm $jid.mfile 2> /dev/null + fi + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile +# end Solaris HPC 7.1 for DMP +# for Myrinet, construct a configuration file in ~/.gmpi +# this must be readable by each process +# format is (hostname) (port number) for each process + elif test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + echo $nprocd > ~/.gmpi/$jid.host + grep -v '^#' $host | $AWK \ +'BEGIN {iport[0] = 2; \ + iport[1] = 4; \ + iport[2] = 5; \ + iport[3] = 6; \ + iport[4] = 7 \ + } \ +{if ( NF > 0 ) \ + for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ +}' >> ~/.gmpi/$jid.host + else +# this is for mpich-1.2.5 and later, using the -pg option +# format: host nproc executable user arguments +# the arguments are added later + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ +'{if ( NF > 0) {\ + fnr++ ; \ + if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ + else printf("%s %s",$1,$2); \ + if ( NF == 2 ) printf(" %s %s\n",path,user);\ + if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ + if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ + }\ + }' > $jid.host + fi +# end Myrinet + elif test $MACHINENAME = DEC -a $MPITYPE = hardware + then +# Compaq MPI via Memory Channel + grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host +# end Compaq MPI + else +# MPICH + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ +'{if ( NF > 0) {\ + fnr++ ; \ + if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ + else printf("%s %s",$1,$2); \ + if ( NF == 2 ) printf(" %s\n",path);\ + if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ + if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ + }\ + }' > $jid.host + fi +# define the variable host and host_filt +# host_filt is used for loops over hosts +# for Myrinet we need to use a filtered variant of userhost +# for others we can use $host + if test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + host=~/.gmpi/$jid.host + host_filt=$jid.host_tMp + grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt + else + host=$jid.host + host_filt=$host + fi + else + host=$jid.host + host_filt=$host + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + host_filt=$jid.mfile + fi + fi +# figure out if the machines in the hostfile are nfs mounted +# or distributed and set the variable "dirstatus" accordingly. +# only perform the check if user subroutine is used +# or a user subroutine executable is used + + numfield=1 + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then + numfield=2 + fi + DIR1=$DIRJOB + if test $program = $prog.marc -o -n "$user" -o -n "$objs" + then + counter=0 + echo " " + echo "checking if local or shared directories for host" + if test "$deletelog" = no + then + echo "checking if local or shared directories for host" >> $jid.log + fi + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + dirstatus[$counter]="shared" + $ECHO " $i $ECHOTXT" + if test "$deletelog" = no + then + $ECHO " $i $ECHOTXT" >> $jid.log + fi + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ + if test -s tmp.$$ + then + dirstatus[$counter]="local" + /bin/rm tmp.$$ + else + if test ! -f $jid.$$ + then + dirstatus[$counter]="local" + $RSH $i /bin/rm $DIR1/$jid.$$ + else + /bin/rm $jid.$$ + fi + fi + if test -f tmp.$$ + then + /bin/rm tmp.$$ + fi + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + echo " ${dirstatus[$counter]}" + if test "$deletelog" = no + then + echo " ${dirstatus[$counter]}" >> $jid.log + fi + fi + done + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + fi + fi + +# figure out if this is a compatible set of machines +# unless explicitly specified with flag -comp +# only perform the check if user subroutine is used +# or a user subroutine executable is used +# Myrinet does not support heterogeneous + if test $program = $prog.marc -o -n "$user" -o -n "$objs" + then + if test $compatible = "unknown" + then + thisname=$ARCH + compatible=yes + counter=0 + echo "checking if machines are compatible for host" + if test "$deletelog" = no + then + echo "checking if machines are compatible for host" >> $jid.log + fi + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + compstatus[$counter]="yes" + $ECHO " $i $ECHOTXT" + if test "$deletelog" = no + then + $ECHO " $i $ECHOTXT" >> $jid.log + fi + othername=`$RSH $i uname -a | cut -f 1 -d " "` + if test $thisname != $othername + then + compatible=no + compstatus[$counter]="no" + fi + fi + echo " ${compstatus[$counter]}" + if test "$deletelog" = no + then + echo " ${compstatus[$counter]}" >> $jid.log + fi + done + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + fi + else + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + compstatus[$counter]=$compatible + fi + done + if test $compatible = "no" + then + echo "all machines assumed incompatible" + if test "$deletelog" = no + then + echo "all machines assumed incompatible" >> $jid.log + fi + else + echo "all machines compatible" + if test "$deletelog" = no + then + echo "all machines compatible" >> $jid.log + fi + fi + fi +# error out if user objects or libraries are used on incompatible machines + if test "$compatible" = "no" -a -n "$objs" + then + echo "User object/libraries cannot be used in a parallel job on incompatible machines" + if test "$deletelog" = no + then + echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log + fi + exit 1 + fi +# modify new host file if NFS mounted heterogeneous machine + doit= + if test $program = $prog.marc + then + doit=yes + fi + if test "$user" + then + doit=yes + fi + if test "$doit" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + $AWK -v hst=$i '{fnr++ ; \ +if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ +printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} + /bin/mv $jid.host{$$} $jid.host + host=$jid.host + fi + fi + done + fi + fi # if test $program = $prog.marc -o $user -o $obj + + else # if test $host + # assume shared memory machine if no hostfile given and + # MPITYPE is set to mpich or Myrinet + # check for Myrinet that the total number of processes is + # less than number of available user ports, 5 + if test $MPITYPE = "mpich" -o $MPITYPE = "scali" + then + numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` + echo `hostname` $numproc $execpath > $jid.host + host=$jid.host + elif test $MPITYPE = "myrinet" + then + if test $nprocd -gt 5 + then + echo " " + echo "error, for Myrinet the number of processes " + echo "must not exceed 5 for a hostname" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet the number of processes " >> $jid.log + echo "must not exceed 5 for a hostname" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + echo $nprocd > ~/.gmpi/$jid.host + echo `hostname` $nprocd | $AWK \ +'BEGIN {iport[0] = 2; \ + iport[1] = 4; \ + iport[2] = 5; \ + iport[3] = 6; \ + iport[4] = 7 \ + } \ + {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ +' >> ~/.gmpi/$jid.host + host=~/.gmpi/$jid.host + else + numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` + echo `hostname` $numproc $execpath > $jid.host + + fi + fi # if test myrinet + + fi # if test $host + + fi # if test $nprocd -gt 1 + +fi # if test $program = $exefile -o $program = $prog.marc + +############################################################################## +# construct run stream (Marc only) # +############################################################################## + +# set maximum message length for ddm to a large number +# for vendor provided mpi +if test $itree -eq 0 -a $MPITYPE = hardware +then + itree=100000000 + if test $MACHINENAME = SGI + then + itree=100000001 + fi +fi +if test $itree -eq 0 -a $MPITYPE = hpmpi +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = myrinet +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = nec +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = scali +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = intelmpi +then + itree=100000000 +fi +if test $nprocdddm -lt 2 +then + nprocdarg= +else + nprocdarg="$nprocdarg $nprocdddm" +fi +if test $nsolver -eq 0 +then + nsolverarg= +else + nsolverarg="$nsolverarg $nsolver" +fi +if test $nprocdddm -lt 2 -a $nsolver -eq 0 +then +nprocd=0 +fi +if test $nprocd -gt 0 +then + if test "$host" + then + if test -z "$RUN_JOB2" + then + echo " " + echo "error: parallel job attempted on non-parallel version," + echo " or, if parallel version is installed, the include " + echo " file is probably corrupted" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error: parallel job attempted on non-parallel version," >> $jid.log + echo " or, if parallel version is installed, the include " >> $jid.log + echo " file is probably corrupted" >> $jid.log + echo " " >> $jid.log + fi + exit + fi + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then + RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP + then + RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" + RUN_JOB=" -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + elif test $MACHINENAME = DEC -a $MPITYPE = hardware + then + RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + numhost=`uniq $jid.mfile | wc -l` + if test "$INTELMPI_VERSION" = "HYDRA" + then + RUN_JOB_TMP="$RUN_JOB2 -configfile $jid.cfile" + else + export I_MPI_JOB_CONTEXT=$$ + mpdboot -n $numhost -r $RSH -f $jid.mfile + RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" + fi + +# intelmpi uses configfile. format: +# -host host1 -n n1 executable marcargs +# one such line per host +# collect the marcargs in RUN_JOB and construct the config file later +# collect the run stream in RUN_JOB_TMP + RUN_JOB="-jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + + + elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" + then + RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + if test "$userhost" + then + RUN_JOB="$RUN_JOB -mhost $userhost" + fi + if test $MPITYPE = "scali" + then +# set default working directory to /tmp to allow +# different directory names + SCAMPI_WORKING_DIRECTORY=/tmp + export SCAMPI_WORKING_DIRECTORY + fi + else + if test -z "$RUN_JOB1" + then + echo " " + echo "error: parallel job attempted on non-parallel version," + echo " or, if parallel version is installed, the include " + echo " file is probably corrupted" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error: parallel job attempted on non-parallel version," >> $jid.log + echo " or, if parallel version is installed, the include " >> $jid.log + echo " file is probably corrupted" >> $jid.log + echo " " >> $jid.log + fi + exit + fi + RUNNPROCD=$nprocd + if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" + then + RUNNPROCD= + MP_PROCS=$nprocd + export MP_PROCS + fi + if test $MPITYPE = "myrinet" + then + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + echo " " > /dev/null + else + export I_MPI_JOB_CONTEXT=$$ + mpdboot -n 1 -f $jid.hosts + fi + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + fi +else + if test $nauto -gt 0 -o $ndcoup -gt 0 + then + RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ +-maxnum $MAXNUM \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else +# this is for a serial job without auto restart: + RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ +-maxnum $MAXNUM \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi +fi +if test "$rid" +then + RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" +fi +if test "$pid" +then + RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" +fi +if test "$sid" +then + RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" +fi +if test "$did" +then + RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" +fi +if test "$vid" +then + RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" +fi +if test $nauto -gt 0 +then + RUN_JOB="$RUN_JOB -autorst $nauto " +fi +if test $ndcoup -gt 0 +then + RUN_JOB="$RUN_JOB -dcoup $ndcoup " +fi +if test $ndytran -gt 0 +then + RUN_JOB="$RUN_JOB -dytran $ndytran " +fi +if test $mesh -gt 0 +then + RUN_JOB="$RUN_JOB -me $mesh " +fi +if test $noutcore -gt 0 +then + RUN_JOB="$RUN_JOB -outcore $noutcore " +fi +if test "$dllrun" -gt 0 +then + RUN_JOB="$RUN_JOB -dll $dllrun " +fi +if test "$trkrun" -gt 0 +then + RUN_JOB="$RUN_JOB -trk $trkrun " +fi +if test "$iam" +then + RUN_JOB="$RUN_JOB -iam $iam " +fi +if test "$justlist" +then + RUN_JOB="$RUN_JOB -list 1 " +fi +if test "$feature" +then + RUN_JOB="$RUN_JOB -feature $feature " +fi +if test "$memlimit" -ne 0 +then + RUN_JOB="$RUN_JOB -ml $memlimit " +fi +if test "$cpinput" +then + RUN_JOB="$RUN_JOB -ci $cpinput " +fi +if test "$cpresults" +then + RUN_JOB="$RUN_JOB -cr $cpresults " +fi +if test "$DIRSCR" != "$DIRJOB" +then + RUN_JOB="$RUN_JOB -dirscr $DIRSCR" +else + DIRSCR=$DIRJOB +fi +if test "$makebdf" +then + RUN_JOB="$RUN_JOB -bdf $makebdf " +fi +if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" +then + # append $RUN_JOB to all lines of the host file + # and set RUN_JOB + $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ + /bin/mv $host.$$ $host + RUN_JOB=$RUN_JOB_TMP +fi +if test $MPITYPE = "intelmpi" -a "$host" +then + # construct config file, append $RUN_JOB to all lines of the config file + # and set RUN_JOB + if test "$INTELMPI_VERSION" = "HYDRA" + then + grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ + '{if ( NF > 0) {\ + printf(" -host %s",$1); \ + printf(" -n %s",$2); \ + if ( NF == 2 ) printf(" %s",path);\ + if ( NF >= 3 ) printf(" -wdir %s ",$3); \ + if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ + printf(" %s\n",args); \ + }\ + }' > $jid.cfile + else + grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ + '{if ( NF > 0) {\ + printf("-host %s -n %s",$1,$2); \ + if ( NF == 2 ) printf(" %s",path);\ + if ( NF >= 3 ) printf(" -wdir %s ",$3); \ + if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ + printf(" %s\n",args); \ + }\ + }' > $jid.cfile + fi + RUN_JOB=$RUN_JOB_TMP +fi +echo " " +echo "Final run stream value" +echo " RUNJOB="$RUN_JOB +if test "$deletelog" = no +then +echo " " >> $jid.log +echo "Final run stream value" >> $jid.log +echo " RUNJOB="$RUN_JOB >> $jid.log +fi + + +############################################################################## +# run marc using valgrind # +############################################################################## +#RUN_JOB="valgrind $RUN_JOB" +#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" +#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" +#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" +############################################################################## + + +############################################################################## +# run the requested program in a queue # +############################################################################## + +if test "$deletelog" = yes +then + echo + date +else + echo >> $jid.log + date >> $jid.log +fi +if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] +then + +/bin/rm -f $jid.runmarcscript + + +# +# compile user subroutine if present +# +if test "$link" +then + if test -z "$FCOMPROOT"; then + echo "$0: No compiler available" + echo + echo " $PRODUCT Exit number 3" + exit 1 + fi + echo + echo "Using compiler from: $FCOMPROOT" + echo + if test "$user" + then + userobj=$usermoext.o + fi + cat > $jid.runmarcscript << END4 + if test "$user" + then + if test $MACHINENAME = "CRAY" + then + $DFORTHIGH $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTHIGH $user -o $userobj || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + $SOLVERLIBS \ + $MARCCUDALIBS \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $DAMASK \ + $SYSLIBS \ + $SFLIB \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 + } +END4 +else + prgsav=yes +fi +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null + +# +# run marc +# + +cat >> $jid.runmarcscript << END5 + +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi + +# first remove all .out files and incremental restart files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test \$numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null + numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null + /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null +fi + +if test $nprocdddm -gt 1 +then + $RUN_JOB 2>>$jid.log +else + $RUN_JOB 2>>$jid.log +fi + +if test $dllrun -eq 0; then + if test $prgsav = no + then + /bin/rm -f $bd$program 2>/dev/null + fi +else + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes + then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi + +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test \$numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +fi +END5 + + +# Submit to marc batch queue +# +if [ $qid = at ] +then +QUENAME=at +SUBMCMD= +else +# +# Submit to qsub queue +# +QUENAME=qsub +SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" +if test "$priority" +then + SUBMCMD=$SUBMCMD" -p $priority" +fi +if test "$att" +then + SUBMCMD=$SUBMCMD" -a $att" +fi +if test "$cpu" +then + SUBMCMD=$SUBMCMD" -lt $cpu" +fi + +fi +echo $QUENAME $SUBMCMD +#cat $jid.runmarcscript +$QUENAME $SUBMCMD < $jid.runmarcscript + +/bin/rm -f $jid.runmarcscript + +############################################################################## +# run the requested program in the background # +############################################################################## + +else +if test $qid = background +then + +# +# first remove all old .out files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null +fi +# +# compile user subroutine if present +# +( +if test "$link" +then + if test -z "$FCOMPROOT"; then + echo "$0: No compiler available" + echo + echo " $PRODUCT Exit number 3" + exit 1 + fi + echo + echo "Using compiler from: $FCOMPROOT" + echo + if test "$user" + then + # compile and link on other hosts in $host if compstatus=no + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${compstatus[$counter]} = "no" + then + DIR1=$DIRJOB + DIR2=$DIR + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + marcdir=`echo $line | $AWK '{print $4}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -n "$marcdir" + then + DIR2=$marcdir + fi + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then + $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" + then + hname=_$ibase + else + hname= + fi + remoteprog=$DIR1/${execname}$hname + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo + $RSH $i $DIR2/tools/comp_damask_h $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else + echo "$0: compile failed for $user on host $i" + echo " $PRODUCT Exit number 3" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi + done + fi + fi + if test "$userhost" + then + echo + echo "Compiling and linking user subroutine $user on host `hostname`" + fi + userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then + $DFORTHIGH $user || \ + { + echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTHIGH $user -o $userobj || \ + { + echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi # if test $user + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $DAMASK \ + $SYSLIBS \ + $SFLIB \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + echo " $PRODUCT Exit number 3" + exit 1 + } + # copy user subroutine executable for hosts using local working dir + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" + then + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + echo "Copying executable to host ${i}" + $RCP $program ${i}:${DIR1}/ + fi + fi + done + fi + fi +else # if test $link + prgsav=yes +fi # if test $link +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null + +# +# run marc + +# + +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi + +# for DDM with ARC support + +if test $ddm_arc -gt 0; then + RUN_JOB="$MESHERDIR/sf_exeddm $RUN_JOB -ddm $ddm_arc " +fi + + +$RUN_JOB & + +marcpid=$! +echo $marcpid > $DIRJOB/$jid.pid +wait $marcpid + +if test $nprocd -gt 1 +then + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + if test "$host" + then + /bin/rm $jid.mfile 2> /dev/null + /bin/rm $jid.hosts 2> /dev/null + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.cfile 2> /dev/null + fi + fi + fi +fi + + +if test $dllrun -eq 0; then +if test $prgsav = no +then + /bin/rm -f $bd$program 2>/dev/null + # for network run, remove executable on remote machines + # and executables with modified name + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + if test -f "$host_filt" + then + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + # if an incompatible host uses shared directory, + # then the root machine deletes the executable + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + hname=_$ibase + /bin/rm ${execname}$hname + fi + # if local directory used, the remote machine + # deletes the executable + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null + fi + fi + done + fi + fi +fi +fi +else +#dllrun >0 + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sin 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + if test $MPITYPE = "myrinet" + then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi + fi +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + /bin/rm $DIRJOB/$jid.sle 2>/dev/null + /bin/rm $DIRJOB/$jid.sin 2>/dev/null +fi +) 1>>$jid.log 2>&1 & + + +############################################################################## +# run the requested program in the foreground # +############################################################################## + +else + +# +# compile user subroutine if present +# +if test "$link" +then + if test -z "$FCOMPROOT"; then + echo "$0: No compiler available" + echo + echo " $PRODUCT Exit number 3" + exit 1 + fi + echo + echo "Using compiler from: $FCOMPROOT" + echo + if test "$user" + then + # compile and link on other hosts in $host if compstatus=no + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${compstatus[$counter]} = "no" + then + DIR1=$DIRJOB + DIR2=$DIR + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + marcdir=`echo $line | $AWK '{print $4}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -n "$marcdir" + then + DIR2=$marcdir + fi + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then + $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" + then + hname=_$ibase + else + hname= + fi + remoteprog=$DIR1/${execname}$hname + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo + $RSH $i $DIR2/tools/comp_damask_h $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else + echo "$0: compile failed for $user on host $i" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi + done + fi + fi + if test "$userhost" + then + echo + echo "Compiling and linking user subroutine $user on host `hostname`" + fi + userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then + $DFORTHIGH $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTHIGH $user -o $userobj || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi # if test $user + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $DAMASK \ + $SYSLIBS \ + $SFLIB \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 + } + # copy user subroutine executable for hosts using local working dir + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" + then + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + echo "Copying executable to host ${i}" + $RCP $program ${i}:${DIR1}/ + fi + fi + done + fi + fi +else # if test $link + prgsav=yes +fi # if test $link +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null +# done if no job id given +if test -z "$jid" +then + echo + echo only compilation requested + echo + exit +fi +# +# run marc +# +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi +# first remove all .out files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null +fi + +# for DDM with ARC support + +if test $ddm_arc -gt 0; then + RUN_JOB="$MESHERDIR/sf_exeddm $RUN_JOB -ddm $ddm_arc " +fi + + $RUN_JOB + +if test $nprocd -gt 1 +then + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + if test "$host" + then + /bin/rm $jid.mfile 2> /dev/null + /bin/rm $jid.hosts 2> /dev/null + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.cfile 2> /dev/null + else + echo " " > /dev/null + fi + else + if test "$host" + then + mpdcleanup -a -f $jid.mfile + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.mfile 2> /dev/null + else + mpdcleanup -a -f $jid.hosts + /bin/rm $jid.hosts 2> /dev/null + fi + fi + fi +fi + +if test $dllrun -eq 0; then +if test $prgsav = no +then + /bin/rm -f $bd$program 2>/dev/null + # for network run, remove executable on remote machines + # and executables with modified name + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + if test -f "$host_filt" + then + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + # if an incompatible host uses shared directory, + # then the root machine deletes the executable + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + hname=_$ibase + /bin/rm ${execname}$hname + fi + # if local directory used, the remote machine + # deletes the executable + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null + fi + fi + done + fi + fi +fi +fi +else +#dllrun >0 + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi + +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sin 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + if test $MPITYPE = "myrinet" + then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi + fi +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + /bin/rm $DIRJOB/$jid.sle 2>/dev/null + /bin/rm $DIRJOB/$jid.sin 2>/dev/null +fi + + +fi +fi diff --git a/installation/mods_MarcMentat/2016/Marc_tools/run_damask_hmp b/installation/mods_MarcMentat/2016/Marc_tools/run_damask_hmp new file mode 100644 index 000000000..7af233017 --- /dev/null +++ b/installation/mods_MarcMentat/2016/Marc_tools/run_damask_hmp @@ -0,0 +1,4096 @@ +#!/bin/ksh +############################################################################## +# # +# run_marc - run a marc job # +# ------------------------- # +# # +# usage: run_marc -j jid { options } # +# # +# where standard options are: required: defaults: # +# -------------------------- # +# # +# -j* jid job id number. ** YES ** . # +# -pr* prog program name. . marc # +# -v* y|n do or do not verify inputs. . yes # +# -q* s|l|v|b|f batch queue name or background, . short # +# foreground. # +# -b* as alternative to option -q* # +# # +# ( batch queues only : # +# -pq* intra queue priority. . . # +# -at DATE/TIME delay start of job. . . # +# format : January,1,1990,12:31 # +# or : today,5pm # +# -cpu* secs job CPU limit . . ) # +# # +# -r* rid restart file job id. . . # +# -si* sid substructure file id. . . # +# -pi* post post file job id. . . # +# -de* did defaults file . no # +# -vf vid viewfactor . no # +# # +# -u* user user subroutine. . . # +# -obj obj user objects or libraries. . . # +# -sa* y|n do or do not save load module. . no # +# -autorst auto restart flag for auto forge . no # +# -me manual remeshing control . no # +# -ml memory limit in Mbyte # +# -mo This option is deprecated. As of Marc 2015, only # +# the integer*8 version is available. # +# -mpi selects MPI version # +# each platform has a default MPI version and some # +# have an alternative version. see the include file # +# for the respective platform # +# MPI_DEFAULT defines the default MPI version # +# MPI_OTHER defines versions one can switch to # +# -dcoup for contact decoupling # +# currently not supported # +# -dir directory where the job i/o should take place. # +# defaults to current directory. # +# -sdir directory where scratch files are created # +# defaults to current directory. # +# # +# -alloc only perform memory allocation test, no analysis # +# -list y only list options in the input file, no analysis # +# -fe num set feature number "num" for the run. only one allowed # +# -dytran flag to switch from Dytran to Marc # +# dytran = 0, program will run w/o Marc-Dytran Switch # +# = 1, program will restart Marc after Dytran run # +# >= 2, Not supported yet. # +# currently not supported # +# -ou force analysis to use out-of-core control # +# =0, not used # +# =1, element storage out-of-core # +# -dll run marc using shared library libmarc.so and exe_marc # +# =1, used # +# =2, do not free streaming input memory # +# =3, run with marc input deck # +# -trk run marc for post-tracking # +# -gpuid run marc using GPGPU capability # +# specify gpuid on to be used in the analysis. Multiple # +# IDs may be assigned for DDM runs. # +# Separate a list of IDs with a colon. Each DMP # +# process will be assigned a GPU ID in round robin fastion# +# = 0 # +# = 0:1 etc... # +# # +# where parallel options are: # +# -------------------------- # +# # +# itree, host, and comp options are available for the domain # +# decomposition only. # +# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # +# # +# # +# -nprocd number of domains. # +# defaults to single domain solution. # +# -nprocds number of domains if single input file. # +# defaults to single domain solution. # +# -nps same as -nprocds. # +# -nsolver number of solver tasks for solver types 12 and 13 # +# these are distributed tasks operating via MPI # +# -nthread_elem number of threads for element assembly and recovery # +# = 0: use defaults. # +# defaults to 1 for single domain solution. # +# defaults to number of domains for multi-domain # +# solution. # +# > 1: number of threads to be used by element assembly # +# recovery. # +# Also can be set through MARC_NUMBER_OF_THREADS # +# environment variable. # +# if both specified, -nthread_elem option will be used. # +# defaults if neither MARC_NUMBER_OF_THREADS environment # +# variable set nor -nthread_elem specified. # +# -nthread_solver number of threads for solver types 6, 8, and 11 # +# = 0: use defaults. # +# defaults to 1 for single domain solution. # +# defaults to number of domains for multi-domain # +# solution. # +# > 1: number of threads to be used by 6, 8, and 11 # +# Also can be set through MARC_NUMBER_OF_THREADS # +# environment variable. # +# if both specified, -nthread_solver option will be used. # +# defaults if neither MARC_NUMBER_OF_THREADS environment # +# variable set nor -nthread_solver specified. # +# -nthread Same as -nthread_solver. # +# -itree message passing tree type for domain decomposition. # +# for debugging purposes; should not normally be used. # +# -host hostfile name for distributed execution on network. # +# defaults to no hostfile, unless jobid.defhost exists. # +# if jobid.defhost exists, only -np(s) necessary # +# -comp* y|n to be used with user routines on a network of # +# incompatible machines. # +# if set to no, a separate executable will be created # +# for each machine on the network. # +# if set to yes, the executable located on the machine # +# from which marc is started will be used on all machines.# +# defaults to no if O/S versions different on machines. # +# # +# -ci y|n copy input files to remote hosts (default: yes) # +# if "yes", input files are automatically copied to # +# remote hosts for a network run if necessary. # +# -cr y|n copy post files from remote hosts (default: yes) # +# if "yes", post files are automatically copied back from # +# remote hosts for a network run if necessary. # +############################################################################## +# set DIR to the directory in which this script is +REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" +DIR=`dirname $REALCOM` +# make sure DIR has an absolute path +case $DIR in + \/*) + ;; + *) + DIR=`pwd`/$DIR + ;; +esac +DIRSCRIPT=$DIR +AWK=awk +ARCH=`uname -a | cut -f 1 -d " "` +# Sun has a bad awk, use nawk instead +if test $ARCH = "SunOS" +then + AWK=nawk +fi +BASENAME=basename +# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists +if test $ARCH = "SunOS" +then + if test -x /usr/ucb/basename + then + BASENAME=/usr/ucb/basename + fi +fi + +# echo command line in the case of ECHO_COMMAND is true +if test "$ECHO_COMMAND" = true ; then + echo command "$0" "$@" +fi + +# +# "mode" selects version, i4 or i8 +# default is i4 +# this can be changed by a file run_marc_defaults +# located in the tools directory of the Marc installation +# or in the user's home directory +# format: +# MARC_MODE i8 +# it can also be set by the environmental variable MARC_INTEGER_SIZE +# and by the command line option "-mo" +# +mode= +modeerror= +modeoption= +if test -f $DIRSCRIPT/run_marc_defaults; then + line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $DIRSCRIPT/run_marc_defaults` + if test "$line" = "MARC_MODE"; then + echo + echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available + echo + line= + fi + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + modeerror="defaults file $DIRSCRIPT/run_marc_defaults used mode $line ; this must be i8" + modeoption=error + echo $modeerror + fi + if test "$line" = "i8"; then + mode=i8 + fi +fi +if test -f $HOME/run_marc_defaults; then + line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $HOME/run_marc_defaults` + if test "$line" = "MARC_MODE"; then + echo + echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available + echo + line= + fi + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + modeerror="defaults file $HOME/run_marc_defaults used mode $line ; this must be i8" + modeoption=error + echo $modeerror + fi + if test "$line" = "i8"; then + mode=i8 + fi +fi +if test -n "$MARC_INTEGER_SIZE" ; then + mode=$MARC_INTEGER_SIZE +fi +if test -z "$mode" ; then + mode=i8 +fi +case $mode in + i4) + modeerror="bad value for MARC_INTEGER_SIZE variable; only i8 is supported." + modeoption=error + echo $modeerror + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo "bad value for MARC_INTEGER_SIZE variable; only i8 is supported." + exit + ;; +esac + +setmode=false +for arg in $* ; do + if $setmode ; then + mode=$arg + case $mode in + i4) + modeerror="bad value for mode option; only i8 is supported." + modeoption=error + echo + echo $modeerror + echo + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo " " + echo "error, version mode must be i8" + echo " " + echo " use -mo i8 " + echo " " + exit + ;; + esac + setmode=false + fi + if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then + echo + echo warning: the option -mo is deprecated, as of Marc 2015, only the integer*8 version is available + echo + setmode=true + fi + if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + fi + if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then + modeerror="bad value for mode option; only i8 is supported." + modeoption=error + echo + echo $modeerror + echo + fi +done + +# set to i4 version for 32 bit Linux +if test "`uname -s`" = "Linux"; then + if test "`uname -m`" = "i686"; then + mode=i4 + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + fi +fi + + +. "$DIR/getarch" + +. $MARC_INCLUDE +# + +# +# Dynamically determine the echo syntax +# + +case "`echo '\c'`" in + '\c') + ECHO='echo -n' + ECHOTXT=' ' + ;; + *) + ECHO='echo' + ECHOTXT=' \c' + ;; +esac + +# +# Variables for the MARC environment +# + +PRODUCT="Marc" +EXITMSG=$MARC_TOOLS/MESSAGES +export EXITMSG +FLEXDIR=$DIR/../flexlm/licenses +export FLEXDIR +TIMCHK=3600 +export TIMCHK +BINDIR=$MARC_BIN +export BINDIR +AFMATDAT=$MARC_RUNTIME/AF_flowmat/ +export AFMATDAT +export MESHERDIR +MSC_LICENSE_FINPROC=1 +export MSC_LICENSE_FINPROC +# +# define directory path to global unified material database +# +MATFILE= +export MATFILE + +# +# define memory limit +# first set to MEMLIMIT from include +# -ml option overrules if specified +memlimit=$MEMLIMIT +# +# Define share library path based on platforms +# This is required for using the Patran Mesher +# +if test $MACHINENAME = "HP" +then + SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH + export SHLIB_PATH +fi +# the one for IBM is defined futher down + +LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$MESHERDIR:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$SFMATDIR:$LD_LIBRARY_PATH +LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH +LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH +export LD_LIBRARY_PATH +export LD_LIBRARY64_PATH +export LD_LIBRARYN32_PATH + +atexit() { +kill -15 $$ +# +if test $MPITYPE = "myrinet" +then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi +fi +} + +trap "atexit" 2 + +# +# defaults +# + +prog=marc +exefile=marc +jid= +rid= +pid= +sid= +did= +vid= +user= +usernoext= +objs= +qid=background +cpu= +priority= +att= +trk= +verify=yes +prgsav=no +rmdll=no +cpdll=no +progdll= +pathdll= +error= +nprocd=0 +nprocdddm=1 +nprocdddmprint= +icreated=0 +nprocdarg= +nsolver=0 +nsolverarg=-ns +if test $nprocds +then + if test $nprocds -gt 1 + then + nprocdddm=$nprocds + nprocdddmprint=$nprocds + icreated=1 + nprocdarg=-nprocds + fi +fi +ntprint=0 +nt=-1 +nte=-1 +nts=-1 +ntarg=-nt +ntearg=-nte +ntsarg=-nts +nteprint= +ntsprint= +gpuids= +nauto=0 +ndcoup=0 +ndytran=0 +noutcore=0 +dllrun=0 +mesh=0 +itree=0 +iam= +ddm_arc=0 +link= +trkrun=0 +DIRJOB=`pwd` +DIRSCR=$DIRJOB +DIRSCRSET= +autoforge=0 +dotdat=.dat +dotdefhost=.defhost +host= +numhost= +mfile= +userhost= +makebdf= +cpinput=yes +cpresults=yes +marcdll=libmarc.$EXT_DLL +# define hostname and strip off extensions (alpha.aaa.com) +thishost=`hostname` +thishost=${thishost%%.*} +compatible=unknown +numfield=1 +justlist= +feature= +mpioption=false +iprintsimufact= +MDSRCLIB=$MARC_LIB/mdsrc.a +# +# check run_marc_defaults file for default MPI setting +# located in the tools directory of the Marc installation +# or in the user's home directory +# format: +# MARC_MPI +# +value= +file= +if test -f $DIRSCRIPT/run_marc_defaults; then + value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` + value=`echo $value | $AWK '{print $NF}'` + if test -n "$value"; then + file=$DIRSCRIPT/run_marc_defaults + fi +fi +if test -f $HOME/run_marc_defaults; then + value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` + value=`echo $value | $AWK '{print $NF}'` + if test -n "$value"; then + file=$HOME/run_marc_defaults + fi +fi +if test -n "$value"; then + MARC_MPITYPE=$value + notok=true + for i in "$MPI_OTHER"; do + if test "$MARC_MPITYPE" = "$i"; then + notok=false + fi + done + if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then + notok=false + fi + if $notok; then + echo " " + echo " error, incorrect option for MARC_MPI" + echo " defined in $file: $MARC_MPITYPE" + echo " valid options: $MPI_DEFAULT $MPI_OTHER" + echo " " + exit + fi + if test "$value" != "$MPI_DEFAULT"; then + exefile=marc_$value + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a_$value + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" + fi + fi +fi +# +# +# allow scratch directory to be specified with environmental variable +# MARCSCRATCH +if test $MARCSCRATCH +then + if test -d $MARCSCRATCH + then + DIRSCR=$MARCSCRATCH + else + echo "error, scratch directory '$MARCSCRATCH'" + echo " specified via environmental variable MARCSCRATCH does not exist" + exit + fi +fi +# +############################################################################## +# parse input - arguments always come in pairs # +############################################################################## + +arg=$1 +if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then + shift + arg=$1 +fi +while [ -n "$arg" ] +do + shift + value=$1 + case $arg in + -al* | -AL*) + LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH + $MARC_BIN/marc -alloc 1 + exit + ;; + -li* | -LI*) + justlist=yes + ;; + -fe* | -FE*) + feature=$value + + ;; + -pr* | -PR*) + if test `dirname $value` = '.' + then + prog=`$BASENAME $value .marc` + progdll=`$BASENAME $value` + else + prog=`dirname $value`/`$BASENAME $value .marc` + progdll=`dirname $value`/`$BASENAME $value` + fi + prdir=`dirname $value` + case $prdir in + \/*) + ;; + *) + prog=`pwd`/$prdir/$prog + ;; + esac + ;; + -j* | -J*) + jid=`$BASENAME $value $dotdat` + DIRJID=`dirname $value` + case $DIRJID in + \/*) + ;; + *) + DIRJID=`pwd`/$DIRJID + ;; + esac + ;; + -r* | -R*) + rid=`$BASENAME $value .t08` + DIRRID=`dirname $value` + case $DIRRID in + \/*) + ;; + *) + DIRRID=`pwd`/$DIRRID + ;; + esac + ;; + -si* | -SI*) + sid=$value + DIRSID=`dirname $value` + case $DIRSID in + \/*) + ;; + *) + DIRSID=`pwd`/$DIRSID + ;; + esac + ;; + -pi* | -PI*) + if test -f $value.t19 + then + pid=`$BASENAME $value .t19` + else + pid=`$BASENAME $value .t16` + fi + DIRPID=`dirname $value` + case $DIRPID in + \/*) + ;; + *) + DIRPID=`pwd`/$DIRPID + ;; + esac + ;; + -bdf | -BDF) + makebdf=1 + ;; + -de* | -DE*) + did=`$BASENAME $value $dotdat` + DIRDID=`dirname $value` + case $DIRDID in + \/*) + ;; + *) + DIRDID=`pwd`/$DIRDID + ;; + esac + ;; + -vf | -VF) + vid=`$BASENAME $value .vfs` + DIRVID=`dirname $value` + case $DIRVID in + \/*) + ;; + *) + DIRVID=`pwd`/$DIRVID + ;; + esac + ;; + -u* | -U*) + user=$value + case $user in + \/*) + ;; + *) + user=`pwd`/$user + ;; + esac + usernoext=$user + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + ;; + -obj | -OBJ) + objs="$value" + ;; + -q* | -Q*) + qid=$value + ;; + -b* | -B*) + case $value in + y* | Y*) + qid=background + ;; + n* | N*) + qid=foreground + ;; + *) + ;; + esac + ;; + -at | -AT) + att=$value + ;; + -cpu* | -CPU*) + cpu=$value + ;; + -pq | -PQ*) + priority=$value + ;; + -v* | -V*) + verify=$value + ;; + -sa* | -SA*) + prgsav=$value + ;; + -np* | -NP*) + nprocdddm=$value + nprocdddmprint=$value + case $arg in + -nps* | -NPS* | -nprocds* | -NPROCDS*) + icreated=1 + nprocdarg=-nprocds + ;; + esac + case $arg in + -np | -NP | -nprocd | -NPROCD) + icreated=0 + nprocdarg=-nprocd + ;; + esac + ;; + -ns* | -NS*) + nsolver=$value + ;; + -nt* | -NT*) + case $arg in + -nte | -NTE | -nthread_e* | -NTHREAD_E*) + nte=$value + ;; + esac + case $arg in + -nts | -NTS | -nthread_s* | -NTHREAD_S*) + nts=$value + ;; + esac + case $arg in + -nt | -NT | -nth* | -NTH* | -nthread* | -NTHREAD*) + nt=$value + ;; + esac + ;; + -gp* | -GP*) + gpuids=$value + ;; + -it* | -IT*) + itree=$value + ;; + -iam | -IAM) + iam=$value + case $value in + sfg | sfm | sim) + iprintsimufact=true + ;; + esac + ;; + -au* | -AU*) + nauto=$value + ;; + -dc* | -DC*) + ndcoup=$value + ;; + -dy* | -DY*) + ndytran=$value + ;; + -ou* | -OU*) + noutcore=$value + ;; + -dll | -DLL) + dllrun=$value + ;; + -trk | -TRK) + trkrun=$value + ;; + -ddm | -DDM) + ddm_arc=$value + ;; + -me | -ME ) + mesh=$value + ;; + -ml | -ML ) + memlimit=$value + ;; + -mo | -MO ) + ;; + -mpi | -MPI ) + mpioption=true + MARC_MPITYPE=$value + if test "$value" != "$MPI_DEFAULT"; then + exefile=marc_$value + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a_$value + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" + fi + else + exefile=marc + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" + fi + fi + ;; + -dir* | -DIR*) + DIRJOB=$value + case $DIRJOB in + \/*) + ;; + *) + DIRJOB=`pwd`/$DIRJOB + ;; + esac + if test -z "$DIRSCRSET" + then + DIRSCR=$DIRJOB + fi + ;; + -sd* | -SD*) + DIRSCR=$value + DIRSCRSET=yes + case $DIRSCR in + \/*) + ;; + *) + DIRSCR=`pwd`/$DIRSCR + ;; + esac + ;; + -ho* | -HO*) + host=$value + ;; + -co* | -CO*) + compatible=$value + ;; + -ci* | -CI*) + cpinput=$value + ;; + -cr* | -CR*) + cpresults=$value + ;; + *) + error="$error +$arg: invalid option" + break + ;; + esac + case $value in + -*) + error="$error +$arg: invalid name $value" + break + ;; + esac + shift + arg=$1 + if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then + shift + arg=$1 + fi +done +argc=`expr $# % 2` +if test $argc -eq 1 +then +# +# odd number of arguments +# + error="$error +argument list incomplete" +fi + +if test $nprocdddm -gt 0 +then +nprocd=$nprocdddm +fi + +if test $nsolver -gt 0 +then + if test $nsolver -gt $nprocd + then + nprocd=$nsolver + fi +fi +# Set defaults +if test $nt -eq -1 +then +nt=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nt -lt 0 +then +nt=0 +fi +if test $nte -eq -1 +then +nte=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nte -lt 0 +then +nte=0 +fi +if test $nts -eq -1 +then +nts=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nts -lt 0 +then +nts=0 +fi +# +# set number of element loop threads +# +ntprint=$nt +nteprint=$nte +# copy from -nprocd[s] +if test $nprocdddm -gt 1 +then + nteprint=$nprocdddm +fi +# override with -nthread_elem option +if test $nte -ne 0 +then +nteprint=$nte +fi +# check for minimum 1 threads per processes for DDM +if test $nprocdddm -gt 1 +then + if test $nteprint -lt $nprocdddm + then + nteprint=$nprocdddm + fi +fi +nte=$nteprint +# +# set number of Solver threads +# +ntsprint=$nts +# copy from -nthread or -nprocd[s] +if test $ntprint -ne 0 +then + ntsprint=$ntprint +else + if test $nprocdddm -gt 1 + then + ntsprint=$nprocdddm + fi +fi +# override with -nthread_solver option +if test $nts -ne 0 +then + ntsprint=$nts +fi +# check for minimum 1 threads per solver process. +if test $nsolver -lt $nprocdddm +then + if test $ntsprint -lt $nsolver + then + ntsprint=$nsolver + fi +else + if test $ntsprint -lt $nprocdddm + then + ntsprint=$nprocdddm + fi +fi +if test $ntsprint -eq 1 +then + set ntsprint=0 +fi +nts=$ntsprint + +# set stack size for multi-threading. +export KMP_MONITOR_STACKSIZE=7M +export OMP_STACKSIZE=7M + +# +# deprecate -nthread option at arugment of marc +nt=0 +# Reset nprocdddmm, nsolver and threads if not given. +if test $nprocdddm -eq 0 +then + nprocdarg= +fi +if test $nprocdddm -eq 0 +then + nprocdddmprint= +fi +if test $nprocdddm -eq 0 +then + nprocdddm= +fi + +if test $nsolver -eq 0 +then + nsolverprint= +fi +# end of threads setting. +gpuoption= +if test "$gpuids" = "" ; then + gpuoption= +else + gpuoption="-gp $gpuids" +fi + +if test "$gpuids" = "" ; then + export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH +else + MARCCUDALIBS=$MARCCUDALIBS2 + export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH +fi +# Linux 64 + HPMPI, Below code is taken from include_linux64 +if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" +then + export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" +fi + +if test $nprocd -gt 1; then + if test -f $jid$dotdefhost; then + if test "$host" = ""; then + host=$jid$dotdefhost + fi + fi + if test -f hostfile_qa_$nprocd; then + if test "$host" = ""; then + host=hostfile_qa_$nprocd + fi + fi +fi + +if test "$dllrun" -gt 0; then + exefile=exe_marc + prog=exe_marc + program=$exefile + bd=$MARC_BIN/ + if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then + dotdat=.inp + fi + + if test "$progdll"; then + /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll + rmdll=yes + pathdll=yes + progdll=${progdll}_$marcdll + else + progdll=$marcdll + fi + + if test "$user"; then + . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user + user= + if test $prgsav = no; then + rmdll=yes + fi + if test $prgsav = yes; then + cpdll=yes + rmdll=yes + fi + pathdll=yes + fi +fi + +############################################################################## +# check parameter validity # +############################################################################## + +while test forever; do + +# +# check for input file existence +# +if test $nprocdddm -gt 1 -a $icreated -eq 0; then + if test ! -f $DIRJID/1$jid$dotdat; then + if test "$jid" != "" ; then + error="$error +input file $DIRJID/1$jid$dotdat not accessible" + fi + fi +else + if test ! -f $DIRJID/$jid$dotdat; then + if test "$jid" != "" ; then + error="$error +input file $DIRJID/$jid$dotdat not accessible" + fi + fi +fi + if test $nprocd -gt 1; then + if test "$host" ; then + if test ! -f $host; then + error="$error +host name file $host not accessible" + fi + fi + fi + +# +# check if the job is already running in the background +# +if test -f $DIRJOB/$jid.pid; then + error="$error +job is already running (the file $jid.pid exists)" +fi + +# +# if the program name is other than marc, then +# assume that this is a program in the users local directory +# + +bd=$MARC_BIN/ + +case $prog in + marc | MARC | $exefile) + program=$exefile + if test "$rid" + then + if test ! -f $DIRRID/$rid.t08 + then + error="$error +restart file $DIRRID/$rid.t08 not accessible" + fi + fi + if test "$pid" + then + if test ! -f $DIRPID/$pid.t16 + then + if test ! -f $DIRPID/$pid.t19 + then + error="$error +post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" + fi + fi + fi + if test "$user" + then + if test ! -f $user + then + error="$error +user subroutine file $user not accessible" + fi + fi + if test "$objs" + then + missingobjs= + for o in $objs + do + if test ! -f "$o" + then + if test -z "$missingobjs" + then + missingobjs="$o" + else + missingobjs="$missingobjs $o" + fi + fi + done + if test -n "$missingobjs" + then + error="$error +user object/library file(s) $missingobjs not accessible" + fi + fi + if test "$did" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRDID/1$did$dotdat + then + error="$error +defaults file $DIRDID/1$did$dotdat not accessible" + fi + else + if test ! -f $DIRDID/$did$dotdat + then + error="$error +defaults file $DIRDID/$did$dotdat not accessible" + fi + fi + fi + if test "$vid" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRVID/1$vid.vfs + then + error="$error +view factor file $DIRVID/1$vid.vfs not accessible" + fi + else + if test ! -f $DIRVID/$vid.vfs + then + error="$error +view factor file $DIRVID/$vid.vfs not accessible" + fi + fi + fi + if $mpioption + then + notok=true + for i in "$MPI_OTHER"; do + if test "$MARC_MPITYPE" = "$i"; then + notok=false + fi + done + if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then + notok=false + fi + if $notok; then + error="$error +incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" + fi + fi + ;; + *) + program=$prog.marc + case $prog in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + if test "$rid" + then + if test ! -f $DIRRID/$rid.t08 + then + error="$error +restart file $DIRRID/$rid.t08 not accessible" + fi + fi + if test "$pid" + then + if test ! -f $DIRPID/$pid.t16 + then + if test ! -f $DIRPID/$pid.t19 + then + error="$error +post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" + fi + fi + fi + if test "$user" + then + error="$error +program option may not be used with user subroutine" + fi + if test "$objs" + then + error="$error +program option may not be used with user objects or libraries" + fi + if test "$did" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRDID/1$did$dotdat + then + error="$error +defaults file $DIRDID/1$did$dotdat not accessible" + fi + else + if test ! -f $DIRDID/$did$dotdat + then + error="$error +defaults file $DIRDID/$did$dotdat not accessible" + fi + fi + fi + if test "$nauto" + then + if test $nauto -gt 2 + then + error="$error +incorrect option for auto restart " + fi + fi + if test "$ndcoup" + then + if test $ndcoup -gt 3 + then + error="$error +incorrect option for contact decoupling " + fi + fi + if test "$ndytran" + then + if test $ndytran -gt 1 + then + error="$error +incorrect option for Marc-Dytran Switch " + fi + fi + if $mpioption + then + if test ! -x $MARC_BIN/$exefile + then + error="$error +incorrect option for -mpi option: $MARC_MPITYPE " + fi + fi + ;; +esac + +############################################################################## +# check argument integrity # +############################################################################## + +if test "$jid" +then + : +else + if test "$user" + then +# allow user sub without giving job id + qid=foreground + verify=no + else + error="$error +job id required" +fi +fi + +if test $nprocd -gt 1 +then + if test $nauto -gt 0 + then + error="$error +cannot run DDM job with auto restart (-au) option " + fi +fi +case $qid in + S* | s*) + qid=short + ;; + L* | l*) + qid=long + ;; + V* | v*) + qid=verylong + ;; + B* | b*) + qid=background + ;; + F* | f*) + qid=foreground + ;; + A* | a*) + qid=at + ;; + *) + error="$error +bad value for queue_id option" + ;; +esac + +case $prgsav in + N* | n*) + prgsav=no + ;; + Y* | y*) + prgsav=yes + ;; + *) + error="$error +bad value for save option" + ;; +esac + +case $verify in + N* | n*) + verify=no + ;; + Y* | y*) + verify=yes + ;; + *) + error="$error +bad value for verify option" + ;; +esac + +case $nprocdddm in + -* ) + error="$error +bad value for nprocd option" + ;; +esac + +case $nt in + -* ) + error="$error +bad value for nt option" + ;; +esac + +case $itree in + -* ) + error="$error +bad value for itree option" + ;; +esac +case $iam in + -* ) + error="$error +bad value for iam option" + ;; +esac +case $compatible in + N* | n*) + compatible=no + ;; + Y* | y*) + compatible=yes + ;; + unknown) + ;; + *) + error="$error +bad value for comp option" + ;; +esac +case $cpinput in + N* | n*) + cpinput=no + ;; + Y* | y*) + cpinput=yes + ;; + *) + error="$error +bad value for copy input option" + ;; +esac +case $cpresults in + N* | n*) + cpresults=no + ;; + Y* | y*) + cpresults=yes + ;; + *) + error="$error +bad value for copy results option" + ;; +esac + +# +# check for external file to run +# +if test -f $MARC_TOOLS/run_marc_check +then + . $MARC_TOOLS/run_marc_check +fi + +############################################################################## +# interact with the user to get the required information to run marc or # +# other marc system program # +############################################################################## + +deletelog=yes +if test $qid = background -a $verify = no +then +echo \ +" +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid +User subroutine name : $user +User objects/libs : $objs +Restart file job ID : $rid +Substructure file ID : $sid +Post file job ID : $pid +Defaults file ID : $did +View Factor file ID : $vid +Save generated module: $prgsav +MPI library : $MPITYPE +DDM processes : $nprocdddmprint +Element loop threads : $nteprint +Solver processes : $nsolverprint +Solver threads : $ntsprint +GPGPU option : $gpuids +Host file name : $host" > $jid.log +if test "$iprintsimufact" = true ; then + echo "DDM with ARC Mapper : $ddm_arc" >> $jid.log +fi +echo \ +"Message passing type : $itree +Run job in queue : $qid +Run directory : $DIRJOB +Scratch directory : $DIRSCR +Memory limit in Mbyte: $memlimit +Auto Restart : $nauto " >> $jid.log +deletelog=no +fi +echo \ +" +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid +User subroutine name : $user +User objects/libs : $objs +Restart file job ID : $rid +Substructure file ID : $sid +Post file job ID : $pid +Defaults file ID : $did +View Factor file ID : $vid +Save generated module: $prgsav +MPI library : $MPITYPE +DDM processes : $nprocdddmprint +Element loop threads : $nteprint +Solver processes : $nsolverprint +Solver threads : $ntsprint" +if test "$iprintsimufact" = true ; then + echo "DDM with ARC Mapper : $ddm_arc" +fi +echo \ +"GPGPU option : $gpuids +Host file name : $host +Message passing type : $itree +Run job in queue : $qid +Run directory : $DIRJOB +Scratch directory : $DIRSCR +Memory limit in Mbyte: $memlimit +Auto Restart : $nauto" + + +case $qid in + s* | S* | l* | L* | v* | V* ) + echo \ +"Queue priority : $priority +Queue CPU limit : $cpu +Queue start time : $att" + ;; +# * ) +# echo \ +#" " +# ;; +esac + +if test "$modeoption" +then + error=$modeerror +fi + +if test "$error" +then + if test $verify = yes + then + $ECHO "$error + +Please correct or quit(correct,quit,): $ECHOTXT" + error= + read answer + case $answer in + q* | Q*) + answer=quit + ;; + *) + answer=correct + ;; + esac + else + $ECHO "$error + $ECHOTXT" + echo " " + if test "$deletelog" = no + then + $ECHO "$error + $ECHOTXT" >> $jid.log + echo " " >> $jid.log + fi + answer=quit + fi +else + if test $verify = yes + then + $ECHO " +Are these parameters correct (yes,no,quit,)? $ECHOTXT" + read answer + case $answer in + q* | Q*) + answer=quit + ;; + y* | Y*) + answer=yes + ;; + *) + answer=no + ;; + esac + else + answer=yes + fi +fi + +case $answer in + no | correct) + +############################################################################## +# prompt for each value # +############################################################################## + + $ECHO " +Program name ($prog)? $ECHOTXT" + read value + if test "$value" + then + prog=$value + fi + $ECHO "Job ID ($jid)? $ECHOTXT" + read value + if test "$value" + then + jid=`$BASENAME $value $dotdat` + DIRJID=`dirname $value` + case $DIRJID in + \/*) + ;; + *) + DIRJID=`pwd`/$DIRJID + ;; + esac + fi + $ECHO "User subroutine name ($user)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + user= + ;; + *) + user=$value + case $user in + \/*) + ;; + *) + user=`pwd`/$user + ;; + esac + usernoext=$user + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + ;; + esac + fi + $ECHO "User objects or libraries ($objs)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + objs= + ;; + *) + objs="$value" + ;; + esac + fi + $ECHO "Restart File Job ID ($rid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + rid= + ;; + *) + rid=`$BASENAME $value .t08` + DIRRID=`dirname $value` + case $DIRRID in + \/*) + ;; + *) + DIRRID=`pwd`/$DIRRID + ;; + esac + ;; + esac + fi + $ECHO "Substructure File ID ($sid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + sid= + ;; + *) + sid=$value + DIRSID=`dirname $value` + case $DIRSID in + \/*) + ;; + *) + DIRSID=`pwd`/$DIRSID + ;; + esac + ;; + esac + fi + $ECHO "Post File Job ID ($pid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + pid= + ;; + *) + pid=$value + DIRPID=`dirname $value` + case $DIRPID in + \/*) + ;; + *) + DIRPID=`pwd`/$DIRPID + ;; + esac + ;; + esac + fi + $ECHO "Defaults File ID ($did)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + did= + ;; + *) + did=`$BASENAME $value $dotdat` + DIRDID=`dirname $value` + case $DIRDID in + \/*) + ;; + *) + DIRDID=`pwd`/$DIRDID + ;; + esac + ;; + esac + fi + $ECHO "View Factor File ID ($vid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + vid= + ;; + *) + vid=`$BASENAME $value .vfs` + DIRVID=`dirname $value` + case $DIRVID in + \/*) + ;; + *) + DIRVID=`pwd`/$DIRVID + ;; + esac + ;; + esac + fi + $ECHO "Save generated module ($prgsav)? $ECHOTXT" + read value + if test "$value" + then + prgsav=$value + fi + $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" + read value + if test "$value" + then + nprocdddm=$value + nprocdddmprint=$value + fi + $ECHO "Run on ($nte) Element loop threads ? $ECHOTXT" + read value + if test "$value" + then + nte=$value + fi + $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" + read value + if test "$value" + then + nsolver=$value + fi + $ECHO "Run on ($nts) Solver threads ? $ECHOTXT" + read value + if test "$value" + then + nts=$value + fi +# + if test $nprocdddm -gt 0 + then + nprocd=$nprocdddm + fi + if test $nsolver -gt 0 + then + if test $nsolver -gt $nprocd + then + nprocd=$nsolver + fi + fi +# Element loop threads. + if test $nte -eq -1 + then + nte=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nte -lt 0 + then + nte=0 + fi + nteprint=$nte +# Copy from ddm + if test $nprocdddm -gt 1 + then + nteprint=$nprocdddm + fi +# override with -nthread_elem option + if test $nte -ne 0 + then + nteprint=$nte + fi +# check for minimum 1 threads per processes for DDM + if test $nprocdddm -ne 0 + then + if test $nteprint -lt $nprocdddm + then + nteprint=$nprocdddm + fi + fi + nte=$nteprint +# Solver threads. + if test $nts -eq -1 + then + nts=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nts -lt 0 + then + nts=0 + fi + ntsprint=$nts +# Copy from ddm + if test $nprocdddm -gt 1 + then + ntsprint=$nprocdddm + fi +# override with -nthread_solver option + if test $nts -ne 0 + then + ntsprint=$nts + fi +# check for minimum 1 threads per solver process. + if test $nsolver -lt $nprocdddm + then + if test $ntsprint -lt $nsolver + then + ntsprint=$nsolver + fi + else + if test $ntsprint -lt $nprocdddm + then + ntsprint=$nprocdddm + fi + fi + if test $ntsprint -eq 1 + then + set ntsprint=0 + fi + nts=$ntsprint + $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" + read value + if test "$value" + then + gpuids=$value + fi + if test "$gpuids" = "" ; then + gpuoption= + else + gpuoption="-gp $gpuids" + fi + if test "$gpuids" = "" ; then + export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH + else + MARCCUDALIBS=$MARCCUDALIBS2 + export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH + fi + if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" + then + export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" + fi +# + if test $nprocd -gt 1 + then + $ECHO "Message passing type ($itree)? $ECHOTXT" + read value + if test "$value" + then + itree=$value + fi + $ECHO "Host file name ($host)? $ECHOTXT" + read value + if test "$value" + then + host=$value + fi + if test $nprocdddm -gt 1 + then + $ECHO "Single input file? $ECHOTXT" + read value + case $value in + y* | Y*) + icreated=1 + nprocdarg=-nprocds + ;; + esac + $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" + read value + if test "$value" + then + compatible=$value + fi + $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" + read value + if test "$value" + then + cpinput=$value + fi + $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" + read value + if test "$value" + then + cpresults=$value + fi + fi + fi + $ECHO "Run the job in the queue ($qid)? $ECHOTXT" + read value + if test "$value" + then + qid=$value + fi + case $qid in + s* | S* | l* | L* | v* | V* ) + $ECHO "Queue priority ($priority)? $ECHOTXT" + read value + if test "$value" + then + priority=$value + fi + $ECHO "Job starts at ($att)? $ECHOTXT" + read value + if test "$value" + then + att=$value + fi + $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" + read value + if test "$value" + then + cpu=$value + fi + ;; + * ) + ;; + esac + $ECHO "Auto Restart option ($nauto)? $ECHOTXT" + read value + if test "$value" + then + nauto=$value + fi + $ECHO "Run directory ($DIRJOB)? $ECHOTXT" + read value + if test "$value" + then + DIRJOB=$value + DIRSCR=$DIRJOB + fi + $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" + read value + if test "$value" + then + DIRSCR=$value + fi + ;; + quit) + exit 1 + ;; + *) + break + ;; + +esac + + if test $nt -eq -1 + then + nt=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nt -lt 0 + then + nt=0 + fi + +done +# +if test $nt -eq 0 +then + ntarg= +fi +if test $nt -eq 0 +then + ntprint= +fi +if test $nt -eq 0 +then + nt= +fi + +if test $nte -eq 0 +then + ntearg= +fi +if test $nte -eq 0 +then + nteprint= +fi +if test $nte -eq 0 +then + nte= +fi + +if test $nts -eq 0 +then + ntsarg= +fi +if test $nts -eq 0 +then + ntsprint= +fi +if test $nts -eq 0 +then + nts= +fi +# +if test "$dllrun" -gt 0; then + exefile=exe_marc + prog=exe_marc + program=$exefile + bd=$MARC_BIN/ + if test "$user"; then + . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user + user= + pathdll=yes + if test $prgsav = no; then + rmdll=yes + fi + if test $prgsav = yes; then + cpdll=yes + rmdll=yes + fi + fi + + if test "$pathdll"; then +# +# reset share lib path +# + if test $MACHINENAME = "HP" + then + SHLIB_PATH=$DIRJOB:$SHLIB_PATH + export SHLIB_PATH + fi + if test $MACHINENAME = "IBM" + then + LIBPATH=$DIRJOB:$LIBPATH + export LIBPATH + fi +# + LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH + LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH + LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH + export LD_LIBRARY_PATH + export LD_LIBRARY64_PATH + export LD_LIBRARYN32_PATH + fi +fi +# end of dllrun>0 + + +if test $program = $exefile -o $program = $prog.marc +then + +# delete the old .log file unless we run in the background +if test "$deletelog" = yes +then + if test "$jid" + then + /bin/rm $jid.log 2>/dev/null + fi +else + echo + echo running the job in the background, see $jid.log + echo +fi + +# +# check if this is an autoforge or rezoning or radiation job +# +if test $nprocd -eq 1 -a "$jid" + +then + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` + if test "$line" + then + autoforge=1 + fi + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` + if test "$line" + then + autoforge=1 + fi + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` + if test "$line" + then + autoforge=1 + fi +fi +# +# check that jobname for restarted run is not the same +# as restart file basename +# +if test "$rid" +then + if test "$jid" = "$rid" + then + echo " " + echo "ERROR: job name of current run is the same as job name" + echo " of the restarted job" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "ERROR: job name of current run is the same as job name" >> $jid.log + echo " of the restarted job" >> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi +fi + +# +# user objects/libraries used +# + + if test "$objs" + then + program="$DIRJOB/$jid.marc" + case $program in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + link=yes + fi + +# +# user subroutine used +# +# add DAMASK options for linking + DAMASK="-lstdc++" + + if test "$user" + then + program=$usernoext.marc + case $program in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + link=yes + fi + +# +# Special case for IBM using POE but not an SP machine +# in this case we always need a host file, also for serial jobs. +# +if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP +then + MP_HOSTFILE=${jid}.host + if test -f $jid.host + then + /bin/rm $jid.host 2> /dev/null + fi + if test $nprocd -gt 1 + then + numdom=$nprocd + while test $numdom -gt 0 + do + hostname -s >> $MP_HOSTFILE + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + else + hostname -s > $MP_HOSTFILE + fi +fi +# +# check ssh for all hosts in host file +# +if test $nprocd -gt 1 +then +if test $MPITYPE = "intelmpi" -a "$INTELMPI_VERSION" = "HYDRA" + then +# get host list + if test "$host" + then + line=`grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' | uniq` +# count failing hosts + counter=0 + for i in $line + do + $RSH -o BatchMode=yes -o ConnectTimeout=10 $i uname -n + status=$? + if [[ $status != 0 ]] ; then + counter=$((counter+1)) + if [ "$counter" = "1" ]; then + echo " " + echo " error - connection test failed... " + echo " " + fi + echo " " + echo " connection test with ssh failed on host $i" + echo " check the following command: ssh $i uname -n " + echo " " + fi + done +# echo error message and quit + if test $counter -ne 0 + then + echo " " + echo " A parallel job using IntelMPI cannot be started. " + echo " The ssh command must be working correctly between " + echo " the computers used in the analysis. Furthermore, " + echo " it must be set up such that it does not prompt the " + echo " user for a password. " + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo " A parallel job using IntelMPI cannot be started. ">> $jid.log + echo " The ssh command must be working correctly between ">> $jid.log + echo " the computers used in the analysis. Furthermore, ">> $jid.log + echo " it must be set up such that it does not prompt the ">> $jid.log + echo " user for a password. ">> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + fi +fi +fi +# +# check correctness of host file; fix for user sub +# + if test $nprocd -gt 1 + then + +# construct the path name to the executable (execpath) + execpath=$MARC_BIN/$exefile + usersub=0 + if test $program = $prog.marc + then + execpath=$prog.marc + usersub=1 + fi + if test "$objs" + then + execpath="$DIRJOB/$jid.marc" + usersub=1 + fi + if test "$user" + then + execpath=$usernoext.marc + usersub=1 + fi + export execpath + execname=`$BASENAME $execpath` + + if test "$host" + then + userhost=$host + case $userhost in + \/* | \.\/*) + ;; + *) + userhost=`pwd`/$userhost + ;; + esac + +# check that the number of processes specified in the hostfile is +# equal to nprocd specified by -nprocd. + numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` + if test $nprocd -ne $numproc + then + echo " " + echo "error, the number of processes specified in the host file" + echo "must be equal to the number of processes given by -nprocd/-nsolver" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, the number of processes specified in the host file" >> $jid.log + echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + +# check for Myrinet that the number of processes per host is +# less than number of available user ports, 5 +# .gmpi directory must exist in user's home directory +# and must have write permission from remote hosts + if test $MPITYPE = "myrinet" + then + numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` + if test $numproc -gt 5 + then + echo " " + echo "error, for Myrinet the number of processes specified " + echo "in the hostfile must not exceed 5 for a hostname" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet the number of processes specified " >> $jid.log + echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + if test ! -d ~/.gmpi + then + echo " " + echo "error, for Myrinet a .gmpi directory must exist " + echo "under the user's home directory" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log + echo "under the user's home directory" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + homedir=`echo ~` + for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ + if test -s tmp.$$ + then + echo " " + echo "error, for Myrinet a shared .gmpi directory must exist " + echo "under the user's home directory " + echo "with remote write permission" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log + echo "under the user's home directory " >> $jid.log + echo "with remote write permission" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + else + /bin/rm tmp.$$ + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + fi + fi + done + fi + fi + +# construct the host file $jid.host which is used by mpirun +# skip lines starting with # and only consider lines with more than +# one word in them. Note that the hostfile given to this script +# has two columns: the host name and the number of shared processes +# to run on this host. mpirun wants the number of _other_ +# processes to run in addition to the one being run on the machine +# on which the job is started. hence the $2-1 for fnr == 1. + if test -f $jid.host + then + /bin/rm $jid.host 2> /dev/null + fi + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then +# HPMPI or HP hardware MPI + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ + -v mpihpspecial="$MPIHPSPECIAL" \ +'{if ( NF > 0) {\ + fnr++ ; \ + printf("-h %s -np %s",$1,$2); \ + printf(" %s",mpihpspecial); \ + if ( NF == 2 ) printf(" %s\n",path);\ + if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ + if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ + }\ + }' > $jid.host +# end HPMPI or HP hardware MPI + elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP + then +# IBM using hardware MPI (POE) + MP_HOSTFILE=$jid.host + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host +# end IBM using hardware MPI (POE) +# for Intel MPI, need to create a machinefile for DMP + elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then +# Intel MPI + if test -f $jid.mfile + then + /bin/rm $jid.mfile 2> /dev/null + fi + /bin/cp $host $jid.host + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile +# end Intel MPI for DMP +# for Solaris HPC 7.1, need to create a machinefile for DMP + elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" + then +# Solaris HPC 7.1 + if test -f $jid.mfile + then + /bin/rm $jid.mfile 2> /dev/null + fi + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile +# end Solaris HPC 7.1 for DMP +# for Myrinet, construct a configuration file in ~/.gmpi +# this must be readable by each process +# format is (hostname) (port number) for each process + elif test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + echo $nprocd > ~/.gmpi/$jid.host + grep -v '^#' $host | $AWK \ +'BEGIN {iport[0] = 2; \ + iport[1] = 4; \ + iport[2] = 5; \ + iport[3] = 6; \ + iport[4] = 7 \ + } \ +{if ( NF > 0 ) \ + for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ +}' >> ~/.gmpi/$jid.host + else +# this is for mpich-1.2.5 and later, using the -pg option +# format: host nproc executable user arguments +# the arguments are added later + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ +'{if ( NF > 0) {\ + fnr++ ; \ + if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ + else printf("%s %s",$1,$2); \ + if ( NF == 2 ) printf(" %s %s\n",path,user);\ + if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ + if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ + }\ + }' > $jid.host + fi +# end Myrinet + elif test $MACHINENAME = DEC -a $MPITYPE = hardware + then +# Compaq MPI via Memory Channel + grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host +# end Compaq MPI + else +# MPICH + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ +'{if ( NF > 0) {\ + fnr++ ; \ + if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ + else printf("%s %s",$1,$2); \ + if ( NF == 2 ) printf(" %s\n",path);\ + if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ + if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ + }\ + }' > $jid.host + fi +# define the variable host and host_filt +# host_filt is used for loops over hosts +# for Myrinet we need to use a filtered variant of userhost +# for others we can use $host + if test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + host=~/.gmpi/$jid.host + host_filt=$jid.host_tMp + grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt + else + host=$jid.host + host_filt=$host + fi + else + host=$jid.host + host_filt=$host + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + host_filt=$jid.mfile + fi + fi +# figure out if the machines in the hostfile are nfs mounted +# or distributed and set the variable "dirstatus" accordingly. +# only perform the check if user subroutine is used +# or a user subroutine executable is used + + numfield=1 + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then + numfield=2 + fi + DIR1=$DIRJOB + if test $program = $prog.marc -o -n "$user" -o -n "$objs" + then + counter=0 + echo " " + echo "checking if local or shared directories for host" + if test "$deletelog" = no + then + echo "checking if local or shared directories for host" >> $jid.log + fi + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + dirstatus[$counter]="shared" + $ECHO " $i $ECHOTXT" + if test "$deletelog" = no + then + $ECHO " $i $ECHOTXT" >> $jid.log + fi + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ + if test -s tmp.$$ + then + dirstatus[$counter]="local" + /bin/rm tmp.$$ + else + if test ! -f $jid.$$ + then + dirstatus[$counter]="local" + $RSH $i /bin/rm $DIR1/$jid.$$ + else + /bin/rm $jid.$$ + fi + fi + if test -f tmp.$$ + then + /bin/rm tmp.$$ + fi + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + echo " ${dirstatus[$counter]}" + if test "$deletelog" = no + then + echo " ${dirstatus[$counter]}" >> $jid.log + fi + fi + done + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + fi + fi + +# figure out if this is a compatible set of machines +# unless explicitly specified with flag -comp +# only perform the check if user subroutine is used +# or a user subroutine executable is used +# Myrinet does not support heterogeneous + if test $program = $prog.marc -o -n "$user" -o -n "$objs" + then + if test $compatible = "unknown" + then + thisname=$ARCH + compatible=yes + counter=0 + echo "checking if machines are compatible for host" + if test "$deletelog" = no + then + echo "checking if machines are compatible for host" >> $jid.log + fi + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + compstatus[$counter]="yes" + $ECHO " $i $ECHOTXT" + if test "$deletelog" = no + then + $ECHO " $i $ECHOTXT" >> $jid.log + fi + othername=`$RSH $i uname -a | cut -f 1 -d " "` + if test $thisname != $othername + then + compatible=no + compstatus[$counter]="no" + fi + fi + echo " ${compstatus[$counter]}" + if test "$deletelog" = no + then + echo " ${compstatus[$counter]}" >> $jid.log + fi + done + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + fi + else + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + compstatus[$counter]=$compatible + fi + done + if test $compatible = "no" + then + echo "all machines assumed incompatible" + if test "$deletelog" = no + then + echo "all machines assumed incompatible" >> $jid.log + fi + else + echo "all machines compatible" + if test "$deletelog" = no + then + echo "all machines compatible" >> $jid.log + fi + fi + fi +# error out if user objects or libraries are used on incompatible machines + if test "$compatible" = "no" -a -n "$objs" + then + echo "User object/libraries cannot be used in a parallel job on incompatible machines" + if test "$deletelog" = no + then + echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log + fi + exit 1 + fi +# modify new host file if NFS mounted heterogeneous machine + doit= + if test $program = $prog.marc + then + doit=yes + fi + if test "$user" + then + doit=yes + fi + if test "$doit" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + $AWK -v hst=$i '{fnr++ ; \ +if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ +printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} + /bin/mv $jid.host{$$} $jid.host + host=$jid.host + fi + fi + done + fi + fi # if test $program = $prog.marc -o $user -o $obj + + else # if test $host + # assume shared memory machine if no hostfile given and + # MPITYPE is set to mpich or Myrinet + # check for Myrinet that the total number of processes is + # less than number of available user ports, 5 + if test $MPITYPE = "mpich" -o $MPITYPE = "scali" + then + numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` + echo `hostname` $numproc $execpath > $jid.host + host=$jid.host + elif test $MPITYPE = "myrinet" + then + if test $nprocd -gt 5 + then + echo " " + echo "error, for Myrinet the number of processes " + echo "must not exceed 5 for a hostname" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet the number of processes " >> $jid.log + echo "must not exceed 5 for a hostname" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + echo $nprocd > ~/.gmpi/$jid.host + echo `hostname` $nprocd | $AWK \ +'BEGIN {iport[0] = 2; \ + iport[1] = 4; \ + iport[2] = 5; \ + iport[3] = 6; \ + iport[4] = 7 \ + } \ + {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ +' >> ~/.gmpi/$jid.host + host=~/.gmpi/$jid.host + else + numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` + echo `hostname` $numproc $execpath > $jid.host + + fi + fi # if test myrinet + + fi # if test $host + + fi # if test $nprocd -gt 1 + +fi # if test $program = $exefile -o $program = $prog.marc + +############################################################################## +# construct run stream (Marc only) # +############################################################################## + +# set maximum message length for ddm to a large number +# for vendor provided mpi +if test $itree -eq 0 -a $MPITYPE = hardware +then + itree=100000000 + if test $MACHINENAME = SGI + then + itree=100000001 + fi +fi +if test $itree -eq 0 -a $MPITYPE = hpmpi +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = myrinet +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = nec +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = scali +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = intelmpi +then + itree=100000000 +fi +if test $nprocdddm -lt 2 +then + nprocdarg= +else + nprocdarg="$nprocdarg $nprocdddm" +fi +if test $nsolver -eq 0 +then + nsolverarg= +else + nsolverarg="$nsolverarg $nsolver" +fi +if test $nprocdddm -lt 2 -a $nsolver -eq 0 +then +nprocd=0 +fi +if test $nprocd -gt 0 +then + if test "$host" + then + if test -z "$RUN_JOB2" + then + echo " " + echo "error: parallel job attempted on non-parallel version," + echo " or, if parallel version is installed, the include " + echo " file is probably corrupted" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error: parallel job attempted on non-parallel version," >> $jid.log + echo " or, if parallel version is installed, the include " >> $jid.log + echo " file is probably corrupted" >> $jid.log + echo " " >> $jid.log + fi + exit + fi + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then + RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP + then + RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" + RUN_JOB=" -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + elif test $MACHINENAME = DEC -a $MPITYPE = hardware + then + RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + numhost=`uniq $jid.mfile | wc -l` + if test "$INTELMPI_VERSION" = "HYDRA" + then + RUN_JOB_TMP="$RUN_JOB2 -configfile $jid.cfile" + else + export I_MPI_JOB_CONTEXT=$$ + mpdboot -n $numhost -r $RSH -f $jid.mfile + RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" + fi + +# intelmpi uses configfile. format: +# -host host1 -n n1 executable marcargs +# one such line per host +# collect the marcargs in RUN_JOB and construct the config file later +# collect the run stream in RUN_JOB_TMP + RUN_JOB="-jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + + + elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" + then + RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + if test "$userhost" + then + RUN_JOB="$RUN_JOB -mhost $userhost" + fi + if test $MPITYPE = "scali" + then +# set default working directory to /tmp to allow +# different directory names + SCAMPI_WORKING_DIRECTORY=/tmp + export SCAMPI_WORKING_DIRECTORY + fi + else + if test -z "$RUN_JOB1" + then + echo " " + echo "error: parallel job attempted on non-parallel version," + echo " or, if parallel version is installed, the include " + echo " file is probably corrupted" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error: parallel job attempted on non-parallel version," >> $jid.log + echo " or, if parallel version is installed, the include " >> $jid.log + echo " file is probably corrupted" >> $jid.log + echo " " >> $jid.log + fi + exit + fi + RUNNPROCD=$nprocd + if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" + then + RUNNPROCD= + MP_PROCS=$nprocd + export MP_PROCS + fi + if test $MPITYPE = "myrinet" + then + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + echo " " > /dev/null + else + export I_MPI_JOB_CONTEXT=$$ + mpdboot -n 1 -f $jid.hosts + fi + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + fi +else + if test $nauto -gt 0 -o $ndcoup -gt 0 + then + RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ +-maxnum $MAXNUM \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else +# this is for a serial job without auto restart: + RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ +-maxnum $MAXNUM \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi +fi +if test "$rid" +then + RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" +fi +if test "$pid" +then + RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" +fi +if test "$sid" +then + RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" +fi +if test "$did" +then + RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" +fi +if test "$vid" +then + RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" +fi +if test $nauto -gt 0 +then + RUN_JOB="$RUN_JOB -autorst $nauto " +fi +if test $ndcoup -gt 0 +then + RUN_JOB="$RUN_JOB -dcoup $ndcoup " +fi +if test $ndytran -gt 0 +then + RUN_JOB="$RUN_JOB -dytran $ndytran " +fi +if test $mesh -gt 0 +then + RUN_JOB="$RUN_JOB -me $mesh " +fi +if test $noutcore -gt 0 +then + RUN_JOB="$RUN_JOB -outcore $noutcore " +fi +if test "$dllrun" -gt 0 +then + RUN_JOB="$RUN_JOB -dll $dllrun " +fi +if test "$trkrun" -gt 0 +then + RUN_JOB="$RUN_JOB -trk $trkrun " +fi +if test "$iam" +then + RUN_JOB="$RUN_JOB -iam $iam " +fi +if test "$justlist" +then + RUN_JOB="$RUN_JOB -list 1 " +fi +if test "$feature" +then + RUN_JOB="$RUN_JOB -feature $feature " +fi +if test "$memlimit" -ne 0 +then + RUN_JOB="$RUN_JOB -ml $memlimit " +fi +if test "$cpinput" +then + RUN_JOB="$RUN_JOB -ci $cpinput " +fi +if test "$cpresults" +then + RUN_JOB="$RUN_JOB -cr $cpresults " +fi +if test "$DIRSCR" != "$DIRJOB" +then + RUN_JOB="$RUN_JOB -dirscr $DIRSCR" +else + DIRSCR=$DIRJOB +fi +if test "$makebdf" +then + RUN_JOB="$RUN_JOB -bdf $makebdf " +fi +if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" +then + # append $RUN_JOB to all lines of the host file + # and set RUN_JOB + $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ + /bin/mv $host.$$ $host + RUN_JOB=$RUN_JOB_TMP +fi +if test $MPITYPE = "intelmpi" -a "$host" +then + # construct config file, append $RUN_JOB to all lines of the config file + # and set RUN_JOB + if test "$INTELMPI_VERSION" = "HYDRA" + then + grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ + '{if ( NF > 0) {\ + printf(" -host %s",$1); \ + printf(" -n %s",$2); \ + if ( NF == 2 ) printf(" %s",path);\ + if ( NF >= 3 ) printf(" -wdir %s ",$3); \ + if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ + printf(" %s\n",args); \ + }\ + }' > $jid.cfile + else + grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ + '{if ( NF > 0) {\ + printf("-host %s -n %s",$1,$2); \ + if ( NF == 2 ) printf(" %s",path);\ + if ( NF >= 3 ) printf(" -wdir %s ",$3); \ + if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ + printf(" %s\n",args); \ + }\ + }' > $jid.cfile + fi + RUN_JOB=$RUN_JOB_TMP +fi +echo " " +echo "Final run stream value" +echo " RUNJOB="$RUN_JOB +if test "$deletelog" = no +then +echo " " >> $jid.log +echo "Final run stream value" >> $jid.log +echo " RUNJOB="$RUN_JOB >> $jid.log +fi + + +############################################################################## +# run marc using valgrind # +############################################################################## +#RUN_JOB="valgrind $RUN_JOB" +#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" +#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" +#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" +############################################################################## + + +############################################################################## +# run the requested program in a queue # +############################################################################## + +if test "$deletelog" = yes +then + echo + date +else + echo >> $jid.log + date >> $jid.log +fi +if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] +then + +/bin/rm -f $jid.runmarcscript + + +# +# compile user subroutine if present +# +if test "$link" +then + if test -z "$FCOMPROOT"; then + echo "$0: No compiler available" + echo + echo " $PRODUCT Exit number 3" + exit 1 + fi + echo + echo "Using compiler from: $FCOMPROOT" + echo + if test "$user" + then + userobj=$usermoext.o + fi + cat > $jid.runmarcscript << END4 + if test "$user" + then + if test $MACHINENAME = "CRAY" + then + $DFORTHIGHMP $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTHIGHMP $user -o $userobj || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + $SOLVERLIBS \ + $MARCCUDALIBS \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $DAMASK \ + $SYSLIBS \ + $SFLIB \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 + } +END4 +else + prgsav=yes +fi +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null + +# +# run marc +# + +cat >> $jid.runmarcscript << END5 + +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi + +# first remove all .out files and incremental restart files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test \$numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null + numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null + /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null +fi + +if test $nprocdddm -gt 1 +then + $RUN_JOB 2>>$jid.log +else + $RUN_JOB 2>>$jid.log +fi + +if test $dllrun -eq 0; then + if test $prgsav = no + then + /bin/rm -f $bd$program 2>/dev/null + fi +else + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes + then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi + +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test \$numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +fi +END5 + + +# Submit to marc batch queue +# +if [ $qid = at ] +then +QUENAME=at +SUBMCMD= +else +# +# Submit to qsub queue +# +QUENAME=qsub +SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" +if test "$priority" +then + SUBMCMD=$SUBMCMD" -p $priority" +fi +if test "$att" +then + SUBMCMD=$SUBMCMD" -a $att" +fi +if test "$cpu" +then + SUBMCMD=$SUBMCMD" -lt $cpu" +fi + +fi +echo $QUENAME $SUBMCMD +#cat $jid.runmarcscript +$QUENAME $SUBMCMD < $jid.runmarcscript + +/bin/rm -f $jid.runmarcscript + +############################################################################## +# run the requested program in the background # +############################################################################## + +else +if test $qid = background +then + +# +# first remove all old .out files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null +fi +# +# compile user subroutine if present +# +( +if test "$link" +then + if test -z "$FCOMPROOT"; then + echo "$0: No compiler available" + echo + echo " $PRODUCT Exit number 3" + exit 1 + fi + echo + echo "Using compiler from: $FCOMPROOT" + echo + if test "$user" + then + # compile and link on other hosts in $host if compstatus=no + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${compstatus[$counter]} = "no" + then + DIR1=$DIRJOB + DIR2=$DIR + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + marcdir=`echo $line | $AWK '{print $4}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -n "$marcdir" + then + DIR2=$marcdir + fi + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then + $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" + then + hname=_$ibase + else + hname= + fi + remoteprog=$DIR1/${execname}$hname + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo + $RSH $i $DIR2/tools/comp_damask_hmp $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else + echo "$0: compile failed for $user on host $i" + echo " $PRODUCT Exit number 3" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi + done + fi + fi + if test "$userhost" + then + echo + echo "Compiling and linking user subroutine $user on host `hostname`" + fi + userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then + $DFORTHIGHMP $user || \ + { + echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTHIGHMP $user -o $userobj || \ + { + echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi # if test $user + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $DAMASK \ + $SYSLIBS \ + $SFLIB \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + echo " $PRODUCT Exit number 3" + exit 1 + } + # copy user subroutine executable for hosts using local working dir + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" + then + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + echo "Copying executable to host ${i}" + $RCP $program ${i}:${DIR1}/ + fi + fi + done + fi + fi +else # if test $link + prgsav=yes +fi # if test $link +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null + +# +# run marc + +# + +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi + +# for DDM with ARC support + +if test $ddm_arc -gt 0; then + RUN_JOB="$MESHERDIR/sf_exeddm $RUN_JOB -ddm $ddm_arc " +fi + + +$RUN_JOB & + +marcpid=$! +echo $marcpid > $DIRJOB/$jid.pid +wait $marcpid + +if test $nprocd -gt 1 +then + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + if test "$host" + then + /bin/rm $jid.mfile 2> /dev/null + /bin/rm $jid.hosts 2> /dev/null + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.cfile 2> /dev/null + fi + fi + fi +fi + + +if test $dllrun -eq 0; then +if test $prgsav = no +then + /bin/rm -f $bd$program 2>/dev/null + # for network run, remove executable on remote machines + # and executables with modified name + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + if test -f "$host_filt" + then + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + # if an incompatible host uses shared directory, + # then the root machine deletes the executable + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + hname=_$ibase + /bin/rm ${execname}$hname + fi + # if local directory used, the remote machine + # deletes the executable + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null + fi + fi + done + fi + fi +fi +fi +else +#dllrun >0 + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sin 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + if test $MPITYPE = "myrinet" + then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi + fi +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + /bin/rm $DIRJOB/$jid.sle 2>/dev/null + /bin/rm $DIRJOB/$jid.sin 2>/dev/null +fi +) 1>>$jid.log 2>&1 & + + +############################################################################## +# run the requested program in the foreground # +############################################################################## + +else + +# +# compile user subroutine if present +# +if test "$link" +then + if test -z "$FCOMPROOT"; then + echo "$0: No compiler available" + echo + echo " $PRODUCT Exit number 3" + exit 1 + fi + echo + echo "Using compiler from: $FCOMPROOT" + echo + if test "$user" + then + # compile and link on other hosts in $host if compstatus=no + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${compstatus[$counter]} = "no" + then + DIR1=$DIRJOB + DIR2=$DIR + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + marcdir=`echo $line | $AWK '{print $4}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -n "$marcdir" + then + DIR2=$marcdir + fi + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then + $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" + then + hname=_$ibase + else + hname= + fi + remoteprog=$DIR1/${execname}$hname + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo + $RSH $i $DIR2/tools/comp_damask_hmp $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else + echo "$0: compile failed for $user on host $i" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi + done + fi + fi + if test "$userhost" + then + echo + echo "Compiling and linking user subroutine $user on host `hostname`" + fi + userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then + $DFORTHIGHMP $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTHIGHMP $user -o $userobj || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi # if test $user + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $DAMASK \ + $SYSLIBS \ + $SFLIB \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 + } + # copy user subroutine executable for hosts using local working dir + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" + then + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + echo "Copying executable to host ${i}" + $RCP $program ${i}:${DIR1}/ + fi + fi + done + fi + fi +else # if test $link + prgsav=yes +fi # if test $link +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null +# done if no job id given +if test -z "$jid" +then + echo + echo only compilation requested + echo + exit +fi +# +# run marc +# +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi +# first remove all .out files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null +fi + +# for DDM with ARC support + +if test $ddm_arc -gt 0; then + RUN_JOB="$MESHERDIR/sf_exeddm $RUN_JOB -ddm $ddm_arc " +fi + + $RUN_JOB + +if test $nprocd -gt 1 +then + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + if test "$host" + then + /bin/rm $jid.mfile 2> /dev/null + /bin/rm $jid.hosts 2> /dev/null + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.cfile 2> /dev/null + else + echo " " > /dev/null + fi + else + if test "$host" + then + mpdcleanup -a -f $jid.mfile + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.mfile 2> /dev/null + else + mpdcleanup -a -f $jid.hosts + /bin/rm $jid.hosts 2> /dev/null + fi + fi + fi +fi + +if test $dllrun -eq 0; then +if test $prgsav = no +then + /bin/rm -f $bd$program 2>/dev/null + # for network run, remove executable on remote machines + # and executables with modified name + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + if test -f "$host_filt" + then + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + # if an incompatible host uses shared directory, + # then the root machine deletes the executable + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + hname=_$ibase + /bin/rm ${execname}$hname + fi + # if local directory used, the remote machine + # deletes the executable + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null + fi + fi + done + fi + fi +fi +fi +else +#dllrun >0 + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi + +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sin 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + if test $MPITYPE = "myrinet" + then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi + fi +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + /bin/rm $DIRJOB/$jid.sle 2>/dev/null + /bin/rm $DIRJOB/$jid.sin 2>/dev/null +fi + + +fi +fi diff --git a/installation/mods_MarcMentat/2016/Marc_tools/run_damask_l b/installation/mods_MarcMentat/2016/Marc_tools/run_damask_l new file mode 100644 index 000000000..579c49856 --- /dev/null +++ b/installation/mods_MarcMentat/2016/Marc_tools/run_damask_l @@ -0,0 +1,4096 @@ +#!/bin/ksh +############################################################################## +# # +# run_marc - run a marc job # +# ------------------------- # +# # +# usage: run_marc -j jid { options } # +# # +# where standard options are: required: defaults: # +# -------------------------- # +# # +# -j* jid job id number. ** YES ** . # +# -pr* prog program name. . marc # +# -v* y|n do or do not verify inputs. . yes # +# -q* s|l|v|b|f batch queue name or background, . short # +# foreground. # +# -b* as alternative to option -q* # +# # +# ( batch queues only : # +# -pq* intra queue priority. . . # +# -at DATE/TIME delay start of job. . . # +# format : January,1,1990,12:31 # +# or : today,5pm # +# -cpu* secs job CPU limit . . ) # +# # +# -r* rid restart file job id. . . # +# -si* sid substructure file id. . . # +# -pi* post post file job id. . . # +# -de* did defaults file . no # +# -vf vid viewfactor . no # +# # +# -u* user user subroutine. . . # +# -obj obj user objects or libraries. . . # +# -sa* y|n do or do not save load module. . no # +# -autorst auto restart flag for auto forge . no # +# -me manual remeshing control . no # +# -ml memory limit in Mbyte # +# -mo This option is deprecated. As of Marc 2015, only # +# the integer*8 version is available. # +# -mpi selects MPI version # +# each platform has a default MPI version and some # +# have an alternative version. see the include file # +# for the respective platform # +# MPI_DEFAULT defines the default MPI version # +# MPI_OTHER defines versions one can switch to # +# -dcoup for contact decoupling # +# currently not supported # +# -dir directory where the job i/o should take place. # +# defaults to current directory. # +# -sdir directory where scratch files are created # +# defaults to current directory. # +# # +# -alloc only perform memory allocation test, no analysis # +# -list y only list options in the input file, no analysis # +# -fe num set feature number "num" for the run. only one allowed # +# -dytran flag to switch from Dytran to Marc # +# dytran = 0, program will run w/o Marc-Dytran Switch # +# = 1, program will restart Marc after Dytran run # +# >= 2, Not supported yet. # +# currently not supported # +# -ou force analysis to use out-of-core control # +# =0, not used # +# =1, element storage out-of-core # +# -dll run marc using shared library libmarc.so and exe_marc # +# =1, used # +# =2, do not free streaming input memory # +# =3, run with marc input deck # +# -trk run marc for post-tracking # +# -gpuid run marc using GPGPU capability # +# specify gpuid on to be used in the analysis. Multiple # +# IDs may be assigned for DDM runs. # +# Separate a list of IDs with a colon. Each DMP # +# process will be assigned a GPU ID in round robin fastion# +# = 0 # +# = 0:1 etc... # +# # +# where parallel options are: # +# -------------------------- # +# # +# itree, host, and comp options are available for the domain # +# decomposition only. # +# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # +# # +# # +# -nprocd number of domains. # +# defaults to single domain solution. # +# -nprocds number of domains if single input file. # +# defaults to single domain solution. # +# -nps same as -nprocds. # +# -nsolver number of solver tasks for solver types 12 and 13 # +# these are distributed tasks operating via MPI # +# -nthread_elem number of threads for element assembly and recovery # +# = 0: use defaults. # +# defaults to 1 for single domain solution. # +# defaults to number of domains for multi-domain # +# solution. # +# > 1: number of threads to be used by element assembly # +# recovery. # +# Also can be set through MARC_NUMBER_OF_THREADS # +# environment variable. # +# if both specified, -nthread_elem option will be used. # +# defaults if neither MARC_NUMBER_OF_THREADS environment # +# variable set nor -nthread_elem specified. # +# -nthread_solver number of threads for solver types 6, 8, and 11 # +# = 0: use defaults. # +# defaults to 1 for single domain solution. # +# defaults to number of domains for multi-domain # +# solution. # +# > 1: number of threads to be used by 6, 8, and 11 # +# Also can be set through MARC_NUMBER_OF_THREADS # +# environment variable. # +# if both specified, -nthread_solver option will be used. # +# defaults if neither MARC_NUMBER_OF_THREADS environment # +# variable set nor -nthread_solver specified. # +# -nthread Same as -nthread_solver. # +# -itree message passing tree type for domain decomposition. # +# for debugging purposes; should not normally be used. # +# -host hostfile name for distributed execution on network. # +# defaults to no hostfile, unless jobid.defhost exists. # +# if jobid.defhost exists, only -np(s) necessary # +# -comp* y|n to be used with user routines on a network of # +# incompatible machines. # +# if set to no, a separate executable will be created # +# for each machine on the network. # +# if set to yes, the executable located on the machine # +# from which marc is started will be used on all machines.# +# defaults to no if O/S versions different on machines. # +# # +# -ci y|n copy input files to remote hosts (default: yes) # +# if "yes", input files are automatically copied to # +# remote hosts for a network run if necessary. # +# -cr y|n copy post files from remote hosts (default: yes) # +# if "yes", post files are automatically copied back from # +# remote hosts for a network run if necessary. # +############################################################################## +# set DIR to the directory in which this script is +REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" +DIR=`dirname $REALCOM` +# make sure DIR has an absolute path +case $DIR in + \/*) + ;; + *) + DIR=`pwd`/$DIR + ;; +esac +DIRSCRIPT=$DIR +AWK=awk +ARCH=`uname -a | cut -f 1 -d " "` +# Sun has a bad awk, use nawk instead +if test $ARCH = "SunOS" +then + AWK=nawk +fi +BASENAME=basename +# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists +if test $ARCH = "SunOS" +then + if test -x /usr/ucb/basename + then + BASENAME=/usr/ucb/basename + fi +fi + +# echo command line in the case of ECHO_COMMAND is true +if test "$ECHO_COMMAND" = true ; then + echo command "$0" "$@" +fi + +# +# "mode" selects version, i4 or i8 +# default is i4 +# this can be changed by a file run_marc_defaults +# located in the tools directory of the Marc installation +# or in the user's home directory +# format: +# MARC_MODE i8 +# it can also be set by the environmental variable MARC_INTEGER_SIZE +# and by the command line option "-mo" +# +mode= +modeerror= +modeoption= +if test -f $DIRSCRIPT/run_marc_defaults; then + line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $DIRSCRIPT/run_marc_defaults` + if test "$line" = "MARC_MODE"; then + echo + echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available + echo + line= + fi + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + modeerror="defaults file $DIRSCRIPT/run_marc_defaults used mode $line ; this must be i8" + modeoption=error + echo $modeerror + fi + if test "$line" = "i8"; then + mode=i8 + fi +fi +if test -f $HOME/run_marc_defaults; then + line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $HOME/run_marc_defaults` + if test "$line" = "MARC_MODE"; then + echo + echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available + echo + line= + fi + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + modeerror="defaults file $HOME/run_marc_defaults used mode $line ; this must be i8" + modeoption=error + echo $modeerror + fi + if test "$line" = "i8"; then + mode=i8 + fi +fi +if test -n "$MARC_INTEGER_SIZE" ; then + mode=$MARC_INTEGER_SIZE +fi +if test -z "$mode" ; then + mode=i8 +fi +case $mode in + i4) + modeerror="bad value for MARC_INTEGER_SIZE variable; only i8 is supported." + modeoption=error + echo $modeerror + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo "bad value for MARC_INTEGER_SIZE variable; only i8 is supported." + exit + ;; +esac + +setmode=false +for arg in $* ; do + if $setmode ; then + mode=$arg + case $mode in + i4) + modeerror="bad value for mode option; only i8 is supported." + modeoption=error + echo + echo $modeerror + echo + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo " " + echo "error, version mode must be i8" + echo " " + echo " use -mo i8 " + echo " " + exit + ;; + esac + setmode=false + fi + if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then + echo + echo warning: the option -mo is deprecated, as of Marc 2015, only the integer*8 version is available + echo + setmode=true + fi + if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + fi + if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then + modeerror="bad value for mode option; only i8 is supported." + modeoption=error + echo + echo $modeerror + echo + fi +done + +# set to i4 version for 32 bit Linux +if test "`uname -s`" = "Linux"; then + if test "`uname -m`" = "i686"; then + mode=i4 + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + fi +fi + + +. "$DIR/getarch" + +. $MARC_INCLUDE +# + +# +# Dynamically determine the echo syntax +# + +case "`echo '\c'`" in + '\c') + ECHO='echo -n' + ECHOTXT=' ' + ;; + *) + ECHO='echo' + ECHOTXT=' \c' + ;; +esac + +# +# Variables for the MARC environment +# + +PRODUCT="Marc" +EXITMSG=$MARC_TOOLS/MESSAGES +export EXITMSG +FLEXDIR=$DIR/../flexlm/licenses +export FLEXDIR +TIMCHK=3600 +export TIMCHK +BINDIR=$MARC_BIN +export BINDIR +AFMATDAT=$MARC_RUNTIME/AF_flowmat/ +export AFMATDAT +export MESHERDIR +MSC_LICENSE_FINPROC=1 +export MSC_LICENSE_FINPROC +# +# define directory path to global unified material database +# +MATFILE= +export MATFILE + +# +# define memory limit +# first set to MEMLIMIT from include +# -ml option overrules if specified +memlimit=$MEMLIMIT +# +# Define share library path based on platforms +# This is required for using the Patran Mesher +# +if test $MACHINENAME = "HP" +then + SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH + export SHLIB_PATH +fi +# the one for IBM is defined futher down + +LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$MESHERDIR:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$SFMATDIR:$LD_LIBRARY_PATH +LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH +LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH +export LD_LIBRARY_PATH +export LD_LIBRARY64_PATH +export LD_LIBRARYN32_PATH + +atexit() { +kill -15 $$ +# +if test $MPITYPE = "myrinet" +then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi +fi +} + +trap "atexit" 2 + +# +# defaults +# + +prog=marc +exefile=marc +jid= +rid= +pid= +sid= +did= +vid= +user= +usernoext= +objs= +qid=background +cpu= +priority= +att= +trk= +verify=yes +prgsav=no +rmdll=no +cpdll=no +progdll= +pathdll= +error= +nprocd=0 +nprocdddm=1 +nprocdddmprint= +icreated=0 +nprocdarg= +nsolver=0 +nsolverarg=-ns +if test $nprocds +then + if test $nprocds -gt 1 + then + nprocdddm=$nprocds + nprocdddmprint=$nprocds + icreated=1 + nprocdarg=-nprocds + fi +fi +ntprint=0 +nt=-1 +nte=-1 +nts=-1 +ntarg=-nt +ntearg=-nte +ntsarg=-nts +nteprint= +ntsprint= +gpuids= +nauto=0 +ndcoup=0 +ndytran=0 +noutcore=0 +dllrun=0 +mesh=0 +itree=0 +iam= +ddm_arc=0 +link= +trkrun=0 +DIRJOB=`pwd` +DIRSCR=$DIRJOB +DIRSCRSET= +autoforge=0 +dotdat=.dat +dotdefhost=.defhost +host= +numhost= +mfile= +userhost= +makebdf= +cpinput=yes +cpresults=yes +marcdll=libmarc.$EXT_DLL +# define hostname and strip off extensions (alpha.aaa.com) +thishost=`hostname` +thishost=${thishost%%.*} +compatible=unknown +numfield=1 +justlist= +feature= +mpioption=false +iprintsimufact= +MDSRCLIB=$MARC_LIB/mdsrc.a +# +# check run_marc_defaults file for default MPI setting +# located in the tools directory of the Marc installation +# or in the user's home directory +# format: +# MARC_MPI +# +value= +file= +if test -f $DIRSCRIPT/run_marc_defaults; then + value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` + value=`echo $value | $AWK '{print $NF}'` + if test -n "$value"; then + file=$DIRSCRIPT/run_marc_defaults + fi +fi +if test -f $HOME/run_marc_defaults; then + value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` + value=`echo $value | $AWK '{print $NF}'` + if test -n "$value"; then + file=$HOME/run_marc_defaults + fi +fi +if test -n "$value"; then + MARC_MPITYPE=$value + notok=true + for i in "$MPI_OTHER"; do + if test "$MARC_MPITYPE" = "$i"; then + notok=false + fi + done + if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then + notok=false + fi + if $notok; then + echo " " + echo " error, incorrect option for MARC_MPI" + echo " defined in $file: $MARC_MPITYPE" + echo " valid options: $MPI_DEFAULT $MPI_OTHER" + echo " " + exit + fi + if test "$value" != "$MPI_DEFAULT"; then + exefile=marc_$value + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a_$value + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" + fi + fi +fi +# +# +# allow scratch directory to be specified with environmental variable +# MARCSCRATCH +if test $MARCSCRATCH +then + if test -d $MARCSCRATCH + then + DIRSCR=$MARCSCRATCH + else + echo "error, scratch directory '$MARCSCRATCH'" + echo " specified via environmental variable MARCSCRATCH does not exist" + exit + fi +fi +# +############################################################################## +# parse input - arguments always come in pairs # +############################################################################## + +arg=$1 +if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then + shift + arg=$1 +fi +while [ -n "$arg" ] +do + shift + value=$1 + case $arg in + -al* | -AL*) + LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH + $MARC_BIN/marc -alloc 1 + exit + ;; + -li* | -LI*) + justlist=yes + ;; + -fe* | -FE*) + feature=$value + + ;; + -pr* | -PR*) + if test `dirname $value` = '.' + then + prog=`$BASENAME $value .marc` + progdll=`$BASENAME $value` + else + prog=`dirname $value`/`$BASENAME $value .marc` + progdll=`dirname $value`/`$BASENAME $value` + fi + prdir=`dirname $value` + case $prdir in + \/*) + ;; + *) + prog=`pwd`/$prdir/$prog + ;; + esac + ;; + -j* | -J*) + jid=`$BASENAME $value $dotdat` + DIRJID=`dirname $value` + case $DIRJID in + \/*) + ;; + *) + DIRJID=`pwd`/$DIRJID + ;; + esac + ;; + -r* | -R*) + rid=`$BASENAME $value .t08` + DIRRID=`dirname $value` + case $DIRRID in + \/*) + ;; + *) + DIRRID=`pwd`/$DIRRID + ;; + esac + ;; + -si* | -SI*) + sid=$value + DIRSID=`dirname $value` + case $DIRSID in + \/*) + ;; + *) + DIRSID=`pwd`/$DIRSID + ;; + esac + ;; + -pi* | -PI*) + if test -f $value.t19 + then + pid=`$BASENAME $value .t19` + else + pid=`$BASENAME $value .t16` + fi + DIRPID=`dirname $value` + case $DIRPID in + \/*) + ;; + *) + DIRPID=`pwd`/$DIRPID + ;; + esac + ;; + -bdf | -BDF) + makebdf=1 + ;; + -de* | -DE*) + did=`$BASENAME $value $dotdat` + DIRDID=`dirname $value` + case $DIRDID in + \/*) + ;; + *) + DIRDID=`pwd`/$DIRDID + ;; + esac + ;; + -vf | -VF) + vid=`$BASENAME $value .vfs` + DIRVID=`dirname $value` + case $DIRVID in + \/*) + ;; + *) + DIRVID=`pwd`/$DIRVID + ;; + esac + ;; + -u* | -U*) + user=$value + case $user in + \/*) + ;; + *) + user=`pwd`/$user + ;; + esac + usernoext=$user + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + ;; + -obj | -OBJ) + objs="$value" + ;; + -q* | -Q*) + qid=$value + ;; + -b* | -B*) + case $value in + y* | Y*) + qid=background + ;; + n* | N*) + qid=foreground + ;; + *) + ;; + esac + ;; + -at | -AT) + att=$value + ;; + -cpu* | -CPU*) + cpu=$value + ;; + -pq | -PQ*) + priority=$value + ;; + -v* | -V*) + verify=$value + ;; + -sa* | -SA*) + prgsav=$value + ;; + -np* | -NP*) + nprocdddm=$value + nprocdddmprint=$value + case $arg in + -nps* | -NPS* | -nprocds* | -NPROCDS*) + icreated=1 + nprocdarg=-nprocds + ;; + esac + case $arg in + -np | -NP | -nprocd | -NPROCD) + icreated=0 + nprocdarg=-nprocd + ;; + esac + ;; + -ns* | -NS*) + nsolver=$value + ;; + -nt* | -NT*) + case $arg in + -nte | -NTE | -nthread_e* | -NTHREAD_E*) + nte=$value + ;; + esac + case $arg in + -nts | -NTS | -nthread_s* | -NTHREAD_S*) + nts=$value + ;; + esac + case $arg in + -nt | -NT | -nth* | -NTH* | -nthread* | -NTHREAD*) + nt=$value + ;; + esac + ;; + -gp* | -GP*) + gpuids=$value + ;; + -it* | -IT*) + itree=$value + ;; + -iam | -IAM) + iam=$value + case $value in + sfg | sfm | sim) + iprintsimufact=true + ;; + esac + ;; + -au* | -AU*) + nauto=$value + ;; + -dc* | -DC*) + ndcoup=$value + ;; + -dy* | -DY*) + ndytran=$value + ;; + -ou* | -OU*) + noutcore=$value + ;; + -dll | -DLL) + dllrun=$value + ;; + -trk | -TRK) + trkrun=$value + ;; + -ddm | -DDM) + ddm_arc=$value + ;; + -me | -ME ) + mesh=$value + ;; + -ml | -ML ) + memlimit=$value + ;; + -mo | -MO ) + ;; + -mpi | -MPI ) + mpioption=true + MARC_MPITYPE=$value + if test "$value" != "$MPI_DEFAULT"; then + exefile=marc_$value + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a_$value + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" + fi + else + exefile=marc + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" + fi + fi + ;; + -dir* | -DIR*) + DIRJOB=$value + case $DIRJOB in + \/*) + ;; + *) + DIRJOB=`pwd`/$DIRJOB + ;; + esac + if test -z "$DIRSCRSET" + then + DIRSCR=$DIRJOB + fi + ;; + -sd* | -SD*) + DIRSCR=$value + DIRSCRSET=yes + case $DIRSCR in + \/*) + ;; + *) + DIRSCR=`pwd`/$DIRSCR + ;; + esac + ;; + -ho* | -HO*) + host=$value + ;; + -co* | -CO*) + compatible=$value + ;; + -ci* | -CI*) + cpinput=$value + ;; + -cr* | -CR*) + cpresults=$value + ;; + *) + error="$error +$arg: invalid option" + break + ;; + esac + case $value in + -*) + error="$error +$arg: invalid name $value" + break + ;; + esac + shift + arg=$1 + if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then + shift + arg=$1 + fi +done +argc=`expr $# % 2` +if test $argc -eq 1 +then +# +# odd number of arguments +# + error="$error +argument list incomplete" +fi + +if test $nprocdddm -gt 0 +then +nprocd=$nprocdddm +fi + +if test $nsolver -gt 0 +then + if test $nsolver -gt $nprocd + then + nprocd=$nsolver + fi +fi +# Set defaults +if test $nt -eq -1 +then +nt=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nt -lt 0 +then +nt=0 +fi +if test $nte -eq -1 +then +nte=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nte -lt 0 +then +nte=0 +fi +if test $nts -eq -1 +then +nts=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nts -lt 0 +then +nts=0 +fi +# +# set number of element loop threads +# +ntprint=$nt +nteprint=$nte +# copy from -nprocd[s] +if test $nprocdddm -gt 1 +then + nteprint=$nprocdddm +fi +# override with -nthread_elem option +if test $nte -ne 0 +then +nteprint=$nte +fi +# check for minimum 1 threads per processes for DDM +if test $nprocdddm -gt 1 +then + if test $nteprint -lt $nprocdddm + then + nteprint=$nprocdddm + fi +fi +nte=$nteprint +# +# set number of Solver threads +# +ntsprint=$nts +# copy from -nthread or -nprocd[s] +if test $ntprint -ne 0 +then + ntsprint=$ntprint +else + if test $nprocdddm -gt 1 + then + ntsprint=$nprocdddm + fi +fi +# override with -nthread_solver option +if test $nts -ne 0 +then + ntsprint=$nts +fi +# check for minimum 1 threads per solver process. +if test $nsolver -lt $nprocdddm +then + if test $ntsprint -lt $nsolver + then + ntsprint=$nsolver + fi +else + if test $ntsprint -lt $nprocdddm + then + ntsprint=$nprocdddm + fi +fi +if test $ntsprint -eq 1 +then + set ntsprint=0 +fi +nts=$ntsprint + +# set stack size for multi-threading. +export KMP_MONITOR_STACKSIZE=7M +export OMP_STACKSIZE=7M + +# +# deprecate -nthread option at arugment of marc +nt=0 +# Reset nprocdddmm, nsolver and threads if not given. +if test $nprocdddm -eq 0 +then + nprocdarg= +fi +if test $nprocdddm -eq 0 +then + nprocdddmprint= +fi +if test $nprocdddm -eq 0 +then + nprocdddm= +fi + +if test $nsolver -eq 0 +then + nsolverprint= +fi +# end of threads setting. +gpuoption= +if test "$gpuids" = "" ; then + gpuoption= +else + gpuoption="-gp $gpuids" +fi + +if test "$gpuids" = "" ; then + export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH +else + MARCCUDALIBS=$MARCCUDALIBS2 + export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH +fi +# Linux 64 + HPMPI, Below code is taken from include_linux64 +if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" +then + export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" +fi + +if test $nprocd -gt 1; then + if test -f $jid$dotdefhost; then + if test "$host" = ""; then + host=$jid$dotdefhost + fi + fi + if test -f hostfile_qa_$nprocd; then + if test "$host" = ""; then + host=hostfile_qa_$nprocd + fi + fi +fi + +if test "$dllrun" -gt 0; then + exefile=exe_marc + prog=exe_marc + program=$exefile + bd=$MARC_BIN/ + if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then + dotdat=.inp + fi + + if test "$progdll"; then + /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll + rmdll=yes + pathdll=yes + progdll=${progdll}_$marcdll + else + progdll=$marcdll + fi + + if test "$user"; then + . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user + user= + if test $prgsav = no; then + rmdll=yes + fi + if test $prgsav = yes; then + cpdll=yes + rmdll=yes + fi + pathdll=yes + fi +fi + +############################################################################## +# check parameter validity # +############################################################################## + +while test forever; do + +# +# check for input file existence +# +if test $nprocdddm -gt 1 -a $icreated -eq 0; then + if test ! -f $DIRJID/1$jid$dotdat; then + if test "$jid" != "" ; then + error="$error +input file $DIRJID/1$jid$dotdat not accessible" + fi + fi +else + if test ! -f $DIRJID/$jid$dotdat; then + if test "$jid" != "" ; then + error="$error +input file $DIRJID/$jid$dotdat not accessible" + fi + fi +fi + if test $nprocd -gt 1; then + if test "$host" ; then + if test ! -f $host; then + error="$error +host name file $host not accessible" + fi + fi + fi + +# +# check if the job is already running in the background +# +if test -f $DIRJOB/$jid.pid; then + error="$error +job is already running (the file $jid.pid exists)" +fi + +# +# if the program name is other than marc, then +# assume that this is a program in the users local directory +# + +bd=$MARC_BIN/ + +case $prog in + marc | MARC | $exefile) + program=$exefile + if test "$rid" + then + if test ! -f $DIRRID/$rid.t08 + then + error="$error +restart file $DIRRID/$rid.t08 not accessible" + fi + fi + if test "$pid" + then + if test ! -f $DIRPID/$pid.t16 + then + if test ! -f $DIRPID/$pid.t19 + then + error="$error +post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" + fi + fi + fi + if test "$user" + then + if test ! -f $user + then + error="$error +user subroutine file $user not accessible" + fi + fi + if test "$objs" + then + missingobjs= + for o in $objs + do + if test ! -f "$o" + then + if test -z "$missingobjs" + then + missingobjs="$o" + else + missingobjs="$missingobjs $o" + fi + fi + done + if test -n "$missingobjs" + then + error="$error +user object/library file(s) $missingobjs not accessible" + fi + fi + if test "$did" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRDID/1$did$dotdat + then + error="$error +defaults file $DIRDID/1$did$dotdat not accessible" + fi + else + if test ! -f $DIRDID/$did$dotdat + then + error="$error +defaults file $DIRDID/$did$dotdat not accessible" + fi + fi + fi + if test "$vid" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRVID/1$vid.vfs + then + error="$error +view factor file $DIRVID/1$vid.vfs not accessible" + fi + else + if test ! -f $DIRVID/$vid.vfs + then + error="$error +view factor file $DIRVID/$vid.vfs not accessible" + fi + fi + fi + if $mpioption + then + notok=true + for i in "$MPI_OTHER"; do + if test "$MARC_MPITYPE" = "$i"; then + notok=false + fi + done + if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then + notok=false + fi + if $notok; then + error="$error +incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" + fi + fi + ;; + *) + program=$prog.marc + case $prog in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + if test "$rid" + then + if test ! -f $DIRRID/$rid.t08 + then + error="$error +restart file $DIRRID/$rid.t08 not accessible" + fi + fi + if test "$pid" + then + if test ! -f $DIRPID/$pid.t16 + then + if test ! -f $DIRPID/$pid.t19 + then + error="$error +post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" + fi + fi + fi + if test "$user" + then + error="$error +program option may not be used with user subroutine" + fi + if test "$objs" + then + error="$error +program option may not be used with user objects or libraries" + fi + if test "$did" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRDID/1$did$dotdat + then + error="$error +defaults file $DIRDID/1$did$dotdat not accessible" + fi + else + if test ! -f $DIRDID/$did$dotdat + then + error="$error +defaults file $DIRDID/$did$dotdat not accessible" + fi + fi + fi + if test "$nauto" + then + if test $nauto -gt 2 + then + error="$error +incorrect option for auto restart " + fi + fi + if test "$ndcoup" + then + if test $ndcoup -gt 3 + then + error="$error +incorrect option for contact decoupling " + fi + fi + if test "$ndytran" + then + if test $ndytran -gt 1 + then + error="$error +incorrect option for Marc-Dytran Switch " + fi + fi + if $mpioption + then + if test ! -x $MARC_BIN/$exefile + then + error="$error +incorrect option for -mpi option: $MARC_MPITYPE " + fi + fi + ;; +esac + +############################################################################## +# check argument integrity # +############################################################################## + +if test "$jid" +then + : +else + if test "$user" + then +# allow user sub without giving job id + qid=foreground + verify=no + else + error="$error +job id required" +fi +fi + +if test $nprocd -gt 1 +then + if test $nauto -gt 0 + then + error="$error +cannot run DDM job with auto restart (-au) option " + fi +fi +case $qid in + S* | s*) + qid=short + ;; + L* | l*) + qid=long + ;; + V* | v*) + qid=verylong + ;; + B* | b*) + qid=background + ;; + F* | f*) + qid=foreground + ;; + A* | a*) + qid=at + ;; + *) + error="$error +bad value for queue_id option" + ;; +esac + +case $prgsav in + N* | n*) + prgsav=no + ;; + Y* | y*) + prgsav=yes + ;; + *) + error="$error +bad value for save option" + ;; +esac + +case $verify in + N* | n*) + verify=no + ;; + Y* | y*) + verify=yes + ;; + *) + error="$error +bad value for verify option" + ;; +esac + +case $nprocdddm in + -* ) + error="$error +bad value for nprocd option" + ;; +esac + +case $nt in + -* ) + error="$error +bad value for nt option" + ;; +esac + +case $itree in + -* ) + error="$error +bad value for itree option" + ;; +esac +case $iam in + -* ) + error="$error +bad value for iam option" + ;; +esac +case $compatible in + N* | n*) + compatible=no + ;; + Y* | y*) + compatible=yes + ;; + unknown) + ;; + *) + error="$error +bad value for comp option" + ;; +esac +case $cpinput in + N* | n*) + cpinput=no + ;; + Y* | y*) + cpinput=yes + ;; + *) + error="$error +bad value for copy input option" + ;; +esac +case $cpresults in + N* | n*) + cpresults=no + ;; + Y* | y*) + cpresults=yes + ;; + *) + error="$error +bad value for copy results option" + ;; +esac + +# +# check for external file to run +# +if test -f $MARC_TOOLS/run_marc_check +then + . $MARC_TOOLS/run_marc_check +fi + +############################################################################## +# interact with the user to get the required information to run marc or # +# other marc system program # +############################################################################## + +deletelog=yes +if test $qid = background -a $verify = no +then +echo \ +" +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid +User subroutine name : $user +User objects/libs : $objs +Restart file job ID : $rid +Substructure file ID : $sid +Post file job ID : $pid +Defaults file ID : $did +View Factor file ID : $vid +Save generated module: $prgsav +MPI library : $MPITYPE +DDM processes : $nprocdddmprint +Element loop threads : $nteprint +Solver processes : $nsolverprint +Solver threads : $ntsprint +GPGPU option : $gpuids +Host file name : $host" > $jid.log +if test "$iprintsimufact" = true ; then + echo "DDM with ARC Mapper : $ddm_arc" >> $jid.log +fi +echo \ +"Message passing type : $itree +Run job in queue : $qid +Run directory : $DIRJOB +Scratch directory : $DIRSCR +Memory limit in Mbyte: $memlimit +Auto Restart : $nauto " >> $jid.log +deletelog=no +fi +echo \ +" +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid +User subroutine name : $user +User objects/libs : $objs +Restart file job ID : $rid +Substructure file ID : $sid +Post file job ID : $pid +Defaults file ID : $did +View Factor file ID : $vid +Save generated module: $prgsav +MPI library : $MPITYPE +DDM processes : $nprocdddmprint +Element loop threads : $nteprint +Solver processes : $nsolverprint +Solver threads : $ntsprint" +if test "$iprintsimufact" = true ; then + echo "DDM with ARC Mapper : $ddm_arc" +fi +echo \ +"GPGPU option : $gpuids +Host file name : $host +Message passing type : $itree +Run job in queue : $qid +Run directory : $DIRJOB +Scratch directory : $DIRSCR +Memory limit in Mbyte: $memlimit +Auto Restart : $nauto" + + +case $qid in + s* | S* | l* | L* | v* | V* ) + echo \ +"Queue priority : $priority +Queue CPU limit : $cpu +Queue start time : $att" + ;; +# * ) +# echo \ +#" " +# ;; +esac + +if test "$modeoption" +then + error=$modeerror +fi + +if test "$error" +then + if test $verify = yes + then + $ECHO "$error + +Please correct or quit(correct,quit,): $ECHOTXT" + error= + read answer + case $answer in + q* | Q*) + answer=quit + ;; + *) + answer=correct + ;; + esac + else + $ECHO "$error + $ECHOTXT" + echo " " + if test "$deletelog" = no + then + $ECHO "$error + $ECHOTXT" >> $jid.log + echo " " >> $jid.log + fi + answer=quit + fi +else + if test $verify = yes + then + $ECHO " +Are these parameters correct (yes,no,quit,)? $ECHOTXT" + read answer + case $answer in + q* | Q*) + answer=quit + ;; + y* | Y*) + answer=yes + ;; + *) + answer=no + ;; + esac + else + answer=yes + fi +fi + +case $answer in + no | correct) + +############################################################################## +# prompt for each value # +############################################################################## + + $ECHO " +Program name ($prog)? $ECHOTXT" + read value + if test "$value" + then + prog=$value + fi + $ECHO "Job ID ($jid)? $ECHOTXT" + read value + if test "$value" + then + jid=`$BASENAME $value $dotdat` + DIRJID=`dirname $value` + case $DIRJID in + \/*) + ;; + *) + DIRJID=`pwd`/$DIRJID + ;; + esac + fi + $ECHO "User subroutine name ($user)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + user= + ;; + *) + user=$value + case $user in + \/*) + ;; + *) + user=`pwd`/$user + ;; + esac + usernoext=$user + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + ;; + esac + fi + $ECHO "User objects or libraries ($objs)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + objs= + ;; + *) + objs="$value" + ;; + esac + fi + $ECHO "Restart File Job ID ($rid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + rid= + ;; + *) + rid=`$BASENAME $value .t08` + DIRRID=`dirname $value` + case $DIRRID in + \/*) + ;; + *) + DIRRID=`pwd`/$DIRRID + ;; + esac + ;; + esac + fi + $ECHO "Substructure File ID ($sid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + sid= + ;; + *) + sid=$value + DIRSID=`dirname $value` + case $DIRSID in + \/*) + ;; + *) + DIRSID=`pwd`/$DIRSID + ;; + esac + ;; + esac + fi + $ECHO "Post File Job ID ($pid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + pid= + ;; + *) + pid=$value + DIRPID=`dirname $value` + case $DIRPID in + \/*) + ;; + *) + DIRPID=`pwd`/$DIRPID + ;; + esac + ;; + esac + fi + $ECHO "Defaults File ID ($did)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + did= + ;; + *) + did=`$BASENAME $value $dotdat` + DIRDID=`dirname $value` + case $DIRDID in + \/*) + ;; + *) + DIRDID=`pwd`/$DIRDID + ;; + esac + ;; + esac + fi + $ECHO "View Factor File ID ($vid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + vid= + ;; + *) + vid=`$BASENAME $value .vfs` + DIRVID=`dirname $value` + case $DIRVID in + \/*) + ;; + *) + DIRVID=`pwd`/$DIRVID + ;; + esac + ;; + esac + fi + $ECHO "Save generated module ($prgsav)? $ECHOTXT" + read value + if test "$value" + then + prgsav=$value + fi + $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" + read value + if test "$value" + then + nprocdddm=$value + nprocdddmprint=$value + fi + $ECHO "Run on ($nte) Element loop threads ? $ECHOTXT" + read value + if test "$value" + then + nte=$value + fi + $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" + read value + if test "$value" + then + nsolver=$value + fi + $ECHO "Run on ($nts) Solver threads ? $ECHOTXT" + read value + if test "$value" + then + nts=$value + fi +# + if test $nprocdddm -gt 0 + then + nprocd=$nprocdddm + fi + if test $nsolver -gt 0 + then + if test $nsolver -gt $nprocd + then + nprocd=$nsolver + fi + fi +# Element loop threads. + if test $nte -eq -1 + then + nte=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nte -lt 0 + then + nte=0 + fi + nteprint=$nte +# Copy from ddm + if test $nprocdddm -gt 1 + then + nteprint=$nprocdddm + fi +# override with -nthread_elem option + if test $nte -ne 0 + then + nteprint=$nte + fi +# check for minimum 1 threads per processes for DDM + if test $nprocdddm -ne 0 + then + if test $nteprint -lt $nprocdddm + then + nteprint=$nprocdddm + fi + fi + nte=$nteprint +# Solver threads. + if test $nts -eq -1 + then + nts=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nts -lt 0 + then + nts=0 + fi + ntsprint=$nts +# Copy from ddm + if test $nprocdddm -gt 1 + then + ntsprint=$nprocdddm + fi +# override with -nthread_solver option + if test $nts -ne 0 + then + ntsprint=$nts + fi +# check for minimum 1 threads per solver process. + if test $nsolver -lt $nprocdddm + then + if test $ntsprint -lt $nsolver + then + ntsprint=$nsolver + fi + else + if test $ntsprint -lt $nprocdddm + then + ntsprint=$nprocdddm + fi + fi + if test $ntsprint -eq 1 + then + set ntsprint=0 + fi + nts=$ntsprint + $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" + read value + if test "$value" + then + gpuids=$value + fi + if test "$gpuids" = "" ; then + gpuoption= + else + gpuoption="-gp $gpuids" + fi + if test "$gpuids" = "" ; then + export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH + else + MARCCUDALIBS=$MARCCUDALIBS2 + export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH + fi + if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" + then + export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" + fi +# + if test $nprocd -gt 1 + then + $ECHO "Message passing type ($itree)? $ECHOTXT" + read value + if test "$value" + then + itree=$value + fi + $ECHO "Host file name ($host)? $ECHOTXT" + read value + if test "$value" + then + host=$value + fi + if test $nprocdddm -gt 1 + then + $ECHO "Single input file? $ECHOTXT" + read value + case $value in + y* | Y*) + icreated=1 + nprocdarg=-nprocds + ;; + esac + $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" + read value + if test "$value" + then + compatible=$value + fi + $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" + read value + if test "$value" + then + cpinput=$value + fi + $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" + read value + if test "$value" + then + cpresults=$value + fi + fi + fi + $ECHO "Run the job in the queue ($qid)? $ECHOTXT" + read value + if test "$value" + then + qid=$value + fi + case $qid in + s* | S* | l* | L* | v* | V* ) + $ECHO "Queue priority ($priority)? $ECHOTXT" + read value + if test "$value" + then + priority=$value + fi + $ECHO "Job starts at ($att)? $ECHOTXT" + read value + if test "$value" + then + att=$value + fi + $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" + read value + if test "$value" + then + cpu=$value + fi + ;; + * ) + ;; + esac + $ECHO "Auto Restart option ($nauto)? $ECHOTXT" + read value + if test "$value" + then + nauto=$value + fi + $ECHO "Run directory ($DIRJOB)? $ECHOTXT" + read value + if test "$value" + then + DIRJOB=$value + DIRSCR=$DIRJOB + fi + $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" + read value + if test "$value" + then + DIRSCR=$value + fi + ;; + quit) + exit 1 + ;; + *) + break + ;; + +esac + + if test $nt -eq -1 + then + nt=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nt -lt 0 + then + nt=0 + fi + +done +# +if test $nt -eq 0 +then + ntarg= +fi +if test $nt -eq 0 +then + ntprint= +fi +if test $nt -eq 0 +then + nt= +fi + +if test $nte -eq 0 +then + ntearg= +fi +if test $nte -eq 0 +then + nteprint= +fi +if test $nte -eq 0 +then + nte= +fi + +if test $nts -eq 0 +then + ntsarg= +fi +if test $nts -eq 0 +then + ntsprint= +fi +if test $nts -eq 0 +then + nts= +fi +# +if test "$dllrun" -gt 0; then + exefile=exe_marc + prog=exe_marc + program=$exefile + bd=$MARC_BIN/ + if test "$user"; then + . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user + user= + pathdll=yes + if test $prgsav = no; then + rmdll=yes + fi + if test $prgsav = yes; then + cpdll=yes + rmdll=yes + fi + fi + + if test "$pathdll"; then +# +# reset share lib path +# + if test $MACHINENAME = "HP" + then + SHLIB_PATH=$DIRJOB:$SHLIB_PATH + export SHLIB_PATH + fi + if test $MACHINENAME = "IBM" + then + LIBPATH=$DIRJOB:$LIBPATH + export LIBPATH + fi +# + LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH + LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH + LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH + export LD_LIBRARY_PATH + export LD_LIBRARY64_PATH + export LD_LIBRARYN32_PATH + fi +fi +# end of dllrun>0 + + +if test $program = $exefile -o $program = $prog.marc +then + +# delete the old .log file unless we run in the background +if test "$deletelog" = yes +then + if test "$jid" + then + /bin/rm $jid.log 2>/dev/null + fi +else + echo + echo running the job in the background, see $jid.log + echo +fi + +# +# check if this is an autoforge or rezoning or radiation job +# +if test $nprocd -eq 1 -a "$jid" + +then + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` + if test "$line" + then + autoforge=1 + fi + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` + if test "$line" + then + autoforge=1 + fi + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` + if test "$line" + then + autoforge=1 + fi +fi +# +# check that jobname for restarted run is not the same +# as restart file basename +# +if test "$rid" +then + if test "$jid" = "$rid" + then + echo " " + echo "ERROR: job name of current run is the same as job name" + echo " of the restarted job" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "ERROR: job name of current run is the same as job name" >> $jid.log + echo " of the restarted job" >> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi +fi + +# +# user objects/libraries used +# + + if test "$objs" + then + program="$DIRJOB/$jid.marc" + case $program in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + link=yes + fi + +# +# user subroutine used +# +# add DAMASK options for linking + DAMASK="-lstdc++" + + if test "$user" + then + program=$usernoext.marc + case $program in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + link=yes + fi + +# +# Special case for IBM using POE but not an SP machine +# in this case we always need a host file, also for serial jobs. +# +if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP +then + MP_HOSTFILE=${jid}.host + if test -f $jid.host + then + /bin/rm $jid.host 2> /dev/null + fi + if test $nprocd -gt 1 + then + numdom=$nprocd + while test $numdom -gt 0 + do + hostname -s >> $MP_HOSTFILE + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + else + hostname -s > $MP_HOSTFILE + fi +fi +# +# check ssh for all hosts in host file +# +if test $nprocd -gt 1 +then +if test $MPITYPE = "intelmpi" -a "$INTELMPI_VERSION" = "HYDRA" + then +# get host list + if test "$host" + then + line=`grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' | uniq` +# count failing hosts + counter=0 + for i in $line + do + $RSH -o BatchMode=yes -o ConnectTimeout=10 $i uname -n + status=$? + if [[ $status != 0 ]] ; then + counter=$((counter+1)) + if [ "$counter" = "1" ]; then + echo " " + echo " error - connection test failed... " + echo " " + fi + echo " " + echo " connection test with ssh failed on host $i" + echo " check the following command: ssh $i uname -n " + echo " " + fi + done +# echo error message and quit + if test $counter -ne 0 + then + echo " " + echo " A parallel job using IntelMPI cannot be started. " + echo " The ssh command must be working correctly between " + echo " the computers used in the analysis. Furthermore, " + echo " it must be set up such that it does not prompt the " + echo " user for a password. " + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo " A parallel job using IntelMPI cannot be started. ">> $jid.log + echo " The ssh command must be working correctly between ">> $jid.log + echo " the computers used in the analysis. Furthermore, ">> $jid.log + echo " it must be set up such that it does not prompt the ">> $jid.log + echo " user for a password. ">> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + fi +fi +fi +# +# check correctness of host file; fix for user sub +# + if test $nprocd -gt 1 + then + +# construct the path name to the executable (execpath) + execpath=$MARC_BIN/$exefile + usersub=0 + if test $program = $prog.marc + then + execpath=$prog.marc + usersub=1 + fi + if test "$objs" + then + execpath="$DIRJOB/$jid.marc" + usersub=1 + fi + if test "$user" + then + execpath=$usernoext.marc + usersub=1 + fi + export execpath + execname=`$BASENAME $execpath` + + if test "$host" + then + userhost=$host + case $userhost in + \/* | \.\/*) + ;; + *) + userhost=`pwd`/$userhost + ;; + esac + +# check that the number of processes specified in the hostfile is +# equal to nprocd specified by -nprocd. + numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` + if test $nprocd -ne $numproc + then + echo " " + echo "error, the number of processes specified in the host file" + echo "must be equal to the number of processes given by -nprocd/-nsolver" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, the number of processes specified in the host file" >> $jid.log + echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + +# check for Myrinet that the number of processes per host is +# less than number of available user ports, 5 +# .gmpi directory must exist in user's home directory +# and must have write permission from remote hosts + if test $MPITYPE = "myrinet" + then + numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` + if test $numproc -gt 5 + then + echo " " + echo "error, for Myrinet the number of processes specified " + echo "in the hostfile must not exceed 5 for a hostname" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet the number of processes specified " >> $jid.log + echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + if test ! -d ~/.gmpi + then + echo " " + echo "error, for Myrinet a .gmpi directory must exist " + echo "under the user's home directory" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log + echo "under the user's home directory" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + homedir=`echo ~` + for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ + if test -s tmp.$$ + then + echo " " + echo "error, for Myrinet a shared .gmpi directory must exist " + echo "under the user's home directory " + echo "with remote write permission" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log + echo "under the user's home directory " >> $jid.log + echo "with remote write permission" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + else + /bin/rm tmp.$$ + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + fi + fi + done + fi + fi + +# construct the host file $jid.host which is used by mpirun +# skip lines starting with # and only consider lines with more than +# one word in them. Note that the hostfile given to this script +# has two columns: the host name and the number of shared processes +# to run on this host. mpirun wants the number of _other_ +# processes to run in addition to the one being run on the machine +# on which the job is started. hence the $2-1 for fnr == 1. + if test -f $jid.host + then + /bin/rm $jid.host 2> /dev/null + fi + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then +# HPMPI or HP hardware MPI + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ + -v mpihpspecial="$MPIHPSPECIAL" \ +'{if ( NF > 0) {\ + fnr++ ; \ + printf("-h %s -np %s",$1,$2); \ + printf(" %s",mpihpspecial); \ + if ( NF == 2 ) printf(" %s\n",path);\ + if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ + if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ + }\ + }' > $jid.host +# end HPMPI or HP hardware MPI + elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP + then +# IBM using hardware MPI (POE) + MP_HOSTFILE=$jid.host + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host +# end IBM using hardware MPI (POE) +# for Intel MPI, need to create a machinefile for DMP + elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then +# Intel MPI + if test -f $jid.mfile + then + /bin/rm $jid.mfile 2> /dev/null + fi + /bin/cp $host $jid.host + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile +# end Intel MPI for DMP +# for Solaris HPC 7.1, need to create a machinefile for DMP + elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" + then +# Solaris HPC 7.1 + if test -f $jid.mfile + then + /bin/rm $jid.mfile 2> /dev/null + fi + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile +# end Solaris HPC 7.1 for DMP +# for Myrinet, construct a configuration file in ~/.gmpi +# this must be readable by each process +# format is (hostname) (port number) for each process + elif test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + echo $nprocd > ~/.gmpi/$jid.host + grep -v '^#' $host | $AWK \ +'BEGIN {iport[0] = 2; \ + iport[1] = 4; \ + iport[2] = 5; \ + iport[3] = 6; \ + iport[4] = 7 \ + } \ +{if ( NF > 0 ) \ + for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ +}' >> ~/.gmpi/$jid.host + else +# this is for mpich-1.2.5 and later, using the -pg option +# format: host nproc executable user arguments +# the arguments are added later + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ +'{if ( NF > 0) {\ + fnr++ ; \ + if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ + else printf("%s %s",$1,$2); \ + if ( NF == 2 ) printf(" %s %s\n",path,user);\ + if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ + if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ + }\ + }' > $jid.host + fi +# end Myrinet + elif test $MACHINENAME = DEC -a $MPITYPE = hardware + then +# Compaq MPI via Memory Channel + grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host +# end Compaq MPI + else +# MPICH + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ +'{if ( NF > 0) {\ + fnr++ ; \ + if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ + else printf("%s %s",$1,$2); \ + if ( NF == 2 ) printf(" %s\n",path);\ + if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ + if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ + }\ + }' > $jid.host + fi +# define the variable host and host_filt +# host_filt is used for loops over hosts +# for Myrinet we need to use a filtered variant of userhost +# for others we can use $host + if test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + host=~/.gmpi/$jid.host + host_filt=$jid.host_tMp + grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt + else + host=$jid.host + host_filt=$host + fi + else + host=$jid.host + host_filt=$host + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + host_filt=$jid.mfile + fi + fi +# figure out if the machines in the hostfile are nfs mounted +# or distributed and set the variable "dirstatus" accordingly. +# only perform the check if user subroutine is used +# or a user subroutine executable is used + + numfield=1 + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then + numfield=2 + fi + DIR1=$DIRJOB + if test $program = $prog.marc -o -n "$user" -o -n "$objs" + then + counter=0 + echo " " + echo "checking if local or shared directories for host" + if test "$deletelog" = no + then + echo "checking if local or shared directories for host" >> $jid.log + fi + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + dirstatus[$counter]="shared" + $ECHO " $i $ECHOTXT" + if test "$deletelog" = no + then + $ECHO " $i $ECHOTXT" >> $jid.log + fi + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ + if test -s tmp.$$ + then + dirstatus[$counter]="local" + /bin/rm tmp.$$ + else + if test ! -f $jid.$$ + then + dirstatus[$counter]="local" + $RSH $i /bin/rm $DIR1/$jid.$$ + else + /bin/rm $jid.$$ + fi + fi + if test -f tmp.$$ + then + /bin/rm tmp.$$ + fi + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + echo " ${dirstatus[$counter]}" + if test "$deletelog" = no + then + echo " ${dirstatus[$counter]}" >> $jid.log + fi + fi + done + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + fi + fi + +# figure out if this is a compatible set of machines +# unless explicitly specified with flag -comp +# only perform the check if user subroutine is used +# or a user subroutine executable is used +# Myrinet does not support heterogeneous + if test $program = $prog.marc -o -n "$user" -o -n "$objs" + then + if test $compatible = "unknown" + then + thisname=$ARCH + compatible=yes + counter=0 + echo "checking if machines are compatible for host" + if test "$deletelog" = no + then + echo "checking if machines are compatible for host" >> $jid.log + fi + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + compstatus[$counter]="yes" + $ECHO " $i $ECHOTXT" + if test "$deletelog" = no + then + $ECHO " $i $ECHOTXT" >> $jid.log + fi + othername=`$RSH $i uname -a | cut -f 1 -d " "` + if test $thisname != $othername + then + compatible=no + compstatus[$counter]="no" + fi + fi + echo " ${compstatus[$counter]}" + if test "$deletelog" = no + then + echo " ${compstatus[$counter]}" >> $jid.log + fi + done + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + fi + else + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + compstatus[$counter]=$compatible + fi + done + if test $compatible = "no" + then + echo "all machines assumed incompatible" + if test "$deletelog" = no + then + echo "all machines assumed incompatible" >> $jid.log + fi + else + echo "all machines compatible" + if test "$deletelog" = no + then + echo "all machines compatible" >> $jid.log + fi + fi + fi +# error out if user objects or libraries are used on incompatible machines + if test "$compatible" = "no" -a -n "$objs" + then + echo "User object/libraries cannot be used in a parallel job on incompatible machines" + if test "$deletelog" = no + then + echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log + fi + exit 1 + fi +# modify new host file if NFS mounted heterogeneous machine + doit= + if test $program = $prog.marc + then + doit=yes + fi + if test "$user" + then + doit=yes + fi + if test "$doit" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + $AWK -v hst=$i '{fnr++ ; \ +if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ +printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} + /bin/mv $jid.host{$$} $jid.host + host=$jid.host + fi + fi + done + fi + fi # if test $program = $prog.marc -o $user -o $obj + + else # if test $host + # assume shared memory machine if no hostfile given and + # MPITYPE is set to mpich or Myrinet + # check for Myrinet that the total number of processes is + # less than number of available user ports, 5 + if test $MPITYPE = "mpich" -o $MPITYPE = "scali" + then + numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` + echo `hostname` $numproc $execpath > $jid.host + host=$jid.host + elif test $MPITYPE = "myrinet" + then + if test $nprocd -gt 5 + then + echo " " + echo "error, for Myrinet the number of processes " + echo "must not exceed 5 for a hostname" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet the number of processes " >> $jid.log + echo "must not exceed 5 for a hostname" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + echo $nprocd > ~/.gmpi/$jid.host + echo `hostname` $nprocd | $AWK \ +'BEGIN {iport[0] = 2; \ + iport[1] = 4; \ + iport[2] = 5; \ + iport[3] = 6; \ + iport[4] = 7 \ + } \ + {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ +' >> ~/.gmpi/$jid.host + host=~/.gmpi/$jid.host + else + numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` + echo `hostname` $numproc $execpath > $jid.host + + fi + fi # if test myrinet + + fi # if test $host + + fi # if test $nprocd -gt 1 + +fi # if test $program = $exefile -o $program = $prog.marc + +############################################################################## +# construct run stream (Marc only) # +############################################################################## + +# set maximum message length for ddm to a large number +# for vendor provided mpi +if test $itree -eq 0 -a $MPITYPE = hardware +then + itree=100000000 + if test $MACHINENAME = SGI + then + itree=100000001 + fi +fi +if test $itree -eq 0 -a $MPITYPE = hpmpi +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = myrinet +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = nec +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = scali +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = intelmpi +then + itree=100000000 +fi +if test $nprocdddm -lt 2 +then + nprocdarg= +else + nprocdarg="$nprocdarg $nprocdddm" +fi +if test $nsolver -eq 0 +then + nsolverarg= +else + nsolverarg="$nsolverarg $nsolver" +fi +if test $nprocdddm -lt 2 -a $nsolver -eq 0 +then +nprocd=0 +fi +if test $nprocd -gt 0 +then + if test "$host" + then + if test -z "$RUN_JOB2" + then + echo " " + echo "error: parallel job attempted on non-parallel version," + echo " or, if parallel version is installed, the include " + echo " file is probably corrupted" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error: parallel job attempted on non-parallel version," >> $jid.log + echo " or, if parallel version is installed, the include " >> $jid.log + echo " file is probably corrupted" >> $jid.log + echo " " >> $jid.log + fi + exit + fi + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then + RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP + then + RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" + RUN_JOB=" -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + elif test $MACHINENAME = DEC -a $MPITYPE = hardware + then + RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + numhost=`uniq $jid.mfile | wc -l` + if test "$INTELMPI_VERSION" = "HYDRA" + then + RUN_JOB_TMP="$RUN_JOB2 -configfile $jid.cfile" + else + export I_MPI_JOB_CONTEXT=$$ + mpdboot -n $numhost -r $RSH -f $jid.mfile + RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" + fi + +# intelmpi uses configfile. format: +# -host host1 -n n1 executable marcargs +# one such line per host +# collect the marcargs in RUN_JOB and construct the config file later +# collect the run stream in RUN_JOB_TMP + RUN_JOB="-jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + + + elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" + then + RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + if test "$userhost" + then + RUN_JOB="$RUN_JOB -mhost $userhost" + fi + if test $MPITYPE = "scali" + then +# set default working directory to /tmp to allow +# different directory names + SCAMPI_WORKING_DIRECTORY=/tmp + export SCAMPI_WORKING_DIRECTORY + fi + else + if test -z "$RUN_JOB1" + then + echo " " + echo "error: parallel job attempted on non-parallel version," + echo " or, if parallel version is installed, the include " + echo " file is probably corrupted" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error: parallel job attempted on non-parallel version," >> $jid.log + echo " or, if parallel version is installed, the include " >> $jid.log + echo " file is probably corrupted" >> $jid.log + echo " " >> $jid.log + fi + exit + fi + RUNNPROCD=$nprocd + if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" + then + RUNNPROCD= + MP_PROCS=$nprocd + export MP_PROCS + fi + if test $MPITYPE = "myrinet" + then + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + echo " " > /dev/null + else + export I_MPI_JOB_CONTEXT=$$ + mpdboot -n 1 -f $jid.hosts + fi + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + fi +else + if test $nauto -gt 0 -o $ndcoup -gt 0 + then + RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ +-maxnum $MAXNUM \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else +# this is for a serial job without auto restart: + RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ +-maxnum $MAXNUM \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi +fi +if test "$rid" +then + RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" +fi +if test "$pid" +then + RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" +fi +if test "$sid" +then + RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" +fi +if test "$did" +then + RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" +fi +if test "$vid" +then + RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" +fi +if test $nauto -gt 0 +then + RUN_JOB="$RUN_JOB -autorst $nauto " +fi +if test $ndcoup -gt 0 +then + RUN_JOB="$RUN_JOB -dcoup $ndcoup " +fi +if test $ndytran -gt 0 +then + RUN_JOB="$RUN_JOB -dytran $ndytran " +fi +if test $mesh -gt 0 +then + RUN_JOB="$RUN_JOB -me $mesh " +fi +if test $noutcore -gt 0 +then + RUN_JOB="$RUN_JOB -outcore $noutcore " +fi +if test "$dllrun" -gt 0 +then + RUN_JOB="$RUN_JOB -dll $dllrun " +fi +if test "$trkrun" -gt 0 +then + RUN_JOB="$RUN_JOB -trk $trkrun " +fi +if test "$iam" +then + RUN_JOB="$RUN_JOB -iam $iam " +fi +if test "$justlist" +then + RUN_JOB="$RUN_JOB -list 1 " +fi +if test "$feature" +then + RUN_JOB="$RUN_JOB -feature $feature " +fi +if test "$memlimit" -ne 0 +then + RUN_JOB="$RUN_JOB -ml $memlimit " +fi +if test "$cpinput" +then + RUN_JOB="$RUN_JOB -ci $cpinput " +fi +if test "$cpresults" +then + RUN_JOB="$RUN_JOB -cr $cpresults " +fi +if test "$DIRSCR" != "$DIRJOB" +then + RUN_JOB="$RUN_JOB -dirscr $DIRSCR" +else + DIRSCR=$DIRJOB +fi +if test "$makebdf" +then + RUN_JOB="$RUN_JOB -bdf $makebdf " +fi +if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" +then + # append $RUN_JOB to all lines of the host file + # and set RUN_JOB + $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ + /bin/mv $host.$$ $host + RUN_JOB=$RUN_JOB_TMP +fi +if test $MPITYPE = "intelmpi" -a "$host" +then + # construct config file, append $RUN_JOB to all lines of the config file + # and set RUN_JOB + if test "$INTELMPI_VERSION" = "HYDRA" + then + grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ + '{if ( NF > 0) {\ + printf(" -host %s",$1); \ + printf(" -n %s",$2); \ + if ( NF == 2 ) printf(" %s",path);\ + if ( NF >= 3 ) printf(" -wdir %s ",$3); \ + if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ + printf(" %s\n",args); \ + }\ + }' > $jid.cfile + else + grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ + '{if ( NF > 0) {\ + printf("-host %s -n %s",$1,$2); \ + if ( NF == 2 ) printf(" %s",path);\ + if ( NF >= 3 ) printf(" -wdir %s ",$3); \ + if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ + printf(" %s\n",args); \ + }\ + }' > $jid.cfile + fi + RUN_JOB=$RUN_JOB_TMP +fi +echo " " +echo "Final run stream value" +echo " RUNJOB="$RUN_JOB +if test "$deletelog" = no +then +echo " " >> $jid.log +echo "Final run stream value" >> $jid.log +echo " RUNJOB="$RUN_JOB >> $jid.log +fi + + +############################################################################## +# run marc using valgrind # +############################################################################## +#RUN_JOB="valgrind $RUN_JOB" +#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" +#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" +#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" +############################################################################## + + +############################################################################## +# run the requested program in a queue # +############################################################################## + +if test "$deletelog" = yes +then + echo + date +else + echo >> $jid.log + date >> $jid.log +fi +if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] +then + +/bin/rm -f $jid.runmarcscript + + +# +# compile user subroutine if present +# +if test "$link" +then + if test -z "$FCOMPROOT"; then + echo "$0: No compiler available" + echo + echo " $PRODUCT Exit number 3" + exit 1 + fi + echo + echo "Using compiler from: $FCOMPROOT" + echo + if test "$user" + then + userobj=$usermoext.o + fi + cat > $jid.runmarcscript << END4 + if test "$user" + then + if test $MACHINENAME = "CRAY" + then + $DFORTLOW $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTLOW $user -o $userobj || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + $SOLVERLIBS \ + $MARCCUDALIBS \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $DAMASK \ + $SYSLIBS \ + $SFLIB \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 + } +END4 +else + prgsav=yes +fi +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null + +# +# run marc +# + +cat >> $jid.runmarcscript << END5 + +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi + +# first remove all .out files and incremental restart files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test \$numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null + numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null + /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null +fi + +if test $nprocdddm -gt 1 +then + $RUN_JOB 2>>$jid.log +else + $RUN_JOB 2>>$jid.log +fi + +if test $dllrun -eq 0; then + if test $prgsav = no + then + /bin/rm -f $bd$program 2>/dev/null + fi +else + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes + then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi + +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test \$numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +fi +END5 + + +# Submit to marc batch queue +# +if [ $qid = at ] +then +QUENAME=at +SUBMCMD= +else +# +# Submit to qsub queue +# +QUENAME=qsub +SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" +if test "$priority" +then + SUBMCMD=$SUBMCMD" -p $priority" +fi +if test "$att" +then + SUBMCMD=$SUBMCMD" -a $att" +fi +if test "$cpu" +then + SUBMCMD=$SUBMCMD" -lt $cpu" +fi + +fi +echo $QUENAME $SUBMCMD +#cat $jid.runmarcscript +$QUENAME $SUBMCMD < $jid.runmarcscript + +/bin/rm -f $jid.runmarcscript + +############################################################################## +# run the requested program in the background # +############################################################################## + +else +if test $qid = background +then + +# +# first remove all old .out files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null +fi +# +# compile user subroutine if present +# +( +if test "$link" +then + if test -z "$FCOMPROOT"; then + echo "$0: No compiler available" + echo + echo " $PRODUCT Exit number 3" + exit 1 + fi + echo + echo "Using compiler from: $FCOMPROOT" + echo + if test "$user" + then + # compile and link on other hosts in $host if compstatus=no + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${compstatus[$counter]} = "no" + then + DIR1=$DIRJOB + DIR2=$DIR + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + marcdir=`echo $line | $AWK '{print $4}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -n "$marcdir" + then + DIR2=$marcdir + fi + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then + $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" + then + hname=_$ibase + else + hname= + fi + remoteprog=$DIR1/${execname}$hname + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo + $RSH $i $DIR2/tools/comp_damask_l $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else + echo "$0: compile failed for $user on host $i" + echo " $PRODUCT Exit number 3" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi + done + fi + fi + if test "$userhost" + then + echo + echo "Compiling and linking user subroutine $user on host `hostname`" + fi + userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then + $DFORTLOW $user || \ + { + echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTLOW $user -o $userobj || \ + { + echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi # if test $user + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $DAMASK \ + $SYSLIBS \ + $SFLIB \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + echo " $PRODUCT Exit number 3" + exit 1 + } + # copy user subroutine executable for hosts using local working dir + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" + then + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + echo "Copying executable to host ${i}" + $RCP $program ${i}:${DIR1}/ + fi + fi + done + fi + fi +else # if test $link + prgsav=yes +fi # if test $link +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null + +# +# run marc + +# + +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi + +# for DDM with ARC support + +if test $ddm_arc -gt 0; then + RUN_JOB="$MESHERDIR/sf_exeddm $RUN_JOB -ddm $ddm_arc " +fi + + +$RUN_JOB & + +marcpid=$! +echo $marcpid > $DIRJOB/$jid.pid +wait $marcpid + +if test $nprocd -gt 1 +then + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + if test "$host" + then + /bin/rm $jid.mfile 2> /dev/null + /bin/rm $jid.hosts 2> /dev/null + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.cfile 2> /dev/null + fi + fi + fi +fi + + +if test $dllrun -eq 0; then +if test $prgsav = no +then + /bin/rm -f $bd$program 2>/dev/null + # for network run, remove executable on remote machines + # and executables with modified name + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + if test -f "$host_filt" + then + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + # if an incompatible host uses shared directory, + # then the root machine deletes the executable + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + hname=_$ibase + /bin/rm ${execname}$hname + fi + # if local directory used, the remote machine + # deletes the executable + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null + fi + fi + done + fi + fi +fi +fi +else +#dllrun >0 + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sin 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + if test $MPITYPE = "myrinet" + then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi + fi +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + /bin/rm $DIRJOB/$jid.sle 2>/dev/null + /bin/rm $DIRJOB/$jid.sin 2>/dev/null +fi +) 1>>$jid.log 2>&1 & + + +############################################################################## +# run the requested program in the foreground # +############################################################################## + +else + +# +# compile user subroutine if present +# +if test "$link" +then + if test -z "$FCOMPROOT"; then + echo "$0: No compiler available" + echo + echo " $PRODUCT Exit number 3" + exit 1 + fi + echo + echo "Using compiler from: $FCOMPROOT" + echo + if test "$user" + then + # compile and link on other hosts in $host if compstatus=no + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${compstatus[$counter]} = "no" + then + DIR1=$DIRJOB + DIR2=$DIR + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + marcdir=`echo $line | $AWK '{print $4}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -n "$marcdir" + then + DIR2=$marcdir + fi + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then + $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" + then + hname=_$ibase + else + hname= + fi + remoteprog=$DIR1/${execname}$hname + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo + $RSH $i $DIR2/tools/comp_damask_l $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else + echo "$0: compile failed for $user on host $i" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi + done + fi + fi + if test "$userhost" + then + echo + echo "Compiling and linking user subroutine $user on host `hostname`" + fi + userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then + $DFORTLOW $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTLOW $user -o $userobj || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi # if test $user + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $DAMASK \ + $SYSLIBS \ + $SFLIB \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 + } + # copy user subroutine executable for hosts using local working dir + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" + then + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + echo "Copying executable to host ${i}" + $RCP $program ${i}:${DIR1}/ + fi + fi + done + fi + fi +else # if test $link + prgsav=yes +fi # if test $link +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null +# done if no job id given +if test -z "$jid" +then + echo + echo only compilation requested + echo + exit +fi +# +# run marc +# +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi +# first remove all .out files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null +fi + +# for DDM with ARC support + +if test $ddm_arc -gt 0; then + RUN_JOB="$MESHERDIR/sf_exeddm $RUN_JOB -ddm $ddm_arc " +fi + + $RUN_JOB + +if test $nprocd -gt 1 +then + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + if test "$host" + then + /bin/rm $jid.mfile 2> /dev/null + /bin/rm $jid.hosts 2> /dev/null + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.cfile 2> /dev/null + else + echo " " > /dev/null + fi + else + if test "$host" + then + mpdcleanup -a -f $jid.mfile + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.mfile 2> /dev/null + else + mpdcleanup -a -f $jid.hosts + /bin/rm $jid.hosts 2> /dev/null + fi + fi + fi +fi + +if test $dllrun -eq 0; then +if test $prgsav = no +then + /bin/rm -f $bd$program 2>/dev/null + # for network run, remove executable on remote machines + # and executables with modified name + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + if test -f "$host_filt" + then + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + # if an incompatible host uses shared directory, + # then the root machine deletes the executable + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + hname=_$ibase + /bin/rm ${execname}$hname + fi + # if local directory used, the remote machine + # deletes the executable + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null + fi + fi + done + fi + fi +fi +fi +else +#dllrun >0 + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi + +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sin 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + if test $MPITYPE = "myrinet" + then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi + fi +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + /bin/rm $DIRJOB/$jid.sle 2>/dev/null + /bin/rm $DIRJOB/$jid.sin 2>/dev/null +fi + + +fi +fi diff --git a/installation/mods_MarcMentat/2016/Marc_tools/run_damask_lmp b/installation/mods_MarcMentat/2016/Marc_tools/run_damask_lmp new file mode 100644 index 000000000..72348a618 --- /dev/null +++ b/installation/mods_MarcMentat/2016/Marc_tools/run_damask_lmp @@ -0,0 +1,4096 @@ +#!/bin/ksh +############################################################################## +# # +# run_marc - run a marc job # +# ------------------------- # +# # +# usage: run_marc -j jid { options } # +# # +# where standard options are: required: defaults: # +# -------------------------- # +# # +# -j* jid job id number. ** YES ** . # +# -pr* prog program name. . marc # +# -v* y|n do or do not verify inputs. . yes # +# -q* s|l|v|b|f batch queue name or background, . short # +# foreground. # +# -b* as alternative to option -q* # +# # +# ( batch queues only : # +# -pq* intra queue priority. . . # +# -at DATE/TIME delay start of job. . . # +# format : January,1,1990,12:31 # +# or : today,5pm # +# -cpu* secs job CPU limit . . ) # +# # +# -r* rid restart file job id. . . # +# -si* sid substructure file id. . . # +# -pi* post post file job id. . . # +# -de* did defaults file . no # +# -vf vid viewfactor . no # +# # +# -u* user user subroutine. . . # +# -obj obj user objects or libraries. . . # +# -sa* y|n do or do not save load module. . no # +# -autorst auto restart flag for auto forge . no # +# -me manual remeshing control . no # +# -ml memory limit in Mbyte # +# -mo This option is deprecated. As of Marc 2015, only # +# the integer*8 version is available. # +# -mpi selects MPI version # +# each platform has a default MPI version and some # +# have an alternative version. see the include file # +# for the respective platform # +# MPI_DEFAULT defines the default MPI version # +# MPI_OTHER defines versions one can switch to # +# -dcoup for contact decoupling # +# currently not supported # +# -dir directory where the job i/o should take place. # +# defaults to current directory. # +# -sdir directory where scratch files are created # +# defaults to current directory. # +# # +# -alloc only perform memory allocation test, no analysis # +# -list y only list options in the input file, no analysis # +# -fe num set feature number "num" for the run. only one allowed # +# -dytran flag to switch from Dytran to Marc # +# dytran = 0, program will run w/o Marc-Dytran Switch # +# = 1, program will restart Marc after Dytran run # +# >= 2, Not supported yet. # +# currently not supported # +# -ou force analysis to use out-of-core control # +# =0, not used # +# =1, element storage out-of-core # +# -dll run marc using shared library libmarc.so and exe_marc # +# =1, used # +# =2, do not free streaming input memory # +# =3, run with marc input deck # +# -trk run marc for post-tracking # +# -gpuid run marc using GPGPU capability # +# specify gpuid on to be used in the analysis. Multiple # +# IDs may be assigned for DDM runs. # +# Separate a list of IDs with a colon. Each DMP # +# process will be assigned a GPU ID in round robin fastion# +# = 0 # +# = 0:1 etc... # +# # +# where parallel options are: # +# -------------------------- # +# # +# itree, host, and comp options are available for the domain # +# decomposition only. # +# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # +# # +# # +# -nprocd number of domains. # +# defaults to single domain solution. # +# -nprocds number of domains if single input file. # +# defaults to single domain solution. # +# -nps same as -nprocds. # +# -nsolver number of solver tasks for solver types 12 and 13 # +# these are distributed tasks operating via MPI # +# -nthread_elem number of threads for element assembly and recovery # +# = 0: use defaults. # +# defaults to 1 for single domain solution. # +# defaults to number of domains for multi-domain # +# solution. # +# > 1: number of threads to be used by element assembly # +# recovery. # +# Also can be set through MARC_NUMBER_OF_THREADS # +# environment variable. # +# if both specified, -nthread_elem option will be used. # +# defaults if neither MARC_NUMBER_OF_THREADS environment # +# variable set nor -nthread_elem specified. # +# -nthread_solver number of threads for solver types 6, 8, and 11 # +# = 0: use defaults. # +# defaults to 1 for single domain solution. # +# defaults to number of domains for multi-domain # +# solution. # +# > 1: number of threads to be used by 6, 8, and 11 # +# Also can be set through MARC_NUMBER_OF_THREADS # +# environment variable. # +# if both specified, -nthread_solver option will be used. # +# defaults if neither MARC_NUMBER_OF_THREADS environment # +# variable set nor -nthread_solver specified. # +# -nthread Same as -nthread_solver. # +# -itree message passing tree type for domain decomposition. # +# for debugging purposes; should not normally be used. # +# -host hostfile name for distributed execution on network. # +# defaults to no hostfile, unless jobid.defhost exists. # +# if jobid.defhost exists, only -np(s) necessary # +# -comp* y|n to be used with user routines on a network of # +# incompatible machines. # +# if set to no, a separate executable will be created # +# for each machine on the network. # +# if set to yes, the executable located on the machine # +# from which marc is started will be used on all machines.# +# defaults to no if O/S versions different on machines. # +# # +# -ci y|n copy input files to remote hosts (default: yes) # +# if "yes", input files are automatically copied to # +# remote hosts for a network run if necessary. # +# -cr y|n copy post files from remote hosts (default: yes) # +# if "yes", post files are automatically copied back from # +# remote hosts for a network run if necessary. # +############################################################################## +# set DIR to the directory in which this script is +REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" +DIR=`dirname $REALCOM` +# make sure DIR has an absolute path +case $DIR in + \/*) + ;; + *) + DIR=`pwd`/$DIR + ;; +esac +DIRSCRIPT=$DIR +AWK=awk +ARCH=`uname -a | cut -f 1 -d " "` +# Sun has a bad awk, use nawk instead +if test $ARCH = "SunOS" +then + AWK=nawk +fi +BASENAME=basename +# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists +if test $ARCH = "SunOS" +then + if test -x /usr/ucb/basename + then + BASENAME=/usr/ucb/basename + fi +fi + +# echo command line in the case of ECHO_COMMAND is true +if test "$ECHO_COMMAND" = true ; then + echo command "$0" "$@" +fi + +# +# "mode" selects version, i4 or i8 +# default is i4 +# this can be changed by a file run_marc_defaults +# located in the tools directory of the Marc installation +# or in the user's home directory +# format: +# MARC_MODE i8 +# it can also be set by the environmental variable MARC_INTEGER_SIZE +# and by the command line option "-mo" +# +mode= +modeerror= +modeoption= +if test -f $DIRSCRIPT/run_marc_defaults; then + line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $DIRSCRIPT/run_marc_defaults` + if test "$line" = "MARC_MODE"; then + echo + echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available + echo + line= + fi + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + modeerror="defaults file $DIRSCRIPT/run_marc_defaults used mode $line ; this must be i8" + modeoption=error + echo $modeerror + fi + if test "$line" = "i8"; then + mode=i8 + fi +fi +if test -f $HOME/run_marc_defaults; then + line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $HOME/run_marc_defaults` + if test "$line" = "MARC_MODE"; then + echo + echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available + echo + line= + fi + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + modeerror="defaults file $HOME/run_marc_defaults used mode $line ; this must be i8" + modeoption=error + echo $modeerror + fi + if test "$line" = "i8"; then + mode=i8 + fi +fi +if test -n "$MARC_INTEGER_SIZE" ; then + mode=$MARC_INTEGER_SIZE +fi +if test -z "$mode" ; then + mode=i8 +fi +case $mode in + i4) + modeerror="bad value for MARC_INTEGER_SIZE variable; only i8 is supported." + modeoption=error + echo $modeerror + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo "bad value for MARC_INTEGER_SIZE variable; only i8 is supported." + exit + ;; +esac + +setmode=false +for arg in $* ; do + if $setmode ; then + mode=$arg + case $mode in + i4) + modeerror="bad value for mode option; only i8 is supported." + modeoption=error + echo + echo $modeerror + echo + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo " " + echo "error, version mode must be i8" + echo " " + echo " use -mo i8 " + echo " " + exit + ;; + esac + setmode=false + fi + if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then + echo + echo warning: the option -mo is deprecated, as of Marc 2015, only the integer*8 version is available + echo + setmode=true + fi + if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + fi + if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then + modeerror="bad value for mode option; only i8 is supported." + modeoption=error + echo + echo $modeerror + echo + fi +done + +# set to i4 version for 32 bit Linux +if test "`uname -s`" = "Linux"; then + if test "`uname -m`" = "i686"; then + mode=i4 + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + fi +fi + + +. "$DIR/getarch" + +. $MARC_INCLUDE +# + +# +# Dynamically determine the echo syntax +# + +case "`echo '\c'`" in + '\c') + ECHO='echo -n' + ECHOTXT=' ' + ;; + *) + ECHO='echo' + ECHOTXT=' \c' + ;; +esac + +# +# Variables for the MARC environment +# + +PRODUCT="Marc" +EXITMSG=$MARC_TOOLS/MESSAGES +export EXITMSG +FLEXDIR=$DIR/../flexlm/licenses +export FLEXDIR +TIMCHK=3600 +export TIMCHK +BINDIR=$MARC_BIN +export BINDIR +AFMATDAT=$MARC_RUNTIME/AF_flowmat/ +export AFMATDAT +export MESHERDIR +MSC_LICENSE_FINPROC=1 +export MSC_LICENSE_FINPROC +# +# define directory path to global unified material database +# +MATFILE= +export MATFILE + +# +# define memory limit +# first set to MEMLIMIT from include +# -ml option overrules if specified +memlimit=$MEMLIMIT +# +# Define share library path based on platforms +# This is required for using the Patran Mesher +# +if test $MACHINENAME = "HP" +then + SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH + export SHLIB_PATH +fi +# the one for IBM is defined futher down + +LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$MESHERDIR:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$SFMATDIR:$LD_LIBRARY_PATH +LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH +LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH +export LD_LIBRARY_PATH +export LD_LIBRARY64_PATH +export LD_LIBRARYN32_PATH + +atexit() { +kill -15 $$ +# +if test $MPITYPE = "myrinet" +then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi +fi +} + +trap "atexit" 2 + +# +# defaults +# + +prog=marc +exefile=marc +jid= +rid= +pid= +sid= +did= +vid= +user= +usernoext= +objs= +qid=background +cpu= +priority= +att= +trk= +verify=yes +prgsav=no +rmdll=no +cpdll=no +progdll= +pathdll= +error= +nprocd=0 +nprocdddm=1 +nprocdddmprint= +icreated=0 +nprocdarg= +nsolver=0 +nsolverarg=-ns +if test $nprocds +then + if test $nprocds -gt 1 + then + nprocdddm=$nprocds + nprocdddmprint=$nprocds + icreated=1 + nprocdarg=-nprocds + fi +fi +ntprint=0 +nt=-1 +nte=-1 +nts=-1 +ntarg=-nt +ntearg=-nte +ntsarg=-nts +nteprint= +ntsprint= +gpuids= +nauto=0 +ndcoup=0 +ndytran=0 +noutcore=0 +dllrun=0 +mesh=0 +itree=0 +iam= +ddm_arc=0 +link= +trkrun=0 +DIRJOB=`pwd` +DIRSCR=$DIRJOB +DIRSCRSET= +autoforge=0 +dotdat=.dat +dotdefhost=.defhost +host= +numhost= +mfile= +userhost= +makebdf= +cpinput=yes +cpresults=yes +marcdll=libmarc.$EXT_DLL +# define hostname and strip off extensions (alpha.aaa.com) +thishost=`hostname` +thishost=${thishost%%.*} +compatible=unknown +numfield=1 +justlist= +feature= +mpioption=false +iprintsimufact= +MDSRCLIB=$MARC_LIB/mdsrc.a +# +# check run_marc_defaults file for default MPI setting +# located in the tools directory of the Marc installation +# or in the user's home directory +# format: +# MARC_MPI +# +value= +file= +if test -f $DIRSCRIPT/run_marc_defaults; then + value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` + value=`echo $value | $AWK '{print $NF}'` + if test -n "$value"; then + file=$DIRSCRIPT/run_marc_defaults + fi +fi +if test -f $HOME/run_marc_defaults; then + value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` + value=`echo $value | $AWK '{print $NF}'` + if test -n "$value"; then + file=$HOME/run_marc_defaults + fi +fi +if test -n "$value"; then + MARC_MPITYPE=$value + notok=true + for i in "$MPI_OTHER"; do + if test "$MARC_MPITYPE" = "$i"; then + notok=false + fi + done + if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then + notok=false + fi + if $notok; then + echo " " + echo " error, incorrect option for MARC_MPI" + echo " defined in $file: $MARC_MPITYPE" + echo " valid options: $MPI_DEFAULT $MPI_OTHER" + echo " " + exit + fi + if test "$value" != "$MPI_DEFAULT"; then + exefile=marc_$value + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a_$value + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" + fi + fi +fi +# +# +# allow scratch directory to be specified with environmental variable +# MARCSCRATCH +if test $MARCSCRATCH +then + if test -d $MARCSCRATCH + then + DIRSCR=$MARCSCRATCH + else + echo "error, scratch directory '$MARCSCRATCH'" + echo " specified via environmental variable MARCSCRATCH does not exist" + exit + fi +fi +# +############################################################################## +# parse input - arguments always come in pairs # +############################################################################## + +arg=$1 +if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then + shift + arg=$1 +fi +while [ -n "$arg" ] +do + shift + value=$1 + case $arg in + -al* | -AL*) + LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH + $MARC_BIN/marc -alloc 1 + exit + ;; + -li* | -LI*) + justlist=yes + ;; + -fe* | -FE*) + feature=$value + + ;; + -pr* | -PR*) + if test `dirname $value` = '.' + then + prog=`$BASENAME $value .marc` + progdll=`$BASENAME $value` + else + prog=`dirname $value`/`$BASENAME $value .marc` + progdll=`dirname $value`/`$BASENAME $value` + fi + prdir=`dirname $value` + case $prdir in + \/*) + ;; + *) + prog=`pwd`/$prdir/$prog + ;; + esac + ;; + -j* | -J*) + jid=`$BASENAME $value $dotdat` + DIRJID=`dirname $value` + case $DIRJID in + \/*) + ;; + *) + DIRJID=`pwd`/$DIRJID + ;; + esac + ;; + -r* | -R*) + rid=`$BASENAME $value .t08` + DIRRID=`dirname $value` + case $DIRRID in + \/*) + ;; + *) + DIRRID=`pwd`/$DIRRID + ;; + esac + ;; + -si* | -SI*) + sid=$value + DIRSID=`dirname $value` + case $DIRSID in + \/*) + ;; + *) + DIRSID=`pwd`/$DIRSID + ;; + esac + ;; + -pi* | -PI*) + if test -f $value.t19 + then + pid=`$BASENAME $value .t19` + else + pid=`$BASENAME $value .t16` + fi + DIRPID=`dirname $value` + case $DIRPID in + \/*) + ;; + *) + DIRPID=`pwd`/$DIRPID + ;; + esac + ;; + -bdf | -BDF) + makebdf=1 + ;; + -de* | -DE*) + did=`$BASENAME $value $dotdat` + DIRDID=`dirname $value` + case $DIRDID in + \/*) + ;; + *) + DIRDID=`pwd`/$DIRDID + ;; + esac + ;; + -vf | -VF) + vid=`$BASENAME $value .vfs` + DIRVID=`dirname $value` + case $DIRVID in + \/*) + ;; + *) + DIRVID=`pwd`/$DIRVID + ;; + esac + ;; + -u* | -U*) + user=$value + case $user in + \/*) + ;; + *) + user=`pwd`/$user + ;; + esac + usernoext=$user + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + ;; + -obj | -OBJ) + objs="$value" + ;; + -q* | -Q*) + qid=$value + ;; + -b* | -B*) + case $value in + y* | Y*) + qid=background + ;; + n* | N*) + qid=foreground + ;; + *) + ;; + esac + ;; + -at | -AT) + att=$value + ;; + -cpu* | -CPU*) + cpu=$value + ;; + -pq | -PQ*) + priority=$value + ;; + -v* | -V*) + verify=$value + ;; + -sa* | -SA*) + prgsav=$value + ;; + -np* | -NP*) + nprocdddm=$value + nprocdddmprint=$value + case $arg in + -nps* | -NPS* | -nprocds* | -NPROCDS*) + icreated=1 + nprocdarg=-nprocds + ;; + esac + case $arg in + -np | -NP | -nprocd | -NPROCD) + icreated=0 + nprocdarg=-nprocd + ;; + esac + ;; + -ns* | -NS*) + nsolver=$value + ;; + -nt* | -NT*) + case $arg in + -nte | -NTE | -nthread_e* | -NTHREAD_E*) + nte=$value + ;; + esac + case $arg in + -nts | -NTS | -nthread_s* | -NTHREAD_S*) + nts=$value + ;; + esac + case $arg in + -nt | -NT | -nth* | -NTH* | -nthread* | -NTHREAD*) + nt=$value + ;; + esac + ;; + -gp* | -GP*) + gpuids=$value + ;; + -it* | -IT*) + itree=$value + ;; + -iam | -IAM) + iam=$value + case $value in + sfg | sfm | sim) + iprintsimufact=true + ;; + esac + ;; + -au* | -AU*) + nauto=$value + ;; + -dc* | -DC*) + ndcoup=$value + ;; + -dy* | -DY*) + ndytran=$value + ;; + -ou* | -OU*) + noutcore=$value + ;; + -dll | -DLL) + dllrun=$value + ;; + -trk | -TRK) + trkrun=$value + ;; + -ddm | -DDM) + ddm_arc=$value + ;; + -me | -ME ) + mesh=$value + ;; + -ml | -ML ) + memlimit=$value + ;; + -mo | -MO ) + ;; + -mpi | -MPI ) + mpioption=true + MARC_MPITYPE=$value + if test "$value" != "$MPI_DEFAULT"; then + exefile=marc_$value + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a_$value + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" + fi + else + exefile=marc + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" + fi + fi + ;; + -dir* | -DIR*) + DIRJOB=$value + case $DIRJOB in + \/*) + ;; + *) + DIRJOB=`pwd`/$DIRJOB + ;; + esac + if test -z "$DIRSCRSET" + then + DIRSCR=$DIRJOB + fi + ;; + -sd* | -SD*) + DIRSCR=$value + DIRSCRSET=yes + case $DIRSCR in + \/*) + ;; + *) + DIRSCR=`pwd`/$DIRSCR + ;; + esac + ;; + -ho* | -HO*) + host=$value + ;; + -co* | -CO*) + compatible=$value + ;; + -ci* | -CI*) + cpinput=$value + ;; + -cr* | -CR*) + cpresults=$value + ;; + *) + error="$error +$arg: invalid option" + break + ;; + esac + case $value in + -*) + error="$error +$arg: invalid name $value" + break + ;; + esac + shift + arg=$1 + if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then + shift + arg=$1 + fi +done +argc=`expr $# % 2` +if test $argc -eq 1 +then +# +# odd number of arguments +# + error="$error +argument list incomplete" +fi + +if test $nprocdddm -gt 0 +then +nprocd=$nprocdddm +fi + +if test $nsolver -gt 0 +then + if test $nsolver -gt $nprocd + then + nprocd=$nsolver + fi +fi +# Set defaults +if test $nt -eq -1 +then +nt=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nt -lt 0 +then +nt=0 +fi +if test $nte -eq -1 +then +nte=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nte -lt 0 +then +nte=0 +fi +if test $nts -eq -1 +then +nts=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nts -lt 0 +then +nts=0 +fi +# +# set number of element loop threads +# +ntprint=$nt +nteprint=$nte +# copy from -nprocd[s] +if test $nprocdddm -gt 1 +then + nteprint=$nprocdddm +fi +# override with -nthread_elem option +if test $nte -ne 0 +then +nteprint=$nte +fi +# check for minimum 1 threads per processes for DDM +if test $nprocdddm -gt 1 +then + if test $nteprint -lt $nprocdddm + then + nteprint=$nprocdddm + fi +fi +nte=$nteprint +# +# set number of Solver threads +# +ntsprint=$nts +# copy from -nthread or -nprocd[s] +if test $ntprint -ne 0 +then + ntsprint=$ntprint +else + if test $nprocdddm -gt 1 + then + ntsprint=$nprocdddm + fi +fi +# override with -nthread_solver option +if test $nts -ne 0 +then + ntsprint=$nts +fi +# check for minimum 1 threads per solver process. +if test $nsolver -lt $nprocdddm +then + if test $ntsprint -lt $nsolver + then + ntsprint=$nsolver + fi +else + if test $ntsprint -lt $nprocdddm + then + ntsprint=$nprocdddm + fi +fi +if test $ntsprint -eq 1 +then + set ntsprint=0 +fi +nts=$ntsprint + +# set stack size for multi-threading. +export KMP_MONITOR_STACKSIZE=7M +export OMP_STACKSIZE=7M + +# +# deprecate -nthread option at arugment of marc +nt=0 +# Reset nprocdddmm, nsolver and threads if not given. +if test $nprocdddm -eq 0 +then + nprocdarg= +fi +if test $nprocdddm -eq 0 +then + nprocdddmprint= +fi +if test $nprocdddm -eq 0 +then + nprocdddm= +fi + +if test $nsolver -eq 0 +then + nsolverprint= +fi +# end of threads setting. +gpuoption= +if test "$gpuids" = "" ; then + gpuoption= +else + gpuoption="-gp $gpuids" +fi + +if test "$gpuids" = "" ; then + export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH +else + MARCCUDALIBS=$MARCCUDALIBS2 + export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH +fi +# Linux 64 + HPMPI, Below code is taken from include_linux64 +if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" +then + export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" +fi + +if test $nprocd -gt 1; then + if test -f $jid$dotdefhost; then + if test "$host" = ""; then + host=$jid$dotdefhost + fi + fi + if test -f hostfile_qa_$nprocd; then + if test "$host" = ""; then + host=hostfile_qa_$nprocd + fi + fi +fi + +if test "$dllrun" -gt 0; then + exefile=exe_marc + prog=exe_marc + program=$exefile + bd=$MARC_BIN/ + if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then + dotdat=.inp + fi + + if test "$progdll"; then + /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll + rmdll=yes + pathdll=yes + progdll=${progdll}_$marcdll + else + progdll=$marcdll + fi + + if test "$user"; then + . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user + user= + if test $prgsav = no; then + rmdll=yes + fi + if test $prgsav = yes; then + cpdll=yes + rmdll=yes + fi + pathdll=yes + fi +fi + +############################################################################## +# check parameter validity # +############################################################################## + +while test forever; do + +# +# check for input file existence +# +if test $nprocdddm -gt 1 -a $icreated -eq 0; then + if test ! -f $DIRJID/1$jid$dotdat; then + if test "$jid" != "" ; then + error="$error +input file $DIRJID/1$jid$dotdat not accessible" + fi + fi +else + if test ! -f $DIRJID/$jid$dotdat; then + if test "$jid" != "" ; then + error="$error +input file $DIRJID/$jid$dotdat not accessible" + fi + fi +fi + if test $nprocd -gt 1; then + if test "$host" ; then + if test ! -f $host; then + error="$error +host name file $host not accessible" + fi + fi + fi + +# +# check if the job is already running in the background +# +if test -f $DIRJOB/$jid.pid; then + error="$error +job is already running (the file $jid.pid exists)" +fi + +# +# if the program name is other than marc, then +# assume that this is a program in the users local directory +# + +bd=$MARC_BIN/ + +case $prog in + marc | MARC | $exefile) + program=$exefile + if test "$rid" + then + if test ! -f $DIRRID/$rid.t08 + then + error="$error +restart file $DIRRID/$rid.t08 not accessible" + fi + fi + if test "$pid" + then + if test ! -f $DIRPID/$pid.t16 + then + if test ! -f $DIRPID/$pid.t19 + then + error="$error +post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" + fi + fi + fi + if test "$user" + then + if test ! -f $user + then + error="$error +user subroutine file $user not accessible" + fi + fi + if test "$objs" + then + missingobjs= + for o in $objs + do + if test ! -f "$o" + then + if test -z "$missingobjs" + then + missingobjs="$o" + else + missingobjs="$missingobjs $o" + fi + fi + done + if test -n "$missingobjs" + then + error="$error +user object/library file(s) $missingobjs not accessible" + fi + fi + if test "$did" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRDID/1$did$dotdat + then + error="$error +defaults file $DIRDID/1$did$dotdat not accessible" + fi + else + if test ! -f $DIRDID/$did$dotdat + then + error="$error +defaults file $DIRDID/$did$dotdat not accessible" + fi + fi + fi + if test "$vid" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRVID/1$vid.vfs + then + error="$error +view factor file $DIRVID/1$vid.vfs not accessible" + fi + else + if test ! -f $DIRVID/$vid.vfs + then + error="$error +view factor file $DIRVID/$vid.vfs not accessible" + fi + fi + fi + if $mpioption + then + notok=true + for i in "$MPI_OTHER"; do + if test "$MARC_MPITYPE" = "$i"; then + notok=false + fi + done + if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then + notok=false + fi + if $notok; then + error="$error +incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" + fi + fi + ;; + *) + program=$prog.marc + case $prog in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + if test "$rid" + then + if test ! -f $DIRRID/$rid.t08 + then + error="$error +restart file $DIRRID/$rid.t08 not accessible" + fi + fi + if test "$pid" + then + if test ! -f $DIRPID/$pid.t16 + then + if test ! -f $DIRPID/$pid.t19 + then + error="$error +post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" + fi + fi + fi + if test "$user" + then + error="$error +program option may not be used with user subroutine" + fi + if test "$objs" + then + error="$error +program option may not be used with user objects or libraries" + fi + if test "$did" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRDID/1$did$dotdat + then + error="$error +defaults file $DIRDID/1$did$dotdat not accessible" + fi + else + if test ! -f $DIRDID/$did$dotdat + then + error="$error +defaults file $DIRDID/$did$dotdat not accessible" + fi + fi + fi + if test "$nauto" + then + if test $nauto -gt 2 + then + error="$error +incorrect option for auto restart " + fi + fi + if test "$ndcoup" + then + if test $ndcoup -gt 3 + then + error="$error +incorrect option for contact decoupling " + fi + fi + if test "$ndytran" + then + if test $ndytran -gt 1 + then + error="$error +incorrect option for Marc-Dytran Switch " + fi + fi + if $mpioption + then + if test ! -x $MARC_BIN/$exefile + then + error="$error +incorrect option for -mpi option: $MARC_MPITYPE " + fi + fi + ;; +esac + +############################################################################## +# check argument integrity # +############################################################################## + +if test "$jid" +then + : +else + if test "$user" + then +# allow user sub without giving job id + qid=foreground + verify=no + else + error="$error +job id required" +fi +fi + +if test $nprocd -gt 1 +then + if test $nauto -gt 0 + then + error="$error +cannot run DDM job with auto restart (-au) option " + fi +fi +case $qid in + S* | s*) + qid=short + ;; + L* | l*) + qid=long + ;; + V* | v*) + qid=verylong + ;; + B* | b*) + qid=background + ;; + F* | f*) + qid=foreground + ;; + A* | a*) + qid=at + ;; + *) + error="$error +bad value for queue_id option" + ;; +esac + +case $prgsav in + N* | n*) + prgsav=no + ;; + Y* | y*) + prgsav=yes + ;; + *) + error="$error +bad value for save option" + ;; +esac + +case $verify in + N* | n*) + verify=no + ;; + Y* | y*) + verify=yes + ;; + *) + error="$error +bad value for verify option" + ;; +esac + +case $nprocdddm in + -* ) + error="$error +bad value for nprocd option" + ;; +esac + +case $nt in + -* ) + error="$error +bad value for nt option" + ;; +esac + +case $itree in + -* ) + error="$error +bad value for itree option" + ;; +esac +case $iam in + -* ) + error="$error +bad value for iam option" + ;; +esac +case $compatible in + N* | n*) + compatible=no + ;; + Y* | y*) + compatible=yes + ;; + unknown) + ;; + *) + error="$error +bad value for comp option" + ;; +esac +case $cpinput in + N* | n*) + cpinput=no + ;; + Y* | y*) + cpinput=yes + ;; + *) + error="$error +bad value for copy input option" + ;; +esac +case $cpresults in + N* | n*) + cpresults=no + ;; + Y* | y*) + cpresults=yes + ;; + *) + error="$error +bad value for copy results option" + ;; +esac + +# +# check for external file to run +# +if test -f $MARC_TOOLS/run_marc_check +then + . $MARC_TOOLS/run_marc_check +fi + +############################################################################## +# interact with the user to get the required information to run marc or # +# other marc system program # +############################################################################## + +deletelog=yes +if test $qid = background -a $verify = no +then +echo \ +" +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid +User subroutine name : $user +User objects/libs : $objs +Restart file job ID : $rid +Substructure file ID : $sid +Post file job ID : $pid +Defaults file ID : $did +View Factor file ID : $vid +Save generated module: $prgsav +MPI library : $MPITYPE +DDM processes : $nprocdddmprint +Element loop threads : $nteprint +Solver processes : $nsolverprint +Solver threads : $ntsprint +GPGPU option : $gpuids +Host file name : $host" > $jid.log +if test "$iprintsimufact" = true ; then + echo "DDM with ARC Mapper : $ddm_arc" >> $jid.log +fi +echo \ +"Message passing type : $itree +Run job in queue : $qid +Run directory : $DIRJOB +Scratch directory : $DIRSCR +Memory limit in Mbyte: $memlimit +Auto Restart : $nauto " >> $jid.log +deletelog=no +fi +echo \ +" +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid +User subroutine name : $user +User objects/libs : $objs +Restart file job ID : $rid +Substructure file ID : $sid +Post file job ID : $pid +Defaults file ID : $did +View Factor file ID : $vid +Save generated module: $prgsav +MPI library : $MPITYPE +DDM processes : $nprocdddmprint +Element loop threads : $nteprint +Solver processes : $nsolverprint +Solver threads : $ntsprint" +if test "$iprintsimufact" = true ; then + echo "DDM with ARC Mapper : $ddm_arc" +fi +echo \ +"GPGPU option : $gpuids +Host file name : $host +Message passing type : $itree +Run job in queue : $qid +Run directory : $DIRJOB +Scratch directory : $DIRSCR +Memory limit in Mbyte: $memlimit +Auto Restart : $nauto" + + +case $qid in + s* | S* | l* | L* | v* | V* ) + echo \ +"Queue priority : $priority +Queue CPU limit : $cpu +Queue start time : $att" + ;; +# * ) +# echo \ +#" " +# ;; +esac + +if test "$modeoption" +then + error=$modeerror +fi + +if test "$error" +then + if test $verify = yes + then + $ECHO "$error + +Please correct or quit(correct,quit,): $ECHOTXT" + error= + read answer + case $answer in + q* | Q*) + answer=quit + ;; + *) + answer=correct + ;; + esac + else + $ECHO "$error + $ECHOTXT" + echo " " + if test "$deletelog" = no + then + $ECHO "$error + $ECHOTXT" >> $jid.log + echo " " >> $jid.log + fi + answer=quit + fi +else + if test $verify = yes + then + $ECHO " +Are these parameters correct (yes,no,quit,)? $ECHOTXT" + read answer + case $answer in + q* | Q*) + answer=quit + ;; + y* | Y*) + answer=yes + ;; + *) + answer=no + ;; + esac + else + answer=yes + fi +fi + +case $answer in + no | correct) + +############################################################################## +# prompt for each value # +############################################################################## + + $ECHO " +Program name ($prog)? $ECHOTXT" + read value + if test "$value" + then + prog=$value + fi + $ECHO "Job ID ($jid)? $ECHOTXT" + read value + if test "$value" + then + jid=`$BASENAME $value $dotdat` + DIRJID=`dirname $value` + case $DIRJID in + \/*) + ;; + *) + DIRJID=`pwd`/$DIRJID + ;; + esac + fi + $ECHO "User subroutine name ($user)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + user= + ;; + *) + user=$value + case $user in + \/*) + ;; + *) + user=`pwd`/$user + ;; + esac + usernoext=$user + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + ;; + esac + fi + $ECHO "User objects or libraries ($objs)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + objs= + ;; + *) + objs="$value" + ;; + esac + fi + $ECHO "Restart File Job ID ($rid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + rid= + ;; + *) + rid=`$BASENAME $value .t08` + DIRRID=`dirname $value` + case $DIRRID in + \/*) + ;; + *) + DIRRID=`pwd`/$DIRRID + ;; + esac + ;; + esac + fi + $ECHO "Substructure File ID ($sid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + sid= + ;; + *) + sid=$value + DIRSID=`dirname $value` + case $DIRSID in + \/*) + ;; + *) + DIRSID=`pwd`/$DIRSID + ;; + esac + ;; + esac + fi + $ECHO "Post File Job ID ($pid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + pid= + ;; + *) + pid=$value + DIRPID=`dirname $value` + case $DIRPID in + \/*) + ;; + *) + DIRPID=`pwd`/$DIRPID + ;; + esac + ;; + esac + fi + $ECHO "Defaults File ID ($did)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + did= + ;; + *) + did=`$BASENAME $value $dotdat` + DIRDID=`dirname $value` + case $DIRDID in + \/*) + ;; + *) + DIRDID=`pwd`/$DIRDID + ;; + esac + ;; + esac + fi + $ECHO "View Factor File ID ($vid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + vid= + ;; + *) + vid=`$BASENAME $value .vfs` + DIRVID=`dirname $value` + case $DIRVID in + \/*) + ;; + *) + DIRVID=`pwd`/$DIRVID + ;; + esac + ;; + esac + fi + $ECHO "Save generated module ($prgsav)? $ECHOTXT" + read value + if test "$value" + then + prgsav=$value + fi + $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" + read value + if test "$value" + then + nprocdddm=$value + nprocdddmprint=$value + fi + $ECHO "Run on ($nte) Element loop threads ? $ECHOTXT" + read value + if test "$value" + then + nte=$value + fi + $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" + read value + if test "$value" + then + nsolver=$value + fi + $ECHO "Run on ($nts) Solver threads ? $ECHOTXT" + read value + if test "$value" + then + nts=$value + fi +# + if test $nprocdddm -gt 0 + then + nprocd=$nprocdddm + fi + if test $nsolver -gt 0 + then + if test $nsolver -gt $nprocd + then + nprocd=$nsolver + fi + fi +# Element loop threads. + if test $nte -eq -1 + then + nte=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nte -lt 0 + then + nte=0 + fi + nteprint=$nte +# Copy from ddm + if test $nprocdddm -gt 1 + then + nteprint=$nprocdddm + fi +# override with -nthread_elem option + if test $nte -ne 0 + then + nteprint=$nte + fi +# check for minimum 1 threads per processes for DDM + if test $nprocdddm -ne 0 + then + if test $nteprint -lt $nprocdddm + then + nteprint=$nprocdddm + fi + fi + nte=$nteprint +# Solver threads. + if test $nts -eq -1 + then + nts=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nts -lt 0 + then + nts=0 + fi + ntsprint=$nts +# Copy from ddm + if test $nprocdddm -gt 1 + then + ntsprint=$nprocdddm + fi +# override with -nthread_solver option + if test $nts -ne 0 + then + ntsprint=$nts + fi +# check for minimum 1 threads per solver process. + if test $nsolver -lt $nprocdddm + then + if test $ntsprint -lt $nsolver + then + ntsprint=$nsolver + fi + else + if test $ntsprint -lt $nprocdddm + then + ntsprint=$nprocdddm + fi + fi + if test $ntsprint -eq 1 + then + set ntsprint=0 + fi + nts=$ntsprint + $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" + read value + if test "$value" + then + gpuids=$value + fi + if test "$gpuids" = "" ; then + gpuoption= + else + gpuoption="-gp $gpuids" + fi + if test "$gpuids" = "" ; then + export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH + else + MARCCUDALIBS=$MARCCUDALIBS2 + export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH + fi + if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" + then + export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" + fi +# + if test $nprocd -gt 1 + then + $ECHO "Message passing type ($itree)? $ECHOTXT" + read value + if test "$value" + then + itree=$value + fi + $ECHO "Host file name ($host)? $ECHOTXT" + read value + if test "$value" + then + host=$value + fi + if test $nprocdddm -gt 1 + then + $ECHO "Single input file? $ECHOTXT" + read value + case $value in + y* | Y*) + icreated=1 + nprocdarg=-nprocds + ;; + esac + $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" + read value + if test "$value" + then + compatible=$value + fi + $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" + read value + if test "$value" + then + cpinput=$value + fi + $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" + read value + if test "$value" + then + cpresults=$value + fi + fi + fi + $ECHO "Run the job in the queue ($qid)? $ECHOTXT" + read value + if test "$value" + then + qid=$value + fi + case $qid in + s* | S* | l* | L* | v* | V* ) + $ECHO "Queue priority ($priority)? $ECHOTXT" + read value + if test "$value" + then + priority=$value + fi + $ECHO "Job starts at ($att)? $ECHOTXT" + read value + if test "$value" + then + att=$value + fi + $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" + read value + if test "$value" + then + cpu=$value + fi + ;; + * ) + ;; + esac + $ECHO "Auto Restart option ($nauto)? $ECHOTXT" + read value + if test "$value" + then + nauto=$value + fi + $ECHO "Run directory ($DIRJOB)? $ECHOTXT" + read value + if test "$value" + then + DIRJOB=$value + DIRSCR=$DIRJOB + fi + $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" + read value + if test "$value" + then + DIRSCR=$value + fi + ;; + quit) + exit 1 + ;; + *) + break + ;; + +esac + + if test $nt -eq -1 + then + nt=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nt -lt 0 + then + nt=0 + fi + +done +# +if test $nt -eq 0 +then + ntarg= +fi +if test $nt -eq 0 +then + ntprint= +fi +if test $nt -eq 0 +then + nt= +fi + +if test $nte -eq 0 +then + ntearg= +fi +if test $nte -eq 0 +then + nteprint= +fi +if test $nte -eq 0 +then + nte= +fi + +if test $nts -eq 0 +then + ntsarg= +fi +if test $nts -eq 0 +then + ntsprint= +fi +if test $nts -eq 0 +then + nts= +fi +# +if test "$dllrun" -gt 0; then + exefile=exe_marc + prog=exe_marc + program=$exefile + bd=$MARC_BIN/ + if test "$user"; then + . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user + user= + pathdll=yes + if test $prgsav = no; then + rmdll=yes + fi + if test $prgsav = yes; then + cpdll=yes + rmdll=yes + fi + fi + + if test "$pathdll"; then +# +# reset share lib path +# + if test $MACHINENAME = "HP" + then + SHLIB_PATH=$DIRJOB:$SHLIB_PATH + export SHLIB_PATH + fi + if test $MACHINENAME = "IBM" + then + LIBPATH=$DIRJOB:$LIBPATH + export LIBPATH + fi +# + LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH + LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH + LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH + export LD_LIBRARY_PATH + export LD_LIBRARY64_PATH + export LD_LIBRARYN32_PATH + fi +fi +# end of dllrun>0 + + +if test $program = $exefile -o $program = $prog.marc +then + +# delete the old .log file unless we run in the background +if test "$deletelog" = yes +then + if test "$jid" + then + /bin/rm $jid.log 2>/dev/null + fi +else + echo + echo running the job in the background, see $jid.log + echo +fi + +# +# check if this is an autoforge or rezoning or radiation job +# +if test $nprocd -eq 1 -a "$jid" + +then + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` + if test "$line" + then + autoforge=1 + fi + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` + if test "$line" + then + autoforge=1 + fi + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` + if test "$line" + then + autoforge=1 + fi +fi +# +# check that jobname for restarted run is not the same +# as restart file basename +# +if test "$rid" +then + if test "$jid" = "$rid" + then + echo " " + echo "ERROR: job name of current run is the same as job name" + echo " of the restarted job" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "ERROR: job name of current run is the same as job name" >> $jid.log + echo " of the restarted job" >> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi +fi + +# +# user objects/libraries used +# + + if test "$objs" + then + program="$DIRJOB/$jid.marc" + case $program in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + link=yes + fi + +# +# user subroutine used +# +# add DAMASK options for linking + DAMASK="-lstdc++" + + if test "$user" + then + program=$usernoext.marc + case $program in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + link=yes + fi + +# +# Special case for IBM using POE but not an SP machine +# in this case we always need a host file, also for serial jobs. +# +if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP +then + MP_HOSTFILE=${jid}.host + if test -f $jid.host + then + /bin/rm $jid.host 2> /dev/null + fi + if test $nprocd -gt 1 + then + numdom=$nprocd + while test $numdom -gt 0 + do + hostname -s >> $MP_HOSTFILE + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + else + hostname -s > $MP_HOSTFILE + fi +fi +# +# check ssh for all hosts in host file +# +if test $nprocd -gt 1 +then +if test $MPITYPE = "intelmpi" -a "$INTELMPI_VERSION" = "HYDRA" + then +# get host list + if test "$host" + then + line=`grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' | uniq` +# count failing hosts + counter=0 + for i in $line + do + $RSH -o BatchMode=yes -o ConnectTimeout=10 $i uname -n + status=$? + if [[ $status != 0 ]] ; then + counter=$((counter+1)) + if [ "$counter" = "1" ]; then + echo " " + echo " error - connection test failed... " + echo " " + fi + echo " " + echo " connection test with ssh failed on host $i" + echo " check the following command: ssh $i uname -n " + echo " " + fi + done +# echo error message and quit + if test $counter -ne 0 + then + echo " " + echo " A parallel job using IntelMPI cannot be started. " + echo " The ssh command must be working correctly between " + echo " the computers used in the analysis. Furthermore, " + echo " it must be set up such that it does not prompt the " + echo " user for a password. " + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo " A parallel job using IntelMPI cannot be started. ">> $jid.log + echo " The ssh command must be working correctly between ">> $jid.log + echo " the computers used in the analysis. Furthermore, ">> $jid.log + echo " it must be set up such that it does not prompt the ">> $jid.log + echo " user for a password. ">> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + fi +fi +fi +# +# check correctness of host file; fix for user sub +# + if test $nprocd -gt 1 + then + +# construct the path name to the executable (execpath) + execpath=$MARC_BIN/$exefile + usersub=0 + if test $program = $prog.marc + then + execpath=$prog.marc + usersub=1 + fi + if test "$objs" + then + execpath="$DIRJOB/$jid.marc" + usersub=1 + fi + if test "$user" + then + execpath=$usernoext.marc + usersub=1 + fi + export execpath + execname=`$BASENAME $execpath` + + if test "$host" + then + userhost=$host + case $userhost in + \/* | \.\/*) + ;; + *) + userhost=`pwd`/$userhost + ;; + esac + +# check that the number of processes specified in the hostfile is +# equal to nprocd specified by -nprocd. + numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` + if test $nprocd -ne $numproc + then + echo " " + echo "error, the number of processes specified in the host file" + echo "must be equal to the number of processes given by -nprocd/-nsolver" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, the number of processes specified in the host file" >> $jid.log + echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + +# check for Myrinet that the number of processes per host is +# less than number of available user ports, 5 +# .gmpi directory must exist in user's home directory +# and must have write permission from remote hosts + if test $MPITYPE = "myrinet" + then + numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` + if test $numproc -gt 5 + then + echo " " + echo "error, for Myrinet the number of processes specified " + echo "in the hostfile must not exceed 5 for a hostname" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet the number of processes specified " >> $jid.log + echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + if test ! -d ~/.gmpi + then + echo " " + echo "error, for Myrinet a .gmpi directory must exist " + echo "under the user's home directory" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log + echo "under the user's home directory" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + homedir=`echo ~` + for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ + if test -s tmp.$$ + then + echo " " + echo "error, for Myrinet a shared .gmpi directory must exist " + echo "under the user's home directory " + echo "with remote write permission" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log + echo "under the user's home directory " >> $jid.log + echo "with remote write permission" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + else + /bin/rm tmp.$$ + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + fi + fi + done + fi + fi + +# construct the host file $jid.host which is used by mpirun +# skip lines starting with # and only consider lines with more than +# one word in them. Note that the hostfile given to this script +# has two columns: the host name and the number of shared processes +# to run on this host. mpirun wants the number of _other_ +# processes to run in addition to the one being run on the machine +# on which the job is started. hence the $2-1 for fnr == 1. + if test -f $jid.host + then + /bin/rm $jid.host 2> /dev/null + fi + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then +# HPMPI or HP hardware MPI + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ + -v mpihpspecial="$MPIHPSPECIAL" \ +'{if ( NF > 0) {\ + fnr++ ; \ + printf("-h %s -np %s",$1,$2); \ + printf(" %s",mpihpspecial); \ + if ( NF == 2 ) printf(" %s\n",path);\ + if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ + if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ + }\ + }' > $jid.host +# end HPMPI or HP hardware MPI + elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP + then +# IBM using hardware MPI (POE) + MP_HOSTFILE=$jid.host + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host +# end IBM using hardware MPI (POE) +# for Intel MPI, need to create a machinefile for DMP + elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then +# Intel MPI + if test -f $jid.mfile + then + /bin/rm $jid.mfile 2> /dev/null + fi + /bin/cp $host $jid.host + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile +# end Intel MPI for DMP +# for Solaris HPC 7.1, need to create a machinefile for DMP + elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" + then +# Solaris HPC 7.1 + if test -f $jid.mfile + then + /bin/rm $jid.mfile 2> /dev/null + fi + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile +# end Solaris HPC 7.1 for DMP +# for Myrinet, construct a configuration file in ~/.gmpi +# this must be readable by each process +# format is (hostname) (port number) for each process + elif test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + echo $nprocd > ~/.gmpi/$jid.host + grep -v '^#' $host | $AWK \ +'BEGIN {iport[0] = 2; \ + iport[1] = 4; \ + iport[2] = 5; \ + iport[3] = 6; \ + iport[4] = 7 \ + } \ +{if ( NF > 0 ) \ + for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ +}' >> ~/.gmpi/$jid.host + else +# this is for mpich-1.2.5 and later, using the -pg option +# format: host nproc executable user arguments +# the arguments are added later + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ +'{if ( NF > 0) {\ + fnr++ ; \ + if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ + else printf("%s %s",$1,$2); \ + if ( NF == 2 ) printf(" %s %s\n",path,user);\ + if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ + if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ + }\ + }' > $jid.host + fi +# end Myrinet + elif test $MACHINENAME = DEC -a $MPITYPE = hardware + then +# Compaq MPI via Memory Channel + grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host +# end Compaq MPI + else +# MPICH + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ +'{if ( NF > 0) {\ + fnr++ ; \ + if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ + else printf("%s %s",$1,$2); \ + if ( NF == 2 ) printf(" %s\n",path);\ + if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ + if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ + }\ + }' > $jid.host + fi +# define the variable host and host_filt +# host_filt is used for loops over hosts +# for Myrinet we need to use a filtered variant of userhost +# for others we can use $host + if test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + host=~/.gmpi/$jid.host + host_filt=$jid.host_tMp + grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt + else + host=$jid.host + host_filt=$host + fi + else + host=$jid.host + host_filt=$host + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + host_filt=$jid.mfile + fi + fi +# figure out if the machines in the hostfile are nfs mounted +# or distributed and set the variable "dirstatus" accordingly. +# only perform the check if user subroutine is used +# or a user subroutine executable is used + + numfield=1 + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then + numfield=2 + fi + DIR1=$DIRJOB + if test $program = $prog.marc -o -n "$user" -o -n "$objs" + then + counter=0 + echo " " + echo "checking if local or shared directories for host" + if test "$deletelog" = no + then + echo "checking if local or shared directories for host" >> $jid.log + fi + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + dirstatus[$counter]="shared" + $ECHO " $i $ECHOTXT" + if test "$deletelog" = no + then + $ECHO " $i $ECHOTXT" >> $jid.log + fi + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ + if test -s tmp.$$ + then + dirstatus[$counter]="local" + /bin/rm tmp.$$ + else + if test ! -f $jid.$$ + then + dirstatus[$counter]="local" + $RSH $i /bin/rm $DIR1/$jid.$$ + else + /bin/rm $jid.$$ + fi + fi + if test -f tmp.$$ + then + /bin/rm tmp.$$ + fi + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + echo " ${dirstatus[$counter]}" + if test "$deletelog" = no + then + echo " ${dirstatus[$counter]}" >> $jid.log + fi + fi + done + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + fi + fi + +# figure out if this is a compatible set of machines +# unless explicitly specified with flag -comp +# only perform the check if user subroutine is used +# or a user subroutine executable is used +# Myrinet does not support heterogeneous + if test $program = $prog.marc -o -n "$user" -o -n "$objs" + then + if test $compatible = "unknown" + then + thisname=$ARCH + compatible=yes + counter=0 + echo "checking if machines are compatible for host" + if test "$deletelog" = no + then + echo "checking if machines are compatible for host" >> $jid.log + fi + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + compstatus[$counter]="yes" + $ECHO " $i $ECHOTXT" + if test "$deletelog" = no + then + $ECHO " $i $ECHOTXT" >> $jid.log + fi + othername=`$RSH $i uname -a | cut -f 1 -d " "` + if test $thisname != $othername + then + compatible=no + compstatus[$counter]="no" + fi + fi + echo " ${compstatus[$counter]}" + if test "$deletelog" = no + then + echo " ${compstatus[$counter]}" >> $jid.log + fi + done + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + fi + else + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + compstatus[$counter]=$compatible + fi + done + if test $compatible = "no" + then + echo "all machines assumed incompatible" + if test "$deletelog" = no + then + echo "all machines assumed incompatible" >> $jid.log + fi + else + echo "all machines compatible" + if test "$deletelog" = no + then + echo "all machines compatible" >> $jid.log + fi + fi + fi +# error out if user objects or libraries are used on incompatible machines + if test "$compatible" = "no" -a -n "$objs" + then + echo "User object/libraries cannot be used in a parallel job on incompatible machines" + if test "$deletelog" = no + then + echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log + fi + exit 1 + fi +# modify new host file if NFS mounted heterogeneous machine + doit= + if test $program = $prog.marc + then + doit=yes + fi + if test "$user" + then + doit=yes + fi + if test "$doit" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + $AWK -v hst=$i '{fnr++ ; \ +if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ +printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} + /bin/mv $jid.host{$$} $jid.host + host=$jid.host + fi + fi + done + fi + fi # if test $program = $prog.marc -o $user -o $obj + + else # if test $host + # assume shared memory machine if no hostfile given and + # MPITYPE is set to mpich or Myrinet + # check for Myrinet that the total number of processes is + # less than number of available user ports, 5 + if test $MPITYPE = "mpich" -o $MPITYPE = "scali" + then + numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` + echo `hostname` $numproc $execpath > $jid.host + host=$jid.host + elif test $MPITYPE = "myrinet" + then + if test $nprocd -gt 5 + then + echo " " + echo "error, for Myrinet the number of processes " + echo "must not exceed 5 for a hostname" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet the number of processes " >> $jid.log + echo "must not exceed 5 for a hostname" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + echo $nprocd > ~/.gmpi/$jid.host + echo `hostname` $nprocd | $AWK \ +'BEGIN {iport[0] = 2; \ + iport[1] = 4; \ + iport[2] = 5; \ + iport[3] = 6; \ + iport[4] = 7 \ + } \ + {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ +' >> ~/.gmpi/$jid.host + host=~/.gmpi/$jid.host + else + numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` + echo `hostname` $numproc $execpath > $jid.host + + fi + fi # if test myrinet + + fi # if test $host + + fi # if test $nprocd -gt 1 + +fi # if test $program = $exefile -o $program = $prog.marc + +############################################################################## +# construct run stream (Marc only) # +############################################################################## + +# set maximum message length for ddm to a large number +# for vendor provided mpi +if test $itree -eq 0 -a $MPITYPE = hardware +then + itree=100000000 + if test $MACHINENAME = SGI + then + itree=100000001 + fi +fi +if test $itree -eq 0 -a $MPITYPE = hpmpi +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = myrinet +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = nec +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = scali +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = intelmpi +then + itree=100000000 +fi +if test $nprocdddm -lt 2 +then + nprocdarg= +else + nprocdarg="$nprocdarg $nprocdddm" +fi +if test $nsolver -eq 0 +then + nsolverarg= +else + nsolverarg="$nsolverarg $nsolver" +fi +if test $nprocdddm -lt 2 -a $nsolver -eq 0 +then +nprocd=0 +fi +if test $nprocd -gt 0 +then + if test "$host" + then + if test -z "$RUN_JOB2" + then + echo " " + echo "error: parallel job attempted on non-parallel version," + echo " or, if parallel version is installed, the include " + echo " file is probably corrupted" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error: parallel job attempted on non-parallel version," >> $jid.log + echo " or, if parallel version is installed, the include " >> $jid.log + echo " file is probably corrupted" >> $jid.log + echo " " >> $jid.log + fi + exit + fi + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then + RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP + then + RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" + RUN_JOB=" -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + elif test $MACHINENAME = DEC -a $MPITYPE = hardware + then + RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + numhost=`uniq $jid.mfile | wc -l` + if test "$INTELMPI_VERSION" = "HYDRA" + then + RUN_JOB_TMP="$RUN_JOB2 -configfile $jid.cfile" + else + export I_MPI_JOB_CONTEXT=$$ + mpdboot -n $numhost -r $RSH -f $jid.mfile + RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" + fi + +# intelmpi uses configfile. format: +# -host host1 -n n1 executable marcargs +# one such line per host +# collect the marcargs in RUN_JOB and construct the config file later +# collect the run stream in RUN_JOB_TMP + RUN_JOB="-jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + + + elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" + then + RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + if test "$userhost" + then + RUN_JOB="$RUN_JOB -mhost $userhost" + fi + if test $MPITYPE = "scali" + then +# set default working directory to /tmp to allow +# different directory names + SCAMPI_WORKING_DIRECTORY=/tmp + export SCAMPI_WORKING_DIRECTORY + fi + else + if test -z "$RUN_JOB1" + then + echo " " + echo "error: parallel job attempted on non-parallel version," + echo " or, if parallel version is installed, the include " + echo " file is probably corrupted" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error: parallel job attempted on non-parallel version," >> $jid.log + echo " or, if parallel version is installed, the include " >> $jid.log + echo " file is probably corrupted" >> $jid.log + echo " " >> $jid.log + fi + exit + fi + RUNNPROCD=$nprocd + if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" + then + RUNNPROCD= + MP_PROCS=$nprocd + export MP_PROCS + fi + if test $MPITYPE = "myrinet" + then + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + echo " " > /dev/null + else + export I_MPI_JOB_CONTEXT=$$ + mpdboot -n 1 -f $jid.hosts + fi + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + fi +else + if test $nauto -gt 0 -o $ndcoup -gt 0 + then + RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ +-maxnum $MAXNUM \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else +# this is for a serial job without auto restart: + RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ +-maxnum $MAXNUM \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi +fi +if test "$rid" +then + RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" +fi +if test "$pid" +then + RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" +fi +if test "$sid" +then + RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" +fi +if test "$did" +then + RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" +fi +if test "$vid" +then + RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" +fi +if test $nauto -gt 0 +then + RUN_JOB="$RUN_JOB -autorst $nauto " +fi +if test $ndcoup -gt 0 +then + RUN_JOB="$RUN_JOB -dcoup $ndcoup " +fi +if test $ndytran -gt 0 +then + RUN_JOB="$RUN_JOB -dytran $ndytran " +fi +if test $mesh -gt 0 +then + RUN_JOB="$RUN_JOB -me $mesh " +fi +if test $noutcore -gt 0 +then + RUN_JOB="$RUN_JOB -outcore $noutcore " +fi +if test "$dllrun" -gt 0 +then + RUN_JOB="$RUN_JOB -dll $dllrun " +fi +if test "$trkrun" -gt 0 +then + RUN_JOB="$RUN_JOB -trk $trkrun " +fi +if test "$iam" +then + RUN_JOB="$RUN_JOB -iam $iam " +fi +if test "$justlist" +then + RUN_JOB="$RUN_JOB -list 1 " +fi +if test "$feature" +then + RUN_JOB="$RUN_JOB -feature $feature " +fi +if test "$memlimit" -ne 0 +then + RUN_JOB="$RUN_JOB -ml $memlimit " +fi +if test "$cpinput" +then + RUN_JOB="$RUN_JOB -ci $cpinput " +fi +if test "$cpresults" +then + RUN_JOB="$RUN_JOB -cr $cpresults " +fi +if test "$DIRSCR" != "$DIRJOB" +then + RUN_JOB="$RUN_JOB -dirscr $DIRSCR" +else + DIRSCR=$DIRJOB +fi +if test "$makebdf" +then + RUN_JOB="$RUN_JOB -bdf $makebdf " +fi +if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" +then + # append $RUN_JOB to all lines of the host file + # and set RUN_JOB + $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ + /bin/mv $host.$$ $host + RUN_JOB=$RUN_JOB_TMP +fi +if test $MPITYPE = "intelmpi" -a "$host" +then + # construct config file, append $RUN_JOB to all lines of the config file + # and set RUN_JOB + if test "$INTELMPI_VERSION" = "HYDRA" + then + grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ + '{if ( NF > 0) {\ + printf(" -host %s",$1); \ + printf(" -n %s",$2); \ + if ( NF == 2 ) printf(" %s",path);\ + if ( NF >= 3 ) printf(" -wdir %s ",$3); \ + if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ + printf(" %s\n",args); \ + }\ + }' > $jid.cfile + else + grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ + '{if ( NF > 0) {\ + printf("-host %s -n %s",$1,$2); \ + if ( NF == 2 ) printf(" %s",path);\ + if ( NF >= 3 ) printf(" -wdir %s ",$3); \ + if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ + printf(" %s\n",args); \ + }\ + }' > $jid.cfile + fi + RUN_JOB=$RUN_JOB_TMP +fi +echo " " +echo "Final run stream value" +echo " RUNJOB="$RUN_JOB +if test "$deletelog" = no +then +echo " " >> $jid.log +echo "Final run stream value" >> $jid.log +echo " RUNJOB="$RUN_JOB >> $jid.log +fi + + +############################################################################## +# run marc using valgrind # +############################################################################## +#RUN_JOB="valgrind $RUN_JOB" +#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" +#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" +#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" +############################################################################## + + +############################################################################## +# run the requested program in a queue # +############################################################################## + +if test "$deletelog" = yes +then + echo + date +else + echo >> $jid.log + date >> $jid.log +fi +if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] +then + +/bin/rm -f $jid.runmarcscript + + +# +# compile user subroutine if present +# +if test "$link" +then + if test -z "$FCOMPROOT"; then + echo "$0: No compiler available" + echo + echo " $PRODUCT Exit number 3" + exit 1 + fi + echo + echo "Using compiler from: $FCOMPROOT" + echo + if test "$user" + then + userobj=$usermoext.o + fi + cat > $jid.runmarcscript << END4 + if test "$user" + then + if test $MACHINENAME = "CRAY" + then + $DFORTLOWMP $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTLOWMP $user -o $userobj || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + $SOLVERLIBS \ + $MARCCUDALIBS \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $DAMASK \ + $SYSLIBS \ + $SFLIB \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 + } +END4 +else + prgsav=yes +fi +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null + +# +# run marc +# + +cat >> $jid.runmarcscript << END5 + +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi + +# first remove all .out files and incremental restart files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test \$numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null + numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null + /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null +fi + +if test $nprocdddm -gt 1 +then + $RUN_JOB 2>>$jid.log +else + $RUN_JOB 2>>$jid.log +fi + +if test $dllrun -eq 0; then + if test $prgsav = no + then + /bin/rm -f $bd$program 2>/dev/null + fi +else + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes + then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi + +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test \$numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +fi +END5 + + +# Submit to marc batch queue +# +if [ $qid = at ] +then +QUENAME=at +SUBMCMD= +else +# +# Submit to qsub queue +# +QUENAME=qsub +SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" +if test "$priority" +then + SUBMCMD=$SUBMCMD" -p $priority" +fi +if test "$att" +then + SUBMCMD=$SUBMCMD" -a $att" +fi +if test "$cpu" +then + SUBMCMD=$SUBMCMD" -lt $cpu" +fi + +fi +echo $QUENAME $SUBMCMD +#cat $jid.runmarcscript +$QUENAME $SUBMCMD < $jid.runmarcscript + +/bin/rm -f $jid.runmarcscript + +############################################################################## +# run the requested program in the background # +############################################################################## + +else +if test $qid = background +then + +# +# first remove all old .out files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null +fi +# +# compile user subroutine if present +# +( +if test "$link" +then + if test -z "$FCOMPROOT"; then + echo "$0: No compiler available" + echo + echo " $PRODUCT Exit number 3" + exit 1 + fi + echo + echo "Using compiler from: $FCOMPROOT" + echo + if test "$user" + then + # compile and link on other hosts in $host if compstatus=no + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${compstatus[$counter]} = "no" + then + DIR1=$DIRJOB + DIR2=$DIR + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + marcdir=`echo $line | $AWK '{print $4}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -n "$marcdir" + then + DIR2=$marcdir + fi + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then + $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" + then + hname=_$ibase + else + hname= + fi + remoteprog=$DIR1/${execname}$hname + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo + $RSH $i $DIR2/tools/comp_damask_lmp $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else + echo "$0: compile failed for $user on host $i" + echo " $PRODUCT Exit number 3" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi + done + fi + fi + if test "$userhost" + then + echo + echo "Compiling and linking user subroutine $user on host `hostname`" + fi + userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then + $DFORTLOWMP $user || \ + { + echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTLOWMP $user -o $userobj || \ + { + echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi # if test $user + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $DAMASK \ + $SYSLIBS \ + $SFLIB \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + echo " $PRODUCT Exit number 3" + exit 1 + } + # copy user subroutine executable for hosts using local working dir + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" + then + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + echo "Copying executable to host ${i}" + $RCP $program ${i}:${DIR1}/ + fi + fi + done + fi + fi +else # if test $link + prgsav=yes +fi # if test $link +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null + +# +# run marc + +# + +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi + +# for DDM with ARC support + +if test $ddm_arc -gt 0; then + RUN_JOB="$MESHERDIR/sf_exeddm $RUN_JOB -ddm $ddm_arc " +fi + + +$RUN_JOB & + +marcpid=$! +echo $marcpid > $DIRJOB/$jid.pid +wait $marcpid + +if test $nprocd -gt 1 +then + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + if test "$host" + then + /bin/rm $jid.mfile 2> /dev/null + /bin/rm $jid.hosts 2> /dev/null + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.cfile 2> /dev/null + fi + fi + fi +fi + + +if test $dllrun -eq 0; then +if test $prgsav = no +then + /bin/rm -f $bd$program 2>/dev/null + # for network run, remove executable on remote machines + # and executables with modified name + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + if test -f "$host_filt" + then + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + # if an incompatible host uses shared directory, + # then the root machine deletes the executable + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + hname=_$ibase + /bin/rm ${execname}$hname + fi + # if local directory used, the remote machine + # deletes the executable + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null + fi + fi + done + fi + fi +fi +fi +else +#dllrun >0 + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sin 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + if test $MPITYPE = "myrinet" + then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi + fi +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + /bin/rm $DIRJOB/$jid.sle 2>/dev/null + /bin/rm $DIRJOB/$jid.sin 2>/dev/null +fi +) 1>>$jid.log 2>&1 & + + +############################################################################## +# run the requested program in the foreground # +############################################################################## + +else + +# +# compile user subroutine if present +# +if test "$link" +then + if test -z "$FCOMPROOT"; then + echo "$0: No compiler available" + echo + echo " $PRODUCT Exit number 3" + exit 1 + fi + echo + echo "Using compiler from: $FCOMPROOT" + echo + if test "$user" + then + # compile and link on other hosts in $host if compstatus=no + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${compstatus[$counter]} = "no" + then + DIR1=$DIRJOB + DIR2=$DIR + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + marcdir=`echo $line | $AWK '{print $4}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -n "$marcdir" + then + DIR2=$marcdir + fi + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then + $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" + then + hname=_$ibase + else + hname= + fi + remoteprog=$DIR1/${execname}$hname + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo + $RSH $i $DIR2/tools/comp_damask_lmp $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else + echo "$0: compile failed for $user on host $i" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi + done + fi + fi + if test "$userhost" + then + echo + echo "Compiling and linking user subroutine $user on host `hostname`" + fi + userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then + $DFORTLOWMP $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTLOWMP $user -o $userobj || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi # if test $user + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $DAMASK \ + $SYSLIBS \ + $SFLIB \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 + } + # copy user subroutine executable for hosts using local working dir + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" + then + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + echo "Copying executable to host ${i}" + $RCP $program ${i}:${DIR1}/ + fi + fi + done + fi + fi +else # if test $link + prgsav=yes +fi # if test $link +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null +# done if no job id given +if test -z "$jid" +then + echo + echo only compilation requested + echo + exit +fi +# +# run marc +# +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi +# first remove all .out files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null +fi + +# for DDM with ARC support + +if test $ddm_arc -gt 0; then + RUN_JOB="$MESHERDIR/sf_exeddm $RUN_JOB -ddm $ddm_arc " +fi + + $RUN_JOB + +if test $nprocd -gt 1 +then + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + if test "$host" + then + /bin/rm $jid.mfile 2> /dev/null + /bin/rm $jid.hosts 2> /dev/null + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.cfile 2> /dev/null + else + echo " " > /dev/null + fi + else + if test "$host" + then + mpdcleanup -a -f $jid.mfile + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.mfile 2> /dev/null + else + mpdcleanup -a -f $jid.hosts + /bin/rm $jid.hosts 2> /dev/null + fi + fi + fi +fi + +if test $dllrun -eq 0; then +if test $prgsav = no +then + /bin/rm -f $bd$program 2>/dev/null + # for network run, remove executable on remote machines + # and executables with modified name + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + if test -f "$host_filt" + then + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + # if an incompatible host uses shared directory, + # then the root machine deletes the executable + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + hname=_$ibase + /bin/rm ${execname}$hname + fi + # if local directory used, the remote machine + # deletes the executable + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null + fi + fi + done + fi + fi +fi +fi +else +#dllrun >0 + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi + +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sin 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + if test $MPITYPE = "myrinet" + then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi + fi +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + /bin/rm $DIRJOB/$jid.sle 2>/dev/null + /bin/rm $DIRJOB/$jid.sin 2>/dev/null +fi + + +fi +fi diff --git a/installation/mods_MarcMentat/2016/Marc_tools/run_damask_mp b/installation/mods_MarcMentat/2016/Marc_tools/run_damask_mp new file mode 100644 index 000000000..7e1d7265d --- /dev/null +++ b/installation/mods_MarcMentat/2016/Marc_tools/run_damask_mp @@ -0,0 +1,4096 @@ +#!/bin/ksh +############################################################################## +# # +# run_marc - run a marc job # +# ------------------------- # +# # +# usage: run_marc -j jid { options } # +# # +# where standard options are: required: defaults: # +# -------------------------- # +# # +# -j* jid job id number. ** YES ** . # +# -pr* prog program name. . marc # +# -v* y|n do or do not verify inputs. . yes # +# -q* s|l|v|b|f batch queue name or background, . short # +# foreground. # +# -b* as alternative to option -q* # +# # +# ( batch queues only : # +# -pq* intra queue priority. . . # +# -at DATE/TIME delay start of job. . . # +# format : January,1,1990,12:31 # +# or : today,5pm # +# -cpu* secs job CPU limit . . ) # +# # +# -r* rid restart file job id. . . # +# -si* sid substructure file id. . . # +# -pi* post post file job id. . . # +# -de* did defaults file . no # +# -vf vid viewfactor . no # +# # +# -u* user user subroutine. . . # +# -obj obj user objects or libraries. . . # +# -sa* y|n do or do not save load module. . no # +# -autorst auto restart flag for auto forge . no # +# -me manual remeshing control . no # +# -ml memory limit in Mbyte # +# -mo This option is deprecated. As of Marc 2015, only # +# the integer*8 version is available. # +# -mpi selects MPI version # +# each platform has a default MPI version and some # +# have an alternative version. see the include file # +# for the respective platform # +# MPI_DEFAULT defines the default MPI version # +# MPI_OTHER defines versions one can switch to # +# -dcoup for contact decoupling # +# currently not supported # +# -dir directory where the job i/o should take place. # +# defaults to current directory. # +# -sdir directory where scratch files are created # +# defaults to current directory. # +# # +# -alloc only perform memory allocation test, no analysis # +# -list y only list options in the input file, no analysis # +# -fe num set feature number "num" for the run. only one allowed # +# -dytran flag to switch from Dytran to Marc # +# dytran = 0, program will run w/o Marc-Dytran Switch # +# = 1, program will restart Marc after Dytran run # +# >= 2, Not supported yet. # +# currently not supported # +# -ou force analysis to use out-of-core control # +# =0, not used # +# =1, element storage out-of-core # +# -dll run marc using shared library libmarc.so and exe_marc # +# =1, used # +# =2, do not free streaming input memory # +# =3, run with marc input deck # +# -trk run marc for post-tracking # +# -gpuid run marc using GPGPU capability # +# specify gpuid on to be used in the analysis. Multiple # +# IDs may be assigned for DDM runs. # +# Separate a list of IDs with a colon. Each DMP # +# process will be assigned a GPU ID in round robin fastion# +# = 0 # +# = 0:1 etc... # +# # +# where parallel options are: # +# -------------------------- # +# # +# itree, host, and comp options are available for the domain # +# decomposition only. # +# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # +# # +# # +# -nprocd number of domains. # +# defaults to single domain solution. # +# -nprocds number of domains if single input file. # +# defaults to single domain solution. # +# -nps same as -nprocds. # +# -nsolver number of solver tasks for solver types 12 and 13 # +# these are distributed tasks operating via MPI # +# -nthread_elem number of threads for element assembly and recovery # +# = 0: use defaults. # +# defaults to 1 for single domain solution. # +# defaults to number of domains for multi-domain # +# solution. # +# > 1: number of threads to be used by element assembly # +# recovery. # +# Also can be set through MARC_NUMBER_OF_THREADS # +# environment variable. # +# if both specified, -nthread_elem option will be used. # +# defaults if neither MARC_NUMBER_OF_THREADS environment # +# variable set nor -nthread_elem specified. # +# -nthread_solver number of threads for solver types 6, 8, and 11 # +# = 0: use defaults. # +# defaults to 1 for single domain solution. # +# defaults to number of domains for multi-domain # +# solution. # +# > 1: number of threads to be used by 6, 8, and 11 # +# Also can be set through MARC_NUMBER_OF_THREADS # +# environment variable. # +# if both specified, -nthread_solver option will be used. # +# defaults if neither MARC_NUMBER_OF_THREADS environment # +# variable set nor -nthread_solver specified. # +# -nthread Same as -nthread_solver. # +# -itree message passing tree type for domain decomposition. # +# for debugging purposes; should not normally be used. # +# -host hostfile name for distributed execution on network. # +# defaults to no hostfile, unless jobid.defhost exists. # +# if jobid.defhost exists, only -np(s) necessary # +# -comp* y|n to be used with user routines on a network of # +# incompatible machines. # +# if set to no, a separate executable will be created # +# for each machine on the network. # +# if set to yes, the executable located on the machine # +# from which marc is started will be used on all machines.# +# defaults to no if O/S versions different on machines. # +# # +# -ci y|n copy input files to remote hosts (default: yes) # +# if "yes", input files are automatically copied to # +# remote hosts for a network run if necessary. # +# -cr y|n copy post files from remote hosts (default: yes) # +# if "yes", post files are automatically copied back from # +# remote hosts for a network run if necessary. # +############################################################################## +# set DIR to the directory in which this script is +REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" +DIR=`dirname $REALCOM` +# make sure DIR has an absolute path +case $DIR in + \/*) + ;; + *) + DIR=`pwd`/$DIR + ;; +esac +DIRSCRIPT=$DIR +AWK=awk +ARCH=`uname -a | cut -f 1 -d " "` +# Sun has a bad awk, use nawk instead +if test $ARCH = "SunOS" +then + AWK=nawk +fi +BASENAME=basename +# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists +if test $ARCH = "SunOS" +then + if test -x /usr/ucb/basename + then + BASENAME=/usr/ucb/basename + fi +fi + +# echo command line in the case of ECHO_COMMAND is true +if test "$ECHO_COMMAND" = true ; then + echo command "$0" "$@" +fi + +# +# "mode" selects version, i4 or i8 +# default is i4 +# this can be changed by a file run_marc_defaults +# located in the tools directory of the Marc installation +# or in the user's home directory +# format: +# MARC_MODE i8 +# it can also be set by the environmental variable MARC_INTEGER_SIZE +# and by the command line option "-mo" +# +mode= +modeerror= +modeoption= +if test -f $DIRSCRIPT/run_marc_defaults; then + line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $DIRSCRIPT/run_marc_defaults` + if test "$line" = "MARC_MODE"; then + echo + echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available + echo + line= + fi + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + modeerror="defaults file $DIRSCRIPT/run_marc_defaults used mode $line ; this must be i8" + modeoption=error + echo $modeerror + fi + if test "$line" = "i8"; then + mode=i8 + fi +fi +if test -f $HOME/run_marc_defaults; then + line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $HOME/run_marc_defaults` + if test "$line" = "MARC_MODE"; then + echo + echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available + echo + line= + fi + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + modeerror="defaults file $HOME/run_marc_defaults used mode $line ; this must be i8" + modeoption=error + echo $modeerror + fi + if test "$line" = "i8"; then + mode=i8 + fi +fi +if test -n "$MARC_INTEGER_SIZE" ; then + mode=$MARC_INTEGER_SIZE +fi +if test -z "$mode" ; then + mode=i8 +fi +case $mode in + i4) + modeerror="bad value for MARC_INTEGER_SIZE variable; only i8 is supported." + modeoption=error + echo $modeerror + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo "bad value for MARC_INTEGER_SIZE variable; only i8 is supported." + exit + ;; +esac + +setmode=false +for arg in $* ; do + if $setmode ; then + mode=$arg + case $mode in + i4) + modeerror="bad value for mode option; only i8 is supported." + modeoption=error + echo + echo $modeerror + echo + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo " " + echo "error, version mode must be i8" + echo " " + echo " use -mo i8 " + echo " " + exit + ;; + esac + setmode=false + fi + if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then + echo + echo warning: the option -mo is deprecated, as of Marc 2015, only the integer*8 version is available + echo + setmode=true + fi + if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + fi + if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then + modeerror="bad value for mode option; only i8 is supported." + modeoption=error + echo + echo $modeerror + echo + fi +done + +# set to i4 version for 32 bit Linux +if test "`uname -s`" = "Linux"; then + if test "`uname -m`" = "i686"; then + mode=i4 + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + fi +fi + + +. "$DIR/getarch" + +. $MARC_INCLUDE +# + +# +# Dynamically determine the echo syntax +# + +case "`echo '\c'`" in + '\c') + ECHO='echo -n' + ECHOTXT=' ' + ;; + *) + ECHO='echo' + ECHOTXT=' \c' + ;; +esac + +# +# Variables for the MARC environment +# + +PRODUCT="Marc" +EXITMSG=$MARC_TOOLS/MESSAGES +export EXITMSG +FLEXDIR=$DIR/../flexlm/licenses +export FLEXDIR +TIMCHK=3600 +export TIMCHK +BINDIR=$MARC_BIN +export BINDIR +AFMATDAT=$MARC_RUNTIME/AF_flowmat/ +export AFMATDAT +export MESHERDIR +MSC_LICENSE_FINPROC=1 +export MSC_LICENSE_FINPROC +# +# define directory path to global unified material database +# +MATFILE= +export MATFILE + +# +# define memory limit +# first set to MEMLIMIT from include +# -ml option overrules if specified +memlimit=$MEMLIMIT +# +# Define share library path based on platforms +# This is required for using the Patran Mesher +# +if test $MACHINENAME = "HP" +then + SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH + export SHLIB_PATH +fi +# the one for IBM is defined futher down + +LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$MESHERDIR:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$SFMATDIR:$LD_LIBRARY_PATH +LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH +LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH +export LD_LIBRARY_PATH +export LD_LIBRARY64_PATH +export LD_LIBRARYN32_PATH + +atexit() { +kill -15 $$ +# +if test $MPITYPE = "myrinet" +then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi +fi +} + +trap "atexit" 2 + +# +# defaults +# + +prog=marc +exefile=marc +jid= +rid= +pid= +sid= +did= +vid= +user= +usernoext= +objs= +qid=background +cpu= +priority= +att= +trk= +verify=yes +prgsav=no +rmdll=no +cpdll=no +progdll= +pathdll= +error= +nprocd=0 +nprocdddm=1 +nprocdddmprint= +icreated=0 +nprocdarg= +nsolver=0 +nsolverarg=-ns +if test $nprocds +then + if test $nprocds -gt 1 + then + nprocdddm=$nprocds + nprocdddmprint=$nprocds + icreated=1 + nprocdarg=-nprocds + fi +fi +ntprint=0 +nt=-1 +nte=-1 +nts=-1 +ntarg=-nt +ntearg=-nte +ntsarg=-nts +nteprint= +ntsprint= +gpuids= +nauto=0 +ndcoup=0 +ndytran=0 +noutcore=0 +dllrun=0 +mesh=0 +itree=0 +iam= +ddm_arc=0 +link= +trkrun=0 +DIRJOB=`pwd` +DIRSCR=$DIRJOB +DIRSCRSET= +autoforge=0 +dotdat=.dat +dotdefhost=.defhost +host= +numhost= +mfile= +userhost= +makebdf= +cpinput=yes +cpresults=yes +marcdll=libmarc.$EXT_DLL +# define hostname and strip off extensions (alpha.aaa.com) +thishost=`hostname` +thishost=${thishost%%.*} +compatible=unknown +numfield=1 +justlist= +feature= +mpioption=false +iprintsimufact= +MDSRCLIB=$MARC_LIB/mdsrc.a +# +# check run_marc_defaults file for default MPI setting +# located in the tools directory of the Marc installation +# or in the user's home directory +# format: +# MARC_MPI +# +value= +file= +if test -f $DIRSCRIPT/run_marc_defaults; then + value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` + value=`echo $value | $AWK '{print $NF}'` + if test -n "$value"; then + file=$DIRSCRIPT/run_marc_defaults + fi +fi +if test -f $HOME/run_marc_defaults; then + value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` + value=`echo $value | $AWK '{print $NF}'` + if test -n "$value"; then + file=$HOME/run_marc_defaults + fi +fi +if test -n "$value"; then + MARC_MPITYPE=$value + notok=true + for i in "$MPI_OTHER"; do + if test "$MARC_MPITYPE" = "$i"; then + notok=false + fi + done + if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then + notok=false + fi + if $notok; then + echo " " + echo " error, incorrect option for MARC_MPI" + echo " defined in $file: $MARC_MPITYPE" + echo " valid options: $MPI_DEFAULT $MPI_OTHER" + echo " " + exit + fi + if test "$value" != "$MPI_DEFAULT"; then + exefile=marc_$value + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a_$value + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" + fi + fi +fi +# +# +# allow scratch directory to be specified with environmental variable +# MARCSCRATCH +if test $MARCSCRATCH +then + if test -d $MARCSCRATCH + then + DIRSCR=$MARCSCRATCH + else + echo "error, scratch directory '$MARCSCRATCH'" + echo " specified via environmental variable MARCSCRATCH does not exist" + exit + fi +fi +# +############################################################################## +# parse input - arguments always come in pairs # +############################################################################## + +arg=$1 +if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then + shift + arg=$1 +fi +while [ -n "$arg" ] +do + shift + value=$1 + case $arg in + -al* | -AL*) + LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH + $MARC_BIN/marc -alloc 1 + exit + ;; + -li* | -LI*) + justlist=yes + ;; + -fe* | -FE*) + feature=$value + + ;; + -pr* | -PR*) + if test `dirname $value` = '.' + then + prog=`$BASENAME $value .marc` + progdll=`$BASENAME $value` + else + prog=`dirname $value`/`$BASENAME $value .marc` + progdll=`dirname $value`/`$BASENAME $value` + fi + prdir=`dirname $value` + case $prdir in + \/*) + ;; + *) + prog=`pwd`/$prdir/$prog + ;; + esac + ;; + -j* | -J*) + jid=`$BASENAME $value $dotdat` + DIRJID=`dirname $value` + case $DIRJID in + \/*) + ;; + *) + DIRJID=`pwd`/$DIRJID + ;; + esac + ;; + -r* | -R*) + rid=`$BASENAME $value .t08` + DIRRID=`dirname $value` + case $DIRRID in + \/*) + ;; + *) + DIRRID=`pwd`/$DIRRID + ;; + esac + ;; + -si* | -SI*) + sid=$value + DIRSID=`dirname $value` + case $DIRSID in + \/*) + ;; + *) + DIRSID=`pwd`/$DIRSID + ;; + esac + ;; + -pi* | -PI*) + if test -f $value.t19 + then + pid=`$BASENAME $value .t19` + else + pid=`$BASENAME $value .t16` + fi + DIRPID=`dirname $value` + case $DIRPID in + \/*) + ;; + *) + DIRPID=`pwd`/$DIRPID + ;; + esac + ;; + -bdf | -BDF) + makebdf=1 + ;; + -de* | -DE*) + did=`$BASENAME $value $dotdat` + DIRDID=`dirname $value` + case $DIRDID in + \/*) + ;; + *) + DIRDID=`pwd`/$DIRDID + ;; + esac + ;; + -vf | -VF) + vid=`$BASENAME $value .vfs` + DIRVID=`dirname $value` + case $DIRVID in + \/*) + ;; + *) + DIRVID=`pwd`/$DIRVID + ;; + esac + ;; + -u* | -U*) + user=$value + case $user in + \/*) + ;; + *) + user=`pwd`/$user + ;; + esac + usernoext=$user + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + ;; + -obj | -OBJ) + objs="$value" + ;; + -q* | -Q*) + qid=$value + ;; + -b* | -B*) + case $value in + y* | Y*) + qid=background + ;; + n* | N*) + qid=foreground + ;; + *) + ;; + esac + ;; + -at | -AT) + att=$value + ;; + -cpu* | -CPU*) + cpu=$value + ;; + -pq | -PQ*) + priority=$value + ;; + -v* | -V*) + verify=$value + ;; + -sa* | -SA*) + prgsav=$value + ;; + -np* | -NP*) + nprocdddm=$value + nprocdddmprint=$value + case $arg in + -nps* | -NPS* | -nprocds* | -NPROCDS*) + icreated=1 + nprocdarg=-nprocds + ;; + esac + case $arg in + -np | -NP | -nprocd | -NPROCD) + icreated=0 + nprocdarg=-nprocd + ;; + esac + ;; + -ns* | -NS*) + nsolver=$value + ;; + -nt* | -NT*) + case $arg in + -nte | -NTE | -nthread_e* | -NTHREAD_E*) + nte=$value + ;; + esac + case $arg in + -nts | -NTS | -nthread_s* | -NTHREAD_S*) + nts=$value + ;; + esac + case $arg in + -nt | -NT | -nth* | -NTH* | -nthread* | -NTHREAD*) + nt=$value + ;; + esac + ;; + -gp* | -GP*) + gpuids=$value + ;; + -it* | -IT*) + itree=$value + ;; + -iam | -IAM) + iam=$value + case $value in + sfg | sfm | sim) + iprintsimufact=true + ;; + esac + ;; + -au* | -AU*) + nauto=$value + ;; + -dc* | -DC*) + ndcoup=$value + ;; + -dy* | -DY*) + ndytran=$value + ;; + -ou* | -OU*) + noutcore=$value + ;; + -dll | -DLL) + dllrun=$value + ;; + -trk | -TRK) + trkrun=$value + ;; + -ddm | -DDM) + ddm_arc=$value + ;; + -me | -ME ) + mesh=$value + ;; + -ml | -ML ) + memlimit=$value + ;; + -mo | -MO ) + ;; + -mpi | -MPI ) + mpioption=true + MARC_MPITYPE=$value + if test "$value" != "$MPI_DEFAULT"; then + exefile=marc_$value + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a_$value + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" + fi + else + exefile=marc + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" + fi + fi + ;; + -dir* | -DIR*) + DIRJOB=$value + case $DIRJOB in + \/*) + ;; + *) + DIRJOB=`pwd`/$DIRJOB + ;; + esac + if test -z "$DIRSCRSET" + then + DIRSCR=$DIRJOB + fi + ;; + -sd* | -SD*) + DIRSCR=$value + DIRSCRSET=yes + case $DIRSCR in + \/*) + ;; + *) + DIRSCR=`pwd`/$DIRSCR + ;; + esac + ;; + -ho* | -HO*) + host=$value + ;; + -co* | -CO*) + compatible=$value + ;; + -ci* | -CI*) + cpinput=$value + ;; + -cr* | -CR*) + cpresults=$value + ;; + *) + error="$error +$arg: invalid option" + break + ;; + esac + case $value in + -*) + error="$error +$arg: invalid name $value" + break + ;; + esac + shift + arg=$1 + if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then + shift + arg=$1 + fi +done +argc=`expr $# % 2` +if test $argc -eq 1 +then +# +# odd number of arguments +# + error="$error +argument list incomplete" +fi + +if test $nprocdddm -gt 0 +then +nprocd=$nprocdddm +fi + +if test $nsolver -gt 0 +then + if test $nsolver -gt $nprocd + then + nprocd=$nsolver + fi +fi +# Set defaults +if test $nt -eq -1 +then +nt=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nt -lt 0 +then +nt=0 +fi +if test $nte -eq -1 +then +nte=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nte -lt 0 +then +nte=0 +fi +if test $nts -eq -1 +then +nts=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nts -lt 0 +then +nts=0 +fi +# +# set number of element loop threads +# +ntprint=$nt +nteprint=$nte +# copy from -nprocd[s] +if test $nprocdddm -gt 1 +then + nteprint=$nprocdddm +fi +# override with -nthread_elem option +if test $nte -ne 0 +then +nteprint=$nte +fi +# check for minimum 1 threads per processes for DDM +if test $nprocdddm -gt 1 +then + if test $nteprint -lt $nprocdddm + then + nteprint=$nprocdddm + fi +fi +nte=$nteprint +# +# set number of Solver threads +# +ntsprint=$nts +# copy from -nthread or -nprocd[s] +if test $ntprint -ne 0 +then + ntsprint=$ntprint +else + if test $nprocdddm -gt 1 + then + ntsprint=$nprocdddm + fi +fi +# override with -nthread_solver option +if test $nts -ne 0 +then + ntsprint=$nts +fi +# check for minimum 1 threads per solver process. +if test $nsolver -lt $nprocdddm +then + if test $ntsprint -lt $nsolver + then + ntsprint=$nsolver + fi +else + if test $ntsprint -lt $nprocdddm + then + ntsprint=$nprocdddm + fi +fi +if test $ntsprint -eq 1 +then + set ntsprint=0 +fi +nts=$ntsprint + +# set stack size for multi-threading. +export KMP_MONITOR_STACKSIZE=7M +export OMP_STACKSIZE=7M + +# +# deprecate -nthread option at arugment of marc +nt=0 +# Reset nprocdddmm, nsolver and threads if not given. +if test $nprocdddm -eq 0 +then + nprocdarg= +fi +if test $nprocdddm -eq 0 +then + nprocdddmprint= +fi +if test $nprocdddm -eq 0 +then + nprocdddm= +fi + +if test $nsolver -eq 0 +then + nsolverprint= +fi +# end of threads setting. +gpuoption= +if test "$gpuids" = "" ; then + gpuoption= +else + gpuoption="-gp $gpuids" +fi + +if test "$gpuids" = "" ; then + export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH +else + MARCCUDALIBS=$MARCCUDALIBS2 + export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH +fi +# Linux 64 + HPMPI, Below code is taken from include_linux64 +if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" +then + export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" +fi + +if test $nprocd -gt 1; then + if test -f $jid$dotdefhost; then + if test "$host" = ""; then + host=$jid$dotdefhost + fi + fi + if test -f hostfile_qa_$nprocd; then + if test "$host" = ""; then + host=hostfile_qa_$nprocd + fi + fi +fi + +if test "$dllrun" -gt 0; then + exefile=exe_marc + prog=exe_marc + program=$exefile + bd=$MARC_BIN/ + if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then + dotdat=.inp + fi + + if test "$progdll"; then + /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll + rmdll=yes + pathdll=yes + progdll=${progdll}_$marcdll + else + progdll=$marcdll + fi + + if test "$user"; then + . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user + user= + if test $prgsav = no; then + rmdll=yes + fi + if test $prgsav = yes; then + cpdll=yes + rmdll=yes + fi + pathdll=yes + fi +fi + +############################################################################## +# check parameter validity # +############################################################################## + +while test forever; do + +# +# check for input file existence +# +if test $nprocdddm -gt 1 -a $icreated -eq 0; then + if test ! -f $DIRJID/1$jid$dotdat; then + if test "$jid" != "" ; then + error="$error +input file $DIRJID/1$jid$dotdat not accessible" + fi + fi +else + if test ! -f $DIRJID/$jid$dotdat; then + if test "$jid" != "" ; then + error="$error +input file $DIRJID/$jid$dotdat not accessible" + fi + fi +fi + if test $nprocd -gt 1; then + if test "$host" ; then + if test ! -f $host; then + error="$error +host name file $host not accessible" + fi + fi + fi + +# +# check if the job is already running in the background +# +if test -f $DIRJOB/$jid.pid; then + error="$error +job is already running (the file $jid.pid exists)" +fi + +# +# if the program name is other than marc, then +# assume that this is a program in the users local directory +# + +bd=$MARC_BIN/ + +case $prog in + marc | MARC | $exefile) + program=$exefile + if test "$rid" + then + if test ! -f $DIRRID/$rid.t08 + then + error="$error +restart file $DIRRID/$rid.t08 not accessible" + fi + fi + if test "$pid" + then + if test ! -f $DIRPID/$pid.t16 + then + if test ! -f $DIRPID/$pid.t19 + then + error="$error +post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" + fi + fi + fi + if test "$user" + then + if test ! -f $user + then + error="$error +user subroutine file $user not accessible" + fi + fi + if test "$objs" + then + missingobjs= + for o in $objs + do + if test ! -f "$o" + then + if test -z "$missingobjs" + then + missingobjs="$o" + else + missingobjs="$missingobjs $o" + fi + fi + done + if test -n "$missingobjs" + then + error="$error +user object/library file(s) $missingobjs not accessible" + fi + fi + if test "$did" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRDID/1$did$dotdat + then + error="$error +defaults file $DIRDID/1$did$dotdat not accessible" + fi + else + if test ! -f $DIRDID/$did$dotdat + then + error="$error +defaults file $DIRDID/$did$dotdat not accessible" + fi + fi + fi + if test "$vid" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRVID/1$vid.vfs + then + error="$error +view factor file $DIRVID/1$vid.vfs not accessible" + fi + else + if test ! -f $DIRVID/$vid.vfs + then + error="$error +view factor file $DIRVID/$vid.vfs not accessible" + fi + fi + fi + if $mpioption + then + notok=true + for i in "$MPI_OTHER"; do + if test "$MARC_MPITYPE" = "$i"; then + notok=false + fi + done + if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then + notok=false + fi + if $notok; then + error="$error +incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" + fi + fi + ;; + *) + program=$prog.marc + case $prog in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + if test "$rid" + then + if test ! -f $DIRRID/$rid.t08 + then + error="$error +restart file $DIRRID/$rid.t08 not accessible" + fi + fi + if test "$pid" + then + if test ! -f $DIRPID/$pid.t16 + then + if test ! -f $DIRPID/$pid.t19 + then + error="$error +post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" + fi + fi + fi + if test "$user" + then + error="$error +program option may not be used with user subroutine" + fi + if test "$objs" + then + error="$error +program option may not be used with user objects or libraries" + fi + if test "$did" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRDID/1$did$dotdat + then + error="$error +defaults file $DIRDID/1$did$dotdat not accessible" + fi + else + if test ! -f $DIRDID/$did$dotdat + then + error="$error +defaults file $DIRDID/$did$dotdat not accessible" + fi + fi + fi + if test "$nauto" + then + if test $nauto -gt 2 + then + error="$error +incorrect option for auto restart " + fi + fi + if test "$ndcoup" + then + if test $ndcoup -gt 3 + then + error="$error +incorrect option for contact decoupling " + fi + fi + if test "$ndytran" + then + if test $ndytran -gt 1 + then + error="$error +incorrect option for Marc-Dytran Switch " + fi + fi + if $mpioption + then + if test ! -x $MARC_BIN/$exefile + then + error="$error +incorrect option for -mpi option: $MARC_MPITYPE " + fi + fi + ;; +esac + +############################################################################## +# check argument integrity # +############################################################################## + +if test "$jid" +then + : +else + if test "$user" + then +# allow user sub without giving job id + qid=foreground + verify=no + else + error="$error +job id required" +fi +fi + +if test $nprocd -gt 1 +then + if test $nauto -gt 0 + then + error="$error +cannot run DDM job with auto restart (-au) option " + fi +fi +case $qid in + S* | s*) + qid=short + ;; + L* | l*) + qid=long + ;; + V* | v*) + qid=verylong + ;; + B* | b*) + qid=background + ;; + F* | f*) + qid=foreground + ;; + A* | a*) + qid=at + ;; + *) + error="$error +bad value for queue_id option" + ;; +esac + +case $prgsav in + N* | n*) + prgsav=no + ;; + Y* | y*) + prgsav=yes + ;; + *) + error="$error +bad value for save option" + ;; +esac + +case $verify in + N* | n*) + verify=no + ;; + Y* | y*) + verify=yes + ;; + *) + error="$error +bad value for verify option" + ;; +esac + +case $nprocdddm in + -* ) + error="$error +bad value for nprocd option" + ;; +esac + +case $nt in + -* ) + error="$error +bad value for nt option" + ;; +esac + +case $itree in + -* ) + error="$error +bad value for itree option" + ;; +esac +case $iam in + -* ) + error="$error +bad value for iam option" + ;; +esac +case $compatible in + N* | n*) + compatible=no + ;; + Y* | y*) + compatible=yes + ;; + unknown) + ;; + *) + error="$error +bad value for comp option" + ;; +esac +case $cpinput in + N* | n*) + cpinput=no + ;; + Y* | y*) + cpinput=yes + ;; + *) + error="$error +bad value for copy input option" + ;; +esac +case $cpresults in + N* | n*) + cpresults=no + ;; + Y* | y*) + cpresults=yes + ;; + *) + error="$error +bad value for copy results option" + ;; +esac + +# +# check for external file to run +# +if test -f $MARC_TOOLS/run_marc_check +then + . $MARC_TOOLS/run_marc_check +fi + +############################################################################## +# interact with the user to get the required information to run marc or # +# other marc system program # +############################################################################## + +deletelog=yes +if test $qid = background -a $verify = no +then +echo \ +" +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid +User subroutine name : $user +User objects/libs : $objs +Restart file job ID : $rid +Substructure file ID : $sid +Post file job ID : $pid +Defaults file ID : $did +View Factor file ID : $vid +Save generated module: $prgsav +MPI library : $MPITYPE +DDM processes : $nprocdddmprint +Element loop threads : $nteprint +Solver processes : $nsolverprint +Solver threads : $ntsprint +GPGPU option : $gpuids +Host file name : $host" > $jid.log +if test "$iprintsimufact" = true ; then + echo "DDM with ARC Mapper : $ddm_arc" >> $jid.log +fi +echo \ +"Message passing type : $itree +Run job in queue : $qid +Run directory : $DIRJOB +Scratch directory : $DIRSCR +Memory limit in Mbyte: $memlimit +Auto Restart : $nauto " >> $jid.log +deletelog=no +fi +echo \ +" +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid +User subroutine name : $user +User objects/libs : $objs +Restart file job ID : $rid +Substructure file ID : $sid +Post file job ID : $pid +Defaults file ID : $did +View Factor file ID : $vid +Save generated module: $prgsav +MPI library : $MPITYPE +DDM processes : $nprocdddmprint +Element loop threads : $nteprint +Solver processes : $nsolverprint +Solver threads : $ntsprint" +if test "$iprintsimufact" = true ; then + echo "DDM with ARC Mapper : $ddm_arc" +fi +echo \ +"GPGPU option : $gpuids +Host file name : $host +Message passing type : $itree +Run job in queue : $qid +Run directory : $DIRJOB +Scratch directory : $DIRSCR +Memory limit in Mbyte: $memlimit +Auto Restart : $nauto" + + +case $qid in + s* | S* | l* | L* | v* | V* ) + echo \ +"Queue priority : $priority +Queue CPU limit : $cpu +Queue start time : $att" + ;; +# * ) +# echo \ +#" " +# ;; +esac + +if test "$modeoption" +then + error=$modeerror +fi + +if test "$error" +then + if test $verify = yes + then + $ECHO "$error + +Please correct or quit(correct,quit,): $ECHOTXT" + error= + read answer + case $answer in + q* | Q*) + answer=quit + ;; + *) + answer=correct + ;; + esac + else + $ECHO "$error + $ECHOTXT" + echo " " + if test "$deletelog" = no + then + $ECHO "$error + $ECHOTXT" >> $jid.log + echo " " >> $jid.log + fi + answer=quit + fi +else + if test $verify = yes + then + $ECHO " +Are these parameters correct (yes,no,quit,)? $ECHOTXT" + read answer + case $answer in + q* | Q*) + answer=quit + ;; + y* | Y*) + answer=yes + ;; + *) + answer=no + ;; + esac + else + answer=yes + fi +fi + +case $answer in + no | correct) + +############################################################################## +# prompt for each value # +############################################################################## + + $ECHO " +Program name ($prog)? $ECHOTXT" + read value + if test "$value" + then + prog=$value + fi + $ECHO "Job ID ($jid)? $ECHOTXT" + read value + if test "$value" + then + jid=`$BASENAME $value $dotdat` + DIRJID=`dirname $value` + case $DIRJID in + \/*) + ;; + *) + DIRJID=`pwd`/$DIRJID + ;; + esac + fi + $ECHO "User subroutine name ($user)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + user= + ;; + *) + user=$value + case $user in + \/*) + ;; + *) + user=`pwd`/$user + ;; + esac + usernoext=$user + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` + usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` + ;; + esac + fi + $ECHO "User objects or libraries ($objs)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + objs= + ;; + *) + objs="$value" + ;; + esac + fi + $ECHO "Restart File Job ID ($rid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + rid= + ;; + *) + rid=`$BASENAME $value .t08` + DIRRID=`dirname $value` + case $DIRRID in + \/*) + ;; + *) + DIRRID=`pwd`/$DIRRID + ;; + esac + ;; + esac + fi + $ECHO "Substructure File ID ($sid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + sid= + ;; + *) + sid=$value + DIRSID=`dirname $value` + case $DIRSID in + \/*) + ;; + *) + DIRSID=`pwd`/$DIRSID + ;; + esac + ;; + esac + fi + $ECHO "Post File Job ID ($pid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + pid= + ;; + *) + pid=$value + DIRPID=`dirname $value` + case $DIRPID in + \/*) + ;; + *) + DIRPID=`pwd`/$DIRPID + ;; + esac + ;; + esac + fi + $ECHO "Defaults File ID ($did)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + did= + ;; + *) + did=`$BASENAME $value $dotdat` + DIRDID=`dirname $value` + case $DIRDID in + \/*) + ;; + *) + DIRDID=`pwd`/$DIRDID + ;; + esac + ;; + esac + fi + $ECHO "View Factor File ID ($vid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + vid= + ;; + *) + vid=`$BASENAME $value .vfs` + DIRVID=`dirname $value` + case $DIRVID in + \/*) + ;; + *) + DIRVID=`pwd`/$DIRVID + ;; + esac + ;; + esac + fi + $ECHO "Save generated module ($prgsav)? $ECHOTXT" + read value + if test "$value" + then + prgsav=$value + fi + $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" + read value + if test "$value" + then + nprocdddm=$value + nprocdddmprint=$value + fi + $ECHO "Run on ($nte) Element loop threads ? $ECHOTXT" + read value + if test "$value" + then + nte=$value + fi + $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" + read value + if test "$value" + then + nsolver=$value + fi + $ECHO "Run on ($nts) Solver threads ? $ECHOTXT" + read value + if test "$value" + then + nts=$value + fi +# + if test $nprocdddm -gt 0 + then + nprocd=$nprocdddm + fi + if test $nsolver -gt 0 + then + if test $nsolver -gt $nprocd + then + nprocd=$nsolver + fi + fi +# Element loop threads. + if test $nte -eq -1 + then + nte=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nte -lt 0 + then + nte=0 + fi + nteprint=$nte +# Copy from ddm + if test $nprocdddm -gt 1 + then + nteprint=$nprocdddm + fi +# override with -nthread_elem option + if test $nte -ne 0 + then + nteprint=$nte + fi +# check for minimum 1 threads per processes for DDM + if test $nprocdddm -ne 0 + then + if test $nteprint -lt $nprocdddm + then + nteprint=$nprocdddm + fi + fi + nte=$nteprint +# Solver threads. + if test $nts -eq -1 + then + nts=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nts -lt 0 + then + nts=0 + fi + ntsprint=$nts +# Copy from ddm + if test $nprocdddm -gt 1 + then + ntsprint=$nprocdddm + fi +# override with -nthread_solver option + if test $nts -ne 0 + then + ntsprint=$nts + fi +# check for minimum 1 threads per solver process. + if test $nsolver -lt $nprocdddm + then + if test $ntsprint -lt $nsolver + then + ntsprint=$nsolver + fi + else + if test $ntsprint -lt $nprocdddm + then + ntsprint=$nprocdddm + fi + fi + if test $ntsprint -eq 1 + then + set ntsprint=0 + fi + nts=$ntsprint + $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" + read value + if test "$value" + then + gpuids=$value + fi + if test "$gpuids" = "" ; then + gpuoption= + else + gpuoption="-gp $gpuids" + fi + if test "$gpuids" = "" ; then + export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH + else + MARCCUDALIBS=$MARCCUDALIBS2 + export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH + fi + if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" + then + export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" + fi +# + if test $nprocd -gt 1 + then + $ECHO "Message passing type ($itree)? $ECHOTXT" + read value + if test "$value" + then + itree=$value + fi + $ECHO "Host file name ($host)? $ECHOTXT" + read value + if test "$value" + then + host=$value + fi + if test $nprocdddm -gt 1 + then + $ECHO "Single input file? $ECHOTXT" + read value + case $value in + y* | Y*) + icreated=1 + nprocdarg=-nprocds + ;; + esac + $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" + read value + if test "$value" + then + compatible=$value + fi + $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" + read value + if test "$value" + then + cpinput=$value + fi + $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" + read value + if test "$value" + then + cpresults=$value + fi + fi + fi + $ECHO "Run the job in the queue ($qid)? $ECHOTXT" + read value + if test "$value" + then + qid=$value + fi + case $qid in + s* | S* | l* | L* | v* | V* ) + $ECHO "Queue priority ($priority)? $ECHOTXT" + read value + if test "$value" + then + priority=$value + fi + $ECHO "Job starts at ($att)? $ECHOTXT" + read value + if test "$value" + then + att=$value + fi + $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" + read value + if test "$value" + then + cpu=$value + fi + ;; + * ) + ;; + esac + $ECHO "Auto Restart option ($nauto)? $ECHOTXT" + read value + if test "$value" + then + nauto=$value + fi + $ECHO "Run directory ($DIRJOB)? $ECHOTXT" + read value + if test "$value" + then + DIRJOB=$value + DIRSCR=$DIRJOB + fi + $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" + read value + if test "$value" + then + DIRSCR=$value + fi + ;; + quit) + exit 1 + ;; + *) + break + ;; + +esac + + if test $nt -eq -1 + then + nt=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nt -lt 0 + then + nt=0 + fi + +done +# +if test $nt -eq 0 +then + ntarg= +fi +if test $nt -eq 0 +then + ntprint= +fi +if test $nt -eq 0 +then + nt= +fi + +if test $nte -eq 0 +then + ntearg= +fi +if test $nte -eq 0 +then + nteprint= +fi +if test $nte -eq 0 +then + nte= +fi + +if test $nts -eq 0 +then + ntsarg= +fi +if test $nts -eq 0 +then + ntsprint= +fi +if test $nts -eq 0 +then + nts= +fi +# +if test "$dllrun" -gt 0; then + exefile=exe_marc + prog=exe_marc + program=$exefile + bd=$MARC_BIN/ + if test "$user"; then + . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user + user= + pathdll=yes + if test $prgsav = no; then + rmdll=yes + fi + if test $prgsav = yes; then + cpdll=yes + rmdll=yes + fi + fi + + if test "$pathdll"; then +# +# reset share lib path +# + if test $MACHINENAME = "HP" + then + SHLIB_PATH=$DIRJOB:$SHLIB_PATH + export SHLIB_PATH + fi + if test $MACHINENAME = "IBM" + then + LIBPATH=$DIRJOB:$LIBPATH + export LIBPATH + fi +# + LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH + LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH + LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH + export LD_LIBRARY_PATH + export LD_LIBRARY64_PATH + export LD_LIBRARYN32_PATH + fi +fi +# end of dllrun>0 + + +if test $program = $exefile -o $program = $prog.marc +then + +# delete the old .log file unless we run in the background +if test "$deletelog" = yes +then + if test "$jid" + then + /bin/rm $jid.log 2>/dev/null + fi +else + echo + echo running the job in the background, see $jid.log + echo +fi + +# +# check if this is an autoforge or rezoning or radiation job +# +if test $nprocd -eq 1 -a "$jid" + +then + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` + if test "$line" + then + autoforge=1 + fi + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` + if test "$line" + then + autoforge=1 + fi + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` + if test "$line" + then + autoforge=1 + fi +fi +# +# check that jobname for restarted run is not the same +# as restart file basename +# +if test "$rid" +then + if test "$jid" = "$rid" + then + echo " " + echo "ERROR: job name of current run is the same as job name" + echo " of the restarted job" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "ERROR: job name of current run is the same as job name" >> $jid.log + echo " of the restarted job" >> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi +fi + +# +# user objects/libraries used +# + + if test "$objs" + then + program="$DIRJOB/$jid.marc" + case $program in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + link=yes + fi + +# +# user subroutine used +# +# add DAMASK options for linking + DAMASK="-lstdc++" + + if test "$user" + then + program=$usernoext.marc + case $program in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + link=yes + fi + +# +# Special case for IBM using POE but not an SP machine +# in this case we always need a host file, also for serial jobs. +# +if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP +then + MP_HOSTFILE=${jid}.host + if test -f $jid.host + then + /bin/rm $jid.host 2> /dev/null + fi + if test $nprocd -gt 1 + then + numdom=$nprocd + while test $numdom -gt 0 + do + hostname -s >> $MP_HOSTFILE + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + else + hostname -s > $MP_HOSTFILE + fi +fi +# +# check ssh for all hosts in host file +# +if test $nprocd -gt 1 +then +if test $MPITYPE = "intelmpi" -a "$INTELMPI_VERSION" = "HYDRA" + then +# get host list + if test "$host" + then + line=`grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' | uniq` +# count failing hosts + counter=0 + for i in $line + do + $RSH -o BatchMode=yes -o ConnectTimeout=10 $i uname -n + status=$? + if [[ $status != 0 ]] ; then + counter=$((counter+1)) + if [ "$counter" = "1" ]; then + echo " " + echo " error - connection test failed... " + echo " " + fi + echo " " + echo " connection test with ssh failed on host $i" + echo " check the following command: ssh $i uname -n " + echo " " + fi + done +# echo error message and quit + if test $counter -ne 0 + then + echo " " + echo " A parallel job using IntelMPI cannot be started. " + echo " The ssh command must be working correctly between " + echo " the computers used in the analysis. Furthermore, " + echo " it must be set up such that it does not prompt the " + echo " user for a password. " + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo " A parallel job using IntelMPI cannot be started. ">> $jid.log + echo " The ssh command must be working correctly between ">> $jid.log + echo " the computers used in the analysis. Furthermore, ">> $jid.log + echo " it must be set up such that it does not prompt the ">> $jid.log + echo " user for a password. ">> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + fi +fi +fi +# +# check correctness of host file; fix for user sub +# + if test $nprocd -gt 1 + then + +# construct the path name to the executable (execpath) + execpath=$MARC_BIN/$exefile + usersub=0 + if test $program = $prog.marc + then + execpath=$prog.marc + usersub=1 + fi + if test "$objs" + then + execpath="$DIRJOB/$jid.marc" + usersub=1 + fi + if test "$user" + then + execpath=$usernoext.marc + usersub=1 + fi + export execpath + execname=`$BASENAME $execpath` + + if test "$host" + then + userhost=$host + case $userhost in + \/* | \.\/*) + ;; + *) + userhost=`pwd`/$userhost + ;; + esac + +# check that the number of processes specified in the hostfile is +# equal to nprocd specified by -nprocd. + numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` + if test $nprocd -ne $numproc + then + echo " " + echo "error, the number of processes specified in the host file" + echo "must be equal to the number of processes given by -nprocd/-nsolver" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, the number of processes specified in the host file" >> $jid.log + echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + +# check for Myrinet that the number of processes per host is +# less than number of available user ports, 5 +# .gmpi directory must exist in user's home directory +# and must have write permission from remote hosts + if test $MPITYPE = "myrinet" + then + numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` + if test $numproc -gt 5 + then + echo " " + echo "error, for Myrinet the number of processes specified " + echo "in the hostfile must not exceed 5 for a hostname" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet the number of processes specified " >> $jid.log + echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + if test ! -d ~/.gmpi + then + echo " " + echo "error, for Myrinet a .gmpi directory must exist " + echo "under the user's home directory" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log + echo "under the user's home directory" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + homedir=`echo ~` + for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ + if test -s tmp.$$ + then + echo " " + echo "error, for Myrinet a shared .gmpi directory must exist " + echo "under the user's home directory " + echo "with remote write permission" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log + echo "under the user's home directory " >> $jid.log + echo "with remote write permission" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + else + /bin/rm tmp.$$ + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + fi + fi + done + fi + fi + +# construct the host file $jid.host which is used by mpirun +# skip lines starting with # and only consider lines with more than +# one word in them. Note that the hostfile given to this script +# has two columns: the host name and the number of shared processes +# to run on this host. mpirun wants the number of _other_ +# processes to run in addition to the one being run on the machine +# on which the job is started. hence the $2-1 for fnr == 1. + if test -f $jid.host + then + /bin/rm $jid.host 2> /dev/null + fi + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then +# HPMPI or HP hardware MPI + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ + -v mpihpspecial="$MPIHPSPECIAL" \ +'{if ( NF > 0) {\ + fnr++ ; \ + printf("-h %s -np %s",$1,$2); \ + printf(" %s",mpihpspecial); \ + if ( NF == 2 ) printf(" %s\n",path);\ + if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ + if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ + }\ + }' > $jid.host +# end HPMPI or HP hardware MPI + elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP + then +# IBM using hardware MPI (POE) + MP_HOSTFILE=$jid.host + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host +# end IBM using hardware MPI (POE) +# for Intel MPI, need to create a machinefile for DMP + elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then +# Intel MPI + if test -f $jid.mfile + then + /bin/rm $jid.mfile 2> /dev/null + fi + /bin/cp $host $jid.host + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile +# end Intel MPI for DMP +# for Solaris HPC 7.1, need to create a machinefile for DMP + elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" + then +# Solaris HPC 7.1 + if test -f $jid.mfile + then + /bin/rm $jid.mfile 2> /dev/null + fi + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile +# end Solaris HPC 7.1 for DMP +# for Myrinet, construct a configuration file in ~/.gmpi +# this must be readable by each process +# format is (hostname) (port number) for each process + elif test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + echo $nprocd > ~/.gmpi/$jid.host + grep -v '^#' $host | $AWK \ +'BEGIN {iport[0] = 2; \ + iport[1] = 4; \ + iport[2] = 5; \ + iport[3] = 6; \ + iport[4] = 7 \ + } \ +{if ( NF > 0 ) \ + for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ +}' >> ~/.gmpi/$jid.host + else +# this is for mpich-1.2.5 and later, using the -pg option +# format: host nproc executable user arguments +# the arguments are added later + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ +'{if ( NF > 0) {\ + fnr++ ; \ + if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ + else printf("%s %s",$1,$2); \ + if ( NF == 2 ) printf(" %s %s\n",path,user);\ + if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ + if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ + }\ + }' > $jid.host + fi +# end Myrinet + elif test $MACHINENAME = DEC -a $MPITYPE = hardware + then +# Compaq MPI via Memory Channel + grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host +# end Compaq MPI + else +# MPICH + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ +'{if ( NF > 0) {\ + fnr++ ; \ + if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ + else printf("%s %s",$1,$2); \ + if ( NF == 2 ) printf(" %s\n",path);\ + if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ + if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ + }\ + }' > $jid.host + fi +# define the variable host and host_filt +# host_filt is used for loops over hosts +# for Myrinet we need to use a filtered variant of userhost +# for others we can use $host + if test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + host=~/.gmpi/$jid.host + host_filt=$jid.host_tMp + grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt + else + host=$jid.host + host_filt=$host + fi + else + host=$jid.host + host_filt=$host + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + host_filt=$jid.mfile + fi + fi +# figure out if the machines in the hostfile are nfs mounted +# or distributed and set the variable "dirstatus" accordingly. +# only perform the check if user subroutine is used +# or a user subroutine executable is used + + numfield=1 + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then + numfield=2 + fi + DIR1=$DIRJOB + if test $program = $prog.marc -o -n "$user" -o -n "$objs" + then + counter=0 + echo " " + echo "checking if local or shared directories for host" + if test "$deletelog" = no + then + echo "checking if local or shared directories for host" >> $jid.log + fi + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + dirstatus[$counter]="shared" + $ECHO " $i $ECHOTXT" + if test "$deletelog" = no + then + $ECHO " $i $ECHOTXT" >> $jid.log + fi + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ + if test -s tmp.$$ + then + dirstatus[$counter]="local" + /bin/rm tmp.$$ + else + if test ! -f $jid.$$ + then + dirstatus[$counter]="local" + $RSH $i /bin/rm $DIR1/$jid.$$ + else + /bin/rm $jid.$$ + fi + fi + if test -f tmp.$$ + then + /bin/rm tmp.$$ + fi + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + echo " ${dirstatus[$counter]}" + if test "$deletelog" = no + then + echo " ${dirstatus[$counter]}" >> $jid.log + fi + fi + done + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + fi + fi + +# figure out if this is a compatible set of machines +# unless explicitly specified with flag -comp +# only perform the check if user subroutine is used +# or a user subroutine executable is used +# Myrinet does not support heterogeneous + if test $program = $prog.marc -o -n "$user" -o -n "$objs" + then + if test $compatible = "unknown" + then + thisname=$ARCH + compatible=yes + counter=0 + echo "checking if machines are compatible for host" + if test "$deletelog" = no + then + echo "checking if machines are compatible for host" >> $jid.log + fi + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + compstatus[$counter]="yes" + $ECHO " $i $ECHOTXT" + if test "$deletelog" = no + then + $ECHO " $i $ECHOTXT" >> $jid.log + fi + othername=`$RSH $i uname -a | cut -f 1 -d " "` + if test $thisname != $othername + then + compatible=no + compstatus[$counter]="no" + fi + fi + echo " ${compstatus[$counter]}" + if test "$deletelog" = no + then + echo " ${compstatus[$counter]}" >> $jid.log + fi + done + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + fi + else + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + compstatus[$counter]=$compatible + fi + done + if test $compatible = "no" + then + echo "all machines assumed incompatible" + if test "$deletelog" = no + then + echo "all machines assumed incompatible" >> $jid.log + fi + else + echo "all machines compatible" + if test "$deletelog" = no + then + echo "all machines compatible" >> $jid.log + fi + fi + fi +# error out if user objects or libraries are used on incompatible machines + if test "$compatible" = "no" -a -n "$objs" + then + echo "User object/libraries cannot be used in a parallel job on incompatible machines" + if test "$deletelog" = no + then + echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log + fi + exit 1 + fi +# modify new host file if NFS mounted heterogeneous machine + doit= + if test $program = $prog.marc + then + doit=yes + fi + if test "$user" + then + doit=yes + fi + if test "$doit" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + $AWK -v hst=$i '{fnr++ ; \ +if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ +printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} + /bin/mv $jid.host{$$} $jid.host + host=$jid.host + fi + fi + done + fi + fi # if test $program = $prog.marc -o $user -o $obj + + else # if test $host + # assume shared memory machine if no hostfile given and + # MPITYPE is set to mpich or Myrinet + # check for Myrinet that the total number of processes is + # less than number of available user ports, 5 + if test $MPITYPE = "mpich" -o $MPITYPE = "scali" + then + numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` + echo `hostname` $numproc $execpath > $jid.host + host=$jid.host + elif test $MPITYPE = "myrinet" + then + if test $nprocd -gt 5 + then + echo " " + echo "error, for Myrinet the number of processes " + echo "must not exceed 5 for a hostname" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet the number of processes " >> $jid.log + echo "must not exceed 5 for a hostname" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + echo $nprocd > ~/.gmpi/$jid.host + echo `hostname` $nprocd | $AWK \ +'BEGIN {iport[0] = 2; \ + iport[1] = 4; \ + iport[2] = 5; \ + iport[3] = 6; \ + iport[4] = 7 \ + } \ + {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ +' >> ~/.gmpi/$jid.host + host=~/.gmpi/$jid.host + else + numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` + echo `hostname` $numproc $execpath > $jid.host + + fi + fi # if test myrinet + + fi # if test $host + + fi # if test $nprocd -gt 1 + +fi # if test $program = $exefile -o $program = $prog.marc + +############################################################################## +# construct run stream (Marc only) # +############################################################################## + +# set maximum message length for ddm to a large number +# for vendor provided mpi +if test $itree -eq 0 -a $MPITYPE = hardware +then + itree=100000000 + if test $MACHINENAME = SGI + then + itree=100000001 + fi +fi +if test $itree -eq 0 -a $MPITYPE = hpmpi +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = myrinet +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = nec +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = scali +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = intelmpi +then + itree=100000000 +fi +if test $nprocdddm -lt 2 +then + nprocdarg= +else + nprocdarg="$nprocdarg $nprocdddm" +fi +if test $nsolver -eq 0 +then + nsolverarg= +else + nsolverarg="$nsolverarg $nsolver" +fi +if test $nprocdddm -lt 2 -a $nsolver -eq 0 +then +nprocd=0 +fi +if test $nprocd -gt 0 +then + if test "$host" + then + if test -z "$RUN_JOB2" + then + echo " " + echo "error: parallel job attempted on non-parallel version," + echo " or, if parallel version is installed, the include " + echo " file is probably corrupted" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error: parallel job attempted on non-parallel version," >> $jid.log + echo " or, if parallel version is installed, the include " >> $jid.log + echo " file is probably corrupted" >> $jid.log + echo " " >> $jid.log + fi + exit + fi + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then + RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP + then + RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" + RUN_JOB=" -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + elif test $MACHINENAME = DEC -a $MPITYPE = hardware + then + RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + numhost=`uniq $jid.mfile | wc -l` + if test "$INTELMPI_VERSION" = "HYDRA" + then + RUN_JOB_TMP="$RUN_JOB2 -configfile $jid.cfile" + else + export I_MPI_JOB_CONTEXT=$$ + mpdboot -n $numhost -r $RSH -f $jid.mfile + RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" + fi + +# intelmpi uses configfile. format: +# -host host1 -n n1 executable marcargs +# one such line per host +# collect the marcargs in RUN_JOB and construct the config file later +# collect the run stream in RUN_JOB_TMP + RUN_JOB="-jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + + + elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" + then + RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + if test "$userhost" + then + RUN_JOB="$RUN_JOB -mhost $userhost" + fi + if test $MPITYPE = "scali" + then +# set default working directory to /tmp to allow +# different directory names + SCAMPI_WORKING_DIRECTORY=/tmp + export SCAMPI_WORKING_DIRECTORY + fi + else + if test -z "$RUN_JOB1" + then + echo " " + echo "error: parallel job attempted on non-parallel version," + echo " or, if parallel version is installed, the include " + echo " file is probably corrupted" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error: parallel job attempted on non-parallel version," >> $jid.log + echo " or, if parallel version is installed, the include " >> $jid.log + echo " file is probably corrupted" >> $jid.log + echo " " >> $jid.log + fi + exit + fi + RUNNPROCD=$nprocd + if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" + then + RUNNPROCD= + MP_PROCS=$nprocd + export MP_PROCS + fi + if test $MPITYPE = "myrinet" + then + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + echo " " > /dev/null + else + export I_MPI_JOB_CONTEXT=$$ + mpdboot -n 1 -f $jid.hosts + fi + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + fi +else + if test $nauto -gt 0 -o $ndcoup -gt 0 + then + RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ +-maxnum $MAXNUM \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else +# this is for a serial job without auto restart: + RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ +-maxnum $MAXNUM \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi +fi +if test "$rid" +then + RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" +fi +if test "$pid" +then + RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" +fi +if test "$sid" +then + RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" +fi +if test "$did" +then + RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" +fi +if test "$vid" +then + RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" +fi +if test $nauto -gt 0 +then + RUN_JOB="$RUN_JOB -autorst $nauto " +fi +if test $ndcoup -gt 0 +then + RUN_JOB="$RUN_JOB -dcoup $ndcoup " +fi +if test $ndytran -gt 0 +then + RUN_JOB="$RUN_JOB -dytran $ndytran " +fi +if test $mesh -gt 0 +then + RUN_JOB="$RUN_JOB -me $mesh " +fi +if test $noutcore -gt 0 +then + RUN_JOB="$RUN_JOB -outcore $noutcore " +fi +if test "$dllrun" -gt 0 +then + RUN_JOB="$RUN_JOB -dll $dllrun " +fi +if test "$trkrun" -gt 0 +then + RUN_JOB="$RUN_JOB -trk $trkrun " +fi +if test "$iam" +then + RUN_JOB="$RUN_JOB -iam $iam " +fi +if test "$justlist" +then + RUN_JOB="$RUN_JOB -list 1 " +fi +if test "$feature" +then + RUN_JOB="$RUN_JOB -feature $feature " +fi +if test "$memlimit" -ne 0 +then + RUN_JOB="$RUN_JOB -ml $memlimit " +fi +if test "$cpinput" +then + RUN_JOB="$RUN_JOB -ci $cpinput " +fi +if test "$cpresults" +then + RUN_JOB="$RUN_JOB -cr $cpresults " +fi +if test "$DIRSCR" != "$DIRJOB" +then + RUN_JOB="$RUN_JOB -dirscr $DIRSCR" +else + DIRSCR=$DIRJOB +fi +if test "$makebdf" +then + RUN_JOB="$RUN_JOB -bdf $makebdf " +fi +if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" +then + # append $RUN_JOB to all lines of the host file + # and set RUN_JOB + $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ + /bin/mv $host.$$ $host + RUN_JOB=$RUN_JOB_TMP +fi +if test $MPITYPE = "intelmpi" -a "$host" +then + # construct config file, append $RUN_JOB to all lines of the config file + # and set RUN_JOB + if test "$INTELMPI_VERSION" = "HYDRA" + then + grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ + '{if ( NF > 0) {\ + printf(" -host %s",$1); \ + printf(" -n %s",$2); \ + if ( NF == 2 ) printf(" %s",path);\ + if ( NF >= 3 ) printf(" -wdir %s ",$3); \ + if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ + printf(" %s\n",args); \ + }\ + }' > $jid.cfile + else + grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ + '{if ( NF > 0) {\ + printf("-host %s -n %s",$1,$2); \ + if ( NF == 2 ) printf(" %s",path);\ + if ( NF >= 3 ) printf(" -wdir %s ",$3); \ + if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ + printf(" %s\n",args); \ + }\ + }' > $jid.cfile + fi + RUN_JOB=$RUN_JOB_TMP +fi +echo " " +echo "Final run stream value" +echo " RUNJOB="$RUN_JOB +if test "$deletelog" = no +then +echo " " >> $jid.log +echo "Final run stream value" >> $jid.log +echo " RUNJOB="$RUN_JOB >> $jid.log +fi + + +############################################################################## +# run marc using valgrind # +############################################################################## +#RUN_JOB="valgrind $RUN_JOB" +#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" +#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" +#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" +############################################################################## + + +############################################################################## +# run the requested program in a queue # +############################################################################## + +if test "$deletelog" = yes +then + echo + date +else + echo >> $jid.log + date >> $jid.log +fi +if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] +then + +/bin/rm -f $jid.runmarcscript + + +# +# compile user subroutine if present +# +if test "$link" +then + if test -z "$FCOMPROOT"; then + echo "$0: No compiler available" + echo + echo " $PRODUCT Exit number 3" + exit 1 + fi + echo + echo "Using compiler from: $FCOMPROOT" + echo + if test "$user" + then + userobj=$usermoext.o + fi + cat > $jid.runmarcscript << END4 + if test "$user" + then + if test $MACHINENAME = "CRAY" + then + $DFORTRANMP $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTRANMP $user -o $userobj || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + $SOLVERLIBS \ + $MARCCUDALIBS \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $DAMASK \ + $SYSLIBS \ + $SFLIB \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 + } +END4 +else + prgsav=yes +fi +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null + +# +# run marc +# + +cat >> $jid.runmarcscript << END5 + +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi + +# first remove all .out files and incremental restart files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test \$numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null + numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null + /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null +fi + +if test $nprocdddm -gt 1 +then + $RUN_JOB 2>>$jid.log +else + $RUN_JOB 2>>$jid.log +fi + +if test $dllrun -eq 0; then + if test $prgsav = no + then + /bin/rm -f $bd$program 2>/dev/null + fi +else + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes + then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi + +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test \$numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +fi +END5 + + +# Submit to marc batch queue +# +if [ $qid = at ] +then +QUENAME=at +SUBMCMD= +else +# +# Submit to qsub queue +# +QUENAME=qsub +SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" +if test "$priority" +then + SUBMCMD=$SUBMCMD" -p $priority" +fi +if test "$att" +then + SUBMCMD=$SUBMCMD" -a $att" +fi +if test "$cpu" +then + SUBMCMD=$SUBMCMD" -lt $cpu" +fi + +fi +echo $QUENAME $SUBMCMD +#cat $jid.runmarcscript +$QUENAME $SUBMCMD < $jid.runmarcscript + +/bin/rm -f $jid.runmarcscript + +############################################################################## +# run the requested program in the background # +############################################################################## + +else +if test $qid = background +then + +# +# first remove all old .out files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null +fi +# +# compile user subroutine if present +# +( +if test "$link" +then + if test -z "$FCOMPROOT"; then + echo "$0: No compiler available" + echo + echo " $PRODUCT Exit number 3" + exit 1 + fi + echo + echo "Using compiler from: $FCOMPROOT" + echo + if test "$user" + then + # compile and link on other hosts in $host if compstatus=no + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${compstatus[$counter]} = "no" + then + DIR1=$DIRJOB + DIR2=$DIR + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + marcdir=`echo $line | $AWK '{print $4}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -n "$marcdir" + then + DIR2=$marcdir + fi + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then + $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" + then + hname=_$ibase + else + hname= + fi + remoteprog=$DIR1/${execname}$hname + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo + $RSH $i $DIR2/tools/comp_damask_mp $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else + echo "$0: compile failed for $user on host $i" + echo " $PRODUCT Exit number 3" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi + done + fi + fi + if test "$userhost" + then + echo + echo "Compiling and linking user subroutine $user on host `hostname`" + fi + userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then + $DFORTRANMP $user || \ + { + echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTRANMP $user -o $userobj || \ + { + echo "$0: compile failed for $user" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi # if test $user + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $DAMASK \ + $SYSLIBS \ + $SFLIB \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + echo " $PRODUCT Exit number 3" + exit 1 + } + # copy user subroutine executable for hosts using local working dir + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" + then + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + echo "Copying executable to host ${i}" + $RCP $program ${i}:${DIR1}/ + fi + fi + done + fi + fi +else # if test $link + prgsav=yes +fi # if test $link +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null + +# +# run marc + +# + +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi + +# for DDM with ARC support + +if test $ddm_arc -gt 0; then + RUN_JOB="$MESHERDIR/sf_exeddm $RUN_JOB -ddm $ddm_arc " +fi + + +$RUN_JOB & + +marcpid=$! +echo $marcpid > $DIRJOB/$jid.pid +wait $marcpid + +if test $nprocd -gt 1 +then + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + if test "$host" + then + /bin/rm $jid.mfile 2> /dev/null + /bin/rm $jid.hosts 2> /dev/null + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.cfile 2> /dev/null + fi + fi + fi +fi + + +if test $dllrun -eq 0; then +if test $prgsav = no +then + /bin/rm -f $bd$program 2>/dev/null + # for network run, remove executable on remote machines + # and executables with modified name + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + if test -f "$host_filt" + then + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + # if an incompatible host uses shared directory, + # then the root machine deletes the executable + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + hname=_$ibase + /bin/rm ${execname}$hname + fi + # if local directory used, the remote machine + # deletes the executable + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null + fi + fi + done + fi + fi +fi +fi +else +#dllrun >0 + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sin 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + if test $MPITYPE = "myrinet" + then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi + fi +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + /bin/rm $DIRJOB/$jid.sle 2>/dev/null + /bin/rm $DIRJOB/$jid.sin 2>/dev/null +fi +) 1>>$jid.log 2>&1 & + + +############################################################################## +# run the requested program in the foreground # +############################################################################## + +else + +# +# compile user subroutine if present +# +if test "$link" +then + if test -z "$FCOMPROOT"; then + echo "$0: No compiler available" + echo + echo " $PRODUCT Exit number 3" + exit 1 + fi + echo + echo "Using compiler from: $FCOMPROOT" + echo + if test "$user" + then + # compile and link on other hosts in $host if compstatus=no + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${compstatus[$counter]} = "no" + then + DIR1=$DIRJOB + DIR2=$DIR + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + marcdir=`echo $line | $AWK '{print $4}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -n "$marcdir" + then + DIR2=$marcdir + fi + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then + $RCP $user $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" + then + hname=_$ibase + else + hname= + fi + remoteprog=$DIR1/${execname}$hname + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo + $RSH $i $DIR2/tools/comp_damask_mp $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else + echo "$0: compile failed for $user on host $i" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $remoteuser 2> /dev/null + fi + fi + fi + done + fi + fi + if test "$userhost" + then + echo + echo "Compiling and linking user subroutine $user on host `hostname`" + fi + userobj=$usernoext.o + if test $MACHINENAME = "CRAY" + then + $DFORTRANMP $user || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $DFORTRANMP $user -o $userobj || \ + { + echo "$0: compile failed for $user" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + fi # if test $user + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $DAMASK \ + $SYSLIBS \ + $SFLIB \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 + } + # copy user subroutine executable for hosts using local working dir + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" + then + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + echo "Copying executable to host ${i}" + $RCP $program ${i}:${DIR1}/ + fi + fi + done + fi + fi +else # if test $link + prgsav=yes +fi # if test $link +/bin/rm $userobj 2>/dev/null +/bin/rm $DIRJOB/*.mod 2>/dev/null +# done if no job id given +if test -z "$jid" +then + echo + echo only compilation requested + echo + exit +fi +# +# run marc +# +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi +# first remove all .out files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null +fi + +# for DDM with ARC support + +if test $ddm_arc -gt 0; then + RUN_JOB="$MESHERDIR/sf_exeddm $RUN_JOB -ddm $ddm_arc " +fi + + $RUN_JOB + +if test $nprocd -gt 1 +then + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + if test "$host" + then + /bin/rm $jid.mfile 2> /dev/null + /bin/rm $jid.hosts 2> /dev/null + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.cfile 2> /dev/null + else + echo " " > /dev/null + fi + else + if test "$host" + then + mpdcleanup -a -f $jid.mfile + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.mfile 2> /dev/null + else + mpdcleanup -a -f $jid.hosts + /bin/rm $jid.hosts 2> /dev/null + fi + fi + fi +fi + +if test $dllrun -eq 0; then +if test $prgsav = no +then + /bin/rm -f $bd$program 2>/dev/null + # for network run, remove executable on remote machines + # and executables with modified name + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + if test -f "$host_filt" + then + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + # if an incompatible host uses shared directory, + # then the root machine deletes the executable + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + hname=_$ibase + /bin/rm ${execname}$hname + fi + # if local directory used, the remote machine + # deletes the executable + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null + fi + fi + done + fi + fi +fi +fi +else +#dllrun >0 + if test $cpdll = yes; then + filename=$usernoext + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi + +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sin 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + if test $MPITYPE = "myrinet" + then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi + fi +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + /bin/rm $DIRJOB/$jid.sle 2>/dev/null + /bin/rm $DIRJOB/$jid.sin 2>/dev/null +fi + + +fi +fi diff --git a/installation/mods_MarcMentat/2016/Marc_tools/run_marc.original b/installation/mods_MarcMentat/2016/Marc_tools/run_marc.original new file mode 100644 index 000000000..cb6316033 --- /dev/null +++ b/installation/mods_MarcMentat/2016/Marc_tools/run_marc.original @@ -0,0 +1,4193 @@ +#!/bin/ksh +############################################################################## +# # +# run_marc - run a marc job # +# ------------------------- # +# # +# usage: run_marc -j jid { options } # +# # +# where standard options are: required: defaults: # +# -------------------------- # +# # +# -j* jid job id number. ** YES ** . # +# -pr* prog program name. . marc # +# -v* y|n do or do not verify inputs. . yes # +# -q* s|l|v|b|f batch queue name or background, . short # +# foreground. # +# -b* as alternative to option -q* # +# # +# ( batch queues only : # +# -pq* intra queue priority. . . # +# -at DATE/TIME delay start of job. . . # +# format : January,1,1990,12:31 # +# or : today,5pm # +# -cpu* secs job CPU limit . . ) # +# # +# -r* rid restart file job id. . . # +# -si* sid substructure file id. . . # +# -pi* post post file job id. . . # +# -de* did defaults file . no # +# -vf vid viewfactor . no # +# # +# -u* user user subroutine. . . # +# -obj obj user objects or libraries. . . # +# -sa* y|n do or do not save load module. . no # +# -autorst auto restart flag for auto forge . no # +# -me manual remeshing control . no # +# -ml memory limit in Mbyte # +# -mo This option is deprecated. As of Marc 2015, only # +# the integer*8 version is available. # +# -mpi selects MPI version # +# each platform has a default MPI version and some # +# have an alternative version. see the include file # +# for the respective platform # +# MPI_DEFAULT defines the default MPI version # +# MPI_OTHER defines versions one can switch to # +# -dcoup for contact decoupling # +# currently not supported # +# -dir directory where the job i/o should take place. # +# defaults to current directory. # +# -sdir directory where scratch files are created # +# defaults to current directory. # +# # +# -alloc only perform memory allocation test, no analysis # +# -list y only list options in the input file, no analysis # +# -fe num set feature number "num" for the run. only one allowed # +# -dytran flag to switch from Dytran to Marc # +# dytran = 0, program will run w/o Marc-Dytran Switch # +# = 1, program will restart Marc after Dytran run # +# >= 2, Not supported yet. # +# currently not supported # +# -ou force analysis to use out-of-core control # +# =0, not used # +# =1, element storage out-of-core # +# -dll run marc using shared library libmarc.so and exe_marc # +# =1, used # +# =2, do not free streaming input memory # +# =3, run with marc input deck # +# -trk run marc for post-tracking # +# -gpuid run marc using GPGPU capability # +# specify gpuid on to be used in the analysis. Multiple # +# IDs may be assigned for DDM runs. # +# Separate a list of IDs with a colon. Each DMP # +# process will be assigned a GPU ID in round robin fastion# +# = 0 # +# = 0:1 etc... # +# # +# where parallel options are: # +# -------------------------- # +# # +# itree, host, and comp options are available for the domain # +# decomposition only. # +# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # +# # +# # +# -nprocd number of domains. # +# defaults to single domain solution. # +# -nprocds number of domains if single input file. # +# defaults to single domain solution. # +# -nps same as -nprocds. # +# -nsolver number of solver tasks for solver types 12 and 13 # +# these are distributed tasks operating via MPI # +# -nthread_elem number of threads for element assembly and recovery # +# = 0: use defaults. # +# defaults to 1 for single domain solution. # +# defaults to number of domains for multi-domain # +# solution. # +# > 1: number of threads to be used by element assembly # +# recovery. # +# Also can be set through MARC_NUMBER_OF_THREADS # +# environment variable. # +# if both specified, -nthread_elem option will be used. # +# defaults if neither MARC_NUMBER_OF_THREADS environment # +# variable set nor -nthread_elem specified. # +# -nthread_solver number of threads for solver types 6, 8, and 11 # +# = 0: use defaults. # +# defaults to 1 for single domain solution. # +# defaults to number of domains for multi-domain # +# solution. # +# > 1: number of threads to be used by 6, 8, and 11 # +# Also can be set through MARC_NUMBER_OF_THREADS # +# environment variable. # +# if both specified, -nthread_solver option will be used. # +# defaults if neither MARC_NUMBER_OF_THREADS environment # +# variable set nor -nthread_solver specified. # +# -nthread Same as -nthread_solver. # +# -itree message passing tree type for domain decomposition. # +# for debugging purposes; should not normally be used. # +# -host hostfile name for distributed execution on network. # +# defaults to no hostfile, unless jobid.defhost exists. # +# if jobid.defhost exists, only -np(s) necessary # +# -comp* y|n to be used with user routines on a network of # +# incompatible machines. # +# if set to no, a separate executable will be created # +# for each machine on the network. # +# if set to yes, the executable located on the machine # +# from which marc is started will be used on all machines.# +# defaults to no if O/S versions different on machines. # +# # +# -ci y|n copy input files to remote hosts (default: yes) # +# if "yes", input files are automatically copied to # +# remote hosts for a network run if necessary. # +# -cr y|n copy post files from remote hosts (default: yes) # +# if "yes", post files are automatically copied back from # +# remote hosts for a network run if necessary. # +############################################################################## +# set DIR to the directory in which this script is +REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" +DIR=`dirname $REALCOM` +# make sure DIR has an absolute path +case $DIR in + \/*) + ;; + *) + DIR=`pwd`/$DIR + ;; +esac +DIRSCRIPT=$DIR +AWK=awk +ARCH=`uname -a | cut -f 1 -d " "` +# Sun has a bad awk, use nawk instead +if test $ARCH = "SunOS" +then + AWK=nawk +fi +BASENAME=basename +# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists +if test $ARCH = "SunOS" +then + if test -x /usr/ucb/basename + then + BASENAME=/usr/ucb/basename + fi +fi + +# echo command line in the case of ECHO_COMMAND is true +if test "$ECHO_COMMAND" = true ; then + echo command "$0" "$@" +fi + +# +# "mode" selects version, i4 or i8 +# default is i4 +# this can be changed by a file run_marc_defaults +# located in the tools directory of the Marc installation +# or in the user's home directory +# format: +# MARC_MODE i8 +# it can also be set by the environmental variable MARC_INTEGER_SIZE +# and by the command line option "-mo" +# +mode= +modeerror= +modeoption= +if test -f $DIRSCRIPT/run_marc_defaults; then + line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $DIRSCRIPT/run_marc_defaults` + if test "$line" = "MARC_MODE"; then + echo + echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available + echo + line= + fi + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + modeerror="defaults file $DIRSCRIPT/run_marc_defaults used mode $line ; this must be i8" + modeoption=error + echo $modeerror + fi + if test "$line" = "i8"; then + mode=i8 + fi +fi +if test -f $HOME/run_marc_defaults; then + line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $HOME/run_marc_defaults` + if test "$line" = "MARC_MODE"; then + echo + echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available + echo + line= + fi + line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` + line=`echo $line | $AWK '{print $NF}'` + if test "$line" = "i4"; then + modeerror="defaults file $HOME/run_marc_defaults used mode $line ; this must be i8" + modeoption=error + echo $modeerror + fi + if test "$line" = "i8"; then + mode=i8 + fi +fi +if test -n "$MARC_INTEGER_SIZE" ; then + mode=$MARC_INTEGER_SIZE +fi +if test -z "$mode" ; then + mode=i8 +fi +case $mode in + i4) + modeerror="bad value for MARC_INTEGER_SIZE variable; only i8 is supported." + modeoption=error + echo $modeerror + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo "bad value for MARC_INTEGER_SIZE variable; only i8 is supported." + exit + ;; +esac + +setmode=false +for arg in $* ; do + if $setmode ; then + mode=$arg + case $mode in + i4) + modeerror="bad value for mode option; only i8 is supported." + modeoption=error + echo + echo $modeerror + echo + ;; + i8) + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + ;; + *) + echo " " + echo "error, version mode must be i8" + echo " " + echo " use -mo i8 " + echo " " + exit + ;; + esac + setmode=false + fi + if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then + echo + echo warning: the option -mo is deprecated, as of Marc 2015, only the integer*8 version is available + echo + setmode=true + fi + if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then + MARC_INTEGER_SIZE=i8 + export MARC_INTEGER_SIZE + fi + if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then + modeerror="bad value for mode option; only i8 is supported." + modeoption=error + echo + echo $modeerror + echo + fi +done + +# set to i4 version for 32 bit Linux +if test "`uname -s`" = "Linux"; then + if test "`uname -m`" = "i686"; then + mode=i4 + MARC_INTEGER_SIZE=i4 + export MARC_INTEGER_SIZE + fi +fi + + +. "$DIR/getarch" + +. $MARC_INCLUDE +# + +# +# Dynamically determine the echo syntax +# + +case "`echo '\c'`" in + '\c') + ECHO='echo -n' + ECHOTXT=' ' + ;; + *) + ECHO='echo' + ECHOTXT=' \c' + ;; +esac + +# +# Variables for the MARC environment +# + +PRODUCT="Marc" +EXITMSG=$MARC_TOOLS/MESSAGES +export EXITMSG +FLEXDIR=$DIR/../flexlm/licenses +export FLEXDIR +TIMCHK=3600 +export TIMCHK +BINDIR=$MARC_BIN +export BINDIR +AFMATDAT=$MARC_RUNTIME/AF_flowmat/ +export AFMATDAT +export MESHERDIR +MSC_LICENSE_FINPROC=1 +export MSC_LICENSE_FINPROC +# +# define directory path to global unified material database +# +MATFILE= +export MATFILE + +# +# define memory limit +# first set to MEMLIMIT from include +# -ml option overrules if specified +memlimit=$MEMLIMIT +# +# Define share library path based on platforms +# This is required for using the Patran Mesher +# +if test $MACHINENAME = "HP" +then + SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH + export SHLIB_PATH +fi +# the one for IBM is defined futher down + +LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$MESHERDIR:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$SFMATDIR:$LD_LIBRARY_PATH +LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH +LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH +export LD_LIBRARY_PATH +export LD_LIBRARY64_PATH +export LD_LIBRARYN32_PATH + +atexit() { +kill -15 $$ +# +if test $MPITYPE = "myrinet" +then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi +fi +} + +trap "atexit" 2 + +# +# defaults +# + +prog=marc +exefile=marc +jid= +rid= +pid= +sid= +did= +vid= +user= +usersubname= +objs= +qid=background +cpu= +priority= +att= +trk= +verify=yes +prgsav=no +rmdll=no +cpdll=no +progdll= +pathdll= +error= +nprocd=0 +nprocdddm=1 +nprocdddmprint= +icreated=0 +nprocdarg= +nsolver=0 +nsolverarg=-ns +if test $nprocds +then + if test $nprocds -gt 1 + then + nprocdddm=$nprocds + nprocdddmprint=$nprocds + icreated=1 + nprocdarg=-nprocds + fi +fi +ntprint=0 +nt=-1 +nte=-1 +nts=-1 +ntarg=-nt +ntearg=-nte +ntsarg=-nts +nteprint= +ntsprint= +gpuids= +nauto=0 +ndcoup=0 +ndytran=0 +noutcore=0 +dllrun=0 +mesh=0 +itree=0 +iam= +ddm_arc=0 +link= +trkrun=0 +DIRJOB=`pwd` +DIRSCR=$DIRJOB +DIRSCRSET= +autoforge=0 +dotdat=.dat +dotdefhost=.defhost +host= +numhost= +mfile= +userhost= +makebdf= +cpinput=yes +cpresults=yes +marcdll=libmarc.$EXT_DLL +# define hostname and strip off extensions (alpha.aaa.com) +thishost=`hostname` +thishost=${thishost%%.*} +compatible=unknown +numfield=1 +justlist= +feature= +mpioption=false +iprintsimufact= +MDSRCLIB=$MARC_LIB/mdsrc.a +# +# check run_marc_defaults file for default MPI setting +# located in the tools directory of the Marc installation +# or in the user's home directory +# format: +# MARC_MPI +# +value= +file= +if test -f $DIRSCRIPT/run_marc_defaults; then + value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` + value=`echo $value | $AWK '{print $NF}'` + if test -n "$value"; then + file=$DIRSCRIPT/run_marc_defaults + fi +fi +if test -f $HOME/run_marc_defaults; then + value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` + value=`echo $value | $AWK '{print $NF}'` + if test -n "$value"; then + file=$HOME/run_marc_defaults + fi +fi +if test -n "$value"; then + MARC_MPITYPE=$value + notok=true + for i in "$MPI_OTHER"; do + if test "$MARC_MPITYPE" = "$i"; then + notok=false + fi + done + if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then + notok=false + fi + if $notok; then + echo " " + echo " error, incorrect option for MARC_MPI" + echo " defined in $file: $MARC_MPITYPE" + echo " valid options: $MPI_DEFAULT $MPI_OTHER" + echo " " + exit + fi + if test "$value" != "$MPI_DEFAULT"; then + exefile=marc_$value + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a_$value + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" + fi + fi +fi +# +# +# allow scratch directory to be specified with environmental variable +# MARCSCRATCH +if test $MARCSCRATCH +then + if test -d $MARCSCRATCH + then + DIRSCR=$MARCSCRATCH + else + echo "error, scratch directory '$MARCSCRATCH'" + echo " specified via environmental variable MARCSCRATCH does not exist" + exit + fi +fi +# +############################################################################## +# parse input - arguments always come in pairs # +############################################################################## + +arg=$1 +if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then + shift + arg=$1 +fi +while [ -n "$arg" ] +do + shift + value=$1 + case $arg in + -al* | -AL*) + LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH + $MARC_BIN/marc -alloc 1 + exit + ;; + -li* | -LI*) + justlist=yes + ;; + -fe* | -FE*) + feature=$value + + ;; + -pr* | -PR*) + if test `dirname $value` = '.' + then + prog=`$BASENAME $value .marc` + progdll=`$BASENAME $value` + else + prog=`dirname $value`/`$BASENAME $value .marc` + progdll=`dirname $value`/`$BASENAME $value` + fi + prdir=`dirname $value` + case $prdir in + \/*) + ;; + *) + prog=`pwd`/$prdir/$prog + ;; + esac + ;; + -j* | -J*) + jid=`$BASENAME $value $dotdat` + DIRJID=`dirname $value` + case $DIRJID in + \/*) + ;; + *) + DIRJID=`pwd`/$DIRJID + ;; + esac + ;; + -r* | -R*) + rid=`$BASENAME $value .t08` + DIRRID=`dirname $value` + case $DIRRID in + \/*) + ;; + *) + DIRRID=`pwd`/$DIRRID + ;; + esac + ;; + -si* | -SI*) + sid=$value + DIRSID=`dirname $value` + case $DIRSID in + \/*) + ;; + *) + DIRSID=`pwd`/$DIRSID + ;; + esac + ;; + -pi* | -PI*) + if test -f $value.t19 + then + pid=`$BASENAME $value .t19` + else + pid=`$BASENAME $value .t16` + fi + DIRPID=`dirname $value` + case $DIRPID in + \/*) + ;; + *) + DIRPID=`pwd`/$DIRPID + ;; + esac + ;; + -bdf | -BDF) + makebdf=1 + ;; + -de* | -DE*) + did=`$BASENAME $value $dotdat` + DIRDID=`dirname $value` + case $DIRDID in + \/*) + ;; + *) + DIRDID=`pwd`/$DIRDID + ;; + esac + ;; + -vf | -VF) + vid=`$BASENAME $value .vfs` + DIRVID=`dirname $value` + case $DIRVID in + \/*) + ;; + *) + DIRVID=`pwd`/$DIRVID + ;; + esac + ;; + -u* | -U*) + user=`dirname $value`/`$BASENAME $value .f` + usersubname=$user + basefile=`$BASENAME $value` + if test ${basefile##*.} = f + then + user=`dirname $value`/`$BASENAME $value .f` + usersubname=$user.f + elif test ${basefile##*.} = F + then + user=`dirname $value`/`$BASENAME $value .F` + usersubname=$user.F + elif test ${basefile##*.} = f90 + then + user=`dirname $value`/`$BASENAME $value .f90` + usersubname=$user.f90 + elif test ${basefile##*.} = F90 + then + user=`dirname $value`/`$BASENAME $value .F90` + usersubname=$user.F90 + fi + case $user in + \/*) + ;; + *) + user=`pwd`/$user + usersubname=`pwd`/$usersubname + ;; + esac + if test ! -f $usersubname + then + if test -f $usersubname.f + then + usersubname=$usersubname.f + elif test -f $usersubname.F + then + usersubname=$usersubname.F + elif test -f $usersubname.f90 + then + usersubname=$usersubname.f90 + elif test -f $usersubname.F90 + then + usersubname=$usersubname.F90 + fi + fi + ;; + -obj | -OBJ) + objs="$value" + ;; + -q* | -Q*) + qid=$value + ;; + -b* | -B*) + case $value in + y* | Y*) + qid=background + ;; + n* | N*) + qid=foreground + ;; + *) + ;; + esac + ;; + -at | -AT) + att=$value + ;; + -cpu* | -CPU*) + cpu=$value + ;; + -pq | -PQ*) + priority=$value + ;; + -v* | -V*) + verify=$value + ;; + -sa* | -SA*) + prgsav=$value + ;; + -np* | -NP*) + nprocdddm=$value + nprocdddmprint=$value + case $arg in + -nps* | -NPS* | -nprocds* | -NPROCDS*) + icreated=1 + nprocdarg=-nprocds + ;; + esac + case $arg in + -np | -NP | -nprocd | -NPROCD) + icreated=0 + nprocdarg=-nprocd + ;; + esac + ;; + -ns* | -NS*) + nsolver=$value + ;; + -nt* | -NT*) + case $arg in + -nte | -NTE | -nthread_e* | -NTHREAD_E*) + nte=$value + ;; + esac + case $arg in + -nts | -NTS | -nthread_s* | -NTHREAD_S*) + nts=$value + ;; + esac + case $arg in + -nt | -NT | -nth* | -NTH* | -nthread* | -NTHREAD*) + nt=$value + ;; + esac + ;; + -gp* | -GP*) + gpuids=$value + ;; + -it* | -IT*) + itree=$value + ;; + -iam | -IAM) + iam=$value + case $value in + sfg | sfm | sim) + iprintsimufact=true + ;; + esac + ;; + -au* | -AU*) + nauto=$value + ;; + -dc* | -DC*) + ndcoup=$value + ;; + -dy* | -DY*) + ndytran=$value + ;; + -ou* | -OU*) + noutcore=$value + ;; + -dll | -DLL) + dllrun=$value + ;; + -trk | -TRK) + trkrun=$value + ;; + -ddm | -DDM) + ddm_arc=$value + ;; + -me | -ME ) + mesh=$value + ;; + -ml | -ML ) + memlimit=$value + ;; + -mo | -MO ) + ;; + -mpi | -MPI ) + mpioption=true + MARC_MPITYPE=$value + if test "$value" != "$MPI_DEFAULT"; then + exefile=marc_$value + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a_$value + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" + fi + else + exefile=marc + . $MARC_INCLUDE + MDSRCLIB=$MARC_LIB/mdsrc.a + if test "$MUMPSSOLVER" = MUMPS; then + MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" + fi + fi + ;; + -dir* | -DIR*) + DIRJOB=$value + case $DIRJOB in + \/*) + ;; + *) + DIRJOB=`pwd`/$DIRJOB + ;; + esac + if test -z "$DIRSCRSET" + then + DIRSCR=$DIRJOB + fi + ;; + -sd* | -SD*) + DIRSCR=$value + DIRSCRSET=yes + case $DIRSCR in + \/*) + ;; + *) + DIRSCR=`pwd`/$DIRSCR + ;; + esac + ;; + -ho* | -HO*) + host=$value + ;; + -co* | -CO*) + compatible=$value + ;; + -ci* | -CI*) + cpinput=$value + ;; + -cr* | -CR*) + cpresults=$value + ;; + *) + error="$error +$arg: invalid option" + break + ;; + esac + case $value in + -*) + error="$error +$arg: invalid name $value" + break + ;; + esac + shift + arg=$1 + if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then + shift + arg=$1 + fi +done +argc=`expr $# % 2` +if test $argc -eq 1 +then +# +# odd number of arguments +# + error="$error +argument list incomplete" +fi + +if test $nprocdddm -gt 0 +then +nprocd=$nprocdddm +fi + +if test $nsolver -gt 0 +then + if test $nsolver -gt $nprocd + then + nprocd=$nsolver + fi +fi +# Set defaults +if test $nt -eq -1 +then +nt=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nt -lt 0 +then +nt=0 +fi +if test $nte -eq -1 +then +nte=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nte -lt 0 +then +nte=0 +fi +if test $nts -eq -1 +then +nts=${MARC_NUMBER_OF_THREADS:-0} +fi +if test $nts -lt 0 +then +nts=0 +fi +# +# set number of element loop threads +# +ntprint=$nt +nteprint=$nte +# copy from -nprocd[s] +if test $nprocdddm -gt 1 +then + nteprint=$nprocdddm +fi +# override with -nthread_elem option +if test $nte -ne 0 +then +nteprint=$nte +fi +# check for minimum 1 threads per processes for DDM +if test $nprocdddm -gt 1 +then + if test $nteprint -lt $nprocdddm + then + nteprint=$nprocdddm + fi +fi +nte=$nteprint +# +# set number of Solver threads +# +ntsprint=$nts +# copy from -nthread or -nprocd[s] +if test $ntprint -ne 0 +then + ntsprint=$ntprint +else + if test $nprocdddm -gt 1 + then + ntsprint=$nprocdddm + fi +fi +# override with -nthread_solver option +if test $nts -ne 0 +then + ntsprint=$nts +fi +# check for minimum 1 threads per solver process. +if test $nsolver -lt $nprocdddm +then + if test $ntsprint -lt $nsolver + then + ntsprint=$nsolver + fi +else + if test $ntsprint -lt $nprocdddm + then + ntsprint=$nprocdddm + fi +fi +if test $ntsprint -eq 1 +then + set ntsprint=0 +fi +nts=$ntsprint + +# set stack size for multi-threading. +export KMP_MONITOR_STACKSIZE=7M +export OMP_STACKSIZE=7M + +# +# deprecate -nthread option at arugment of marc +nt=0 +# Reset nprocdddmm, nsolver and threads if not given. +if test $nprocdddm -eq 0 +then + nprocdarg= +fi +if test $nprocdddm -eq 0 +then + nprocdddmprint= +fi +if test $nprocdddm -eq 0 +then + nprocdddm= +fi + +if test $nsolver -eq 0 +then + nsolverprint= +fi +# end of threads setting. +gpuoption= +if test "$gpuids" = "" ; then + gpuoption= +else + gpuoption="-gp $gpuids" +fi + +if test "$gpuids" = "" ; then + export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH +else + MARCCUDALIBS=$MARCCUDALIBS2 + export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH +fi +# Linux 64 + HPMPI, Below code is taken from include_linux64 +if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" +then + export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" +fi + +if test $nprocd -gt 1; then + if test -f $jid$dotdefhost; then + if test "$host" = ""; then + host=$jid$dotdefhost + fi + fi + if test -f hostfile_qa_$nprocd; then + if test "$host" = ""; then + host=hostfile_qa_$nprocd + fi + fi +fi + +if test "$dllrun" -gt 0; then + exefile=exe_marc + prog=exe_marc + program=$exefile + bd=$MARC_BIN/ + if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then + dotdat=.inp + fi + + if test "$progdll"; then + /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll + rmdll=yes + pathdll=yes + progdll=${progdll}_$marcdll + else + progdll=$marcdll + fi + + if test "$user"; then + . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user + user= + if test $prgsav = no; then + rmdll=yes + fi + if test $prgsav = yes; then + cpdll=yes + rmdll=yes + fi + pathdll=yes + fi +fi + +############################################################################## +# check parameter validity # +############################################################################## + +while test forever; do + +# +# check for input file existence +# +if test $nprocdddm -gt 1 -a $icreated -eq 0; then + if test ! -f $DIRJID/1$jid$dotdat; then + if test "$jid" != "" ; then + error="$error +input file $DIRJID/1$jid$dotdat not accessible" + fi + fi +else + if test ! -f $DIRJID/$jid$dotdat; then + if test "$jid" != "" ; then + error="$error +input file $DIRJID/$jid$dotdat not accessible" + fi + fi +fi + if test $nprocd -gt 1; then + if test "$host" ; then + if test ! -f $host; then + error="$error +host name file $host not accessible" + fi + fi + fi + +# +# check if the job is already running in the background +# +if test -f $DIRJOB/$jid.pid; then + error="$error +job is already running (the file $jid.pid exists)" +fi + +# +# if the program name is other than marc, then +# assume that this is a program in the users local directory +# + +bd=$MARC_BIN/ + +case $prog in + marc | MARC | $exefile) + program=$exefile + if test "$rid" + then + if test ! -f $DIRRID/$rid.t08 + then + error="$error +restart file $DIRRID/$rid.t08 not accessible" + fi + fi + if test "$pid" + then + if test ! -f $DIRPID/$pid.t16 + then + if test ! -f $DIRPID/$pid.t19 + then + error="$error +post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" + fi + fi + fi + if test "$usersubname" + then + if test ! -f $usersubname + then + error="$error +user subroutine file $usersubname not accessible" + fi + fi + if test "$objs" + then + missingobjs= + for o in $objs + do + if test ! -f "$o" + then + if test -z "$missingobjs" + then + missingobjs="$o" + else + missingobjs="$missingobjs $o" + fi + fi + done + if test -n "$missingobjs" + then + error="$error +user object/library file(s) $missingobjs not accessible" + fi + fi + if test "$did" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRDID/1$did$dotdat + then + error="$error +defaults file $DIRDID/1$did$dotdat not accessible" + fi + else + if test ! -f $DIRDID/$did$dotdat + then + error="$error +defaults file $DIRDID/$did$dotdat not accessible" + fi + fi + fi + if test "$vid" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRVID/1$vid.vfs + then + error="$error +view factor file $DIRVID/1$vid.vfs not accessible" + fi + else + if test ! -f $DIRVID/$vid.vfs + then + error="$error +view factor file $DIRVID/$vid.vfs not accessible" + fi + fi + fi + if $mpioption + then + notok=true + for i in "$MPI_OTHER"; do + if test "$MARC_MPITYPE" = "$i"; then + notok=false + fi + done + if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then + notok=false + fi + if $notok; then + error="$error +incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" + fi + fi + ;; + *) + program=$prog.marc + case $prog in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + if test "$rid" + then + if test ! -f $DIRRID/$rid.t08 + then + error="$error +restart file $DIRRID/$rid.t08 not accessible" + fi + fi + if test "$pid" + then + if test ! -f $DIRPID/$pid.t16 + then + if test ! -f $DIRPID/$pid.t19 + then + error="$error +post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" + fi + fi + fi + if test "$user" + then + error="$error +program option may not be used with user subroutine" + fi + if test "$objs" + then + error="$error +program option may not be used with user objects or libraries" + fi + if test "$did" + then + if test $nprocdddm -gt 1 -a $icreated -eq 0 + then + if test ! -f $DIRDID/1$did$dotdat + then + error="$error +defaults file $DIRDID/1$did$dotdat not accessible" + fi + else + if test ! -f $DIRDID/$did$dotdat + then + error="$error +defaults file $DIRDID/$did$dotdat not accessible" + fi + fi + fi + if test "$nauto" + then + if test $nauto -gt 2 + then + error="$error +incorrect option for auto restart " + fi + fi + if test "$ndcoup" + then + if test $ndcoup -gt 3 + then + error="$error +incorrect option for contact decoupling " + fi + fi + if test "$ndytran" + then + if test $ndytran -gt 1 + then + error="$error +incorrect option for Marc-Dytran Switch " + fi + fi + if $mpioption + then + if test ! -x $MARC_BIN/$exefile + then + error="$error +incorrect option for -mpi option: $MARC_MPITYPE " + fi + fi + ;; +esac + +############################################################################## +# check argument integrity # +############################################################################## + +if test "$jid" +then + : +else + if test "$user" + then +# allow user sub without giving job id + qid=foreground + verify=no + else + error="$error +job id required" + fi +fi + +if test $nprocd -gt 1 +then + if test $nauto -gt 0 + then + error="$error +cannot run DDM job with auto restart (-au) option " + fi +fi +case $qid in + S* | s*) + qid=short + ;; + L* | l*) + qid=long + ;; + V* | v*) + qid=verylong + ;; + B* | b*) + qid=background + ;; + F* | f*) + qid=foreground + ;; + A* | a*) + qid=at + ;; + *) + error="$error +bad value for queue_id option" + ;; +esac + +case $prgsav in + N* | n*) + prgsav=no + ;; + Y* | y*) + prgsav=yes + ;; + *) + error="$error +bad value for save option" + ;; +esac + +case $verify in + N* | n*) + verify=no + ;; + Y* | y*) + verify=yes + ;; + *) + error="$error +bad value for verify option" + ;; +esac + +case $nprocdddm in + -* ) + error="$error +bad value for nprocd option" + ;; +esac + +case $nt in + -* ) + error="$error +bad value for nt option" + ;; +esac + +case $itree in + -* ) + error="$error +bad value for itree option" + ;; +esac +case $iam in + -* ) + error="$error +bad value for iam option" + ;; +esac +case $compatible in + N* | n*) + compatible=no + ;; + Y* | y*) + compatible=yes + ;; + unknown) + ;; + *) + error="$error +bad value for comp option" + ;; +esac +case $cpinput in + N* | n*) + cpinput=no + ;; + Y* | y*) + cpinput=yes + ;; + *) + error="$error +bad value for copy input option" + ;; +esac +case $cpresults in + N* | n*) + cpresults=no + ;; + Y* | y*) + cpresults=yes + ;; + *) + error="$error +bad value for copy results option" + ;; +esac + +# +# check for external file to run +# +if test -f $MARC_TOOLS/run_marc_check +then + . $MARC_TOOLS/run_marc_check +fi + +############################################################################## +# interact with the user to get the required information to run marc or # +# other marc system program # +############################################################################## + +deletelog=yes +if test $qid = background -a $verify = no +then +echo \ +" +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid +User subroutine name : $usersubname +User objects/libs : $objs +Restart file job ID : $rid +Substructure file ID : $sid +Post file job ID : $pid +Defaults file ID : $did +View Factor file ID : $vid +Save generated module: $prgsav +MPI library : $MPITYPE +DDM processes : $nprocdddmprint +Element loop threads : $nteprint +Solver processes : $nsolverprint +Solver threads : $ntsprint +GPGPU option : $gpuids +Host file name : $host" > $jid.log +if test "$iprintsimufact" = true ; then + echo "DDM with ARC Mapper : $ddm_arc" >> $jid.log +fi +echo \ +"Message passing type : $itree +Run job in queue : $qid +Run directory : $DIRJOB +Scratch directory : $DIRSCR +Memory limit in Mbyte: $memlimit +Auto Restart : $nauto " >> $jid.log +deletelog=no +fi +echo \ +" +Program name : $prog +Marc shared lib : $progdll +Version type : $mode +Job ID : $DIRJID/$jid +User subroutine name : $usersubname +User objects/libs : $objs +Restart file job ID : $rid +Substructure file ID : $sid +Post file job ID : $pid +Defaults file ID : $did +View Factor file ID : $vid +Save generated module: $prgsav +MPI library : $MPITYPE +DDM processes : $nprocdddmprint +Element loop threads : $nteprint +Solver processes : $nsolverprint +Solver threads : $ntsprint" +if test "$iprintsimufact" = true ; then + echo "DDM with ARC Mapper : $ddm_arc" +fi +echo \ +"GPGPU option : $gpuids +Host file name : $host +Message passing type : $itree +Run job in queue : $qid +Run directory : $DIRJOB +Scratch directory : $DIRSCR +Memory limit in Mbyte: $memlimit +Auto Restart : $nauto" + + +case $qid in + s* | S* | l* | L* | v* | V* ) + echo \ +"Queue priority : $priority +Queue CPU limit : $cpu +Queue start time : $att" + ;; +# * ) +# echo \ +#" " +# ;; +esac + +if test "$modeoption" +then + error=$modeerror +fi + +if test "$error" +then + if test $verify = yes + then + $ECHO "$error + +Please correct or quit(correct,quit,): $ECHOTXT" + error= + read answer + case $answer in + q* | Q*) + answer=quit + ;; + *) + answer=correct + ;; + esac + else + $ECHO "$error + $ECHOTXT" + echo " " + if test "$deletelog" = no + then + $ECHO "$error + $ECHOTXT" >> $jid.log + echo " " >> $jid.log + fi + answer=quit + fi +else + if test $verify = yes + then + $ECHO " +Are these parameters correct (yes,no,quit,)? $ECHOTXT" + read answer + case $answer in + q* | Q*) + answer=quit + ;; + y* | Y*) + answer=yes + ;; + *) + answer=no + ;; + esac + else + answer=yes + fi +fi + +case $answer in + no | correct) + +############################################################################## +# prompt for each value # +############################################################################## + + $ECHO " +Program name ($prog)? $ECHOTXT" + read value + if test "$value" + then + prog=$value + fi + $ECHO "Job ID ($jid)? $ECHOTXT" + read value + if test "$value" + then + jid=`$BASENAME $value $dotdat` + DIRJID=`dirname $value` + case $DIRJID in + \/*) + ;; + *) + DIRJID=`pwd`/$DIRJID + ;; + esac + fi + $ECHO "User subroutine name ($usersubname)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + user= + ;; + *) + user=`dirname $value`/`$BASENAME $value .f` + usersubname=$user + basefile=`$BASENAME $value` + if test ${basefile##*.} = f + then + user=`dirname $value`/`$BASENAME $value .f` + usersubname=$user.f + elif test ${basefile##*.} = F + then + user=`dirname $value`/`$BASENAME $value .F` + usersubname=$user.F + elif test ${basefile##*.} = f90 + then + user=`dirname $value`/`$BASENAME $value .f90` + usersubname=$user.f90 + elif test ${basefile##*.} = F90 + then + user=`dirname $value`/`$BASENAME $value .F90` + usersubname=$user.F90 + fi + case $user in + \/*) + ;; + *) + user=`pwd`/$user + usersubname=`pwd`/$usersubname + ;; + esac + if test ! -f $usersubname + then + if test -f $usersubname.f + then + usersubname=$usersubname.f + elif test -f $usersubname.F + then + usersubname=$usersubname.F + elif test -f $usersubname.f90 + then + usersubname=$usersubname.f90 + elif test -f $usersubname.F90 + then + usersubname=$usersubname.F90 + fi + fi + ;; + esac + fi + $ECHO "User objects or libraries ($objs)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + objs= + ;; + *) + objs="$value" + ;; + esac + fi + $ECHO "Restart File Job ID ($rid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + rid= + ;; + *) + rid=`$BASENAME $value .t08` + DIRRID=`dirname $value` + case $DIRRID in + \/*) + ;; + *) + DIRRID=`pwd`/$DIRRID + ;; + esac + ;; + esac + fi + $ECHO "Substructure File ID ($sid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + sid= + ;; + *) + sid=$value + DIRSID=`dirname $value` + case $DIRSID in + \/*) + ;; + *) + DIRSID=`pwd`/$DIRSID + ;; + esac + ;; + esac + fi + $ECHO "Post File Job ID ($pid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + pid= + ;; + *) + pid=$value + DIRPID=`dirname $value` + case $DIRPID in + \/*) + ;; + *) + DIRPID=`pwd`/$DIRPID + ;; + esac + ;; + esac + fi + $ECHO "Defaults File ID ($did)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + did= + ;; + *) + did=`$BASENAME $value $dotdat` + DIRDID=`dirname $value` + case $DIRDID in + \/*) + ;; + *) + DIRDID=`pwd`/$DIRDID + ;; + esac + ;; + esac + fi + $ECHO "View Factor File ID ($vid)? $ECHOTXT" + read value + if test "$value" + then + case $value in + -*) + vid= + ;; + *) + vid=`$BASENAME $value .vfs` + DIRVID=`dirname $value` + case $DIRVID in + \/*) + ;; + *) + DIRVID=`pwd`/$DIRVID + ;; + esac + ;; + esac + fi + $ECHO "Save generated module ($prgsav)? $ECHOTXT" + read value + if test "$value" + then + prgsav=$value + fi + $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" + read value + if test "$value" + then + nprocdddm=$value + nprocdddmprint=$value + fi + $ECHO "Run on ($nte) Element loop threads ? $ECHOTXT" + read value + if test "$value" + then + nte=$value + fi + $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" + read value + if test "$value" + then + nsolver=$value + fi + $ECHO "Run on ($nts) Solver threads ? $ECHOTXT" + read value + if test "$value" + then + nts=$value + fi +# + if test $nprocdddm -gt 0 + then + nprocd=$nprocdddm + fi + if test $nsolver -gt 0 + then + if test $nsolver -gt $nprocd + then + nprocd=$nsolver + fi + fi +# Element loop threads. + if test $nte -eq -1 + then + nte=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nte -lt 0 + then + nte=0 + fi + nteprint=$nte +# Copy from ddm + if test $nprocdddm -gt 1 + then + nteprint=$nprocdddm + fi +# override with -nthread_elem option + if test $nte -ne 0 + then + nteprint=$nte + fi +# check for minimum 1 threads per processes for DDM + if test $nprocdddm -ne 0 + then + if test $nteprint -lt $nprocdddm + then + nteprint=$nprocdddm + fi + fi + nte=$nteprint +# Solver threads. + if test $nts -eq -1 + then + nts=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nts -lt 0 + then + nts=0 + fi + ntsprint=$nts +# Copy from ddm + if test $nprocdddm -gt 1 + then + ntsprint=$nprocdddm + fi +# override with -nthread_solver option + if test $nts -ne 0 + then + ntsprint=$nts + fi +# check for minimum 1 threads per solver process. + if test $nsolver -lt $nprocdddm + then + if test $ntsprint -lt $nsolver + then + ntsprint=$nsolver + fi + else + if test $ntsprint -lt $nprocdddm + then + ntsprint=$nprocdddm + fi + fi + if test $ntsprint -eq 1 + then + set ntsprint=0 + fi + nts=$ntsprint + $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" + read value + if test "$value" + then + gpuids=$value + fi + if test "$gpuids" = "" ; then + gpuoption= + else + gpuoption="-gp $gpuids" + fi + if test "$gpuids" = "" ; then + export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH + else + MARCCUDALIBS=$MARCCUDALIBS2 + export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH + fi + if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" + then + export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" + fi +# + if test $nprocd -gt 1 + then + $ECHO "Message passing type ($itree)? $ECHOTXT" + read value + if test "$value" + then + itree=$value + fi + $ECHO "Host file name ($host)? $ECHOTXT" + read value + if test "$value" + then + host=$value + fi + if test $nprocdddm -gt 1 + then + $ECHO "Single input file? $ECHOTXT" + read value + case $value in + y* | Y*) + icreated=1 + nprocdarg=-nprocds + ;; + esac + $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" + read value + if test "$value" + then + compatible=$value + fi + $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" + read value + if test "$value" + then + cpinput=$value + fi + $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" + read value + if test "$value" + then + cpresults=$value + fi + fi + fi + $ECHO "Run the job in the queue ($qid)? $ECHOTXT" + read value + if test "$value" + then + qid=$value + fi + case $qid in + s* | S* | l* | L* | v* | V* ) + $ECHO "Queue priority ($priority)? $ECHOTXT" + read value + if test "$value" + then + priority=$value + fi + $ECHO "Job starts at ($att)? $ECHOTXT" + read value + if test "$value" + then + att=$value + fi + $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" + read value + if test "$value" + then + cpu=$value + fi + ;; + * ) + ;; + esac + $ECHO "Auto Restart option ($nauto)? $ECHOTXT" + read value + if test "$value" + then + nauto=$value + fi + $ECHO "Run directory ($DIRJOB)? $ECHOTXT" + read value + if test "$value" + then + DIRJOB=$value + DIRSCR=$DIRJOB + fi + $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" + read value + if test "$value" + then + DIRSCR=$value + fi + ;; + quit) + exit 1 + ;; + *) + break + ;; + +esac + + if test $nt -eq -1 + then + nt=${MARC_NUMBER_OF_THREADS:-0} + fi + if test $nt -lt 0 + then + nt=0 + fi + +done +# +if test $nt -eq 0 +then + ntarg= +fi +if test $nt -eq 0 +then + ntprint= +fi +if test $nt -eq 0 +then + nt= +fi + +if test $nte -eq 0 +then + ntearg= +fi +if test $nte -eq 0 +then + nteprint= +fi +if test $nte -eq 0 +then + nte= +fi + +if test $nts -eq 0 +then + ntsarg= +fi +if test $nts -eq 0 +then + ntsprint= +fi +if test $nts -eq 0 +then + nts= +fi +# +if test "$dllrun" -gt 0; then + exefile=exe_marc + prog=exe_marc + program=$exefile + bd=$MARC_BIN/ + if test "$user"; then + . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user + user= + pathdll=yes + if test $prgsav = no; then + rmdll=yes + fi + if test $prgsav = yes; then + cpdll=yes + rmdll=yes + fi + fi + + if test "$pathdll"; then +# +# reset share lib path +# + if test $MACHINENAME = "HP" + then + SHLIB_PATH=$DIRJOB:$SHLIB_PATH + export SHLIB_PATH + fi + if test $MACHINENAME = "IBM" + then + LIBPATH=$DIRJOB:$LIBPATH + export LIBPATH + fi +# + LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH + LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH + LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH + export LD_LIBRARY_PATH + export LD_LIBRARY64_PATH + export LD_LIBRARYN32_PATH + fi +fi +# end of dllrun>0 + + +if test $program = $exefile -o $program = $prog.marc +then + +# delete the old .log file unless we run in the background +if test "$deletelog" = yes +then + if test "$jid" + then + /bin/rm $jid.log 2>/dev/null + fi +else + echo + echo running the job in the background, see $jid.log + echo +fi + +# +# check if this is an autoforge or rezoning or radiation job +# +if test $nprocd -eq 1 -a "$jid" + +then + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` + if test "$line" + then + autoforge=1 + fi + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` + if test "$line" + then + autoforge=1 + fi + line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` + if test "$line" + then + autoforge=1 + fi +fi +# +# check that jobname for restarted run is not the same +# as restart file basename +# +if test "$rid" +then + if test "$jid" = "$rid" + then + echo " " + echo "ERROR: job name of current run is the same as job name" + echo " of the restarted job" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "ERROR: job name of current run is the same as job name" >> $jid.log + echo " of the restarted job" >> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi +fi + +# +# user objects/libraries used +# + + if test "$objs" + then + program="$DIRJOB/$jid.marc" + case $program in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + link=yes + fi + +# +# user subroutine used +# + + if test "$user" + then +# program=$user.marc + program=$DIRJOB/`$BASENAME $user .f`.marc + case $program in + \/* | \.\/*) + bd= + ;; + *) + bd=`pwd`/ + ;; + esac + link=yes + fi + +# +# Special case for IBM using POE but not an SP machine +# in this case we always need a host file, also for serial jobs. +# +if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP +then + MP_HOSTFILE=${jid}.host + if test -f $jid.host + then + /bin/rm $jid.host 2> /dev/null + fi + if test $nprocd -gt 1 + then + numdom=$nprocd + while test $numdom -gt 0 + do + hostname -s >> $MP_HOSTFILE + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + else + hostname -s > $MP_HOSTFILE + fi +fi +# +# check ssh for all hosts in host file +# +if test $nprocd -gt 1 +then +if test $MPITYPE = "intelmpi" -a "$INTELMPI_VERSION" = "HYDRA" + then +# get host list + if test "$host" + then + line=`grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' | uniq` +# count failing hosts + counter=0 + for i in $line + do + $RSH -o BatchMode=yes -o ConnectTimeout=10 $i uname -n + status=$? + if [[ $status != 0 ]] ; then + counter=$((counter+1)) + if [ "$counter" = "1" ]; then + echo " " + echo " error - connection test failed... " + echo " " + fi + echo " " + echo " connection test with ssh failed on host $i" + echo " check the following command: ssh $i uname -n " + echo " " + fi + done +# echo error message and quit + if test $counter -ne 0 + then + echo " " + echo " A parallel job using IntelMPI cannot be started. " + echo " The ssh command must be working correctly between " + echo " the computers used in the analysis. Furthermore, " + echo " it must be set up such that it does not prompt the " + echo " user for a password. " + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo " A parallel job using IntelMPI cannot be started. ">> $jid.log + echo " The ssh command must be working correctly between ">> $jid.log + echo " the computers used in the analysis. Furthermore, ">> $jid.log + echo " it must be set up such that it does not prompt the ">> $jid.log + echo " user for a password. ">> $jid.log + echo " " >> $jid.log + echo " Exit number 8" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + fi +fi +fi +# +# check correctness of host file; fix for user sub +# + if test $nprocd -gt 1 + then + +# construct the path name to the executable (execpath) + execpath=$MARC_BIN/$exefile + usersub=0 + if test $program = $prog.marc + then + execpath=$prog.marc + usersub=1 + fi + if test "$objs" + then + execpath="$DIRJOB/$jid.marc" + usersub=1 + fi + if test "$user" + then + execpath=$DIRJOB/`$BASENAME $user .f`.marc + usersub=1 + fi + export execpath + execname=`$BASENAME $execpath` + + if test "$host" + then + userhost=$host + case $userhost in + \/* | \.\/*) + ;; + *) + userhost=`pwd`/$userhost + ;; + esac + +# check that the number of processes specified in the hostfile is +# equal to nprocd specified by -nprocd. + numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` + if test $nprocd -ne $numproc + then + echo " " + echo "error, the number of processes specified in the host file" + echo "must be equal to the number of processes given by -nprocd/-nsolver" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, the number of processes specified in the host file" >> $jid.log + echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + +# check for Myrinet that the number of processes per host is +# less than number of available user ports, 5 +# .gmpi directory must exist in user's home directory +# and must have write permission from remote hosts + if test $MPITYPE = "myrinet" + then + numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` + if test $numproc -gt 5 + then + echo " " + echo "error, for Myrinet the number of processes specified " + echo "in the hostfile must not exceed 5 for a hostname" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet the number of processes specified " >> $jid.log + echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + if test ! -d ~/.gmpi + then + echo " " + echo "error, for Myrinet a .gmpi directory must exist " + echo "under the user's home directory" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log + echo "under the user's home directory" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + homedir=`echo ~` + for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ + if test -s tmp.$$ + then + echo " " + echo "error, for Myrinet a shared .gmpi directory must exist " + echo "under the user's home directory " + echo "with remote write permission" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log + echo "under the user's home directory " >> $jid.log + echo "with remote write permission" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + else + /bin/rm tmp.$$ + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + fi + fi + done + fi + fi + +# construct the host file $jid.host which is used by mpirun +# skip lines starting with # and only consider lines with more than +# one word in them. Note that the hostfile given to this script +# has two columns: the host name and the number of shared processes +# to run on this host. mpirun wants the number of _other_ +# processes to run in addition to the one being run on the machine +# on which the job is started. hence the $2-1 for fnr == 1. + if test -f $jid.host + then + /bin/rm $jid.host 2> /dev/null + fi + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then +# HPMPI or HP hardware MPI + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ + -v mpihpspecial="$MPIHPSPECIAL" \ +'{if ( NF > 0) {\ + fnr++ ; \ + printf("-h %s -np %s",$1,$2); \ + printf(" %s",mpihpspecial); \ + if ( NF == 2 ) printf(" %s\n",path);\ + if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ + if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ + }\ + }' > $jid.host +# end HPMPI or HP hardware MPI + elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP + then +# IBM using hardware MPI (POE) + MP_HOSTFILE=$jid.host + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host +# end IBM using hardware MPI (POE) +# for Intel MPI, need to create a machinefile for DMP + elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then +# Intel MPI + if test -f $jid.mfile + then + /bin/rm $jid.mfile 2> /dev/null + fi + /bin/cp $host $jid.host + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile +# end Intel MPI for DMP +# for Solaris HPC 7.1, need to create a machinefile for DMP + elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" + then +# Solaris HPC 7.1 + if test -f $jid.mfile + then + /bin/rm $jid.mfile 2> /dev/null + fi + grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile +# end Solaris HPC 7.1 for DMP +# for Myrinet, construct a configuration file in ~/.gmpi +# this must be readable by each process +# format is (hostname) (port number) for each process + elif test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + echo $nprocd > ~/.gmpi/$jid.host + grep -v '^#' $host | $AWK \ +'BEGIN {iport[0] = 2; \ + iport[1] = 4; \ + iport[2] = 5; \ + iport[3] = 6; \ + iport[4] = 7 \ + } \ +{if ( NF > 0 ) \ + for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ +}' >> ~/.gmpi/$jid.host + else +# this is for mpich-1.2.5 and later, using the -pg option +# format: host nproc executable user arguments +# the arguments are added later + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ +'{if ( NF > 0) {\ + fnr++ ; \ + if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ + else printf("%s %s",$1,$2); \ + if ( NF == 2 ) printf(" %s %s\n",path,user);\ + if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ + if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ + }\ + }' > $jid.host + fi +# end Myrinet + elif test $MACHINENAME = DEC -a $MPITYPE = hardware + then +# Compaq MPI via Memory Channel + grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host +# end Compaq MPI + else +# MPICH + grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ +'{if ( NF > 0) {\ + fnr++ ; \ + if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ + else printf("%s %s",$1,$2); \ + if ( NF == 2 ) printf(" %s\n",path);\ + if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ + if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ + }\ + }' > $jid.host + fi +# define the variable host and host_filt +# host_filt is used for loops over hosts +# for Myrinet we need to use a filtered variant of userhost +# for others we can use $host + if test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + host=~/.gmpi/$jid.host + host_filt=$jid.host_tMp + grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt + else + host=$jid.host + host_filt=$host + fi + else + host=$jid.host + host_filt=$host + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + host_filt=$jid.mfile + fi + fi +# figure out if the machines in the hostfile are nfs mounted +# or distributed and set the variable "dirstatus" accordingly. +# only perform the check if user subroutine is used +# or a user subroutine executable is used + + numfield=1 + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then + numfield=2 + fi + DIR1=$DIRJOB + if test $program = $prog.marc -o -n "$user" -o -n "$objs" + then + counter=0 + echo " " + echo "checking if local or shared directories for host" + if test "$deletelog" = no + then + echo "checking if local or shared directories for host" >> $jid.log + fi + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + dirstatus[$counter]="shared" + $ECHO " $i $ECHOTXT" + if test "$deletelog" = no + then + $ECHO " $i $ECHOTXT" >> $jid.log + fi + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ + if test -s tmp.$$ + then + dirstatus[$counter]="local" + /bin/rm tmp.$$ + else + if test ! -f $jid.$$ + then + dirstatus[$counter]="local" + $RSH $i /bin/rm $DIR1/$jid.$$ + else + /bin/rm $jid.$$ + fi + fi + if test -f tmp.$$ + then + /bin/rm tmp.$$ + fi + if test -f $jid.$$ + then + /bin/rm $jid.$$ + fi + echo " ${dirstatus[$counter]}" + if test "$deletelog" = no + then + echo " ${dirstatus[$counter]}" >> $jid.log + fi + fi + done + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + fi + fi + +# figure out if this is a compatible set of machines +# unless explicitly specified with flag -comp +# only perform the check if user subroutine is used +# or a user subroutine executable is used +# Myrinet does not support heterogeneous + if test $program = $prog.marc -o -n "$user" -o -n "$objs" + then + if test $compatible = "unknown" + then + thisname=$ARCH + compatible=yes + counter=0 + echo "checking if machines are compatible for host" + if test "$deletelog" = no + then + echo "checking if machines are compatible for host" >> $jid.log + fi + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + compstatus[$counter]="yes" + $ECHO " $i $ECHOTXT" + if test "$deletelog" = no + then + $ECHO " $i $ECHOTXT" >> $jid.log + fi + othername=`$RSH $i uname -a | cut -f 1 -d " "` + if test $thisname != $othername + then + compatible=no + compstatus[$counter]="no" + fi + fi + echo " ${compstatus[$counter]}" + if test "$deletelog" = no + then + echo " ${compstatus[$counter]}" >> $jid.log + fi + done + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + fi + else + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + compstatus[$counter]=$compatible + fi + done + if test $compatible = "no" + then + echo "all machines assumed incompatible" + if test "$deletelog" = no + then + echo "all machines assumed incompatible" >> $jid.log + fi + else + echo "all machines compatible" + if test "$deletelog" = no + then + echo "all machines compatible" >> $jid.log + fi + fi + fi +# error out if user objects or libraries are used on incompatible machines + if test "$compatible" = "no" -a -n "$objs" + then + echo "User object/libraries cannot be used in a parallel job on incompatible machines" + if test "$deletelog" = no + then + echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log + fi + exit 1 + fi +# modify new host file if NFS mounted heterogeneous machine + doit= + if test $program = $prog.marc + then + doit=yes + fi + if test "$user" + then + doit=yes + fi + if test "$doit" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + $AWK -v hst=$i '{fnr++ ; \ +if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ +printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} + /bin/mv $jid.host{$$} $jid.host + host=$jid.host + fi + fi + done + fi + fi # if test $program = $prog.marc -o $user -o $obj + + else # if test $host + # assume shared memory machine if no hostfile given and + # MPITYPE is set to mpich or Myrinet + # check for Myrinet that the total number of processes is + # less than number of available user ports, 5 + if test $MPITYPE = "mpich" -o $MPITYPE = "scali" + then + numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` + echo `hostname` $numproc $execpath > $jid.host + host=$jid.host + elif test $MPITYPE = "myrinet" + then + if test $nprocd -gt 5 + then + echo " " + echo "error, for Myrinet the number of processes " + echo "must not exceed 5 for a hostname" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error, for Myrinet the number of processes " >> $jid.log + echo "must not exceed 5 for a hostname" >> $jid.log + echo " " >> $jid.log + fi + exit 1 + fi + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + echo $nprocd > ~/.gmpi/$jid.host + echo `hostname` $nprocd | $AWK \ +'BEGIN {iport[0] = 2; \ + iport[1] = 4; \ + iport[2] = 5; \ + iport[3] = 6; \ + iport[4] = 7 \ + } \ + {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ +' >> ~/.gmpi/$jid.host + host=~/.gmpi/$jid.host + else + numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` + echo `hostname` $numproc $execpath > $jid.host + + fi + fi # if test myrinet + + fi # if test $host + + fi # if test $nprocd -gt 1 + +fi # if test $program = $exefile -o $program = $prog.marc + +############################################################################## +# construct run stream (Marc only) # +############################################################################## + +# set maximum message length for ddm to a large number +# for vendor provided mpi +if test $itree -eq 0 -a $MPITYPE = hardware +then + itree=100000000 + if test $MACHINENAME = SGI + then + itree=100000001 + fi +fi +if test $itree -eq 0 -a $MPITYPE = hpmpi +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = myrinet +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = nec +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = scali +then + itree=100000000 +fi +if test $itree -eq 0 -a $MPITYPE = intelmpi +then + itree=100000000 +fi +if test $nprocdddm -lt 2 +then + nprocdarg= +else + nprocdarg="$nprocdarg $nprocdddm" +fi +if test $nsolver -eq 0 +then + nsolverarg= +else + nsolverarg="$nsolverarg $nsolver" +fi +if test $nprocdddm -lt 2 -a $nsolver -eq 0 +then +nprocd=0 +fi +if test $nprocd -gt 0 +then + if test "$host" + then + if test -z "$RUN_JOB2" + then + echo " " + echo "error: parallel job attempted on non-parallel version," + echo " or, if parallel version is installed, the include " + echo " file is probably corrupted" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error: parallel job attempted on non-parallel version," >> $jid.log + echo " or, if parallel version is installed, the include " >> $jid.log + echo " file is probably corrupted" >> $jid.log + echo " " >> $jid.log + fi + exit + fi + if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware + then + RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP + then + RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MPITYPE = "myrinet" + then + if test $MPIVERSION = "MPICH-GM1.2.1..7" + then + RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" + RUN_JOB=" -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + elif test $MACHINENAME = DEC -a $MPITYPE = hardware + then + RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + numhost=`uniq $jid.mfile | wc -l` + if test "$INTELMPI_VERSION" = "HYDRA" + then + RUN_JOB_TMP="$RUN_JOB2 -configfile $jid.cfile" + else + export I_MPI_JOB_CONTEXT=$$ + mpdboot -n $numhost -r $RSH -f $jid.mfile + RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" + fi + +# intelmpi uses configfile. format: +# -host host1 -n n1 executable marcargs +# one such line per host +# collect the marcargs in RUN_JOB and construct the config file later +# collect the run stream in RUN_JOB_TMP + RUN_JOB="-jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + + + elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" + then + RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ +$nprocdarg \ +$nsolverarg \ +-maxnum $MAXNUM -itree $itree \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + if test "$userhost" + then + RUN_JOB="$RUN_JOB -mhost $userhost" + fi + if test $MPITYPE = "scali" + then +# set default working directory to /tmp to allow +# different directory names + SCAMPI_WORKING_DIRECTORY=/tmp + export SCAMPI_WORKING_DIRECTORY + fi + else + if test -z "$RUN_JOB1" + then + echo " " + echo "error: parallel job attempted on non-parallel version," + echo " or, if parallel version is installed, the include " + echo " file is probably corrupted" + echo " " + if test "$deletelog" = no + then + echo " " >> $jid.log + echo "error: parallel job attempted on non-parallel version," >> $jid.log + echo " or, if parallel version is installed, the include " >> $jid.log + echo " file is probably corrupted" >> $jid.log + echo " " >> $jid.log + fi + exit + fi + RUNNPROCD=$nprocd + if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" + then + RUNNPROCD= + MP_PROCS=$nprocd + export MP_PROCS + fi + if test $MPITYPE = "myrinet" + then + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + echo " " > /dev/null + else + export I_MPI_JOB_CONTEXT=$$ + mpdboot -n 1 -f $jid.hosts + fi + RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ + $nprocdarg \ + $nsolverarg \ + -maxnum $MAXNUM -itree $itree \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi + fi +else + if test $nauto -gt 0 -o $ndcoup -gt 0 + then + RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ +-maxnum $MAXNUM \ + $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + else +# this is for a serial job without auto restart: + RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ +-maxnum $MAXNUM \ +$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " + fi +fi +if test "$rid" +then + RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" +fi +if test "$pid" +then + RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" +fi +if test "$sid" +then + RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" +fi +if test "$did" +then + RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" +fi +if test "$vid" +then + RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" +fi +if test $nauto -gt 0 +then + RUN_JOB="$RUN_JOB -autorst $nauto " +fi +if test $ndcoup -gt 0 +then + RUN_JOB="$RUN_JOB -dcoup $ndcoup " +fi +if test $ndytran -gt 0 +then + RUN_JOB="$RUN_JOB -dytran $ndytran " +fi +if test $mesh -gt 0 +then + RUN_JOB="$RUN_JOB -me $mesh " +fi +if test $noutcore -gt 0 +then + RUN_JOB="$RUN_JOB -outcore $noutcore " +fi +if test "$dllrun" -gt 0 +then + RUN_JOB="$RUN_JOB -dll $dllrun " +fi +if test "$trkrun" -gt 0 +then + RUN_JOB="$RUN_JOB -trk $trkrun " +fi +if test "$iam" +then + RUN_JOB="$RUN_JOB -iam $iam " +fi +if test "$justlist" +then + RUN_JOB="$RUN_JOB -list 1 " +fi +if test "$feature" +then + RUN_JOB="$RUN_JOB -feature $feature " +fi +if test "$memlimit" -ne 0 +then + RUN_JOB="$RUN_JOB -ml $memlimit " +fi +if test "$cpinput" +then + RUN_JOB="$RUN_JOB -ci $cpinput " +fi +if test "$cpresults" +then + RUN_JOB="$RUN_JOB -cr $cpresults " +fi +if test "$DIRSCR" != "$DIRJOB" +then + RUN_JOB="$RUN_JOB -dirscr $DIRSCR" +else + DIRSCR=$DIRJOB +fi +if test "$makebdf" +then + RUN_JOB="$RUN_JOB -bdf $makebdf " +fi +if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" +then + # append $RUN_JOB to all lines of the host file + # and set RUN_JOB + $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ + /bin/mv $host.$$ $host + RUN_JOB=$RUN_JOB_TMP +fi +if test $MPITYPE = "intelmpi" -a "$host" +then + # construct config file, append $RUN_JOB to all lines of the config file + # and set RUN_JOB + if test "$INTELMPI_VERSION" = "HYDRA" + then + grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ + '{if ( NF > 0) {\ + printf(" -host %s",$1); \ + printf(" -n %s",$2); \ + if ( NF == 2 ) printf(" %s",path);\ + if ( NF >= 3 ) printf(" -wdir %s ",$3); \ + if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ + printf(" %s\n",args); \ + }\ + }' > $jid.cfile + else + grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ + '{if ( NF > 0) {\ + printf("-host %s -n %s",$1,$2); \ + if ( NF == 2 ) printf(" %s",path);\ + if ( NF >= 3 ) printf(" -wdir %s ",$3); \ + if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ + printf(" %s\n",args); \ + }\ + }' > $jid.cfile + fi + RUN_JOB=$RUN_JOB_TMP +fi +echo " " +echo "Final run stream value" +echo " RUNJOB="$RUN_JOB +if test "$deletelog" = no +then +echo " " >> $jid.log +echo "Final run stream value" >> $jid.log +echo " RUNJOB="$RUN_JOB >> $jid.log +fi + + +############################################################################## +# run marc using valgrind # +############################################################################## +#RUN_JOB="valgrind $RUN_JOB" +#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" +#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" +#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" +############################################################################## + + +############################################################################## +# run the requested program in a queue # +############################################################################## + +if test "$deletelog" = yes +then + echo + date +else + echo >> $jid.log + date >> $jid.log +fi +if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] +then + +/bin/rm -f $jid.runmarcscript + + +# +# compile user subroutine if present +# +if test "$link" +then + if test -z "$FCOMPROOT"; then + echo "$0: No compiler available" + echo + echo " $PRODUCT Exit number 3" + exit 1 + fi + echo + echo "Using compiler from: $FCOMPROOT" + echo + if test "$user" + then + userobj=$DIRJOB/`$BASENAME $user .f`.o + basefile=`$BASENAME $usersubname` + if test ${basefile##*.} = f + then + usersub=$DIRJOB/`$BASENAME $user .f`.F + ln -sf "$user.f" "$usersub" + else + usersub=$usersubname + fi + + fi + cat > $jid.runmarcscript << END4 + if test "$user" + then + if test ${basefile##*.} = f + then + ln -sf "$user.f" "$usersub" + fi + if test $MACHINENAME = "CRAY" + then + $FORTRAN $usersub || \ + { + echo "$0: compile failed for $user.f" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $FORTRAN $usersub -o $userobj || \ + { + echo "$0: compile failed for $user.f" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + if test ${basefile##*.} = f + then + /bin/rm -f "$usersub" + fi + fi + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + $SOLVERLIBS \ + $MARCCUDALIBS \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $SYSLIBS \ + $SFLIB \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 + } +END4 +else + prgsav=yes +fi +/bin/rm $userobj 2>/dev/null + +# +# run marc +# + +cat >> $jid.runmarcscript << END5 + +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi + +# first remove all .out files and incremental restart files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test \$numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null + numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null + /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null +fi + +if test $nprocdddm -gt 1 +then + $RUN_JOB 2>>$jid.log +else + $RUN_JOB 2>>$jid.log +fi + +if test $dllrun -eq 0; then + if test $prgsav = no + then + /bin/rm -f $bd$program 2>/dev/null + fi +else + if test $cpdll = yes; then + filename=`basename $usersubname .f` + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes + then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi + +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test \$numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null +fi +END5 + + +# Submit to marc batch queue +# +if [ $qid = at ] +then +QUENAME=at +SUBMCMD= +else +# +# Submit to qsub queue +# +QUENAME=qsub +SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" +if test "$priority" +then + SUBMCMD=$SUBMCMD" -p $priority" +fi +if test "$att" +then + SUBMCMD=$SUBMCMD" -a $att" +fi +if test "$cpu" +then + SUBMCMD=$SUBMCMD" -lt $cpu" +fi + +fi +echo $QUENAME $SUBMCMD +#cat $jid.runmarcscript +$QUENAME $SUBMCMD < $jid.runmarcscript + +/bin/rm -f $jid.runmarcscript + +############################################################################## +# run the requested program in the background # +############################################################################## + +else +if test $qid = background +then + +# +# first remove all old .out files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null +fi +# +# compile user subroutine if present +# +( +if test "$link" +then + if test -z "$FCOMPROOT"; then + echo "$0: No compiler available" + echo + echo " $PRODUCT Exit number 3" + exit 1 + fi + echo + echo "Using compiler from: $FCOMPROOT" + echo + if test "$user" + then + # compile and link on other hosts in $host if compstatus=no + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${compstatus[$counter]} = "no" + then + DIR1=$DIRJOB + DIR2=$DIR + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + marcdir=`echo $line | $AWK '{print $4}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -n "$marcdir" + then + DIR2=$marcdir + fi + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then + $RCP $user.f $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" + then + hname=_$ibase + else + hname= + fi + remoteprog=$DIR1/${execname}$hname + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo + $RSH $i $DIR2/tools/comp_user $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else + echo "$0: compile failed for $user.f on host $i" + echo " $PRODUCT Exit number 3" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $remoteuser.f 2> /dev/null + fi + fi + fi + done + fi + fi + if test "$userhost" + then + echo + echo "Compiling and linking user subroutine $user.f on host `hostname`" + fi + userobj=$DIRJOB/`$BASENAME $user .f`.o + basefile=`$BASENAME $usersubname` + if test ${basefile##*.} = f + then + usersub=$DIRJOB/`$BASENAME $user .f`.F + ln -sf "$user.f" "$usersub" + else + usersub=$usersubname + fi + if test $MACHINENAME = "CRAY" + then + $FORTRAN $usersub || \ + { + echo "$0: compile failed for $user.f" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $FORTRAN $usersub -o $userobj || \ + { + echo "$0: compile failed for $user.f" + echo " $PRODUCT Exit number 3" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + if test ${basefile##*.} = f + then + /bin/rm -f "$usersub" + fi + fi # if test $user + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $SYSLIBS \ + $SFLIB \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + echo " $PRODUCT Exit number 3" + exit 1 + } + # copy user subroutine executable for hosts using local working dir + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" + then + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + echo "Copying executable to host ${i}" + $RCP $program ${i}:${DIR1}/ + fi + fi + done + fi + fi +else # if test $link + prgsav=yes +fi # if test $link +/bin/rm $userobj 2>/dev/null + +# +# run marc + +# + +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi + +# for DDM with ARC support + +if test $ddm_arc -gt 0; then + RUN_JOB="$MESHERDIR/sf_exeddm $RUN_JOB -ddm $ddm_arc " +fi + + +$RUN_JOB & + +marcpid=$! +echo $marcpid > $DIRJOB/$jid.pid +wait $marcpid + +if test $nprocd -gt 1 +then + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + if test "$host" + then + /bin/rm $jid.mfile 2> /dev/null + /bin/rm $jid.hosts 2> /dev/null + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.cfile 2> /dev/null + fi + fi + fi +fi + + +if test $dllrun -eq 0; then +if test $prgsav = no +then + /bin/rm -f $bd$program 2>/dev/null + # for network run, remove executable on remote machines + # and executables with modified name + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + if test -f "$host_filt" + then + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + # if an incompatible host uses shared directory, + # then the root machine deletes the executable + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + hname=_$ibase + /bin/rm ${execname}$hname + fi + # if local directory used, the remote machine + # deletes the executable + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null + fi + fi + done + fi + fi + fi +fi +else +#dllrun >0 + if test $cpdll = yes; then + filename=`basename $usersubname .f` + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sin 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + if test $MPITYPE = "myrinet" + then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi + fi +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + /bin/rm $DIRJOB/$jid.sle 2>/dev/null + /bin/rm $DIRJOB/$jid.sin 2>/dev/null +fi +) 1>>$jid.log 2>&1 & + + +############################################################################## +# run the requested program in the foreground # +############################################################################## + +else + +# +# compile user subroutine if present +# +if test "$link" +then + if test -z "$FCOMPROOT"; then + echo "$0: No compiler available" + echo + echo " $PRODUCT Exit number 3" + exit 1 + fi + echo + echo "Using compiler from: $FCOMPROOT" + echo + if test "$user" + then + # compile and link on other hosts in $host if compstatus=no + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${compstatus[$counter]} = "no" + then + DIR1=$DIRJOB + DIR2=$DIR + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + marcdir=`echo $line | $AWK '{print $4}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + if test -n "$marcdir" + then + DIR2=$marcdir + fi + # first copy over the user sub if local directories + if test ${dirstatus[$counter]} = "local" + then + $RCP $user.f $i:$DIR1/ + fi + # do the compilation on the other machine + if test ${dirstatus[$counter]} = "shared" + then + hname=_$ibase + else + hname= + fi + remoteprog=$DIR1/${execname}$hname + remoteuser=$DIR1/`$BASENAME $user` + $RSH $i /bin/rm $remoteprog 2> /dev/null + echo + $RSH $i $DIR2/tools/comp_user $DIR2 $DIR1 $remoteuser $remoteprog + # check if successful, the new executable should be there + line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` + if test "$line" + then + echo compilation and linking successful on host $i + else + echo "$0: compile failed for $user.f on host $i" + exit 1 + fi + # remove the user subroutine on remote machine + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $remoteuser.f 2> /dev/null + fi + fi + fi + done + fi + fi + if test "$userhost" + then + echo + echo "Compiling and linking user subroutine $user.f on host `hostname`" + fi + userobj=$DIRJOB/`$BASENAME $user .f`.o + basefile=`$BASENAME $usersubname` + if test ${basefile##*.} = f + then + usersub=$DIRJOB/`$BASENAME $user .f`.F + ln -sf "$user.f" "$usersub" + else + usersub=$usersubname + fi + if test $MACHINENAME = "CRAY" + then + $FORTRAN $usersub || \ + { + echo "$0: compile failed for $user.f" + exit 1 + } + /bin/rm $program 2>/dev/null + else + $FORTRAN $usersub -o $userobj || \ + { + echo "$0: compile failed for $user.f" + exit 1 + } + /bin/rm $program 2>/dev/null + fi + if test ${basefile##*.} = f + then + /bin/rm -f "$usersub" + fi + fi # if test $user + + + $LOAD $bd${program} $MARC_LIB/main.o \ + $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ + ${userobj-} \ + $objs \ + $MARC_LIB/srclib.a \ + $MNFLIBS \ + $MDUSER \ + ${MUMPSSOLVERLIBS} \ + $MDSRCLIB \ + $MARC_LIB/mcvfit.a \ + $STUBS \ + ${SOLVERLIBS} \ + ${MARCCUDALIBS} \ + $TKLIBS \ + $MRCLIBS \ + $METISLIBS \ + $SYSLIBS \ + $SFLIB \ + $SECLIBS || \ + { + echo "$0: link failed for ${user:+$userobj }$objs" + exit 1 + } + # copy user subroutine executable for hosts using local working dir + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" + then + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + echo "Copying executable to host ${i}" + $RCP $program ${i}:${DIR1}/ + fi + fi + done + fi + fi +else # if test $link + prgsav=yes +fi # if test $link +/bin/rm $userobj 2>/dev/null + +# done if no job id given +if test -z "$jid" +then + echo + echo only compilation requested + echo + exit +fi +# +# run marc +# +# Define share library path based on platforms +# This is required for using the Patran Mesher +if test $MACHINENAME = "IBM" +then + LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH + export LIBPATH +fi +# first remove all .out files +# the ones for ddm are removed in the code +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null + /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done +else + /bin/rm $DIRJOB/$jid.out 2>/dev/null +fi + +# for DDM with ARC support + +if test $ddm_arc -gt 0; then + RUN_JOB="$MESHERDIR/sf_exeddm $RUN_JOB -ddm $ddm_arc " +fi + +$RUN_JOB + +if test $nprocd -gt 1 +then + if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" + then + if test "$INTELMPI_VERSION" = "HYDRA" + then + if test "$host" + then + /bin/rm $jid.mfile 2> /dev/null + /bin/rm $jid.hosts 2> /dev/null + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.cfile 2> /dev/null + else + echo " " > /dev/null + fi + else + if test "$host" + then + mpdcleanup -a -f $jid.mfile + /bin/rm $jid.host 2> /dev/null + /bin/rm $jid.mfile 2> /dev/null + else + mpdcleanup -a -f $jid.hosts + /bin/rm $jid.hosts 2> /dev/null + fi + fi + fi +fi + +if test $dllrun -eq 0; then +if test $prgsav = no +then + /bin/rm -f $bd$program 2>/dev/null + # for network run, remove executable on remote machines + # and executables with modified name + if test $nprocd -gt 1 + then + if test "$userhost" + then + counter=0 + if test -f "$host_filt" + then + for i in `$AWK -v n=$numfield '{print $n}' $host_filt` + do + ibase=${i%%.*} + if test $ibase != $thishost + then + counter=$((counter+1)) + DIR1=$DIRJOB + line=`grep -v '^#' $userhost | grep "^$ibase "` + workdir=`echo $line | $AWK '{print $3}'` + if test -n "$workdir" + then + DIR1=$workdir + fi + # if an incompatible host uses shared directory, + # then the root machine deletes the executable + if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" + then + hname=_$ibase + /bin/rm ${execname}$hname + fi + # if local directory used, the remote machine + # deletes the executable + if test ${dirstatus[$counter]} = "local" + then + $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null + fi + fi + done + fi + fi + fi +fi +else +#dllrun >0 + if test $cpdll = yes; then + filename=`basename $usersubname .f` + /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null + fi + if test $rmdll = yes;then + /bin/rm -f $DIRJOB/$marcdll 2>/dev/null + fi +fi + +if test $nprocdddm -gt 1 +then + numdom=$nprocdddm + while test $numdom -gt 0 + do + /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sle 2>/dev/null + /bin/rm $DIRSCR/$numdom$jid.sin 2>/dev/null + numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` + done + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + if test $MPITYPE = "myrinet" + then + if test -f "$host_filt" + then + /bin/rm $host_filt + fi + fi +else + /bin/rm $DIRSCR/$jid.t02 2>/dev/null + /bin/rm $DIRSCR/$jid.t03 2>/dev/null + /bin/rm $DIRSCR/$jid.t11 2>/dev/null + /bin/rm $DIRSCR/$jid.t12 2>/dev/null + /bin/rm $DIRSCR/$jid.t13 2>/dev/null + /bin/rm $DIRSCR/$jid.t14 2>/dev/null + /bin/rm $DIRSCR/$jid.t15 2>/dev/null + /bin/rm $DIRSCR/$jid.t22 2>/dev/null + /bin/rm $DIRSCR/$jid.t23 2>/dev/null + /bin/rm $DIRSCR/$jid.t32 2>/dev/null + /bin/rm $DIRSCR/$jid.t33 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null + /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null + /bin/rm $DIRSCR/$jid.t84 2>/dev/null + /bin/rm $DIRJOB/$jid.pid 2>/dev/null + /bin/rm $DIRJOB/$jid.sle 2>/dev/null + /bin/rm $DIRJOB/$jid.sin 2>/dev/null +fi + + +fi +fi diff --git a/installation/mods_MarcMentat/2016/Mentat_bin/edit_window b/installation/mods_MarcMentat/2016/Mentat_bin/edit_window new file mode 100644 index 000000000..b732a7694 --- /dev/null +++ b/installation/mods_MarcMentat/2016/Mentat_bin/edit_window @@ -0,0 +1,5 @@ +#!/bin/sh +# This script opens a window running an editor. +# The command to invoke the editor is specified during DAMASK installation + +%EDITOR% $* \ No newline at end of file diff --git a/installation/mods_MarcMentat/2016/Mentat_bin/edit_window.original b/installation/mods_MarcMentat/2016/Mentat_bin/edit_window.original new file mode 100644 index 000000000..64c0a68d0 --- /dev/null +++ b/installation/mods_MarcMentat/2016/Mentat_bin/edit_window.original @@ -0,0 +1,18 @@ +#!/bin/sh +# This script opens a window running an editor. The default window is an +# xterm, and the default editor is vi. These may be customized. + +dir= +for d in /usr/bin /usr/bin/X11; do + if test -x "$d/xterm"; then + dir="$d" + break + fi +done + +if test -z "$dir"; then + echo "$0: Could not find xterm" + exit 1 +fi + +"$dir/xterm" -T "vi $*" -n "vi $*" -e vi $* diff --git a/installation/mods_MarcMentat/2016/Mentat_bin/kill1.original b/installation/mods_MarcMentat/2016/Mentat_bin/kill1.original new file mode 100644 index 000000000..6d1ff84bf --- /dev/null +++ b/installation/mods_MarcMentat/2016/Mentat_bin/kill1.original @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ "$1" = "" ]; then + echo "usage: $0 job_name" + exit 1 +fi + +echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2016/Mentat_bin/kill4 b/installation/mods_MarcMentat/2016/Mentat_bin/kill4 new file mode 100644 index 000000000..6d1ff84bf --- /dev/null +++ b/installation/mods_MarcMentat/2016/Mentat_bin/kill4 @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ "$1" = "" ]; then + echo "usage: $0 job_name" + exit 1 +fi + +echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2016/Mentat_bin/kill5 b/installation/mods_MarcMentat/2016/Mentat_bin/kill5 new file mode 100644 index 000000000..6d1ff84bf --- /dev/null +++ b/installation/mods_MarcMentat/2016/Mentat_bin/kill5 @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ "$1" = "" ]; then + echo "usage: $0 job_name" + exit 1 +fi + +echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2016/Mentat_bin/kill6 b/installation/mods_MarcMentat/2016/Mentat_bin/kill6 new file mode 100644 index 000000000..6d1ff84bf --- /dev/null +++ b/installation/mods_MarcMentat/2016/Mentat_bin/kill6 @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ "$1" = "" ]; then + echo "usage: $0 job_name" + exit 1 +fi + +echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2016/Mentat_bin/kill7 b/installation/mods_MarcMentat/2016/Mentat_bin/kill7 new file mode 100644 index 000000000..6d1ff84bf --- /dev/null +++ b/installation/mods_MarcMentat/2016/Mentat_bin/kill7 @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ "$1" = "" ]; then + echo "usage: $0 job_name" + exit 1 +fi + +echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2016/Mentat_bin/kill8 b/installation/mods_MarcMentat/2016/Mentat_bin/kill8 new file mode 100644 index 000000000..6d1ff84bf --- /dev/null +++ b/installation/mods_MarcMentat/2016/Mentat_bin/kill8 @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ "$1" = "" ]; then + echo "usage: $0 job_name" + exit 1 +fi + +echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2016/Mentat_bin/kill9 b/installation/mods_MarcMentat/2016/Mentat_bin/kill9 new file mode 100644 index 000000000..6d1ff84bf --- /dev/null +++ b/installation/mods_MarcMentat/2016/Mentat_bin/kill9 @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ "$1" = "" ]; then + echo "usage: $0 job_name" + exit 1 +fi + +echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2016/Mentat_bin/submit1.original b/installation/mods_MarcMentat/2016/Mentat_bin/submit1.original new file mode 100644 index 000000000..56e2557b7 --- /dev/null +++ b/installation/mods_MarcMentat/2016/Mentat_bin/submit1.original @@ -0,0 +1,186 @@ +#!/bin/sh +# +# The exit status of this script is read by Mentat. +# Normal exit status is 0. +# + +DIR=/msc/marc2016 +if test $MARCDIR1 +then + DIR=$MARCDIR1 +fi + +if test -z "$DIR"; then + REALCOM="`ls -l $0 |awk '{ print $NF; }'`" + DIRSCRIPT=`dirname $REALCOM` + case $DIRSCRIPT in + \/*) + ;; + *) + DIRSCRIPT=`pwd`/$DIRSCRIPT + ;; + esac + . $DIRSCRIPT/getarch + + DIR="$MENTAT_MARCDIR" +fi + +SRCEXT=.f +SRCEXTC=.F +RSTEXT=.t08 +PSTEXT=.t19 +PSTEXTB=.t16 +VWFCEXT=.vfs + +slv=$1 +version=$2 +ndom_fea_solver=$3 +ndom_preprocessor=$4 +hostfile=$5 +compat=$6 +job=$7 +srcfile=$8 +srcmeth=$9 +shift 9 # cannot use $10, $11, ... +restart=$1 +postfile=$2 +viewfactorsfile=$3 +autorst=$4 +copy_datfile="-ci $5" +copy_postfile="-cr $6" +scr_dir=$7 +dcoup=$8 +assem_recov_nthread=$9 +shift 9 # cannot use $10, $11, ... +nthread=$1 +nsolver=$2 +mode=$3 +gpu=$4 + +if [ "$slv" != "" -a "$slv" != "marc" ]; then + slv="-iam sfm" +else + slv="" +fi + +if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then + nprocds="-nprocds $ndom_fea_solver" +else + nprocd="" + if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then + nprocd="-nprocd $ndom_preprocessor" + else + nprocd="" + fi +fi + +if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then + srcfile=`echo $srcfile | sed "s/$SRCEXT$//" | sed "s/$SRCEXTC$//"` + case "$srcmeth" in + -) + srcfile="-u $srcfile" + ;; + compsave) + srcfile="-u $srcfile -save y" + ;; + runsaved) + srcfile="-prog $srcfile" + ;; + esac +else + srcfile="" +fi + +if [ "$restart" != "" -a "$restart" != "-" ]; then + restart=`echo $restart | sed "s/$RSTEXT$//"` + restart="-r $restart" +else + restart="" +fi + +if [ "$postfile" != "" -a "$postfile" != "-" ]; then + postfile=`echo $postfile | sed "s/$PSTEXT$//"` + postfile=`echo $postfile | sed "s/$PSTEXTB$//"` + postfile="-pid $postfile" +else + postfile="" +fi + +if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then + viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` + viewfactorsfile="-vf $viewfactorsfile" +else + viewfactorsfile="" +fi + +if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then + hostfile="-ho $hostfile" +else + hostfile="" +fi + +if [ "$compat" != "" -a "$compat" != "-" ]; then + compat="-co $compat" +else + compat="" +fi + +if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then + scr_dir="-sd $scr_dir" +else + scr_dir="" +fi + +if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then + dcoup="-dcoup $dcoup" +else + dcoup="" +fi + +if [ "$assem_recov_nthread" != "" -a "$assem_recov_nthread" != "1" ]; then + assem_recov_nthread="-nthread_elem $assem_recov_nthread" +else + assem_recov_nthread="" +fi + +if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then + nthread="-nthread $nthread" +else + nthread="" +fi + +if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then + nsolver="-nsolver $nsolver" +else + nsolver="" +fi + +case "$mode" in + 4) mode="-mo i4" ;; + 8) mode="-mo i8" ;; + *) mode= ;; +esac + +if [ "$gpu" != "" -a "$gpu" != "-" ]; then + gpu="-gpu $gpu" +else + gpu="" +fi + +rm -f $job.cnt +rm -f $job.sts +rm -f $job.out +rm -f $job.log + +# To prevent a mismatch with the python version used by the solver +# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH +# unset environment variables PYTHONHOME and PYTHONPATH +unset PYTHONHOME +unset PYTHONPATH + +"${DIR}/tools/run_marc" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ + $srcfile $restart $postfile $viewfactorsfile $hostfile \ + $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ + $assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1 +sleep 1 +exit 0 diff --git a/installation/mods_MarcMentat/2016/Mentat_bin/submit4 b/installation/mods_MarcMentat/2016/Mentat_bin/submit4 new file mode 100644 index 000000000..f25a2004e --- /dev/null +++ b/installation/mods_MarcMentat/2016/Mentat_bin/submit4 @@ -0,0 +1,187 @@ +#!/bin/sh +# +# The exit status of this script is read by Mentat. +# Normal exit status is 0. +# + +DIR=%INSTALLDIR%/marc%VERSION% +if test $MARCDIR1 +then + DIR=$MARCDIR1 +fi + +if test -z "$DIR"; then + REALCOM="`ls -l $0 |awk '{ print $NF; }'`" + DIRSCRIPT=`dirname $REALCOM` + case $DIRSCRIPT in + \/*) + ;; + *) + DIRSCRIPT=`pwd`/$DIRSCRIPT + ;; + esac + . $DIRSCRIPT/getarch + + DIR="$MENTAT_MARCDIR" +fi + +SRCEXT=.f +SRCEXTC=.F +RSTEXT=.t08 +PSTEXT=.t19 +PSTEXTB=.t16 +VWFCEXT=.vfs + +slv=$1 +version=$2 +ndom_fea_solver=$3 +ndom_preprocessor=$4 +hostfile=$5 +compat=$6 +job=$7 +srcfile=$8 +srcmeth=$9 +shift 9 # cannot use $10, $11, ... +restart=$1 +postfile=$2 +viewfactorsfile=$3 +autorst=$4 +copy_datfile="-ci $5" +copy_postfile="-cr $6" +scr_dir=$7 +dcoup=$8 +assem_recov_nthread=$9 +shift 9 # cannot use $10, $11, ... +nthread=$1 +nsolver=$2 +mode=$3 +gpu=$4 + +if [ "$slv" != "" -a "$slv" != "marc" ]; then + slv="-iam sfm" +else + slv="" +fi + +if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then + nprocds="-nprocds $ndom_fea_solver" +else + nprocd="" + if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then + nprocd="-nprocd $ndom_preprocessor" + else + nprocd="" + fi +fi + +if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then + srcfile=`echo $srcfile | sed "s/$SRCEXT$//" | sed "s/$SRCEXTC$//"` + case "$srcmeth" in + -) + srcfile="-u $srcfile" + ;; + compsave) + srcfile="-u $srcfile -save y" + ;; + runsaved) + srcfile=${srcfile%.*}".marc" + srcfile="-prog $srcfile" + ;; + esac +else + srcfile="" +fi + +if [ "$restart" != "" -a "$restart" != "-" ]; then + restart=`echo $restart | sed "s/$RSTEXT$//"` + restart="-r $restart" +else + restart="" +fi + +if [ "$postfile" != "" -a "$postfile" != "-" ]; then + postfile=`echo $postfile | sed "s/$PSTEXT$//"` + postfile=`echo $postfile | sed "s/$PSTEXTB$//"` + postfile="-pid $postfile" +else + postfile="" +fi + +if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then + viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` + viewfactorsfile="-vf $viewfactorsfile" +else + viewfactorsfile="" +fi + +if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then + hostfile="-ho $hostfile" +else + hostfile="" +fi + +if [ "$compat" != "" -a "$compat" != "-" ]; then + compat="-co $compat" +else + compat="" +fi + +if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then + scr_dir="-sd $scr_dir" +else + scr_dir="" +fi + +if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then + dcoup="-dcoup $dcoup" +else + dcoup="" +fi + +if [ "$assem_recov_nthread" != "" -a "$assem_recov_nthread" != "1" ]; then + assem_recov_nthread="-nthread_elem $assem_recov_nthread" +else + assem_recov_nthread="" +fi + +if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then + nthread="-nthread $nthread" +else + nthread="" +fi + +if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then + nsolver="-nsolver $nsolver" +else + nsolver="" +fi + +case "$mode" in + 4) mode="-mo i4" ;; + 8) mode="-mo i8" ;; + *) mode= ;; +esac + +if [ "$gpu" != "" -a "$gpu" != "-" ]; then + gpu="-gpu $gpu" +else + gpu="" +fi + +rm -f $job.cnt +rm -f $job.sts +rm -f $job.out +rm -f $job.log + +# To prevent a mismatch with the python version used by the solver +# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH +# unset environment variables PYTHONHOME and PYTHONPATH +unset PYTHONHOME +unset PYTHONPATH + +"${DIR}/tools/run_damask_hmp" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ + $srcfile $restart $postfile $viewfactorsfile $hostfile \ + $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ + $assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1 +sleep 1 +exit 0 diff --git a/installation/mods_MarcMentat/2016/Mentat_bin/submit5 b/installation/mods_MarcMentat/2016/Mentat_bin/submit5 new file mode 100644 index 000000000..786f6efc5 --- /dev/null +++ b/installation/mods_MarcMentat/2016/Mentat_bin/submit5 @@ -0,0 +1,187 @@ +#!/bin/sh +# +# The exit status of this script is read by Mentat. +# Normal exit status is 0. +# + +DIR=%INSTALLDIR%/marc%VERSION% +if test $MARCDIR1 +then + DIR=$MARCDIR1 +fi + +if test -z "$DIR"; then + REALCOM="`ls -l $0 |awk '{ print $NF; }'`" + DIRSCRIPT=`dirname $REALCOM` + case $DIRSCRIPT in + \/*) + ;; + *) + DIRSCRIPT=`pwd`/$DIRSCRIPT + ;; + esac + . $DIRSCRIPT/getarch + + DIR="$MENTAT_MARCDIR" +fi + +SRCEXT=.f +SRCEXTC=.F +RSTEXT=.t08 +PSTEXT=.t19 +PSTEXTB=.t16 +VWFCEXT=.vfs + +slv=$1 +version=$2 +ndom_fea_solver=$3 +ndom_preprocessor=$4 +hostfile=$5 +compat=$6 +job=$7 +srcfile=$8 +srcmeth=$9 +shift 9 # cannot use $10, $11, ... +restart=$1 +postfile=$2 +viewfactorsfile=$3 +autorst=$4 +copy_datfile="-ci $5" +copy_postfile="-cr $6" +scr_dir=$7 +dcoup=$8 +assem_recov_nthread=$9 +shift 9 # cannot use $10, $11, ... +nthread=$1 +nsolver=$2 +mode=$3 +gpu=$4 + +if [ "$slv" != "" -a "$slv" != "marc" ]; then + slv="-iam sfm" +else + slv="" +fi + +if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then + nprocds="-nprocds $ndom_fea_solver" +else + nprocd="" + if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then + nprocd="-nprocd $ndom_preprocessor" + else + nprocd="" + fi +fi + +if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then + srcfile=`echo $srcfile | sed "s/$SRCEXT$//" | sed "s/$SRCEXTC$//"` + case "$srcmeth" in + -) + srcfile="-u $srcfile" + ;; + compsave) + srcfile="-u $srcfile -save y" + ;; + runsaved) + srcfile=${srcfile%.*}".marc" + srcfile="-prog $srcfile" + ;; + esac +else + srcfile="" +fi + +if [ "$restart" != "" -a "$restart" != "-" ]; then + restart=`echo $restart | sed "s/$RSTEXT$//"` + restart="-r $restart" +else + restart="" +fi + +if [ "$postfile" != "" -a "$postfile" != "-" ]; then + postfile=`echo $postfile | sed "s/$PSTEXT$//"` + postfile=`echo $postfile | sed "s/$PSTEXTB$//"` + postfile="-pid $postfile" +else + postfile="" +fi + +if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then + viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` + viewfactorsfile="-vf $viewfactorsfile" +else + viewfactorsfile="" +fi + +if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then + hostfile="-ho $hostfile" +else + hostfile="" +fi + +if [ "$compat" != "" -a "$compat" != "-" ]; then + compat="-co $compat" +else + compat="" +fi + +if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then + scr_dir="-sd $scr_dir" +else + scr_dir="" +fi + +if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then + dcoup="-dcoup $dcoup" +else + dcoup="" +fi + +if [ "$assem_recov_nthread" != "" -a "$assem_recov_nthread" != "1" ]; then + assem_recov_nthread="-nthread_elem $assem_recov_nthread" +else + assem_recov_nthread="" +fi + +if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then + nthread="-nthread $nthread" +else + nthread="" +fi + +if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then + nsolver="-nsolver $nsolver" +else + nsolver="" +fi + +case "$mode" in + 4) mode="-mo i4" ;; + 8) mode="-mo i8" ;; + *) mode= ;; +esac + +if [ "$gpu" != "" -a "$gpu" != "-" ]; then + gpu="-gpu $gpu" +else + gpu="" +fi + +rm -f $job.cnt +rm -f $job.sts +rm -f $job.out +rm -f $job.log + +# To prevent a mismatch with the python version used by the solver +# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH +# unset environment variables PYTHONHOME and PYTHONPATH +unset PYTHONHOME +unset PYTHONPATH + +"${DIR}/tools/run_damask_mp" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ + $srcfile $restart $postfile $viewfactorsfile $hostfile \ + $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ + $assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1 +sleep 1 +exit 0 diff --git a/installation/mods_MarcMentat/2016/Mentat_bin/submit6 b/installation/mods_MarcMentat/2016/Mentat_bin/submit6 new file mode 100644 index 000000000..6a5d9d79f --- /dev/null +++ b/installation/mods_MarcMentat/2016/Mentat_bin/submit6 @@ -0,0 +1,187 @@ +#!/bin/sh +# +# The exit status of this script is read by Mentat. +# Normal exit status is 0. +# + +DIR=%INSTALLDIR%/marc%VERSION% +if test $MARCDIR1 +then + DIR=$MARCDIR1 +fi + +if test -z "$DIR"; then + REALCOM="`ls -l $0 |awk '{ print $NF; }'`" + DIRSCRIPT=`dirname $REALCOM` + case $DIRSCRIPT in + \/*) + ;; + *) + DIRSCRIPT=`pwd`/$DIRSCRIPT + ;; + esac + . $DIRSCRIPT/getarch + + DIR="$MENTAT_MARCDIR" +fi + +SRCEXT=.f +SRCEXTC=.F +RSTEXT=.t08 +PSTEXT=.t19 +PSTEXTB=.t16 +VWFCEXT=.vfs + +slv=$1 +version=$2 +ndom_fea_solver=$3 +ndom_preprocessor=$4 +hostfile=$5 +compat=$6 +job=$7 +srcfile=$8 +srcmeth=$9 +shift 9 # cannot use $10, $11, ... +restart=$1 +postfile=$2 +viewfactorsfile=$3 +autorst=$4 +copy_datfile="-ci $5" +copy_postfile="-cr $6" +scr_dir=$7 +dcoup=$8 +assem_recov_nthread=$9 +shift 9 # cannot use $10, $11, ... +nthread=$1 +nsolver=$2 +mode=$3 +gpu=$4 + +if [ "$slv" != "" -a "$slv" != "marc" ]; then + slv="-iam sfm" +else + slv="" +fi + +if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then + nprocds="-nprocds $ndom_fea_solver" +else + nprocd="" + if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then + nprocd="-nprocd $ndom_preprocessor" + else + nprocd="" + fi +fi + +if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then + srcfile=`echo $srcfile | sed "s/$SRCEXT$//" | sed "s/$SRCEXTC$//"` + case "$srcmeth" in + -) + srcfile="-u $srcfile" + ;; + compsave) + srcfile="-u $srcfile -save y" + ;; + runsaved) + srcfile=${srcfile%.*}".marc" + srcfile="-prog $srcfile" + ;; + esac +else + srcfile="" +fi + +if [ "$restart" != "" -a "$restart" != "-" ]; then + restart=`echo $restart | sed "s/$RSTEXT$//"` + restart="-r $restart" +else + restart="" +fi + +if [ "$postfile" != "" -a "$postfile" != "-" ]; then + postfile=`echo $postfile | sed "s/$PSTEXT$//"` + postfile=`echo $postfile | sed "s/$PSTEXTB$//"` + postfile="-pid $postfile" +else + postfile="" +fi + +if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then + viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` + viewfactorsfile="-vf $viewfactorsfile" +else + viewfactorsfile="" +fi + +if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then + hostfile="-ho $hostfile" +else + hostfile="" +fi + +if [ "$compat" != "" -a "$compat" != "-" ]; then + compat="-co $compat" +else + compat="" +fi + +if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then + scr_dir="-sd $scr_dir" +else + scr_dir="" +fi + +if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then + dcoup="-dcoup $dcoup" +else + dcoup="" +fi + +if [ "$assem_recov_nthread" != "" -a "$assem_recov_nthread" != "1" ]; then + assem_recov_nthread="-nthread_elem $assem_recov_nthread" +else + assem_recov_nthread="" +fi + +if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then + nthread="-nthread $nthread" +else + nthread="" +fi + +if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then + nsolver="-nsolver $nsolver" +else + nsolver="" +fi + +case "$mode" in + 4) mode="-mo i4" ;; + 8) mode="-mo i8" ;; + *) mode= ;; +esac + +if [ "$gpu" != "" -a "$gpu" != "-" ]; then + gpu="-gpu $gpu" +else + gpu="" +fi + +rm -f $job.cnt +rm -f $job.sts +rm -f $job.out +rm -f $job.log + +# To prevent a mismatch with the python version used by the solver +# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH +# unset environment variables PYTHONHOME and PYTHONPATH +unset PYTHONHOME +unset PYTHONPATH + +"${DIR}/tools/run_damask_lmp" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ + $srcfile $restart $postfile $viewfactorsfile $hostfile \ + $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ + $assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1 +sleep 1 +exit 0 diff --git a/installation/mods_MarcMentat/2016/Mentat_bin/submit7 b/installation/mods_MarcMentat/2016/Mentat_bin/submit7 new file mode 100644 index 000000000..d0e3be475 --- /dev/null +++ b/installation/mods_MarcMentat/2016/Mentat_bin/submit7 @@ -0,0 +1,187 @@ +#!/bin/sh +# +# The exit status of this script is read by Mentat. +# Normal exit status is 0. +# + +DIR=%INSTALLDIR%/marc%VERSION% +if test $MARCDIR1 +then + DIR=$MARCDIR1 +fi + +if test -z "$DIR"; then + REALCOM="`ls -l $0 |awk '{ print $NF; }'`" + DIRSCRIPT=`dirname $REALCOM` + case $DIRSCRIPT in + \/*) + ;; + *) + DIRSCRIPT=`pwd`/$DIRSCRIPT + ;; + esac + . $DIRSCRIPT/getarch + + DIR="$MENTAT_MARCDIR" +fi + +SRCEXT=.f +SRCEXTC=.F +RSTEXT=.t08 +PSTEXT=.t19 +PSTEXTB=.t16 +VWFCEXT=.vfs + +slv=$1 +version=$2 +ndom_fea_solver=$3 +ndom_preprocessor=$4 +hostfile=$5 +compat=$6 +job=$7 +srcfile=$8 +srcmeth=$9 +shift 9 # cannot use $10, $11, ... +restart=$1 +postfile=$2 +viewfactorsfile=$3 +autorst=$4 +copy_datfile="-ci $5" +copy_postfile="-cr $6" +scr_dir=$7 +dcoup=$8 +assem_recov_nthread=$9 +shift 9 # cannot use $10, $11, ... +nthread=$1 +nsolver=$2 +mode=$3 +gpu=$4 + +if [ "$slv" != "" -a "$slv" != "marc" ]; then + slv="-iam sfm" +else + slv="" +fi + +if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then + nprocds="-nprocds $ndom_fea_solver" +else + nprocd="" + if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then + nprocd="-nprocd $ndom_preprocessor" + else + nprocd="" + fi +fi + +if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then + srcfile=`echo $srcfile | sed "s/$SRCEXT$//" | sed "s/$SRCEXTC$//"` + case "$srcmeth" in + -) + srcfile="-u $srcfile" + ;; + compsave) + srcfile="-u $srcfile -save y" + ;; + runsaved) + srcfile=${srcfile%.*}".marc" + srcfile="-prog $srcfile" + ;; + esac +else + srcfile="" +fi + +if [ "$restart" != "" -a "$restart" != "-" ]; then + restart=`echo $restart | sed "s/$RSTEXT$//"` + restart="-r $restart" +else + restart="" +fi + +if [ "$postfile" != "" -a "$postfile" != "-" ]; then + postfile=`echo $postfile | sed "s/$PSTEXT$//"` + postfile=`echo $postfile | sed "s/$PSTEXTB$//"` + postfile="-pid $postfile" +else + postfile="" +fi + +if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then + viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` + viewfactorsfile="-vf $viewfactorsfile" +else + viewfactorsfile="" +fi + +if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then + hostfile="-ho $hostfile" +else + hostfile="" +fi + +if [ "$compat" != "" -a "$compat" != "-" ]; then + compat="-co $compat" +else + compat="" +fi + +if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then + scr_dir="-sd $scr_dir" +else + scr_dir="" +fi + +if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then + dcoup="-dcoup $dcoup" +else + dcoup="" +fi + +if [ "$assem_recov_nthread" != "" -a "$assem_recov_nthread" != "1" ]; then + assem_recov_nthread="-nthread_elem $assem_recov_nthread" +else + assem_recov_nthread="" +fi + +if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then + nthread="-nthread $nthread" +else + nthread="" +fi + +if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then + nsolver="-nsolver $nsolver" +else + nsolver="" +fi + +case "$mode" in + 4) mode="-mo i4" ;; + 8) mode="-mo i8" ;; + *) mode= ;; +esac + +if [ "$gpu" != "" -a "$gpu" != "-" ]; then + gpu="-gpu $gpu" +else + gpu="" +fi + +rm -f $job.cnt +rm -f $job.sts +rm -f $job.out +rm -f $job.log + +# To prevent a mismatch with the python version used by the solver +# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH +# unset environment variables PYTHONHOME and PYTHONPATH +unset PYTHONHOME +unset PYTHONPATH + +"${DIR}/tools/run_damask_h" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ + $srcfile $restart $postfile $viewfactorsfile $hostfile \ + $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ + $assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1 +sleep 1 +exit 0 diff --git a/installation/mods_MarcMentat/2016/Mentat_bin/submit8 b/installation/mods_MarcMentat/2016/Mentat_bin/submit8 new file mode 100644 index 000000000..d466fc6ab --- /dev/null +++ b/installation/mods_MarcMentat/2016/Mentat_bin/submit8 @@ -0,0 +1,187 @@ +#!/bin/sh +# +# The exit status of this script is read by Mentat. +# Normal exit status is 0. +# + +DIR=%INSTALLDIR%/marc%VERSION% +if test $MARCDIR1 +then + DIR=$MARCDIR1 +fi + +if test -z "$DIR"; then + REALCOM="`ls -l $0 |awk '{ print $NF; }'`" + DIRSCRIPT=`dirname $REALCOM` + case $DIRSCRIPT in + \/*) + ;; + *) + DIRSCRIPT=`pwd`/$DIRSCRIPT + ;; + esac + . $DIRSCRIPT/getarch + + DIR="$MENTAT_MARCDIR" +fi + +SRCEXT=.f +SRCEXTC=.F +RSTEXT=.t08 +PSTEXT=.t19 +PSTEXTB=.t16 +VWFCEXT=.vfs + +slv=$1 +version=$2 +ndom_fea_solver=$3 +ndom_preprocessor=$4 +hostfile=$5 +compat=$6 +job=$7 +srcfile=$8 +srcmeth=$9 +shift 9 # cannot use $10, $11, ... +restart=$1 +postfile=$2 +viewfactorsfile=$3 +autorst=$4 +copy_datfile="-ci $5" +copy_postfile="-cr $6" +scr_dir=$7 +dcoup=$8 +assem_recov_nthread=$9 +shift 9 # cannot use $10, $11, ... +nthread=$1 +nsolver=$2 +mode=$3 +gpu=$4 + +if [ "$slv" != "" -a "$slv" != "marc" ]; then + slv="-iam sfm" +else + slv="" +fi + +if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then + nprocds="-nprocds $ndom_fea_solver" +else + nprocd="" + if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then + nprocd="-nprocd $ndom_preprocessor" + else + nprocd="" + fi +fi + +if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then + srcfile=`echo $srcfile | sed "s/$SRCEXT$//" | sed "s/$SRCEXTC$//"` + case "$srcmeth" in + -) + srcfile="-u $srcfile" + ;; + compsave) + srcfile="-u $srcfile -save y" + ;; + runsaved) + srcfile=${srcfile%.*}".marc" + srcfile="-prog $srcfile" + ;; + esac +else + srcfile="" +fi + +if [ "$restart" != "" -a "$restart" != "-" ]; then + restart=`echo $restart | sed "s/$RSTEXT$//"` + restart="-r $restart" +else + restart="" +fi + +if [ "$postfile" != "" -a "$postfile" != "-" ]; then + postfile=`echo $postfile | sed "s/$PSTEXT$//"` + postfile=`echo $postfile | sed "s/$PSTEXTB$//"` + postfile="-pid $postfile" +else + postfile="" +fi + +if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then + viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` + viewfactorsfile="-vf $viewfactorsfile" +else + viewfactorsfile="" +fi + +if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then + hostfile="-ho $hostfile" +else + hostfile="" +fi + +if [ "$compat" != "" -a "$compat" != "-" ]; then + compat="-co $compat" +else + compat="" +fi + +if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then + scr_dir="-sd $scr_dir" +else + scr_dir="" +fi + +if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then + dcoup="-dcoup $dcoup" +else + dcoup="" +fi + +if [ "$assem_recov_nthread" != "" -a "$assem_recov_nthread" != "1" ]; then + assem_recov_nthread="-nthread_elem $assem_recov_nthread" +else + assem_recov_nthread="" +fi + +if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then + nthread="-nthread $nthread" +else + nthread="" +fi + +if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then + nsolver="-nsolver $nsolver" +else + nsolver="" +fi + +case "$mode" in + 4) mode="-mo i4" ;; + 8) mode="-mo i8" ;; + *) mode= ;; +esac + +if [ "$gpu" != "" -a "$gpu" != "-" ]; then + gpu="-gpu $gpu" +else + gpu="" +fi + +rm -f $job.cnt +rm -f $job.sts +rm -f $job.out +rm -f $job.log + +# To prevent a mismatch with the python version used by the solver +# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH +# unset environment variables PYTHONHOME and PYTHONPATH +unset PYTHONHOME +unset PYTHONPATH + +"${DIR}/tools/run_damask" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ + $srcfile $restart $postfile $viewfactorsfile $hostfile \ + $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ + $assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1 +sleep 1 +exit 0 diff --git a/installation/mods_MarcMentat/2016/Mentat_bin/submit9 b/installation/mods_MarcMentat/2016/Mentat_bin/submit9 new file mode 100644 index 000000000..207a61803 --- /dev/null +++ b/installation/mods_MarcMentat/2016/Mentat_bin/submit9 @@ -0,0 +1,187 @@ +#!/bin/sh +# +# The exit status of this script is read by Mentat. +# Normal exit status is 0. +# + +DIR=%INSTALLDIR%/marc%VERSION% +if test $MARCDIR1 +then + DIR=$MARCDIR1 +fi + +if test -z "$DIR"; then + REALCOM="`ls -l $0 |awk '{ print $NF; }'`" + DIRSCRIPT=`dirname $REALCOM` + case $DIRSCRIPT in + \/*) + ;; + *) + DIRSCRIPT=`pwd`/$DIRSCRIPT + ;; + esac + . $DIRSCRIPT/getarch + + DIR="$MENTAT_MARCDIR" +fi + +SRCEXT=.f +SRCEXTC=.F +RSTEXT=.t08 +PSTEXT=.t19 +PSTEXTB=.t16 +VWFCEXT=.vfs + +slv=$1 +version=$2 +ndom_fea_solver=$3 +ndom_preprocessor=$4 +hostfile=$5 +compat=$6 +job=$7 +srcfile=$8 +srcmeth=$9 +shift 9 # cannot use $10, $11, ... +restart=$1 +postfile=$2 +viewfactorsfile=$3 +autorst=$4 +copy_datfile="-ci $5" +copy_postfile="-cr $6" +scr_dir=$7 +dcoup=$8 +assem_recov_nthread=$9 +shift 9 # cannot use $10, $11, ... +nthread=$1 +nsolver=$2 +mode=$3 +gpu=$4 + +if [ "$slv" != "" -a "$slv" != "marc" ]; then + slv="-iam sfm" +else + slv="" +fi + +if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then + nprocds="-nprocds $ndom_fea_solver" +else + nprocd="" + if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then + nprocd="-nprocd $ndom_preprocessor" + else + nprocd="" + fi +fi + +if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then + srcfile=`echo $srcfile | sed "s/$SRCEXT$//" | sed "s/$SRCEXTC$//"` + case "$srcmeth" in + -) + srcfile="-u $srcfile" + ;; + compsave) + srcfile="-u $srcfile -save y" + ;; + runsaved) + srcfile=${srcfile%.*}".marc" + srcfile="-prog $srcfile" + ;; + esac +else + srcfile="" +fi + +if [ "$restart" != "" -a "$restart" != "-" ]; then + restart=`echo $restart | sed "s/$RSTEXT$//"` + restart="-r $restart" +else + restart="" +fi + +if [ "$postfile" != "" -a "$postfile" != "-" ]; then + postfile=`echo $postfile | sed "s/$PSTEXT$//"` + postfile=`echo $postfile | sed "s/$PSTEXTB$//"` + postfile="-pid $postfile" +else + postfile="" +fi + +if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then + viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` + viewfactorsfile="-vf $viewfactorsfile" +else + viewfactorsfile="" +fi + +if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then + hostfile="-ho $hostfile" +else + hostfile="" +fi + +if [ "$compat" != "" -a "$compat" != "-" ]; then + compat="-co $compat" +else + compat="" +fi + +if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then + scr_dir="-sd $scr_dir" +else + scr_dir="" +fi + +if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then + dcoup="-dcoup $dcoup" +else + dcoup="" +fi + +if [ "$assem_recov_nthread" != "" -a "$assem_recov_nthread" != "1" ]; then + assem_recov_nthread="-nthread_elem $assem_recov_nthread" +else + assem_recov_nthread="" +fi + +if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then + nthread="-nthread $nthread" +else + nthread="" +fi + +if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then + nsolver="-nsolver $nsolver" +else + nsolver="" +fi + +case "$mode" in + 4) mode="-mo i4" ;; + 8) mode="-mo i8" ;; + *) mode= ;; +esac + +if [ "$gpu" != "" -a "$gpu" != "-" ]; then + gpu="-gpu $gpu" +else + gpu="" +fi + +rm -f $job.cnt +rm -f $job.sts +rm -f $job.out +rm -f $job.log + +# To prevent a mismatch with the python version used by the solver +# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH +# unset environment variables PYTHONHOME and PYTHONPATH +unset PYTHONHOME +unset PYTHONPATH + +"${DIR}/tools/run_damask_l" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ + $srcfile $restart $postfile $viewfactorsfile $hostfile \ + $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ + $assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1 +sleep 1 +exit 0 diff --git a/installation/mods_MarcMentat/2016/Mentat_menus/job_run.ms b/installation/mods_MarcMentat/2016/Mentat_menus/job_run.ms new file mode 100644 index 000000000..589b9bfcc --- /dev/null +++ b/installation/mods_MarcMentat/2016/Mentat_menus/job_run.ms @@ -0,0 +1,2659 @@ +#ifndef AUTOFORGE +popmenu job_title_pm file jobs.ms +popdown job_title_ok file jobs.ms + +group job_solver_gr file job_common.ms +group user_domains_gr file domain_decomposition.ms +group user_domains_generate_gr file domain_decomposition.ms +group user_domains_tail_gr file domain_decomposition.ms +group job_solver_opts_gr file job_common.ms +popmenu ddm_options file job_common.ms + +browser edit_browser file file.ms +browser directory_browser file file.ms +screen domains file domain_decomposition.ms + + + + browser usersub_file_browser { + position 0 0 + size 82 72 + text "$usersub_file_browser_label" ($usersub_file_browser_label) + filter "*.f *.F *.f90 *.F90" + nvisible 10 + select_files true + cancel_action popdown + ok_action popdown + command "$usersub_file_browser_command" ($usersub_file_browser_command) + } + + + + browser host_file_browser { + position 0 0 + size 82 72 + text "$host_file_browser_label" ($host_file_browser_label) + filter "*" + nvisible 10 + select_files true + cancel_action popdown + ok_action popdown + command "$host_file_browser_command" ($host_file_browser_command) + } + + +#-------------------------------------------------------------------------------------------------- +popmenu job_run_popmenu { + + text "RUN JOB" + + group { + + + label { + position 0 0 + size 6 4 + text "NAME" + } + + display { + position +6 = + size 26 4 + display "job_name" + } + + label { + position 0 +4 + size 6 4 + text "TYPE" + } + + display { + position +6 = + size 26 4 + display job_class_label + } + + button { + position 1 9 + size 24 4 + text "USER SUBROUTINE FILE" + browser usersub_file_browser + settext $usersub_file_browser_label "SELECT USER SUBROUTINE FILE" + set $usersub_file_browser_command "*job_usersub_file" + help job_usersub_file + } + + toggle { + position +26 = + size 22 4 + text "SELECTED USER SUBS" + toggle job_usersubs + help job_run_seluser + visible job_usersubs + popmenu job_usersub_pm + } + + display { + position 1 +4 + size 50 4 + display job_usersub_file + } + + button { + position 1 +4 + size 12 4 + text "EDIT" + command "*job_edit_usersub_file" + visible job_usersub_file + } + + button { + position +12 = + size 12 4 + text "CLEAR" + command "*job_clear_usersub_file" + visible job_usersub_file + } + + roller { + position +12 = + size 26 4 + nvalues 3 + texts "COMPILE / NO SAVE" + "COMPILE AND SAVE" + "RUN SAVED EXECUTABLE" + help job_run_compile + roller "job_option user_source" + visible job_usersub_file + commands "*job_option user_source:compile_nosave" + "*job_option user_source:compile_save" + "*job_option user_source:run_saved" + } + + toggle { + position 1 +6 + size 22 4 + text "PARALLELIZATION/\{GPU}" + help job_run_parallel + toggle "or(*job_option parallel:on, \ + *job_option assem_recov_multi_threading:on, \ + solver_multi_procs, \ + solver_multi_threads, \ + and(job_solver_mfront_sparse,\ + job_nonsym_off,\ + *job_option solver_use_gpu:on))" + popmenu job_run_parallelization_pm + set $popname2 "job_run_parallelization_pm" + } + + frame { + position +22 = + size 28 16 + border_width 1 + border_color black + + group { + + display { + position 0 0 + size 28 4 + display job_ddm_domains + } + + display { + position = +4 + size 28 4 + display job_assem_recov_nthreads + } + + display { + position = +4 + size 28 4 + display job_solver_procs + visible solver_allows_multi_procs + } + + display { + position = = + size 28 4 + display job_solver_threads + visible "and(solver_allows_multi_threads,\ + not(and(job_solver_mfront_sparse,\ + *job_option parallel:on)))" + } + + display { + position = +4 + size 28 4 + display job_solver_gpu + visible "and(job_solver_mfront_sparse,job_nonsym_off)" + } + } + } + + button { + position 1 +18 + size 8 4 + text "TITLE" + popmenu job_title_pm + command "*job_title" + } + +# see also job_common.ms +# see also the ADVANCED JOB SUBMISSION popmenu in this file + + label { + position +10 = + size 7 4 + text "STYLE" + border_width 1 + border_color black + } + + roller { + position +7 = + size 18 4 + nvalues 3 + texts "TABLE-DRIVEN" + "MULTI-PHYSICS" + "OLD" + rollers "job_input_style_table_driven" + "job_input_style_multi_physics" + "job_input_style_old" + commands "*job_option input_style:new *job_option input_physics_style:old" + "*job_option input_physics_style:new *job_option input_style:new" + "*job_option input_style:old *job_option input_physics_style:old" + visibles "job_allows_input_style_table_driven" + "job_allows_input_style_multi_physics" + "job_allows_input_style_old" + help job_option_input_style + } + + button { + position +20 = + size 13 4 + text "SAVE MODEL" + command "*save_model" + } + + button { + position 1 +6 + size 16 6 + text "SUBMIT (1)" + command "*submit_job 1 *monitor_job" + } + + button { + position +16 = + size 16 6 + text "ADVANCED JOB SUBMISSION" + popmenu job_submit_adv_pm + } + + button { + position +16 = + size 18 6 + text "DAMASK" + popmenu damask + } + + button { + position 1 +6 + size 16 6 + text "UPDATE" + command "*update_job" + } + + button { + position +16 = + size 16 6 + text "MONITOR" + command "*monitor_job" + } + + button { + position +16 = + size 18 6 + text "KILL" + command "*kill_job *monitor_job" + } + + label { + position 1 +7 + size 32 4 + text "STATUS" + border_width 1 + border_color black + } + + display { + position +32 = + size 18 4 + display "job_status" + } + + label { + position -32 +4 + size 32 4 + text "CURRENT INCREMENT (CYCLE)" + border_width 1 + border_color black + } + + display { + position +32 = + size 18 4 + display "job_increment" + } + + label { + position -32 +4 + size 32 4 + text "SINGULARITY RATIO" + border_width 1 + border_color black + } + + float { + position +32 = + size 18 4 + display "job_singularity_ratio" + } + + label { + position -32 +4 + size 32 4 + text "CONVERGENCE RATIO" + border_width 1 + border_color black + } + + float { + position +32 = + size 18 4 + display "job_convergence_ratio" + } + + label { + position 1 +4 + size 32 4 + text "ANALYSIS TIME" + border_width 1 + border_color black + } + + float { + position +32 = + size 18 4 + display "job_analysis_time" + } + + label { + position -32 +4 + size 32 4 + text "WALL TIME" + border_width 1 + border_color black + } + + float { + position +32 = + size 18 4 + display "job_time" + } + + frame { + position 1 +4 + size 50 8 + + group { + + frame { + position 0 0 + size 50 8 + text "TOTAL" + border_width 1 + border_color black + group { + + label { + position +6 = + size 13 4 + text "CYCLES" + border_width 1 + border_color black + } + + integer { + position +13 = + size 10 4 + display "acc_job_cycles" + border_width 1 + border_color black + } + + label { + position -13 +4 + size 13 4 + text "SEPARATIONS" + border_width 1 + border_color black + } + + integer { + position +13 = + size 10 4 + display "acc_job_separations" + border_width 1 + border_color black + } + + label { + position +10 -4 + size 11 4 + text "CUT BACKS" + border_width 1 + border_color black + } + + integer { + position +11 = + size 10 4 + display "acc_job_cut_backs" + border_width 1 + border_color black + } + + label { + position -11 +4 + size 11 4 + text "REMESHES" + border_width 1 + border_color black + } + + integer { + position +11 = + size 10 4 + display "acc_job_remeshes" + border_width 1 + border_color black + } + } + } + } + } + + label { + position 1 +8 + size 19 4 + text "EXIT NUMBER" + border_width 1 + border_color black + } + + integer { + position +19 = + size 10 4 + display "job_exit" + } + + button { + position +10 = + size 21 4 + text "EXIT MESSAGE" + popmenu job_exit_msg_pm + help exit_message + } + + label { + position 1 +6 + size 7 4 + text "EDIT" + border_width 1 + border_color black + } + + button { + position +7 = + size 12 4 + text "OUTPUT FILE" + command "*job_edit_output" + } + + button { + position +12 = + size 9 4 + text "LOG FILE" + command "*job_edit_log_file" + } + + button { + position +9 = + size 12 4 + text "STATUS FILE" + command "*job_edit_status_file" + } + + button { + position +12 = + size 10 4 + text "ANY FILE" + settext $edit_browser_label "EDIT FILE" + set $edit_browser_command "*edit_file" + browser edit_browser + help edit_file + } + + popdown { + position 1 +6 + size 32 4 + text "OPEN POST FILE (MODEL PLOT RESULTS MENU)" + command "@popdown(job_properties_pm) @main(results) @popup(modelplot_pm) *post_open_default" + } + + button { + position 1 +6 + size 12 8 + text "RESET" + command "*job_submit_reset" + } + + popdown { + position +38 = + size 12 8 + text "OK" + } + } + + window job_run_wi { + parent mentat + origin 35 1 + size 52 115 + background_color body + border_width 1 + border_color border + buffering single + } + + mode permanent +} + + +#-------------------------------------------------------------------------------------------------- +popmenu job_usersub_pm { + + text "CURRENTLY SELECTED USER SUBROUTINES" + + group { + + + display { + position 1 +5 + size 64 86 + display "job_usersubs" + } + + popdown { + position 27 +88 + size 12 8 + text "OK" + } + } + + window { + parent mentat + origin 38 8 + size 66 102 + background_color body + border_width 1 + border_color border + buffering single + } + + mode dialog +} + + +#-------------------------------------------------------------------------------------------------- +popmenu job_submit_adv_pm { + + text "ADVANCED JOB SUBMISSION" + + group { + + + label { + position 0 0 + size 6 4 + text "NAME" + } + + display { + position +6 = + size 26 4 + display "job_name" + } + + label { + position 0 +4 + size 6 4 + text "TYPE" + } + + display { + position +6 = + size 26 4 + display job_class_label + } + + label { + position 1 9 + size 19 4 + text "INITIAL ALLOCATION" + border_width 1 + border_color black + } + label { + position +19 = + size 15 4 + text "GENERAL MEMORY" + help job_param_general_init_allocation + } + text { + position +15 = + size 10 4 + display "job_param_value_general_init_allocation" + command "*job_param general_init_allocation" + help job_param_general_init_allocation + } + + label { + position +10 = + size 4 4 + text "MB" + border_width 1 + border_color black + } + + toggle { + position 1 +5 + size 32 4 + text "OUT-OF-CORE ELEMENT STORAGE" + help job_param_elsto + toggle "*job_option elsto:on" + true_command "*job_option elsto:on" + false_command "*job_option elsto:off" + } + + toggle { + position 1 +4 + size 32 4 + text "OUT-OF-CORE INCREMENTAL BACKUP" + help job_param_inc_backup_storage + toggle "*job_option inc_backup_storage:out_of_core" + true_command "*job_option inc_backup_storage:out_of_core" + false_command "*job_option inc_backup_storage:in_core" + } + + toggle { + position +34 = + size 14 4 + text "CHECK SIZES" + help job_run_check + toggle "*job_option check:on" + true_command "*job_option check:on" + false_command "*job_option check:off" + } + + label { + position 1 +6 + size 16 4 + text "INTEGER SIZE" + border_width 1 + border_color black + } + + roller { + position +16 = + size 32 4 + nvalues 3 + texts "DEFAULT" + "4-BYTE INTEGERS" + "8-BYTE INTEGERS" + commands "*job_option marc_integer_size:default" + "*job_option marc_integer_size:i4" + "*job_option marc_integer_size:i8" + help job_run_intsize + roller "job_option marc_integer_size" + } + + frame { + position 1 +6 + size 48 12 + text "MARC INPUT FILE" + border_width 1 + border_color black + + group { + + label { + position 0 4 + size 9 4 + text "VERSION" + border_width 1 + border_color black + } + + roller { + position +9 = + size 14 4 + nvalues 22 + nvisible 22 + texts "DEFAULT" +#if 0 + "2016" +#endif + "2015" + "2014.2" + "2014.1" + "2014" + "2013.1" + "2013" + "2012" + "2011" + "2010.2" + "2010" + "2008" + "2007" + "2005R3" + "2005" + "2003" + "2001" + "2000" +#if 0 + "8" +#endif + "K7" + "K6.2" + "K5" + "K4" + help job_param_version + rollers "job_input_version_default" +#if 0 + "job_input_version_2016" +#endif + "job_input_version_2015" + "job_input_version_2014.2" + "job_input_version_2014.1" + "job_input_version_2014" + "job_input_version_2013.1" + "job_input_version_2013" + "job_input_version_2012" + "job_input_version_2011" + "job_input_version_2010.2" + "job_input_version_2010" + "job_input_version_2008" + "job_input_version_2007" + "job_input_version_2005r3" + "job_input_version_2005" + "job_input_version_2003" + "job_input_version_2001" + "job_input_version_2000" +#if 0 + "job_input_version_8" +#endif + "job_input_version_k7" + "job_input_version_k6" + "job_input_version_k5" + "job_input_version_k4" + commands "*job_option version:default" +#if 0 + "*job_option version:2016" +#endif + "*job_option version:2015" + "*job_option version:2014.2" + "*job_option version:2014.1" + "*job_option version:2014" + "*job_option version:2013.1" + "*job_option version:2013" + "*job_option version:2012" + "*job_option version:2011" + "*job_option version:2010.2" + "*job_option version:2010" + "*job_option version:2008" + "*job_option version:2007" + "*job_option version:2005r3" + "*job_option version:2005" + "*job_option version:2003" + "*job_option version:2001" + "*job_option version:2000" +#if 0 + "*job_option version:8" +#endif + "*job_option version:k7" + "*job_option version:k6" + "*job_option version:k5" + "*job_option version:k4" + visibles "job_allows_input_version_default" +#if 0 + "job_allows_input_version_2016" +#endif + "job_allows_input_version_2015" + "job_allows_input_version_2014.2" + "job_allows_input_version_2014.1" + "job_allows_input_version_2014" + "job_allows_input_version_2013.1" + "job_allows_input_version_2013" + "job_allows_input_version_2012" + "job_allows_input_version_2011" + "job_allows_input_version_2010.2" + "job_allows_input_version_2010" + "job_allows_input_version_2008" + "job_allows_input_version_2007" + "job_allows_input_version_2005r3" + "job_allows_input_version_2005" + "job_allows_input_version_2003" + "job_allows_input_version_2001" + "job_allows_input_version_2000" +#if 0 + "job_allows_input_version_8" +#endif + "job_allows_input_version_k7" + "job_allows_input_version_k6" + "job_allows_input_version_k5" + "job_allows_input_version_k4" + } + +# see also job_common.ms +# see also the RUN JOB popmenu in this file + + label { + position +14 = + size 7 4 + text "STYLE" + border_width 1 + border_color black + } + + roller { + position +7 = + size 18 4 + nvalues 3 + texts "TABLE-DRIVEN" + "MULTI-PHYSICS" + "OLD" + rollers "job_input_style_table_driven" + "job_input_style_multi_physics" + "job_input_style_old" + commands "*job_option input_style:new *job_option input_physics_style:old" + "*job_option input_physics_style:new *job_option input_style:new" + "*job_option input_style:old *job_option input_physics_style:old" + visibles "job_allows_input_style_table_driven" + "job_allows_input_style_multi_physics" + "job_allows_input_style_old" + help job_option_input_style + } + + toggle { + position 0 +4 + size 48 4 + text "EXTENDED PRECISION" + help job_run_precision + toggle "*job_option inp_file_prec:extended" + true_command "*job_option inp_file_prec:extended" + false_command "*job_option inp_file_prec:normal" + } + } + } + + button { + position 1 +14 + size 24 4 + text "SCRATCH DIRECTORY" + settext $directory_browser_label "JOB SCRATCH DIRECTORY" + set $directory_browser_command "*job_scratch_directory" + browser directory_browser + help job_scratch_directory + } + + button { + position +24 = + size 24 4 + text "CLEAR" + command "*job_clear_scratch_directory" + visible job_scratch_directory + } + + text { + position 1 +4 + size 48 4 + display job_scratch_dir + command "*job_scratch_directory" + } + +#ifdef DCOM + toggle { + position 1 +6 + size 8 4 + text "\{DCOM}" + toggle "*job_option dcom:on" + help job_run_dcom + true_command "*job_option dcom:on" + false_command "*job_option dcom:off" + visible win32_available + } + + button { + position +8 = + size 12 4 + text "HOSTNAME" + command "*job_dcom_hostname" + visible "and(win32_available, *job_option dcom:on)" + } + + text job_dcom_hostname { + position +12 = + size 28 4 + display "job_dcom_hostname" + command "*job_dcom_hostname" + visible "and(win32_available, *job_option dcom:on)" + } +#endif + + button { + position 1 +6 + size 24 4 + text "TITLE" + popmenu job_title_pm + command "*job_title" + } + + button { + position +24 = + size 24 4 + text "SAVE MODEL" + command "*save_model" + } + + button { + position +4 +6 + size 20 4 + text "WRITE INPUT FILE" + command "*job_write_input" + } + + button { + position = +4 + size 20 4 + text "EDIT INPUT FILE" + command "*job_edit_input" + } + + popdown { + position 1 +5 + size 20 6 + text "SUBMIT 1" + command "*submit_job 1 *monitor_job" + } + + popdown { + position +28 = + size 20 6 + text "EXECUTE 1" + command "*execute_job 1 *monitor_job" + } + + popdown { + position -28 +6 + size 20 6 + text "SUBMIT 2" + command "*submit_job 2 *monitor_job" + } + + popdown { + position +28 = + size 20 6 + text "EXECUTE 2" + command "*execute_job 2 *monitor_job" + } + + popdown { + position -28 +6 + size 20 6 + text "SUBMIT 3" + command "*submit_job 3 *monitor_job" + } + + popdown { + position +28 = + size 20 6 + text "EXECUTE 3" + command "*execute_job 3 *monitor_job" + } + + popdown { + position 19 +8 + size 12 8 + text "OK" + } + } + + window { + parent mentat + origin 38 8 +#ifdef DCOM + size 50 100 +#else + size 50 94 +#endif + background_color body + border_width 1 + border_color border + buffering single + } + + mode permanent +} + +#-------------------------------------------------------------------------------------------------- +popmenu damask { + +#ifdef QT_MENTAT + text "DAMASK.MPIE.DE" +#endif + + group { +#ifndef QT_MENTAT + label { + position 0 0 + size 50 4 + text "DAMASK.MPIE.DE" + } +#endif + + label { + position 1 6 + size 13 6 + text "Optimzation" + border_width 1 + border_color black + } + + label { + position +13 = + size 20 6 + text "write Input" + border_width 1 + border_color black + } + + label { + position +18 = + size 30 6 + text "do not write Inp." + border_width 1 + border_color black + } + + label { + position -32 +6 + size 12 6 + text "O2 / OpenMP" + border_width 1 + border_color black + } + + popdown { + position +12 = + size 20 6 + text "Submit" + command "*submit_job 4 *monitor_job" + } + + popdown { + position +20 = + size 20 6 + text "Execute" + command "*execute_job 4 *monitor_job" + } + + label { + position -32 +6 + size 12 6 + text "O1 / OpenMP" + border_width 1 + border_color black + } + + popdown { + position +12 = + size 20 6 + text "Submit" + command "*submit_job 5 *monitor_job" + } + + popdown { + position +20 = + size 20 6 + text "Execute" + command "*execute_job 5 *monitor_job" + } + + label { + position -32 +6 + size 12 6 + text "O0 / OpenMP" + border_width 1 + border_color black + } + + popdown { + position +12 = + size 20 6 + text "Submit" + command "*submit_job 6 *monitor_job" + } + + popdown { + position +20 = + size 20 6 + text "Execute" + command "*execute_job 6 *monitor_job" + } + + popdown { + position 19 +8 + size 12 8 + text "CANCEL" + } +} + + + + window { + parent mentat + origin 38 8 +#ifdef DCOM + size 50 100 +#else + size 50 94 +#endif + background_color body + border_width 1 + border_color border + buffering single + } + mode permanent +} + +#-------------------------------------------------------------------------------------------------- +popmenu job_exit_msg_pm { + + text "EXIT MESSAGE" + + group { + + + + text { + position 1 5 + size 84 74 + multiline + readonly + display "job_exit_msg" + } + + popdown { + position 37 +76 + size 12 8 + text "OK" + } + } + + window { + parent mentat + origin 38 8 + size 86 90 + background_color body + border_width 1 + border_color border + buffering single + } + + mode dialog +} + + + + +#-------------------------------------------------------------------------------------------------- +popmenu job_run_parallelization_pm { + + text "PARALLELIZATION/\{GPU}" + + group { + + + label { + position 0 0 + size 6 4 + text "NAME" + } + + display { + position +6 = + size 26 4 + display "job_name" + } + + label { + position 0 +4 + size 6 4 + text "TYPE" + } + + display { + position +6 = + size 26 4 + display job_class_label + } + + frame { + position 1 9 + size 48 28 + group job_ddm_gr + text "DOMAIN DECOMPOSITION" + border_width 1 + border_color black + } + + frame { + position 1 +29 + size 36 13 + group job_assem_recov_gr + text "ASSEMBLY AND RECOVERY" + border_width 1 + border_color black + } + + frame { + position 1 +14 + size 58 31 + group job_parallel_matrix_solver_gr + text "MATRIX SOLVER" + border_width 1 + border_color black + } + + frame { + position 1 +32 + size 48 28 + group job_parallel_env_gr + text "PARALLELIZATION ENVIRONMENT" + border_width 1 + border_color black + visible "or(*job_option parallel:on, \ + solver_multi_procs)" + } + + popdown { + position 24 +30 + size 12 8 + text "OK" + } + } + + window { + parent mentat + origin 38 1 + size 60 119 + background_color body + border_width 1 + border_color border + buffering single + } + mode permanent +} + + +#-------------------------------------------------------------------------------------------------- +group job_ddm_gr { + + toggle { + position 1 4 + size 30 4 + text "USE \{DDM}" + toggle "*job_option parallel:on" + help job_run_ddm_use + true_command "*job_option parallel:on" + false_command "*job_option parallel:off" + active "not(job_solver_it_ext)" + } + + frame { + position +2 +5 + size 44 18 + group job_ddm_use_gr + visible "*job_option parallel:on" + } +} + +group job_ddm_use_gr { + roller { + position 0 0 + size 30 4 + nvalues 2 + texts "DECOMPOSITION IN MARC" + "DECOMPOSITION IN MENTAT" + roller "job_option ddm_generator" + commands "*job_option ddm_generator:fea_solver" + "*job_option ddm_generator:preprocessor" + help job_run_ddm_generator + } + + frame { + position 0 +5 + size 44 8 + group job_ddm_fea_solver_gr + visible "*job_option ddm_generator:fea_solver" + } + + frame { + position = = + size 44 8 + group job_ddm_preprocessor_gr + visible "*job_option ddm_generator:preprocessor" + } + + text { + position 0 +9 + size 22 4 + text "Single Input File" + readonly + visible "*job_option ddm_generator:fea_solver" + } + + roller { + position = = + size 22 4 + nvalues 2 + texts "MULTIPLE INPUT FILES" + "SINGLE INPUT FILE" + roller "job_option ddm_single_input" + commands "*job_option ddm_single_input:off" + "*job_option ddm_single_input:on" + visible "*job_option ddm_generator:preprocessor" + help job_run_ddm_single_input + } + + roller { + position +23 = + size 21 4 + nvalues 2 + texts "MULTIPLE POST FILES" + "SINGLE POST FILE" + roller "job_option ddm_single_post" + commands "*job_option ddm_single_post:off" + "*job_option ddm_single_post:on" + help job_run_ddm_single_post + } +} + + + + +#-------------------------------------------------------------------------------------------------- +group job_ddm_fea_solver_gr { + + label { + position 0 0 + size 10 4 + text "# DOMAINS" + help job_param + } + + text { + position +10 = + size 4 4 + display "job_param_value_ndomains" + command "*job_param ndomains" + } + + label { + position +4 = + size 7 4 + text "METHOD" + border_width 1 + border_color black + } + + roller { + position +7 = + size 23 4 + nvalues 7 + texts "METIS BEST" + "METIS ELEMENT" + "METIS NODE" + "REC. COORD. BISECTION" + "VECTOR" + "RADIAL" + "ANGULAR" + help set_job_decomp_type + rollers "*job_option ddm_method:metis_best" + "*job_option ddm_method:metis_element_based" + "*job_option ddm_method:metis_node_based" + "*job_option ddm_method:recur_coord_bisect" + "*job_option ddm_method:vector" + "*job_option ddm_method:radial" + "*job_option ddm_method:angular" + commands "*job_option ddm_method:metis_best" + "*job_option ddm_method:metis_element_based" + "*job_option ddm_method:metis_node_based" + "*job_option ddm_method:recur_coord_bisect" + "*job_option ddm_method:vector" + "*job_option ddm_method:radial" + "*job_option ddm_method:angular" + } + + button { + position +4 +4 + size 19 4 + text "ADVANCED SETTINGS" + popmenu job_ddm_fea_solver_pm + } +} + + + + +#-------------------------------------------------------------------------------------------------- +popmenu job_ddm_fea_solver_pm { + + text "JOB PARALLELIZATION" + + group { + units 32 120 + + + label { + position 0 5 + size 6 4 + text "NAME" + } + + display { + position +6 = + size 26 4 + display "job_name" + } + + label { + position 0 +4 + size 6 4 + text "TYPE" + } + + display { + position +6 = + size 26 4 + display job_class_label + } + + frame { + + position 0 +9 + size 32 76 + text "ADVANCED DECOMPOSITION IN MARC" + border_width 1 + border_color black + + group { + + label { + position 1 4 + size 16 4 + text "# DOMAINS" + help job_param + } + + text { + position +16 = + size 14 4 + display "job_param_value_ndomains" + command "*job_param ndomains" + } + + label { + position 1 +4 + size 7 4 + text "METHOD" + border_width 1 + border_color black + } + + roller { + position +7 = + size 23 4 + nvalues 7 + texts "METIS BEST" + "METIS ELEMENT" + "METIS NODE" + "REC. COORD. BISECTION" + "VECTOR" + "RADIAL" + "ANGULAR" + help set_job_decomp_type + rollers "*job_option ddm_method:metis_best" + "*job_option ddm_method:metis_element_based" + "*job_option ddm_method:metis_node_based" + "*job_option ddm_method:recur_coord_bisect" + "*job_option ddm_method:vector" + "*job_option ddm_method:radial" + "*job_option ddm_method:angular" + commands "*job_option ddm_method:metis_best" + "*job_option ddm_method:metis_element_based" + "*job_option ddm_method:metis_node_based" + "*job_option ddm_method:recur_coord_bisect" + "*job_option ddm_method:vector" + "*job_option ddm_method:radial" + "*job_option ddm_method:angular" + } + + frame { + position 1 +5 + size 30 20 + group job_ddm_direction_gr + visible "or(*job_option ddm_method:vector, \ + *job_option ddm_method:radial, \ + *job_option ddm_method:angular)" + } + + toggle { + position 1 +21 + size 30 4 + text "DOMAIN ISLAND REMOVAL" + toggle "*job_option ddm_island_removal:on" + true_command "*job_option ddm_island_removal:on" + false_command "*job_option ddm_island_removal:off" + } + + label { + position 1 +4 + size 15 4 + border_width 1 + border_color black + text "GRAPH" + } + + roller { + position +15 = + size 15 4 + nvalues 2 + texts "COARSE" + "FINE" + help ddm_decomp_coarse_graph + rollers "*job_option ddm_graph:coarse" + "*job_option ddm_graph:fine" + commands "*job_option ddm_graph:coarse" + "*job_option ddm_graph:fine" + visible "or(*job_option ddm_method:metis_best, \ + *job_option ddm_method:metis_element_based, \ + *job_option ddm_method:metis_node_based)" + } + + label { + position 1 +4 + size 15 4 + border_width 1 + border_color black + text "QUADRATIC ELEMENTS" + } + + roller { + position +15 = + size 15 4 + nvalues 2 + texts "GENUINE" + "LINEARIZED" + help job_run_ddm_decomp_linearized + rollers "*job_option ddm_quadr_elems:genuine" + "*job_option ddm_quadr_elems:linearized" + commands "*job_option ddm_quadr_elems:genuine" + "*job_option ddm_quadr_elems:linearized" + } + + label { + position 1 +5 + size 15 4 + text "ELEMENT WEIGHT FACTOR" + help job_param + } + + text { + position +15 = + size 15 4 + display "job_param_value_ddm_elem_weight_factor" + command "*job_param ddm_elem_weight_factor" + help job_run_ddm_decomp_element_weight_factor + } + + toggle { + position 1 +5 + size 30 4 + text "DETECT CONTACT" + toggle "*job_option ddm_detect_contact:on" + true_command "*job_option ddm_detect_contact:on" + false_command "*job_option ddm_detect_contact:off" + visible "or(*job_option ddm_method:metis_best, \ + *job_option ddm_method:metis_element_based, \ + *job_option ddm_method:metis_node_based)" + help job_run_ddm_decomp_detect_contact + } + + label { + position = +5 + size 15 4 + text "CONTACT TOLERANCE" + visible "*job_option ddm_detect_contact:on" + } + + text { + position +15 = + size 15 4 + command "*set_ddm_contact_tolerance" + display "job_param_value_ddm_contact_tolerance" + command "*job_param ddm_contact_tolerance" + visible "*job_option ddm_detect_contact:on" + help job_run_ddm_decomp_contact_tolerance + } + + label { + position -15 +4 + size 15 4 + text "CONTACT CONSTR FACTOR" + visible "*job_option ddm_detect_contact:on" + } + + text { + position +15 = + size 15 4 + display "job_param_value_ddm_contact_constr_factor" + command "*job_param ddm_contact_constr_factor" + visible "*job_option ddm_detect_contact:on" + help job_run_ddm_decomp_contact_constraint_factor + } + } + } + + popdown { + position 0 +77 + size 32 8 + text "OK" + } + } + mode permanent +} # job_ddm_fea_solver_pm + + + + +#-------------------------------------------------------------------------------------------------- +group job_ddm_direction_gr { + + button { + position 0 0 + size 15 4 + text "DIRECTION" + command "*job_vector ddm_sort_direction_x" + visible "*job_option ddm_method:vector" + } + + button { + position = = + size 15 4 + text "DIRECTION" + command "*job_vector ddm_sort_direction_x" + visible "not(*job_option ddm_method:vector)" + } + + button { + position +15 = + size 15 4 + text "FROM / TO" + command "*job_vector_from_to ddm_sort_direction_x" + } + + text { + position -15 +4 + size 10 4 + command "*job_param ddm_sort_direction_x" + display "job_param_value_ddm_sort_direction_x" + help ddm_job_decomp_user_direction_x + } + + text { + position +10 = + size 10 4 + command "*job_param ddm_sort_direction_y" + display "job_param_value_ddm_sort_direction_y" + } + + text { + position +10 = + size 10 4 + command "*job_param ddm_sort_direction_z" + display "job_param_value_ddm_sort_direction_z" + } + + frame { + position 0 +4 + size 30 8 + group job_ddm_sort_point_gr + visible "not(*job_option ddm_method:vector)" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_ddm_sort_point_gr { + + label { + position 0 0 + size 14 4 + border_width 1 + border_color black + text "POINT ON AXIS" + } + + roller { + position +14 = + size 10 4 + nvalues 2 + texts "DEFAULT" + "USER" + roller "job_option ddm_sort_point" + commands "*job_option ddm_sort_point:default" + "*job_option ddm_sort_point:user" + } + + button { + position +10 = + size 6 4 + text "SET" + command "*job_position ddm_sort_point_x" + visible "*job_option ddm_sort_point:user" + } + + text { + position 0 +4 + size 10 4 + command "*job_param ddm_sort_point_x" + display "job_param_value_ddm_sort_point_x" + visible "*job_option ddm_sort_point:user" + } + + text { + position +10 = + size 10 4 + command "*job_param ddm_sort_point_y" + display "job_param_value_ddm_sort_point_y" + visible "*job_option ddm_sort_point:user" + } + + text { + position +10 = + size 10 4 + command "*job_param ddm_sort_point_z" + display "job_param_value_ddm_sort_point_z" + visible "*job_option ddm_sort_point:user" + } +} + + + + +#-------------------------------------------------------------------------------------------------- +group job_ddm_preprocessor_gr { + + label { + position 0 0 + size 10 4 + text "# DOMAINS" + border_width 1 + border_color black + } + + integer { + position +10 = + size 4 4 + display valid_domains + } + + button { + position +4 = + size 30 4 + text "USER DOMAINS" + popmenu domains_pm + help job_run_ddm_user_domains + } +} + + + + +#-------------------------------------------------------------------------------------------------- +group job_assem_recov_gr { + + toggle { + position 1 +4 + size 30 4 + text "MULTIPLE THREADS" + true_command "*job_option assem_recov_multi_threading:on" + false_command "*job_option assem_recov_multi_threading:off" + toggle "*job_option assem_recov_multi_threading:on" + } + + label { + position +2 +4 + size 12 4 + text "# THREADS" + visible "*job_option assem_recov_multi_threading:on" + } + + text { + position +12 = + size 4 4 + display "job_param_value_assem_recov_nthreads" + command "*job_param assem_recov_nthreads" + visible "*job_option assem_recov_multi_threading:on" + } + + label { + position +4 = + size 12 4 + visible "and(*job_option assem_recov_multi_threading:on, \ + *job_option parallel:on)" + text "PER DOMAIN" + border_width 1 + border_color black + } + + display { + position +12 = + size 4 4 + display "job_assem_recov_nthreads_dom" + visible "and(*job_option assem_recov_multi_threading:on, \ + *job_option parallel:on)" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_parallel_matrix_solver_gr { + + label { + position 3 4 + size 12 4 + text "SOLUTION" + border_width 1 + border_color black + } + + roller { + position +12 = + size 18 4 + nvalues 2 + texts "SYMMETRIC" + "NONSYMMETRIC" + rollers job_nonsym_off + job_nonsym_on + commands "*job_option solver_nonsym:off" + "*job_option solver_nonsym:on" + help job_param_solver_method + } + + label { + position -12 +4 + size 6 4 + text "TYPE" + border_width 1 + border_color black + } + + roller { + position +6 = + size 24 4 + nvalues 9 + help job_param_solver_method + texts "MULTIFRONTAL SPARSE" + "MIXED DIRECT-ITERATIVE" + "CASI ITERATIVE" + "PARDISO DIRECT SPARSE" + "MUMPS PARALLEL DIRECT" + "HARDWARE SPARSE" + "ITERATIVE SPARSE" + "DIRECT PROFILE" + "DIRECT SPARSE" + rollers job_solver_mfront_sparse + job_solver_mixed_direct_iterative + job_solver_it_ext + job_solver_pardiso + job_solver_mumps + job_solver_sparse + job_solver_it_sparse + job_solver_dir_profile + job_solver_dir_sparse + commands "*job_option solver:mfront_sparse" + "*job_option solver:mixed_direct_iterative" + "*job_option solver:it_ext" + "*job_option solver:pardiso" + "*job_option solver:mumps" + "*job_option solver:sparse" + "*job_option solver:it_sparse" + "*job_option solver:dir_profile" + "*job_option solver:dir_sparse" + visibles job_allows_solver_mfront_sparse + job_allows_solver_mixed_direct_iterative + job_allows_solver_it_ext + job_allows_solver_pardiso + job_allows_solver_mumps + job_allows_solver_sparse + job_allows_solver_it_sparse + job_allows_solver_dir_profile + job_allows_solver_dir_sparse + help job_param_solver_method + } + + button { + position +24 = + size 10 4 + text "OPTIONS" + popmenu job_parallel_matrix_solver_opt_pm + } + + frame { + position +10 = + size 14 4 + group job_run_solver_ddm_opts_gr + visible "*job_option parallel:on" + } + + frame { + position 1 +5 + size 46 8 + group job_solver_multi_procs_gr + visible solver_allows_multi_procs + } + + frame { + position = = + size 46 8 + group job_solver_multi_threads_gr + visible solver_allows_multi_threads + } + + frame { + position 1 +9 + size 46 8 + group job_solver_gpu_gr + visible "and(job_solver_mfront_sparse,job_nonsym_off)" + } +} + + + + +#-------------------------------------------------------------------------------------------------- +popmenu job_parallel_matrix_solver_opt_pm { + + text "MATRIX SOLVER OPTIONS" + + group { + + + frame { + position 1 5 + size 36 23 + group job_solver_opts_gr + } + + popdown { + position 13 +25 + size 12 8 + text "OK" + } + } + + window { + parent mentat + origin 41 12 + size 38 39 + border_width 1 + border_color border + background_color body + } + mode dialog +} + + +#-------------------------------------------------------------------------------------------------- +group job_run_solver_ddm_opts_gr { + + button { + position 0 0 + size 14 4 + text "\{DDM} OPTIONS" + popmenu ddm_options +# see also job_common.ms! + visible "not(or(job_solver_it_sparse, \ + job_solver_it_ext, \ + job_solver_mixed_direct_iterative, \ + job_solver_pardiso, \ + job_solver_mumps))" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_procs_gr { + frame { + position 0 0 + size 46 8 + group job_solver_multi_procs_parallel_off_gr + visible "*job_option parallel:off" + } + + frame { + position = = + size 46 8 + group job_solver_multi_procs_parallel_on_gr + visible "*job_option parallel:on" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_procs_parallel_off_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE SOLVER PROCESSES" + true_command "*job_option nsolver_procs_serial:on" + false_command "*job_option nsolver_procs_serial:off" + toggle "*job_option nsolver_procs_serial:on" + help job_run_multithreading + } + + label { + position +2 +4 + size 14 4 + text "# PROCESSES" + visible "*job_option nsolver_procs_serial:on" + help job_param + } + + text { + position +14 = + size 14 4 + display "job_param_value_nsolver_procs" + command "*job_param nsolver_procs" + visible "*job_option nsolver_procs_serial:on" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_procs_parallel_on_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE SOLVER PROCESSES" + help job_run_multithreading + toggle true + set $dummy dummy + } + + label { + position +2 +4 + size 14 4 + text "# PROCESSES" + border_width 1 + border_color black + } + + roller { + position +14 = + size 14 4 + nvalues 2 + texts "AUTOMATIC" + "USER" + commands "*job_option nsolver_procs_ddm:automatic" + "*job_option nsolver_procs_ddm:user" + help job_run_multithreading + rollers "*job_option nsolver_procs_ddm:automatic" + "*job_option nsolver_procs_ddm:user" + } + + frame { + position +14 = + size 16 4 + group job_nsolver_procs_ddm_automatic_gr + visible "*job_option nsolver_procs_ddm:automatic" + } + + frame { + position = = + size 16 4 + group job_nsolver_procs_ddm_user_gr + visible "*job_option nsolver_procs_ddm:user" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_nsolver_procs_ddm_automatic_gr { + + label { + position 0 0 + size 8 4 + text "VALUE" + border_width 1 + border_color black + } + + integer { + position +8 = + size 8 4 + display valid_domains + visible "*job_option ddm_generator:preprocessor" + } + + integer { + position = = + size 8 4 + display "job_param_ndomains" + visible "*job_option ddm_generator:fea_solver" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_nsolver_procs_ddm_user_gr { + + label { + position 0 0 + size 8 4 + text "VALUE" + help job_param + } + + text { + position +8 = + size 8 4 + display "job_param_value_nsolver_procs" + command "*job_param nsolver_procs" + } +} + +group job_solver_multi_threads_gr { + frame { + position 0 0 + size 46 8 + group job_solver_multi_threads_mfront_sparse_parallel_off_gr + visible "and(job_solver_mfront_sparse,*job_option parallel:off)" + } + + frame { + position = = + size 46 8 + group job_solver_multi_threads_mfront_sparse_parallel_on_gr + visible "and(job_solver_mfront_sparse,*job_option parallel:on)" + } + + frame { + position = = + size 46 8 + group job_solver_multi_threads_pardiso_parallel_off_gr + visible "and(job_solver_pardiso,*job_option parallel:off)" + } + + frame { + position = = + size 46 8 + group job_solver_multi_threads_pardiso_parallel_on_gr + visible "and(job_solver_pardiso,*job_option parallel:on)" + } + + frame { + position = = + size 46 8 + group job_solver_multi_threads_it_ext_off_gr + visible "and(job_solver_it_ext,*job_option parallel:off)" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_threads_mfront_sparse_parallel_off_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE THREADS" + toggle "*job_option mfront_sparse_multi_threading:on" + true_command "*job_option mfront_sparse_multi_threading:on" + false_command "*job_option mfront_sparse_multi_threading:off" + help job_run_multithreading + } + + label { + position +2 +4 + size 14 4 + text "# THREADS" + visible "*job_option mfront_sparse_multi_threading:on" + help job_param + } + + text { + position +14 = + size 14 4 + display "job_param_value_nthreads" + command "*job_param nthreads" + visible "*job_option mfront_sparse_multi_threading:on" + } +} + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_threads_mfront_sparse_parallel_on_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE THREADS" + help job_run_multithreading + toggle true + set $dummy dummy + } + + label { + position +30 0 + size 12 4 + visible "and( not(*job_option ddm_precond:direct)\ + *job_option parallel:on)" + text "PER DOMAIN" + border_width 1 + border_color black + } + + display { + position +12 0 + size 4 4 + display "job_mfront_sparse_nthreads_dom" + visible "and( not(*job_option ddm_precond:direct)\ + *job_option parallel:on)" + } + + label { + position 2 +4 + size 14 4 + text "# THREADS" + border_color black + border_width 1 + } + + roller { + position +14 = + size 14 4 + nvalues 2 + texts "AUTOMATIC" + "USER" + commands "*job_option mfront_sparse_multi_threading_ddm:automatic" + "*job_option mfront_sparse_multi_threading_ddm:user" + help job_run_multithreading + rollers "*job_option mfront_sparse_multi_threading_ddm:automatic" + "*job_option mfront_sparse_multi_threading_ddm:user" + } + + frame { + position +14 = + size 16 4 + group job_mfront_sparse_multi_threads_ddm_automatic_gr + visible "*job_option mfront_sparse_multi_threading_ddm:automatic" + } + + frame { + position = = + size 16 4 + group job_mfront_sparse_multi_threads_ddm_user_gr + visible "*job_option mfront_sparse_multi_threading_ddm:user" + } +} +#-------------------------------------------------------------------------------------------------- +group job_mfront_sparse_multi_threads_ddm_automatic_gr { + + label { + position 0 0 + size 8 4 + text "VALUE" + border_width 1 + border_color black + } + + integer { + position +8 = + size 8 4 + display valid_domains + visible "*job_option ddm_generator:preprocessor" + } + + integer { + position = = + size 8 4 + display "job_param_ndomains" + visible "*job_option ddm_generator:fea_solver" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_mfront_sparse_multi_threads_ddm_user_gr { + + label { + position 0 0 + size 8 4 + text "VALUE" + } + + text { + position +8 = + size 8 4 + display "job_param_value_nthreads" + command "*job_param nthreads" + } +} + + + +#-------------------------------------------------------------------------------------------------- +group job_solver_gpu_gr { + + toggle { + position 0 0 + size 30 4 + text "USE \{GPU(s)}" + toggle "*job_option solver_use_gpu:on" + true_command "*job_option solver_use_gpu:on" + false_command "*job_option solver_use_gpu:off" + help job_solver_gpu + } + + label { + position +2 +4 + size 16 4 + text "\{GPU} SELECTION" + border_width 1 + border_color black + visible "*job_option solver_use_gpu:on" + } + + roller { + position +16 = + size 12 4 + nvalues 2 + texts "AUTOMATIC" + "USER" + commands "*job_option solver_gpus:automatic" + "*job_option solver_gpus:user" + rollers "*job_option solver_gpus:automatic" + "*job_option solver_gpus:user" + visible "*job_option solver_use_gpu:on" + help job_solver_gpu + } + + text { + position +12 = + size 16 4 + display job_solver_gpus + command "*clear_job_solver_gpus *job_solver_gpus" + visible "and(*job_option solver_use_gpu:on,*job_option solver_gpus:user)" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_threads_pardiso_parallel_off_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE THREADS" + toggle "*job_option pardiso_multi_threading:on" + true_command "*job_option pardiso_multi_threading:on" + false_command "*job_option pardiso_multi_threading:off" + help job_run_multithreading + } + + label { + position +2 +4 + size 14 4 + text "# THREADS" + visible "*job_option pardiso_multi_threading:on" + help job_param + } + + text { + position +14 = + size 14 4 + display "job_param_value_nthreads" + command "*job_param nthreads" + visible "*job_option pardiso_multi_threading:on" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_threads_pardiso_parallel_on_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE THREADS" + help job_run_multithreading + toggle true + set $dummy dummy + } + + label { + position +2 +4 + size 14 4 + text "# THREADS" + border_color black + border_width 1 + } + + roller { + position +14 = + size 14 4 + nvalues 2 + texts "AUTOMATIC" + "USER" + commands "*job_option pardiso_multi_threading_ddm:automatic" + "*job_option pardiso_multi_threading_ddm:user" + help job_run_multithreading + rollers "*job_option pardiso_multi_threading_ddm:automatic" + "*job_option pardiso_multi_threading_ddm:user" + } + + frame { + position +14 = + size 16 4 + group job_pardiso_multi_threads_ddm_automatic_gr + visible "*job_option pardiso_multi_threading_ddm:automatic" + } + + frame { + position = = + size 16 4 + group job_pardiso_multi_threads_ddm_user_gr + visible "*job_option pardiso_multi_threading_ddm:user" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_pardiso_multi_threads_ddm_automatic_gr { + + label { + position 0 0 + size 8 4 + text "VALUE" + border_width 1 + border_color black + } + + integer { + position +8 = + size 8 4 + display valid_domains + visible "*job_option ddm_generator:preprocessor" + } + + integer { + position = = + size 8 4 + display "job_param_ndomains" + visible "*job_option ddm_generator:fea_solver" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_pardiso_multi_threads_ddm_user_gr { + + label { + position 0 0 + size 8 4 + text "VALUE" + help job_param + } + + text { + position +8 = + size 8 4 + display "job_param_value_nthreads" + command "*job_param nthreads" + } +} + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_threads_it_ext_off_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE THREADS" + toggle "*job_option it_ext_multi_threading:on" + true_command "*job_option it_ext_multi_threading:on" + false_command "*job_option it_ext_multi_threading:off" + help job_run_multithreading + } + + label { + position +2 +4 + size 14 4 + text "# THREADS" + visible "*job_option it_ext_multi_threading:on" + help job_param + } + + text { + position +14 = + size 14 4 + display "job_param_value_nthreads" + command "*job_param nthreads" + visible "*job_option it_ext_multi_threading:on" + } +} + +#-------------------------------------------------------------------------------------------------- +group job_parallel_env_gr { + + roller { + position 1 4 + size 30 4 + nvalues 2 + texts "SINGLE MACHINE" + "NETWORK" + help job_run_ddm_setup + roller "job_option parallel_setup" + commands "*job_option parallel_setup:single" + "*job_option parallel_setup:network" + } + + frame { + position +2 +5 + size 44 18 + group job_parallel_env_network_gr + visible "*job_option parallel_setup:network" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_parallel_env_network_gr { + + button { + position 0 0 + size 28 4 + text "HOST FILE" + browser host_file_browser + settext $host_file_browser_label "SELECT HOST FILE" + set $host_file_browser_command "*job_host_file" + help job_host_file + } + + button { + position +28 = + size 8 4 + text "EDIT" + command "*job_edit_host_file" + help job_edit_host_file + visible job_host_file + } + + button { + position +8 = + size 8 4 + text "CLEAR" + command "*job_clear_host_file" + help job_clear_host_file + visible job_host_file + } + + display { + position 0 +4 + size 44 4 + display job_host_file + } + + frame { + position 0 +5 + size 44 9 + group job_parallel_env_network_ddm_gr + visible "*job_option parallel:on" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_parallel_env_network_ddm_gr { + + toggle { + position 0 0 + size 22 4 + text "COPY INPUT FILE" + toggle "*job_option copy_input_file:on" + true_command "*job_option copy_input_file:on" + false_command "*job_option copy_input_file:off" + help job_host_copy_inputfile + } + + toggle { + position +23 = + size 21 4 + text "COPY POST FILE" + toggle "*job_option copy_post_file:on" + true_command "*job_option copy_post_file:on" + false_command "*job_option copy_post_file:off" + help job_host_copy_inputfile + } + + label { + position 0 +5 + size 10 4 + text "HOSTS" + border_width 1 + border_color black + visible job_usersub_file + } + + roller { + position +10 = + size 18 4 + nvalues 2 + texts "COMPATIBLE" + "INCOMPATIBLE" + roller "job_option network_hosts" + commands "*job_option network_hosts:compatible" + "*job_option network_hosts:incompatible" + help job_host_comp + visible job_usersub_file + } +} + + +#endif diff --git a/installation/mods_MarcMentat/2016/Mentat_menus/job_run.ms.original b/installation/mods_MarcMentat/2016/Mentat_menus/job_run.ms.original new file mode 100644 index 000000000..e67605be2 --- /dev/null +++ b/installation/mods_MarcMentat/2016/Mentat_menus/job_run.ms.original @@ -0,0 +1,2522 @@ +#ifndef AUTOFORGE +popmenu job_title_pm file jobs.ms +popdown job_title_ok file jobs.ms + +group job_solver_gr file job_common.ms +group user_domains_gr file domain_decomposition.ms +group user_domains_generate_gr file domain_decomposition.ms +group user_domains_tail_gr file domain_decomposition.ms +group job_solver_opts_gr file job_common.ms +popmenu ddm_options file job_common.ms + +browser edit_browser file file.ms +browser directory_browser file file.ms +screen domains file domain_decomposition.ms + + + + browser usersub_file_browser { + position 0 0 + size 82 72 + text "$usersub_file_browser_label" ($usersub_file_browser_label) + filter "*.f *.F *.f90 *.F90" + nvisible 10 + select_files true + cancel_action popdown + ok_action popdown + command "$usersub_file_browser_command" ($usersub_file_browser_command) + } + + + + browser host_file_browser { + position 0 0 + size 82 72 + text "$host_file_browser_label" ($host_file_browser_label) + filter "*" + nvisible 10 + select_files true + cancel_action popdown + ok_action popdown + command "$host_file_browser_command" ($host_file_browser_command) + } + + +#-------------------------------------------------------------------------------------------------- +popmenu job_run_popmenu { + + text "RUN JOB" + + group { + + + label { + position 0 0 + size 6 4 + text "NAME" + } + + display { + position +6 = + size 26 4 + display "job_name" + } + + label { + position 0 +4 + size 6 4 + text "TYPE" + } + + display { + position +6 = + size 26 4 + display job_class_label + } + + button { + position 1 9 + size 24 4 + text "USER SUBROUTINE FILE" + browser usersub_file_browser + settext $usersub_file_browser_label "SELECT USER SUBROUTINE FILE" + set $usersub_file_browser_command "*job_usersub_file" + help job_usersub_file + } + + toggle { + position +26 = + size 22 4 + text "SELECTED USER SUBS" + toggle job_usersubs + help job_run_seluser + visible job_usersubs + popmenu job_usersub_pm + } + + display { + position 1 +4 + size 50 4 + display job_usersub_file + } + + button { + position 1 +4 + size 12 4 + text "EDIT" + command "*job_edit_usersub_file" + visible job_usersub_file + } + + button { + position +12 = + size 12 4 + text "CLEAR" + command "*job_clear_usersub_file" + visible job_usersub_file + } + + roller { + position +12 = + size 26 4 + nvalues 3 + texts "COMPILE / NO SAVE" + "COMPILE AND SAVE" + "RUN SAVED EXECUTABLE" + help job_run_compile + roller "job_option user_source" + visible job_usersub_file + commands "*job_option user_source:compile_nosave" + "*job_option user_source:compile_save" + "*job_option user_source:run_saved" + } + + toggle { + position 1 +6 + size 22 4 + text "PARALLELIZATION/\{GPU}" + help job_run_parallel + toggle "or(*job_option parallel:on, \ + *job_option assem_recov_multi_threading:on, \ + solver_multi_procs, \ + solver_multi_threads, \ + and(job_solver_mfront_sparse,\ + job_nonsym_off,\ + *job_option solver_use_gpu:on))" + popmenu job_run_parallelization_pm + set $popname2 "job_run_parallelization_pm" + } + + frame { + position +22 = + size 28 16 + border_width 1 + border_color black + + group { + + display { + position 0 0 + size 28 4 + display job_ddm_domains + } + + display { + position = +4 + size 28 4 + display job_assem_recov_nthreads + } + + display { + position = +4 + size 28 4 + display job_solver_procs + visible solver_allows_multi_procs + } + + display { + position = = + size 28 4 + display job_solver_threads + visible "and(solver_allows_multi_threads,\ + not(and(job_solver_mfront_sparse,\ + *job_option parallel:on)))" + } + + display { + position = +4 + size 28 4 + display job_solver_gpu + visible "and(job_solver_mfront_sparse,job_nonsym_off)" + } + } + } + + button { + position 1 +18 + size 8 4 + text "TITLE" + popmenu job_title_pm + command "*job_title" + } + +# see also job_common.ms +# see also the ADVANCED JOB SUBMISSION popmenu in this file + + label { + position +10 = + size 7 4 + text "STYLE" + border_width 1 + border_color black + } + + roller { + position +7 = + size 18 4 + nvalues 3 + texts "TABLE-DRIVEN" + "MULTI-PHYSICS" + "OLD" + rollers "job_input_style_table_driven" + "job_input_style_multi_physics" + "job_input_style_old" + commands "*job_option input_style:new *job_option input_physics_style:old" + "*job_option input_physics_style:new *job_option input_style:new" + "*job_option input_style:old *job_option input_physics_style:old" + visibles "job_allows_input_style_table_driven" + "job_allows_input_style_multi_physics" + "job_allows_input_style_old" + help job_option_input_style + } + + button { + position +20 = + size 13 4 + text "SAVE MODEL" + command "*save_model" + } + + button { + position 1 +6 + size 16 6 + text "SUBMIT (1)" + command "*submit_job 1 *monitor_job" + } + + button { + position +16 = + size 34 6 + text "ADVANCED JOB SUBMISSION" + popmenu job_submit_adv_pm + } + + button { + position 1 +6 + size 16 6 + text "UPDATE" + command "*update_job" + } + + button { + position +16 = + size 16 6 + text "MONITOR" + command "*monitor_job" + } + + button { + position +16 = + size 18 6 + text "KILL" + command "*kill_job *monitor_job" + } + + label { + position 1 +7 + size 32 4 + text "STATUS" + border_width 1 + border_color black + } + + display { + position +32 = + size 18 4 + display "job_status" + } + + label { + position -32 +4 + size 32 4 + text "CURRENT INCREMENT (CYCLE)" + border_width 1 + border_color black + } + + display { + position +32 = + size 18 4 + display "job_increment" + } + + label { + position -32 +4 + size 32 4 + text "SINGULARITY RATIO" + border_width 1 + border_color black + } + + float { + position +32 = + size 18 4 + display "job_singularity_ratio" + } + + label { + position -32 +4 + size 32 4 + text "CONVERGENCE RATIO" + border_width 1 + border_color black + } + + float { + position +32 = + size 18 4 + display "job_convergence_ratio" + } + + label { + position 1 +4 + size 32 4 + text "ANALYSIS TIME" + border_width 1 + border_color black + } + + float { + position +32 = + size 18 4 + display "job_analysis_time" + } + + label { + position -32 +4 + size 32 4 + text "WALL TIME" + border_width 1 + border_color black + } + + float { + position +32 = + size 18 4 + display "job_time" + } + + frame { + position 1 +4 + size 50 8 + + group { + + frame { + position 0 0 + size 50 8 + text "TOTAL" + border_width 1 + border_color black + group { + + label { + position +6 = + size 13 4 + text "CYCLES" + border_width 1 + border_color black + } + + integer { + position +13 = + size 10 4 + display "acc_job_cycles" + border_width 1 + border_color black + } + + label { + position -13 +4 + size 13 4 + text "SEPARATIONS" + border_width 1 + border_color black + } + + integer { + position +13 = + size 10 4 + display "acc_job_separations" + border_width 1 + border_color black + } + + label { + position +10 -4 + size 11 4 + text "CUT BACKS" + border_width 1 + border_color black + } + + integer { + position +11 = + size 10 4 + display "acc_job_cut_backs" + border_width 1 + border_color black + } + + label { + position -11 +4 + size 11 4 + text "REMESHES" + border_width 1 + border_color black + } + + integer { + position +11 = + size 10 4 + display "acc_job_remeshes" + border_width 1 + border_color black + } + } + } + } + } + + label { + position 1 +8 + size 19 4 + text "EXIT NUMBER" + border_width 1 + border_color black + } + + integer { + position +19 = + size 10 4 + display "job_exit" + } + + button { + position +10 = + size 21 4 + text "EXIT MESSAGE" + popmenu job_exit_msg_pm + help exit_message + } + + label { + position 1 +6 + size 7 4 + text "EDIT" + border_width 1 + border_color black + } + + button { + position +7 = + size 12 4 + text "OUTPUT FILE" + command "*job_edit_output" + } + + button { + position +12 = + size 9 4 + text "LOG FILE" + command "*job_edit_log_file" + } + + button { + position +9 = + size 12 4 + text "STATUS FILE" + command "*job_edit_status_file" + } + + button { + position +12 = + size 10 4 + text "ANY FILE" + settext $edit_browser_label "EDIT FILE" + set $edit_browser_command "*edit_file" + browser edit_browser + help edit_file + } + + popdown { + position 1 +6 + size 32 4 + text "OPEN POST FILE (MODEL PLOT RESULTS MENU)" + command "@popdown(job_properties_pm) @main(results) @popup(modelplot_pm) *post_open_default" + } + + button { + position 1 +6 + size 12 8 + text "RESET" + command "*job_submit_reset" + } + + popdown { + position +38 = + size 12 8 + text "OK" + } + } + + window job_run_wi { + parent mentat + origin 35 1 + size 52 115 + background_color body + border_width 1 + border_color border + buffering single + } + + mode permanent +} + + +#-------------------------------------------------------------------------------------------------- +popmenu job_usersub_pm { + + text "CURRENTLY SELECTED USER SUBROUTINES" + + group { + + + display { + position 1 +5 + size 64 86 + display "job_usersubs" + } + + popdown { + position 27 +88 + size 12 8 + text "OK" + } + } + + window { + parent mentat + origin 38 8 + size 66 102 + background_color body + border_width 1 + border_color border + buffering single + } + + mode dialog +} + + +#-------------------------------------------------------------------------------------------------- +popmenu job_submit_adv_pm { + + text "ADVANCED JOB SUBMISSION" + + group { + + + label { + position 0 0 + size 6 4 + text "NAME" + } + + display { + position +6 = + size 26 4 + display "job_name" + } + + label { + position 0 +4 + size 6 4 + text "TYPE" + } + + display { + position +6 = + size 26 4 + display job_class_label + } + + label { + position 1 9 + size 19 4 + text "INITIAL ALLOCATION" + border_width 1 + border_color black + } + label { + position +19 = + size 15 4 + text "GENERAL MEMORY" + help job_param_general_init_allocation + } + text { + position +15 = + size 10 4 + display "job_param_value_general_init_allocation" + command "*job_param general_init_allocation" + help job_param_general_init_allocation + } + + label { + position +10 = + size 4 4 + text "MB" + border_width 1 + border_color black + } + + toggle { + position 1 +5 + size 32 4 + text "OUT-OF-CORE ELEMENT STORAGE" + help job_param_elsto + toggle "*job_option elsto:on" + true_command "*job_option elsto:on" + false_command "*job_option elsto:off" + } + + toggle { + position 1 +4 + size 32 4 + text "OUT-OF-CORE INCREMENTAL BACKUP" + help job_param_inc_backup_storage + toggle "*job_option inc_backup_storage:out_of_core" + true_command "*job_option inc_backup_storage:out_of_core" + false_command "*job_option inc_backup_storage:in_core" + } + + toggle { + position +34 = + size 14 4 + text "CHECK SIZES" + help job_run_check + toggle "*job_option check:on" + true_command "*job_option check:on" + false_command "*job_option check:off" + } + + label { + position 1 +6 + size 16 4 + text "INTEGER SIZE" + border_width 1 + border_color black + } + + roller { + position +16 = + size 32 4 + nvalues 3 + texts "DEFAULT" + "4-BYTE INTEGERS" + "8-BYTE INTEGERS" + commands "*job_option marc_integer_size:default" + "*job_option marc_integer_size:i4" + "*job_option marc_integer_size:i8" + help job_run_intsize + roller "job_option marc_integer_size" + } + + frame { + position 1 +6 + size 48 12 + text "MARC INPUT FILE" + border_width 1 + border_color black + + group { + + label { + position 0 4 + size 9 4 + text "VERSION" + border_width 1 + border_color black + } + + roller { + position +9 = + size 14 4 + nvalues 22 + nvisible 22 + texts "DEFAULT" +#if 0 + "2016" +#endif + "2015" + "2014.2" + "2014.1" + "2014" + "2013.1" + "2013" + "2012" + "2011" + "2010.2" + "2010" + "2008" + "2007" + "2005R3" + "2005" + "2003" + "2001" + "2000" +#if 0 + "8" +#endif + "K7" + "K6.2" + "K5" + "K4" + help job_param_version + rollers "job_input_version_default" +#if 0 + "job_input_version_2016" +#endif + "job_input_version_2015" + "job_input_version_2014.2" + "job_input_version_2014.1" + "job_input_version_2014" + "job_input_version_2013.1" + "job_input_version_2013" + "job_input_version_2012" + "job_input_version_2011" + "job_input_version_2010.2" + "job_input_version_2010" + "job_input_version_2008" + "job_input_version_2007" + "job_input_version_2005r3" + "job_input_version_2005" + "job_input_version_2003" + "job_input_version_2001" + "job_input_version_2000" +#if 0 + "job_input_version_8" +#endif + "job_input_version_k7" + "job_input_version_k6" + "job_input_version_k5" + "job_input_version_k4" + commands "*job_option version:default" +#if 0 + "*job_option version:2016" +#endif + "*job_option version:2015" + "*job_option version:2014.2" + "*job_option version:2014.1" + "*job_option version:2014" + "*job_option version:2013.1" + "*job_option version:2013" + "*job_option version:2012" + "*job_option version:2011" + "*job_option version:2010.2" + "*job_option version:2010" + "*job_option version:2008" + "*job_option version:2007" + "*job_option version:2005r3" + "*job_option version:2005" + "*job_option version:2003" + "*job_option version:2001" + "*job_option version:2000" +#if 0 + "*job_option version:8" +#endif + "*job_option version:k7" + "*job_option version:k6" + "*job_option version:k5" + "*job_option version:k4" + visibles "job_allows_input_version_default" +#if 0 + "job_allows_input_version_2016" +#endif + "job_allows_input_version_2015" + "job_allows_input_version_2014.2" + "job_allows_input_version_2014.1" + "job_allows_input_version_2014" + "job_allows_input_version_2013.1" + "job_allows_input_version_2013" + "job_allows_input_version_2012" + "job_allows_input_version_2011" + "job_allows_input_version_2010.2" + "job_allows_input_version_2010" + "job_allows_input_version_2008" + "job_allows_input_version_2007" + "job_allows_input_version_2005r3" + "job_allows_input_version_2005" + "job_allows_input_version_2003" + "job_allows_input_version_2001" + "job_allows_input_version_2000" +#if 0 + "job_allows_input_version_8" +#endif + "job_allows_input_version_k7" + "job_allows_input_version_k6" + "job_allows_input_version_k5" + "job_allows_input_version_k4" + } + +# see also job_common.ms +# see also the RUN JOB popmenu in this file + + label { + position +14 = + size 7 4 + text "STYLE" + border_width 1 + border_color black + } + + roller { + position +7 = + size 18 4 + nvalues 3 + texts "TABLE-DRIVEN" + "MULTI-PHYSICS" + "OLD" + rollers "job_input_style_table_driven" + "job_input_style_multi_physics" + "job_input_style_old" + commands "*job_option input_style:new *job_option input_physics_style:old" + "*job_option input_physics_style:new *job_option input_style:new" + "*job_option input_style:old *job_option input_physics_style:old" + visibles "job_allows_input_style_table_driven" + "job_allows_input_style_multi_physics" + "job_allows_input_style_old" + help job_option_input_style + } + + toggle { + position 0 +4 + size 48 4 + text "EXTENDED PRECISION" + help job_run_precision + toggle "*job_option inp_file_prec:extended" + true_command "*job_option inp_file_prec:extended" + false_command "*job_option inp_file_prec:normal" + } + } + } + + button { + position 1 +14 + size 24 4 + text "SCRATCH DIRECTORY" + settext $directory_browser_label "JOB SCRATCH DIRECTORY" + set $directory_browser_command "*job_scratch_directory" + browser directory_browser + help job_scratch_directory + } + + button { + position +24 = + size 24 4 + text "CLEAR" + command "*job_clear_scratch_directory" + visible job_scratch_directory + } + + text { + position 1 +4 + size 48 4 + display job_scratch_dir + command "*job_scratch_directory" + } + +#ifdef DCOM + toggle { + position 1 +6 + size 8 4 + text "\{DCOM}" + toggle "*job_option dcom:on" + help job_run_dcom + true_command "*job_option dcom:on" + false_command "*job_option dcom:off" + visible win32_available + } + + button { + position +8 = + size 12 4 + text "HOSTNAME" + command "*job_dcom_hostname" + visible "and(win32_available, *job_option dcom:on)" + } + + text job_dcom_hostname { + position +12 = + size 28 4 + display "job_dcom_hostname" + command "*job_dcom_hostname" + visible "and(win32_available, *job_option dcom:on)" + } +#endif + + button { + position 1 +6 + size 24 4 + text "TITLE" + popmenu job_title_pm + command "*job_title" + } + + button { + position +24 = + size 24 4 + text "SAVE MODEL" + command "*save_model" + } + + button { + position +4 +6 + size 20 4 + text "WRITE INPUT FILE" + command "*job_write_input" + } + + button { + position = +4 + size 20 4 + text "EDIT INPUT FILE" + command "*job_edit_input" + } + + popdown { + position 1 +5 + size 20 6 + text "SUBMIT 1" + command "*submit_job 1 *monitor_job" + } + + popdown { + position +28 = + size 20 6 + text "EXECUTE 1" + command "*execute_job 1 *monitor_job" + } + + popdown { + position -28 +6 + size 20 6 + text "SUBMIT 2" + command "*submit_job 2 *monitor_job" + } + + popdown { + position +28 = + size 20 6 + text "EXECUTE 2" + command "*execute_job 2 *monitor_job" + } + + popdown { + position -28 +6 + size 20 6 + text "SUBMIT 3" + command "*submit_job 3 *monitor_job" + } + + popdown { + position +28 = + size 20 6 + text "EXECUTE 3" + command "*execute_job 3 *monitor_job" + } + + popdown { + position 19 +8 + size 12 8 + text "OK" + } + } + + window { + parent mentat + origin 38 8 +#ifdef DCOM + size 50 100 +#else + size 50 94 +#endif + background_color body + border_width 1 + border_color border + buffering single + } + + mode permanent +} + + +#-------------------------------------------------------------------------------------------------- +popmenu job_exit_msg_pm { + + text "EXIT MESSAGE" + + group { + + + + text { + position 1 5 + size 84 74 + multiline + readonly + display "job_exit_msg" + } + + popdown { + position 37 +76 + size 12 8 + text "OK" + } + } + + window { + parent mentat + origin 38 8 + size 86 90 + background_color body + border_width 1 + border_color border + buffering single + } + + mode dialog +} + + + + +#-------------------------------------------------------------------------------------------------- +popmenu job_run_parallelization_pm { + + text "PARALLELIZATION/\{GPU}" + + group { + + + label { + position 0 0 + size 6 4 + text "NAME" + } + + display { + position +6 = + size 26 4 + display "job_name" + } + + label { + position 0 +4 + size 6 4 + text "TYPE" + } + + display { + position +6 = + size 26 4 + display job_class_label + } + + frame { + position 1 9 + size 48 28 + group job_ddm_gr + text "DOMAIN DECOMPOSITION" + border_width 1 + border_color black + } + + frame { + position 1 +29 + size 36 13 + group job_assem_recov_gr + text "ASSEMBLY AND RECOVERY" + border_width 1 + border_color black + } + + frame { + position 1 +14 + size 58 31 + group job_parallel_matrix_solver_gr + text "MATRIX SOLVER" + border_width 1 + border_color black + } + + frame { + position 1 +32 + size 48 28 + group job_parallel_env_gr + text "PARALLELIZATION ENVIRONMENT" + border_width 1 + border_color black + visible "or(*job_option parallel:on, \ + solver_multi_procs)" + } + + popdown { + position 24 +30 + size 12 8 + text "OK" + } + } + + window { + parent mentat + origin 38 1 + size 60 119 + background_color body + border_width 1 + border_color border + buffering single + } + mode permanent +} + + +#-------------------------------------------------------------------------------------------------- +group job_ddm_gr { + + toggle { + position 1 4 + size 30 4 + text "USE \{DDM}" + toggle "*job_option parallel:on" + help job_run_ddm_use + true_command "*job_option parallel:on" + false_command "*job_option parallel:off" + active "not(job_solver_it_ext)" + } + + frame { + position +2 +5 + size 44 18 + group job_ddm_use_gr + visible "*job_option parallel:on" + } +} + +group job_ddm_use_gr { + roller { + position 0 0 + size 30 4 + nvalues 2 + texts "DECOMPOSITION IN MARC" + "DECOMPOSITION IN MENTAT" + roller "job_option ddm_generator" + commands "*job_option ddm_generator:fea_solver" + "*job_option ddm_generator:preprocessor" + help job_run_ddm_generator + } + + frame { + position 0 +5 + size 44 8 + group job_ddm_fea_solver_gr + visible "*job_option ddm_generator:fea_solver" + } + + frame { + position = = + size 44 8 + group job_ddm_preprocessor_gr + visible "*job_option ddm_generator:preprocessor" + } + + text { + position 0 +9 + size 22 4 + text "Single Input File" + readonly + visible "*job_option ddm_generator:fea_solver" + } + + roller { + position = = + size 22 4 + nvalues 2 + texts "MULTIPLE INPUT FILES" + "SINGLE INPUT FILE" + roller "job_option ddm_single_input" + commands "*job_option ddm_single_input:off" + "*job_option ddm_single_input:on" + visible "*job_option ddm_generator:preprocessor" + help job_run_ddm_single_input + } + + roller { + position +23 = + size 21 4 + nvalues 2 + texts "MULTIPLE POST FILES" + "SINGLE POST FILE" + roller "job_option ddm_single_post" + commands "*job_option ddm_single_post:off" + "*job_option ddm_single_post:on" + help job_run_ddm_single_post + } +} + + + + +#-------------------------------------------------------------------------------------------------- +group job_ddm_fea_solver_gr { + + label { + position 0 0 + size 10 4 + text "# DOMAINS" + help job_param + } + + text { + position +10 = + size 4 4 + display "job_param_value_ndomains" + command "*job_param ndomains" + } + + label { + position +4 = + size 7 4 + text "METHOD" + border_width 1 + border_color black + } + + roller { + position +7 = + size 23 4 + nvalues 7 + texts "METIS BEST" + "METIS ELEMENT" + "METIS NODE" + "REC. COORD. BISECTION" + "VECTOR" + "RADIAL" + "ANGULAR" + help set_job_decomp_type + rollers "*job_option ddm_method:metis_best" + "*job_option ddm_method:metis_element_based" + "*job_option ddm_method:metis_node_based" + "*job_option ddm_method:recur_coord_bisect" + "*job_option ddm_method:vector" + "*job_option ddm_method:radial" + "*job_option ddm_method:angular" + commands "*job_option ddm_method:metis_best" + "*job_option ddm_method:metis_element_based" + "*job_option ddm_method:metis_node_based" + "*job_option ddm_method:recur_coord_bisect" + "*job_option ddm_method:vector" + "*job_option ddm_method:radial" + "*job_option ddm_method:angular" + } + + button { + position +4 +4 + size 19 4 + text "ADVANCED SETTINGS" + popmenu job_ddm_fea_solver_pm + } +} + + + + +#-------------------------------------------------------------------------------------------------- +popmenu job_ddm_fea_solver_pm { + + text "JOB PARALLELIZATION" + + group { + units 32 120 + + + label { + position 0 5 + size 6 4 + text "NAME" + } + + display { + position +6 = + size 26 4 + display "job_name" + } + + label { + position 0 +4 + size 6 4 + text "TYPE" + } + + display { + position +6 = + size 26 4 + display job_class_label + } + + frame { + + position 0 +9 + size 32 76 + text "ADVANCED DECOMPOSITION IN MARC" + border_width 1 + border_color black + + group { + + label { + position 1 4 + size 16 4 + text "# DOMAINS" + help job_param + } + + text { + position +16 = + size 14 4 + display "job_param_value_ndomains" + command "*job_param ndomains" + } + + label { + position 1 +4 + size 7 4 + text "METHOD" + border_width 1 + border_color black + } + + roller { + position +7 = + size 23 4 + nvalues 7 + texts "METIS BEST" + "METIS ELEMENT" + "METIS NODE" + "REC. COORD. BISECTION" + "VECTOR" + "RADIAL" + "ANGULAR" + help set_job_decomp_type + rollers "*job_option ddm_method:metis_best" + "*job_option ddm_method:metis_element_based" + "*job_option ddm_method:metis_node_based" + "*job_option ddm_method:recur_coord_bisect" + "*job_option ddm_method:vector" + "*job_option ddm_method:radial" + "*job_option ddm_method:angular" + commands "*job_option ddm_method:metis_best" + "*job_option ddm_method:metis_element_based" + "*job_option ddm_method:metis_node_based" + "*job_option ddm_method:recur_coord_bisect" + "*job_option ddm_method:vector" + "*job_option ddm_method:radial" + "*job_option ddm_method:angular" + } + + frame { + position 1 +5 + size 30 20 + group job_ddm_direction_gr + visible "or(*job_option ddm_method:vector, \ + *job_option ddm_method:radial, \ + *job_option ddm_method:angular)" + } + + toggle { + position 1 +21 + size 30 4 + text "DOMAIN ISLAND REMOVAL" + toggle "*job_option ddm_island_removal:on" + true_command "*job_option ddm_island_removal:on" + false_command "*job_option ddm_island_removal:off" + } + + label { + position 1 +4 + size 15 4 + border_width 1 + border_color black + text "GRAPH" + } + + roller { + position +15 = + size 15 4 + nvalues 2 + texts "COARSE" + "FINE" + help ddm_decomp_coarse_graph + rollers "*job_option ddm_graph:coarse" + "*job_option ddm_graph:fine" + commands "*job_option ddm_graph:coarse" + "*job_option ddm_graph:fine" + visible "or(*job_option ddm_method:metis_best, \ + *job_option ddm_method:metis_element_based, \ + *job_option ddm_method:metis_node_based)" + } + + label { + position 1 +4 + size 15 4 + border_width 1 + border_color black + text "QUADRATIC ELEMENTS" + } + + roller { + position +15 = + size 15 4 + nvalues 2 + texts "GENUINE" + "LINEARIZED" + help job_run_ddm_decomp_linearized + rollers "*job_option ddm_quadr_elems:genuine" + "*job_option ddm_quadr_elems:linearized" + commands "*job_option ddm_quadr_elems:genuine" + "*job_option ddm_quadr_elems:linearized" + } + + label { + position 1 +5 + size 15 4 + text "ELEMENT WEIGHT FACTOR" + help job_param + } + + text { + position +15 = + size 15 4 + display "job_param_value_ddm_elem_weight_factor" + command "*job_param ddm_elem_weight_factor" + help job_run_ddm_decomp_element_weight_factor + } + + toggle { + position 1 +5 + size 30 4 + text "DETECT CONTACT" + toggle "*job_option ddm_detect_contact:on" + true_command "*job_option ddm_detect_contact:on" + false_command "*job_option ddm_detect_contact:off" + visible "or(*job_option ddm_method:metis_best, \ + *job_option ddm_method:metis_element_based, \ + *job_option ddm_method:metis_node_based)" + help job_run_ddm_decomp_detect_contact + } + + label { + position = +5 + size 15 4 + text "CONTACT TOLERANCE" + visible "*job_option ddm_detect_contact:on" + } + + text { + position +15 = + size 15 4 + command "*set_ddm_contact_tolerance" + display "job_param_value_ddm_contact_tolerance" + command "*job_param ddm_contact_tolerance" + visible "*job_option ddm_detect_contact:on" + help job_run_ddm_decomp_contact_tolerance + } + + label { + position -15 +4 + size 15 4 + text "CONTACT CONSTR FACTOR" + visible "*job_option ddm_detect_contact:on" + } + + text { + position +15 = + size 15 4 + display "job_param_value_ddm_contact_constr_factor" + command "*job_param ddm_contact_constr_factor" + visible "*job_option ddm_detect_contact:on" + help job_run_ddm_decomp_contact_constraint_factor + } + } + } + + popdown { + position 0 +77 + size 32 8 + text "OK" + } + } + mode permanent +} # job_ddm_fea_solver_pm + + + + +#-------------------------------------------------------------------------------------------------- +group job_ddm_direction_gr { + + button { + position 0 0 + size 15 4 + text "DIRECTION" + command "*job_vector ddm_sort_direction_x" + visible "*job_option ddm_method:vector" + } + + button { + position = = + size 15 4 + text "DIRECTION" + command "*job_vector ddm_sort_direction_x" + visible "not(*job_option ddm_method:vector)" + } + + button { + position +15 = + size 15 4 + text "FROM / TO" + command "*job_vector_from_to ddm_sort_direction_x" + } + + text { + position -15 +4 + size 10 4 + command "*job_param ddm_sort_direction_x" + display "job_param_value_ddm_sort_direction_x" + help ddm_job_decomp_user_direction_x + } + + text { + position +10 = + size 10 4 + command "*job_param ddm_sort_direction_y" + display "job_param_value_ddm_sort_direction_y" + } + + text { + position +10 = + size 10 4 + command "*job_param ddm_sort_direction_z" + display "job_param_value_ddm_sort_direction_z" + } + + frame { + position 0 +4 + size 30 8 + group job_ddm_sort_point_gr + visible "not(*job_option ddm_method:vector)" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_ddm_sort_point_gr { + + label { + position 0 0 + size 14 4 + border_width 1 + border_color black + text "POINT ON AXIS" + } + + roller { + position +14 = + size 10 4 + nvalues 2 + texts "DEFAULT" + "USER" + roller "job_option ddm_sort_point" + commands "*job_option ddm_sort_point:default" + "*job_option ddm_sort_point:user" + } + + button { + position +10 = + size 6 4 + text "SET" + command "*job_position ddm_sort_point_x" + visible "*job_option ddm_sort_point:user" + } + + text { + position 0 +4 + size 10 4 + command "*job_param ddm_sort_point_x" + display "job_param_value_ddm_sort_point_x" + visible "*job_option ddm_sort_point:user" + } + + text { + position +10 = + size 10 4 + command "*job_param ddm_sort_point_y" + display "job_param_value_ddm_sort_point_y" + visible "*job_option ddm_sort_point:user" + } + + text { + position +10 = + size 10 4 + command "*job_param ddm_sort_point_z" + display "job_param_value_ddm_sort_point_z" + visible "*job_option ddm_sort_point:user" + } +} + + + + +#-------------------------------------------------------------------------------------------------- +group job_ddm_preprocessor_gr { + + label { + position 0 0 + size 10 4 + text "# DOMAINS" + border_width 1 + border_color black + } + + integer { + position +10 = + size 4 4 + display valid_domains + } + + button { + position +4 = + size 30 4 + text "USER DOMAINS" + popmenu domains_pm + help job_run_ddm_user_domains + } +} + + + + +#-------------------------------------------------------------------------------------------------- +group job_assem_recov_gr { + + toggle { + position 1 +4 + size 30 4 + text "MULTIPLE THREADS" + true_command "*job_option assem_recov_multi_threading:on" + false_command "*job_option assem_recov_multi_threading:off" + toggle "*job_option assem_recov_multi_threading:on" + } + + label { + position +2 +4 + size 12 4 + text "# THREADS" + visible "*job_option assem_recov_multi_threading:on" + } + + text { + position +12 = + size 4 4 + display "job_param_value_assem_recov_nthreads" + command "*job_param assem_recov_nthreads" + visible "*job_option assem_recov_multi_threading:on" + } + + label { + position +4 = + size 12 4 + visible "and(*job_option assem_recov_multi_threading:on, \ + *job_option parallel:on)" + text "PER DOMAIN" + border_width 1 + border_color black + } + + display { + position +12 = + size 4 4 + display "job_assem_recov_nthreads_dom" + visible "and(*job_option assem_recov_multi_threading:on, \ + *job_option parallel:on)" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_parallel_matrix_solver_gr { + + label { + position 3 4 + size 12 4 + text "SOLUTION" + border_width 1 + border_color black + } + + roller { + position +12 = + size 18 4 + nvalues 2 + texts "SYMMETRIC" + "NONSYMMETRIC" + rollers job_nonsym_off + job_nonsym_on + commands "*job_option solver_nonsym:off" + "*job_option solver_nonsym:on" + help job_param_solver_method + } + + label { + position -12 +4 + size 6 4 + text "TYPE" + border_width 1 + border_color black + } + + roller { + position +6 = + size 24 4 + nvalues 9 + help job_param_solver_method + texts "MULTIFRONTAL SPARSE" + "MIXED DIRECT-ITERATIVE" + "CASI ITERATIVE" + "PARDISO DIRECT SPARSE" + "MUMPS PARALLEL DIRECT" + "HARDWARE SPARSE" + "ITERATIVE SPARSE" + "DIRECT PROFILE" + "DIRECT SPARSE" + rollers job_solver_mfront_sparse + job_solver_mixed_direct_iterative + job_solver_it_ext + job_solver_pardiso + job_solver_mumps + job_solver_sparse + job_solver_it_sparse + job_solver_dir_profile + job_solver_dir_sparse + commands "*job_option solver:mfront_sparse" + "*job_option solver:mixed_direct_iterative" + "*job_option solver:it_ext" + "*job_option solver:pardiso" + "*job_option solver:mumps" + "*job_option solver:sparse" + "*job_option solver:it_sparse" + "*job_option solver:dir_profile" + "*job_option solver:dir_sparse" + visibles job_allows_solver_mfront_sparse + job_allows_solver_mixed_direct_iterative + job_allows_solver_it_ext + job_allows_solver_pardiso + job_allows_solver_mumps + job_allows_solver_sparse + job_allows_solver_it_sparse + job_allows_solver_dir_profile + job_allows_solver_dir_sparse + help job_param_solver_method + } + + button { + position +24 = + size 10 4 + text "OPTIONS" + popmenu job_parallel_matrix_solver_opt_pm + } + + frame { + position +10 = + size 14 4 + group job_run_solver_ddm_opts_gr + visible "*job_option parallel:on" + } + + frame { + position 1 +5 + size 46 8 + group job_solver_multi_procs_gr + visible solver_allows_multi_procs + } + + frame { + position = = + size 46 8 + group job_solver_multi_threads_gr + visible solver_allows_multi_threads + } + + frame { + position 1 +9 + size 46 8 + group job_solver_gpu_gr + visible "and(job_solver_mfront_sparse,job_nonsym_off)" + } +} + + + + +#-------------------------------------------------------------------------------------------------- +popmenu job_parallel_matrix_solver_opt_pm { + + text "MATRIX SOLVER OPTIONS" + + group { + + + frame { + position 1 5 + size 36 23 + group job_solver_opts_gr + } + + popdown { + position 13 +25 + size 12 8 + text "OK" + } + } + + window { + parent mentat + origin 41 12 + size 38 39 + border_width 1 + border_color border + background_color body + } + mode dialog +} + + +#-------------------------------------------------------------------------------------------------- +group job_run_solver_ddm_opts_gr { + + button { + position 0 0 + size 14 4 + text "\{DDM} OPTIONS" + popmenu ddm_options +# see also job_common.ms! + visible "not(or(job_solver_it_sparse, \ + job_solver_it_ext, \ + job_solver_mixed_direct_iterative, \ + job_solver_pardiso, \ + job_solver_mumps))" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_procs_gr { + frame { + position 0 0 + size 46 8 + group job_solver_multi_procs_parallel_off_gr + visible "*job_option parallel:off" + } + + frame { + position = = + size 46 8 + group job_solver_multi_procs_parallel_on_gr + visible "*job_option parallel:on" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_procs_parallel_off_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE SOLVER PROCESSES" + true_command "*job_option nsolver_procs_serial:on" + false_command "*job_option nsolver_procs_serial:off" + toggle "*job_option nsolver_procs_serial:on" + help job_run_multithreading + } + + label { + position +2 +4 + size 14 4 + text "# PROCESSES" + visible "*job_option nsolver_procs_serial:on" + help job_param + } + + text { + position +14 = + size 14 4 + display "job_param_value_nsolver_procs" + command "*job_param nsolver_procs" + visible "*job_option nsolver_procs_serial:on" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_procs_parallel_on_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE SOLVER PROCESSES" + help job_run_multithreading + toggle true + set $dummy dummy + } + + label { + position +2 +4 + size 14 4 + text "# PROCESSES" + border_width 1 + border_color black + } + + roller { + position +14 = + size 14 4 + nvalues 2 + texts "AUTOMATIC" + "USER" + commands "*job_option nsolver_procs_ddm:automatic" + "*job_option nsolver_procs_ddm:user" + help job_run_multithreading + rollers "*job_option nsolver_procs_ddm:automatic" + "*job_option nsolver_procs_ddm:user" + } + + frame { + position +14 = + size 16 4 + group job_nsolver_procs_ddm_automatic_gr + visible "*job_option nsolver_procs_ddm:automatic" + } + + frame { + position = = + size 16 4 + group job_nsolver_procs_ddm_user_gr + visible "*job_option nsolver_procs_ddm:user" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_nsolver_procs_ddm_automatic_gr { + + label { + position 0 0 + size 8 4 + text "VALUE" + border_width 1 + border_color black + } + + integer { + position +8 = + size 8 4 + display valid_domains + visible "*job_option ddm_generator:preprocessor" + } + + integer { + position = = + size 8 4 + display "job_param_ndomains" + visible "*job_option ddm_generator:fea_solver" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_nsolver_procs_ddm_user_gr { + + label { + position 0 0 + size 8 4 + text "VALUE" + help job_param + } + + text { + position +8 = + size 8 4 + display "job_param_value_nsolver_procs" + command "*job_param nsolver_procs" + } +} + +group job_solver_multi_threads_gr { + frame { + position 0 0 + size 46 8 + group job_solver_multi_threads_mfront_sparse_parallel_off_gr + visible "and(job_solver_mfront_sparse,*job_option parallel:off)" + } + + frame { + position = = + size 46 8 + group job_solver_multi_threads_mfront_sparse_parallel_on_gr + visible "and(job_solver_mfront_sparse,*job_option parallel:on)" + } + + frame { + position = = + size 46 8 + group job_solver_multi_threads_pardiso_parallel_off_gr + visible "and(job_solver_pardiso,*job_option parallel:off)" + } + + frame { + position = = + size 46 8 + group job_solver_multi_threads_pardiso_parallel_on_gr + visible "and(job_solver_pardiso,*job_option parallel:on)" + } + + frame { + position = = + size 46 8 + group job_solver_multi_threads_it_ext_off_gr + visible "and(job_solver_it_ext,*job_option parallel:off)" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_threads_mfront_sparse_parallel_off_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE THREADS" + toggle "*job_option mfront_sparse_multi_threading:on" + true_command "*job_option mfront_sparse_multi_threading:on" + false_command "*job_option mfront_sparse_multi_threading:off" + help job_run_multithreading + } + + label { + position +2 +4 + size 14 4 + text "# THREADS" + visible "*job_option mfront_sparse_multi_threading:on" + help job_param + } + + text { + position +14 = + size 14 4 + display "job_param_value_nthreads" + command "*job_param nthreads" + visible "*job_option mfront_sparse_multi_threading:on" + } +} + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_threads_mfront_sparse_parallel_on_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE THREADS" + help job_run_multithreading + toggle true + set $dummy dummy + } + + label { + position +30 0 + size 12 4 + visible "and( not(*job_option ddm_precond:direct)\ + *job_option parallel:on)" + text "PER DOMAIN" + border_width 1 + border_color black + } + + display { + position +12 0 + size 4 4 + display "job_mfront_sparse_nthreads_dom" + visible "and( not(*job_option ddm_precond:direct)\ + *job_option parallel:on)" + } + + label { + position 2 +4 + size 14 4 + text "# THREADS" + border_color black + border_width 1 + } + + roller { + position +14 = + size 14 4 + nvalues 2 + texts "AUTOMATIC" + "USER" + commands "*job_option mfront_sparse_multi_threading_ddm:automatic" + "*job_option mfront_sparse_multi_threading_ddm:user" + help job_run_multithreading + rollers "*job_option mfront_sparse_multi_threading_ddm:automatic" + "*job_option mfront_sparse_multi_threading_ddm:user" + } + + frame { + position +14 = + size 16 4 + group job_mfront_sparse_multi_threads_ddm_automatic_gr + visible "*job_option mfront_sparse_multi_threading_ddm:automatic" + } + + frame { + position = = + size 16 4 + group job_mfront_sparse_multi_threads_ddm_user_gr + visible "*job_option mfront_sparse_multi_threading_ddm:user" + } +} +#-------------------------------------------------------------------------------------------------- +group job_mfront_sparse_multi_threads_ddm_automatic_gr { + + label { + position 0 0 + size 8 4 + text "VALUE" + border_width 1 + border_color black + } + + integer { + position +8 = + size 8 4 + display valid_domains + visible "*job_option ddm_generator:preprocessor" + } + + integer { + position = = + size 8 4 + display "job_param_ndomains" + visible "*job_option ddm_generator:fea_solver" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_mfront_sparse_multi_threads_ddm_user_gr { + + label { + position 0 0 + size 8 4 + text "VALUE" + } + + text { + position +8 = + size 8 4 + display "job_param_value_nthreads" + command "*job_param nthreads" + } +} + + + +#-------------------------------------------------------------------------------------------------- +group job_solver_gpu_gr { + + toggle { + position 0 0 + size 30 4 + text "USE \{GPU(s)}" + toggle "*job_option solver_use_gpu:on" + true_command "*job_option solver_use_gpu:on" + false_command "*job_option solver_use_gpu:off" + help job_solver_gpu + } + + label { + position +2 +4 + size 16 4 + text "\{GPU} SELECTION" + border_width 1 + border_color black + visible "*job_option solver_use_gpu:on" + } + + roller { + position +16 = + size 12 4 + nvalues 2 + texts "AUTOMATIC" + "USER" + commands "*job_option solver_gpus:automatic" + "*job_option solver_gpus:user" + rollers "*job_option solver_gpus:automatic" + "*job_option solver_gpus:user" + visible "*job_option solver_use_gpu:on" + help job_solver_gpu + } + + text { + position +12 = + size 16 4 + display job_solver_gpus + command "*clear_job_solver_gpus *job_solver_gpus" + visible "and(*job_option solver_use_gpu:on,*job_option solver_gpus:user)" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_threads_pardiso_parallel_off_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE THREADS" + toggle "*job_option pardiso_multi_threading:on" + true_command "*job_option pardiso_multi_threading:on" + false_command "*job_option pardiso_multi_threading:off" + help job_run_multithreading + } + + label { + position +2 +4 + size 14 4 + text "# THREADS" + visible "*job_option pardiso_multi_threading:on" + help job_param + } + + text { + position +14 = + size 14 4 + display "job_param_value_nthreads" + command "*job_param nthreads" + visible "*job_option pardiso_multi_threading:on" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_threads_pardiso_parallel_on_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE THREADS" + help job_run_multithreading + toggle true + set $dummy dummy + } + + label { + position +2 +4 + size 14 4 + text "# THREADS" + border_color black + border_width 1 + } + + roller { + position +14 = + size 14 4 + nvalues 2 + texts "AUTOMATIC" + "USER" + commands "*job_option pardiso_multi_threading_ddm:automatic" + "*job_option pardiso_multi_threading_ddm:user" + help job_run_multithreading + rollers "*job_option pardiso_multi_threading_ddm:automatic" + "*job_option pardiso_multi_threading_ddm:user" + } + + frame { + position +14 = + size 16 4 + group job_pardiso_multi_threads_ddm_automatic_gr + visible "*job_option pardiso_multi_threading_ddm:automatic" + } + + frame { + position = = + size 16 4 + group job_pardiso_multi_threads_ddm_user_gr + visible "*job_option pardiso_multi_threading_ddm:user" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_pardiso_multi_threads_ddm_automatic_gr { + + label { + position 0 0 + size 8 4 + text "VALUE" + border_width 1 + border_color black + } + + integer { + position +8 = + size 8 4 + display valid_domains + visible "*job_option ddm_generator:preprocessor" + } + + integer { + position = = + size 8 4 + display "job_param_ndomains" + visible "*job_option ddm_generator:fea_solver" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_pardiso_multi_threads_ddm_user_gr { + + label { + position 0 0 + size 8 4 + text "VALUE" + help job_param + } + + text { + position +8 = + size 8 4 + display "job_param_value_nthreads" + command "*job_param nthreads" + } +} + +#-------------------------------------------------------------------------------------------------- +group job_solver_multi_threads_it_ext_off_gr { + + toggle { + position 0 0 + size 30 4 + text "MULTIPLE THREADS" + toggle "*job_option it_ext_multi_threading:on" + true_command "*job_option it_ext_multi_threading:on" + false_command "*job_option it_ext_multi_threading:off" + help job_run_multithreading + } + + label { + position +2 +4 + size 14 4 + text "# THREADS" + visible "*job_option it_ext_multi_threading:on" + help job_param + } + + text { + position +14 = + size 14 4 + display "job_param_value_nthreads" + command "*job_param nthreads" + visible "*job_option it_ext_multi_threading:on" + } +} + +#-------------------------------------------------------------------------------------------------- +group job_parallel_env_gr { + + roller { + position 1 4 + size 30 4 + nvalues 2 + texts "SINGLE MACHINE" + "NETWORK" + help job_run_ddm_setup + roller "job_option parallel_setup" + commands "*job_option parallel_setup:single" + "*job_option parallel_setup:network" + } + + frame { + position +2 +5 + size 44 18 + group job_parallel_env_network_gr + visible "*job_option parallel_setup:network" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_parallel_env_network_gr { + + button { + position 0 0 + size 28 4 + text "HOST FILE" + browser host_file_browser + settext $host_file_browser_label "SELECT HOST FILE" + set $host_file_browser_command "*job_host_file" + help job_host_file + } + + button { + position +28 = + size 8 4 + text "EDIT" + command "*job_edit_host_file" + help job_edit_host_file + visible job_host_file + } + + button { + position +8 = + size 8 4 + text "CLEAR" + command "*job_clear_host_file" + help job_clear_host_file + visible job_host_file + } + + display { + position 0 +4 + size 44 4 + display job_host_file + } + + frame { + position 0 +5 + size 44 9 + group job_parallel_env_network_ddm_gr + visible "*job_option parallel:on" + } +} + + +#-------------------------------------------------------------------------------------------------- +group job_parallel_env_network_ddm_gr { + + toggle { + position 0 0 + size 22 4 + text "COPY INPUT FILE" + toggle "*job_option copy_input_file:on" + true_command "*job_option copy_input_file:on" + false_command "*job_option copy_input_file:off" + help job_host_copy_inputfile + } + + toggle { + position +23 = + size 21 4 + text "COPY POST FILE" + toggle "*job_option copy_post_file:on" + true_command "*job_option copy_post_file:on" + false_command "*job_option copy_post_file:off" + help job_host_copy_inputfile + } + + label { + position 0 +5 + size 10 4 + text "HOSTS" + border_width 1 + border_color black + visible job_usersub_file + } + + roller { + position +10 = + size 18 4 + nvalues 2 + texts "COMPATIBLE" + "INCOMPATIBLE" + roller "job_option network_hosts" + commands "*job_option network_hosts:compatible" + "*job_option network_hosts:incompatible" + help job_host_comp + visible job_usersub_file + } +} + + +#endif diff --git a/installation/symlink_Code.py b/installation/symlink_Code.py index 933f31c8e..bf5df1d49 100755 --- a/installation/symlink_Code.py +++ b/installation/symlink_Code.py @@ -19,6 +19,7 @@ MarcReleases =[ \ '2014', '2014.2', '2015', + '2016' ] damaskEnv = damask.Environment() diff --git a/lib/MarcInclude/concom2016 b/lib/MarcInclude/concom2016 new file mode 100644 index 000000000..e26774bfc --- /dev/null +++ b/lib/MarcInclude/concom2016 @@ -0,0 +1,417 @@ +! common block definition file taken from respective MSC.Marc release and reformated to free format +!*********************************************************************** +! +! File: concom.cmn +! +! MSC.Marc include file +! +integer(pInt) & + iacous, iasmbl, iautth, ibear, icompl, iconj, icreep, ideva, idyn, idynt,& + ielas, ielcma, ielect, iform, ifour, iharm, ihcps, iheat, iheatt, ihresp,& + ijoule, ilem, ilnmom, iloren, inc, incext, incsub, ipass, iplres, ipois,& + ipoist, irpflo, ismall, ismalt, isoil, ispect, ispnow, istore, iswep, ithcrp,& + itherm, iupblg, iupdat, jacflg, jel, jparks, largst, lfond, loadup, loaduq,& + lodcor, lovl, lsub, magnet, ncycle, newtnt, newton, noshr, linear, ivscpl,& + icrpim, iradrt, ipshft, itshr, iangin, iupmdr, iconjf, jincfl, jpermg, jhour,& + isolvr, jritz, jtable, jshell, jdoubl, jform, jcentr, imini, kautth, iautof,& + ibukty, iassum, icnstd, icnstt, kmakmas, imethvp, iradrte, iradrtp, iupdate, iupdatp,& + ncycnt, marmen , idynme, ihavca, ispf, kmini, imixex, largtt, kdoela, iautofg,& + ipshftp, idntrc, ipore, jtablm, jtablc, isnecma, itrnspo, imsdif, jtrnspo, mcnear,& + imech, imecht, ielcmat, ielectt, magnett, imsdift, noplas, jtabls, jactch, jtablth,& + kgmsto , jpzo, ifricsh, iremkin, iremfor, ishearp, jspf, machining, jlshell, icompsol,& + iupblgfo, jcondir, nstcrp, nactive, ipassref, nstspnt, ibeart, icheckmpc, noline, icuring,& + ishrink, ioffsflg, isetoff, ioffsetm,iharmt, inc_incdat, iautspc, ibrake, icbush, istream_input,& + iprsinp, ivlsinp, ifirst_time,ipin_m, jgnstr_glb, imarc_return,iqvcinp, nqvceid, istpnx, imicro1,& + iaxisymm, jbreakglue,iglstif, jfastasm,iwear, iwearcf, imixmeth, ielcmadyn, idinout, igena_meth,& + magf_meth, non_assumed, iredoboudry, ioffsz0,icomplt, mesh_dual, iactrp, mgnewton, iusedens,igsigd0,& + iaem, icosim, inodels, nlharm, iampini, iphasetr +dimension :: ideva(60) +integer(pInt) num_concom +parameter(num_concom=245) +common/marc_concom/& + iacous, iasmbl, iautth, ibear, icompl, iconj, icreep, ideva, idyn, idynt,& + ielas, ielcma, ielect, iform, ifour, iharm, ihcps, iheat, iheatt, ihresp,& + ijoule, ilem, ilnmom, iloren, inc, incext, incsub, ipass, iplres, ipois,& + ipoist, irpflo, ismall, ismalt, isoil, ispect, ispnow, istore, iswep, ithcrp,& + itherm, iupblg, iupdat, jacflg, jel, jparks, largst, lfond, loadup, loaduq,& + lodcor, lovl, lsub, magnet, ncycle, newtnt, newton, noshr, linear, ivscpl,& + icrpim, iradrt, ipshft, itshr, iangin, iupmdr, iconjf, jincfl, jpermg, jhour,& + isolvr, jritz, jtable, jshell, jdoubl, jform, jcentr, imini, kautth, iautof,& + ibukty, iassum, icnstd, icnstt, kmakmas, imethvp, iradrte, iradrtp, iupdate, iupdatp,& + ncycnt, marmen, idynme, ihavca, ispf, kmini, imixex, largtt, kdoela, iautofg,& + ipshftp, idntrc, ipore, jtablm, jtablc, isnecma, itrnspo, imsdif, jtrnspo, mcnear,& + imech, imecht, ielcmat, ielectt, magnett, imsdift, noplas, jtabls, jactch, jtablth,& + kgmsto , jpzo, ifricsh, iremkin, iremfor, ishearp, jspf, machining, jlshell, icompsol,& + iupblgfo, jcondir, nstcrp, nactive, ipassref, nstspnt, ibeart, icheckmpc, noline, icuring,& + ishrink, ioffsflg, isetoff, ioffsetm,iharmt, inc_incdat, iautspc, ibrake, icbush , istream_input,& + iprsinp, ivlsinp, ifirst_time,ipin_m, jgnstr_glb, imarc_return,iqvcinp, nqvceid, istpnx, imicro1,& + iaxisymm, jbreakglue,iglstif, jfastasm,iwear, iwearcf, imixmeth, ielcmadyn, idinout,igena_meth,& + magf_meth, non_assumed, iredoboudry, ioffsz0,icomplt, mesh_dual, iactrp, mgnewton, iusedens,igsigd0,& + iaem, icosim, inodels, nlharm, iampini, iphasetr +! +! comments of variables: +! +! iacous Control flag for acoustic analysis. Input data. +! iacous=1 modal acoustic analysis. +! iacous=2 harmonic acoustic-structural analysis. +! iasmbl Control flag to indicate that operator matrix should be +! recalculated. +! iautth Control flag for AUTO THERM option. +! ibear Control flag for bearing analysis. Input data. +! icompl Control variable to indicate that a complex analysis is +! being performed. Either a Harmonic analysis with damping, +! or a harmonic electro-magnetic analysis. Input data. +! iconj Flag for EBE conjugate gradient solver (=solver 1, retired) +! Also used for VKI iterative solver. +! icreep Control flag for creep analysis. Input data. +! ideva(60) - debug print out flag +! 1 print element stiffness matrices, mass matrix +! 2 output matrices used in tying +! 3 force the solution of a nonpositive definite matrix +! 4 print info of connections to each node +! 5 info of gap convergence, internal heat generated, contact +! touching and separation +! 6 nodal value array during rezoning +! 7 tying info in CONRAD GAP option, fluid element numbers in +! CHANNEL option +! 8 output incremental displacements in local coord. system +! 9 latent heat output +! 10 stress-strain in local coord. system +! 11 additional info on interlaminar stress +! 12 output right hand side and solution vector +! 13 info of CPU resources used and memory available on NT +! 14 info of mesh adaption process, 2D outline information +! info of penetration checking for remeshing +! save .fem files after afmesh3d meshing +! 15 surface energy balance flag +! 16 print info regarding pyrolysis +! 17 print info of "streamline topology" +! 18 print mesh data changes after remeshing +! 19 print material flow stress data read in from *.mat file +! if unit flag is on, print out flow stress after conversion +! 20 print information on table input +! 21 print out information regarding kinematic boundary conditions +! 22 print out information regarding dist loads, point loads, film +! and foundations +! 23 print out information about automatic domain decomposition +! 24 print out iteration information in SuperForm status report file +! 25 print out information for ablation +! 26 print out information for films - Table input +! 27 print out the tying forces +! 28 print out for CASI solver, convection, +! 29 DDM single file debug printout +! 30 print out cavity debug info +! 31 print out welding related info +! 32 prints categorized DDM memory usage +! 33 print out the cutting info regarding machining feature +! 34 print out the list of quantities which can be defined via a table +! and for each quantity the supported independent variables +! 35 print out detailed coupling region info +! 36 print out solver debug info level 1 (Least Detailed) +! 37 print out solver debug info level 1 (Medium Detailed) +! 38 print out solver debug info level 1 (Very Detailed) +! 39 print detailed memory allocation info +! 40 print out marc-adams debug info +! 41 output rezone mapping post file for debugging +! 42 output post file after calling oprofos() for debugging +! 43 debug printout for vcct +! 44 debug printout for progressive failure +! 45 print out automatically generated midside node coordinates (arecrd) +! 46 print out message about routine and location, where the ibort is raised (ibort_inc) +! 47 print out summary message of element variables on a +! group-basis after all the automatic changes have been +! made (em_ellibp) +! 48 Automatically generate check results based on max and min vals. +! These vals are stored in the checkr file, which is inserted +! into the *dat file by the generate_check_results script from /marc/tools +! 49 Automatically generate check results based on the real calculated values +! at the sppecified check result locations. +! These vals are stored in the checkr file, which is inserted +! into the *dat file by the update_check_results script from /marc/tools +! 50 generate a file containing the resistance or capacity matrix; +! this file can be used to compare results with a reference file +! 51 print out detailed information for segment-to-segment contact +! 52 print out detailed relative displacement information +! for uniaxial sliding contact +! 53 print out detailed sliding direction information for +! uniaxial sliding contact +! 54 print out detailed information for edges attached to a curve +! 55 print information related to viscoelasticity calculations +! 56 print out detailed information for element coloring for multithreading +! 57 print out extra overheads due to multi-threading. +! These overhead includes (i) time and (ii) memory. +! The memory report will be summed over all the children. +! +! +! 58 debug output for ELSTO usage +! +! idyn Control flag for dynamics. Input data. +! 1 = eigenvalue extraction and / or modal superposition +! 2 = Newmark Beta and Single Step Houbolt (ssh with idynme=1) +! 3 = Houbolt +! 4 = Central difference +! 5 = Newer central difference +! idynt Copy of idyn at begining of increment +! ielas Control flag for ELASTIC analysis. Input data. +! Set by user or automatically turned on by Fourier option. +! Implies that each load case is treated separately. +! In Adaptive meshing analysis , forces re-analysis until +! convergence obtained. +! Also seriously misused to indicate no convergence. +! = 1 elastic option with fourier analysis +! = 2 elastic option without fourier analysis +! =-1 no convergence in recycles or max # increments reached +! Set to 1 if ELASTIC or SUBSTRUC parameter cards are used, +! or if fourier option is used. +! Then set to 2 if not fourier analysis. +! ielcma Control flag for electromagnetic analysis. Input data. +! ielcma = 1 Harmonic formulation +! ielcma = 2 Transient formulation +! ielect Control flag for electrostatic option. Input data. +! iform Control flag indicating that contact will be performed. +! ifour Control flag for Fourier analysis. +! 0 = Odd and even terms. +! 1 = symmetric (cosine) terms +! 2 = antisymmetric (sine) terms. +! iharm Control flag to indicate that a harmonic analysis will +! be performed. May change between passes. +! ihcps Control flag for coupled thermal - stress analysis. +! iheat Control flag for heat transfer analysis. Input data. +! iheatt Permanent control flag for heat transfer analysis. +! Note in coupled analysis iheatt will remain as one, +! but iheat will be zero in stress pass. +! ihresp Control flag to indicate to perform a harmonic subincrement. +! ijoule Control flag for Joule heating. +! ilem Control flag to determin which vector is to be transformed. +! Control flag to see where one is: +! ilem = 1 - elem.f +! ilem = 2 - initst.f +! ilem = 3 - pressr.f +! ilem = 3 - fstif.f +! ilem = 4 - jflux.f +! ilem = 4 - strass.f +! ilem = 5 - mass.f +! ilem = 5 - osolty.f +! ilnmom Control flag for soil - pore pressure calculation. Input data. +! ilnmom = 0 - perform only pore pressure calculation. +! = 1 - couples pore pressure - displacement analysis +! iloren Control flag for DeLorenzi J-Integral evaluation. Input data. +! inc Increment number. +! incext Control flag indicating that currently working on a +! subincrement. +! Could be due to harmonics , damping component (bearing), +! stiffness component (bearing), auto therm creep or +! old viscoplaticity +! incsub Sub-increment number. +! ipass Control flag for which part of coupled analysis. +! ipass = -1 - reset to base values +! ipass = 0 - do nothing +! ipass = 1 - stress part +! ipass = 2 - heat transfer part +! iplres Flag indicating that either second matrix is stored. +! dynamic analysis - mass matrix +! heat transfer - specific heat matrix +! buckle - initial stress stiffness +! ipois Control flag indicating Poisson type analysis +! ipois = 1 for heat transfer +! = 1 for heat transfer part of coupled +! = 1 for bearing +! = 1 for electrostatic +! = 1 for magnetostatic +! ipoist Permanent copy of ipois. In coupled analysis , ipois = 0 +! in stress portion, yet ipoist will still =1. +! irpflo global flag for rigid plastic flow analysis +! = 1 eularian formulation +! = 2 regular formulation; rigid material present in the analysis + +! ismall control flag to indicate small displacement analysis. input data. +! ismall = 0 - large disp included. +! ismall = 1 - small displacement. +! the flag is changing between passes. +! ismalt permanent copy of ismall . in heat transfer portion of +! coupled analysis ismall =0 , but ismalt remains the same. +! isoil control flag indicating that soil / pore pressure +! calculation . input data. +! ispect control flag for response spectrum calculation. input data. +! ispnow control flag to indicate to perform a spectrum response +! calculation now. +! istore store stresses flag. +! istore = 0 in elem.f and if first pass of creep +! convergence checking in ogetst.f +! or harmonic analysis or thruc.f if not +! converged. +! iswep control flag for eigenvalue analysis. +! iswep=1 - go do extraction process +! ithcrp control flag for auto therm creep option. input data. +! itherm control flag for either temperature dependent material +! properties and/or thermal loads. +! iupblg control flag for follower force option. input data. +! iupdat control flag for update lagrange option for current element. +! jacflg control flag for lanczos iteration method. input data. +! jel control flag indicating that total load applied in +! increment, ignore previous solution. +! jel = 1 in increment 0 +! = 1 if elastic or fourier +! = 1 in subincrements with elastic and adaptive +! jparks control flag for j integral by parks method. input data. +! largst control flag for finite strain plasticity. input data. +! lfond control variable that indicates if doing elastic +! foundation or film calculation. influences whether +! this is volumetric or surface integration. +! loadup control flag that indicates that nonlinearity occurred +! during previous increment. +! loaduq control flag that indicates that nonlinearity occurred. +! lodcor control flag for switching on the residual load correction. +! notice in input stage lodcor=0 means no loadcor, +! after omarc lodcor=1 means no loadcor +! lovl control flag for determining which "overlay" is to +! be called from ellib. +! lovl = 1 omarc +! = 2 oaread +! = 3 opress +! = 4 oasemb +! = 5 osolty +! = 6 ogetst +! = 7 oscinc +! = 8 odynam +! = 9 opmesh +! = 10 omesh2 +! = 11 osetz +! = 12 oass +! = 13 oincdt +! = 14 oasmas +! = 15 ofluas +! = 16 ofluso +! = 17 oshtra +! = 18 ocass +! = 19 osoltc +! = 20 orezon +! = 21 otest +! = 22 oeigen +! lsub control variable to determine which part of element +! assembly function is being done. +! lsub = 1 - no longer used +! = 2 - beta* +! = 3 - cons* +! = 4 - ldef* +! = 5 - posw* +! = 6 - theta* +! = 7 - tmarx* +! = 8 - geom* +! magnet control flag for magnetostatic analysis. input data. +! ncycle cycle number. accumulated in osolty.f +! note first time through oasemb.f , ncycle = 0. +! newtnt control flag for permanent copy of newton. +! newton iteration type. input data. +! newton : = 1 full newton raphson +! 2 modified newton raphson +! 3 newton raphson with strain correct. +! 4 direct substitution +! 5 direct substitution followed by n.r. +! 6 direct substitution with line search +! 7 full newton raphson with secant initial stress +! 8 secant method +! 9 full newton raphson with line search +! noshr control flag for calculation interlaminar shears for +! elements 22,45, and 75. input data. +!ees +! +! jactch = 1 or 2 if elements are activated or deactivated +! = 3 if elements are adaptively remeshed or rezoned +! = 0 normally / reset to 0 when assembly is done +! ifricsh = 0 call to fricsh in otest not needed +! = 1 call to fricsh (nodal friction) in otest needed +! iremkin = 0 remove deactivated kinematic boundary conditions +! immediately - only in new input format (this is default) +! = 1 remove deactivated kinematic boundary conditions +! gradually - only in new input format +! iremfor = 0 remove force boundary conditions immediately - +! only in new input format (this is default) +! = 1 remove force boundary conditions gradually - +! only in new input format (this is default) +! ishearp set to 1 if shear panel elements are present in the model +! +! jspf = 0 not in spf loadcase +! > 0 in spf loadcase (jspf=1 during first increment) +! machining = 1 if the metal cutting feature is used, for memory allocation purpose +! = 0 (default) if no metal cutting feature required +! +! jlshell = 1 if there is a shell element in the mesh +! icompsol = 1 if there is a composite solid element in the mesh +! iupblgfo = 1 if follower force for point loads +! jcondir = 1 if contact priority option is used +! nstcrp = 0 (default) steady state creep flag (undocumented feature. +! if not 0, turns off special ncycle = 0 code in radial.f) +! nactive = number of active passes, if =1 then it's not a coupled analysis +! ipassref = reference ipass, if not in a multiphysics pass ipass=ipassref +! icheckmpc = value of mpc-check parameter option +! noline = set to 1 in osolty if no line seacrh should be done in ogetst +! icuring = set to 1 if the curing is included for the heat transfer analysis. +! ishrink = set to 1 if shrinkage strain is included for mechancial analysis. +! ioffsflg = 1 for small displacement beam/shell offsets +! = 2 for large displacement beam/shell offsets +! isetoff = 0 - do not apply beam/shell offsets +! = 1 - apply beam/shell offsets +! ioffsetm = min. value of offset flag +! iharmt = 1 global flag if a coupled analysis contains an harmonic pass +! inc_incdat = flag to record increment number of a new loadcase in incdat.f +! iautspc = flag for AutoSPC option +! ibrake = brake squeal in this increment +! icbush = set to 1 if cbush elements present in model +! istream_input = set to 1 for streaming input calling Marc as library +! iprsinp = set to 1 if pressure input, introduced so other variables +! such as h could be a function of pressure +! ivlsinp = set to 1 if velocity input, introduced so other variables +! such as h could be a function of velocity +! ipin_m = # of beam element with PIN flag +! jgnstr_glb = global control over pre or fast integrated composite shells +! imarc_return = Marc return flag for streaming input control +! iqvcimp = if non-zero, then the number of QVECT boundary conditions +! nqvceid = number of QVECT boundary conditions, where emisivity/absorbtion id entered +! istpnx = 1 if to stop at end of increment +! imicro1 = 1 if micro1 interface is used +! iaxisymm = set to 1 if axisymmetric analysis +! jbreakglue = set to 1 if breaking glued option is used +! iglstif = 1 if ddm and global stiffness matrix formed (sgi solver 6 or solver9) +! jfastasm = 1 do fast assembly using SuperForm code +! iwear = set to 1 if wear model, set to 2 if wear model and coordinates updated +! iwearcf = set to 1 to store nodal coefficient of friction for wear calculation +! imixmeth = set=1 then use nonlinear mixture material - allocate memory +! ielcmadyn = flag for magnetodynamics +! 0 - electromagnetics using newmark beta +! 1 - transient magnetics using backward euler +! idinout = flag to control if inside out elements should be deactivated +! igena_meth = 0 - generalized alpha parameters depend on whether or not contact +! is flagged (dynamic,7) +! 10 - generalized alpha parameters are optimized for a contact +! analysis (dynamic,8) +! 11 - generalized alpha parameters are optimized for an analysis +! without contact (dynamic,8) +! magf_meth = - Method to compute force in magnetostatic - structural +! = 1 - Virtual work method based on finite difference for the force computation +! = 2 - Maxwell stress tensor +! = 3 - Virtual work method based on local derivative for the force computation +! non_assumed = 1 no assumed strain formulation (forced) +! iredoboudry set to 1 if contact boundary needs to be recalculated +! ioffsz0 = 1 if composite are used with reference position.ne.0 +! icomplt = 1 global flag if a coupled analysis contains an complex pass +! mesh_dual = 1 two independent meshes are used in magnetodynamic/thermal/structural +! one for magnetodynamic and the other for the remaining passes +! iactrp = 1 in an analysis with global remeshing, include inactive +! rigid bodies on post file +! mgnewton = 1 Use full Newton Raphson iteration for magnetostatic pass +! +! iusedens > 0 if mass density is used in the analysis (dynamics, mass dependent loading) +! igsigd0 = 1 set varselem(igsigd) to zero in next oasemb +! iaem = 1 if marc is called from aem (0 - off - default) +! icosim = 1 if marc is used in co-simulation software (ADAMS-MARC) +! inodels = 1 nodal integration elements 239/240/241 present +! nlharm = 0 harmonic subincrements are linear +! = 1 harmonic subincrements are nonlinear +! iampini = 0 amplitude of previous harmonic subinc is initial estimate (default) +! = 1 zero amplitude is initial estimate +! iphasetr = 1 phase transformation material model is used +! +!*********************************************************************** +!$omp threadprivate(/marc_concom/) +!! diff --git a/lib/MarcInclude/creeps2016 b/lib/MarcInclude/creeps2016 new file mode 100644 index 000000000..85c67492d --- /dev/null +++ b/lib/MarcInclude/creeps2016 @@ -0,0 +1,66 @@ +! common block definition file taken from respective MSC.Marc release and reformated to free format +!*********************************************************************** +! +! File: creeps.cmn +! +! MSC.Marc include file +! +real(pReal) cptim,timinc,timinc_p,timinc_s,timincm,timinc_a,timinc_b +integer(pInt) icfte,icfst,icfeq,icftm,icetem,mcreep,jcreep,icpa,icftmp,icfstr,& + icfqcp,icfcpm,icrppr,icrcha,icpb,iicpmt,iicpa +real(pReal) time_beg_lcase,time_beg_inc,fractol,time_beg_pst +real(pReal) fraction_donn,timinc_ol2 +! +integer(pInt) num_creepsr,num_creepsi,num_creeps2r +parameter(num_creepsr=7) +parameter(num_creepsi=17) +parameter(num_creeps2r=6) +common/marc_creeps/cptim,timinc,timinc_p,timinc_s,timincm,timinc_a,timinc_b,icfte,icfst,& + icfeq,icftm,icetem,mcreep,jcreep,icpa,icftmp,icfstr,icfqcp,icfcpm,icrppr,icrcha,icpb,iicpmt,iicpa +common/marc_creeps2/time_beg_lcase,time_beg_inc,fractol,time_beg_pst,fraction_donn,timinc_ol2 +! +! cptim Total time at begining of increment. +! timinc Incremental time for this step. +! icfte Local copy number of slopes of creep strain rate function +! versus temperature. Is -1 if exponent law used. +! icfst Local copy number of slopes of creep strain rate function +! versus equivalent stress. Is -1 if exponent law used. +! icfeq Local copy number of slopes of creep strain rate function +! versus equivalent strain. Is -1 if exponent law used. +! icftm Local copy number of slopes of creep strain rate function +! versus time. Is -1 if exponent law used. +! icetem Element number that needs to be checked for creep convergence +! or, if negative, the number of elements that need to +! be checked. In the latter case the elements to check +! are stored in ielcp. +! mcreep Maximum nuber of iterations for explicit creep. +! jcreep Counter of number of iterations for explicit creep +! procedure. jcreep must be .le. mcreep +! icpa Pointer to constant in creep strain rate expression. +! icftmp Pointer to temperature dependent creep strain rate data. +! icfstr Pointer to equivalent stress dependent creep strain rate data. +! icfqcp Pointer to equivalent creep strain dependent creep strain +! rate data. +! icfcpm Pointer to equivalent creep strain rate dependent +! creep strain rate data. +! icrppr Permanent copy of icreep +! icrcha Control flag for creep convergence checking , if set to +! 1 then testing on absolute change in stress and creep +! strain, not relative testing. Input data. +! icpb Pointer to storage of material id cross reference numbers. +! iicpmt +! iicpa Pointer to constant in creep strain rate expression +! +! time_beg_lcase time at the beginning of the current load case +! time_beg_inc time at the beginning of the current increment +! fractol fraction of loadcase or increment time when we +! consider it to be finished +! time_beg_pst time corresponding to first increment to be +! read in from thermal post file for auto step +! +! timinc_old Time step of the previous increment +! +!*********************************************************************** +!!$omp threadprivate(/marc_creeps/) +!!$omp threadprivate(/marc_creeps2/) +!! diff --git a/lib/damask/solver/marc.py b/lib/damask/solver/marc.py index 090aeb82b..a4168f709 100644 --- a/lib/damask/solver/marc.py +++ b/lib/damask/solver/marc.py @@ -9,6 +9,7 @@ class Marc(Solver): def __init__(self): self.solver = 'Marc' self.releases = { \ + '2016': ['linux64',''], '2015': ['linux64',''], '2014.2':['linux64',''], '2014' :['linux64',''], From 6d9d25ea43ddc26bee3bc80d73ced1554b87184e Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 27 Oct 2016 22:41:50 +0200 Subject: [PATCH 336/412] python 3 compatible and modernized --- .../pre/patchFromReconstructedBoundaries.py | 182 +++++++++--------- 1 file changed, 87 insertions(+), 95 deletions(-) diff --git a/processing/pre/patchFromReconstructedBoundaries.py b/processing/pre/patchFromReconstructedBoundaries.py index d9861619e..a43ccc236 100755 --- a/processing/pre/patchFromReconstructedBoundaries.py +++ b/processing/pre/patchFromReconstructedBoundaries.py @@ -13,7 +13,7 @@ scriptID = ' '.join([scriptName,damask.version]) try: # check for Python Image Lib from PIL import Image,ImageDraw ImageCapability = True -except: +except ImportError: ImageCapability = False sys.path.append(damask.solver.Marc().libraryPath()) @@ -21,7 +21,7 @@ sys.path.append(damask.solver.Marc().libraryPath()) try: # check for MSC.Mentat Python interface import py_mentat MentatCapability = True -except: +except ImportError: MentatCapability = False @@ -344,7 +344,7 @@ def rcbParser(content,M,size,tolerance,idcolumn,segmentcolumn): else: myNeighbors[grainNeighbors[leg][side]] = 1 if myNeighbors: # do I have any neighbors (i.e., non-bounding box segment) - candidateGrains = sorted(myNeighbors.items(), key=lambda (k,v): (v,k), reverse=True) # sort grain counting + candidateGrains = sorted(myNeighbors.iteritems(), key=lambda p: (p[1],p[0]), reverse=True) # sort grain counting # most frequent one not yet seen? rcData['grainMapping'].append(candidateGrains[0 if candidateGrains[0][0] not in rcData['grainMapping'] else 1][0]) # must be me then # special case of bi-crystal situation... @@ -647,7 +647,6 @@ def job(grainNumber,grainMapping,twoD): "*job_param univ_gas_const 8.314472", "*job_param planck_radiation_2 1.4387752e-2", "*job_param speed_light_vacuum 299792458", -# "*job_usersub_file /san/%s/FEM/DAMASK/code/mpie_cpfem_marc2010.f90 | subroutine definition"%(pwd.getpwuid(os.geteuid())[0].rpartition("\\")[2]), "*job_option user_source:compile_save", ] @@ -750,7 +749,7 @@ def inside(x,y,points): return inside # ------------------------- -def fftbuild(rcData,height,xframe,yframe,resolution,extrusion): +def fftbuild(rcData,height,xframe,yframe,grid,extrusion): """Build array of grain numbers""" maxX = -1.*sys.maxint maxY = -1.*sys.maxint @@ -760,14 +759,14 @@ def fftbuild(rcData,height,xframe,yframe,resolution,extrusion): maxY = max(maxY, y) xsize = maxX+2*xframe # add framsize ysize = maxY+2*yframe - xres = int(round(resolution/2.0)*2) # use only even resolution - yres = int(round(xres/xsize*ysize/2.0)*2) # calculate other resolutions + xres = int(grid) + yres = int(xres/xsize*ysize) zres = extrusion zsize = extrusion*min([xsize/xres,ysize/yres]) fftdata = {'fftpoints':[], \ - 'resolution':(xres,yres,zres), \ - 'dimension':(xsize,ysize,zsize)} + 'grid':(xres,yres,zres), \ + 'size':(xsize,ysize,zsize)} frameindex=len(rcData['grain'])+1 # calculate frame index as largest grain index plus one dx = xsize/(xres) # calculate step sizes @@ -841,8 +840,8 @@ parser.add_option('-x', '--xmargin', type='float', metavar = 'float', dest='xmargin',help='margin in x in units of patch size [%default]') parser.add_option('-y', '--ymargin', type='float', metavar = 'float', dest='ymargin', help='margin in y in units of patch size [%default]') -parser.add_option('-r', '--resolution', type='int', metavar = 'int', - dest='resolution',help='number of Fourier points/Finite Elements across patch size + x_margin [%default]') +parser.add_option('-g', '--grid', type='int', metavar = 'int', + dest='grid',help='number of Fourier points/Finite Elements across patch size + x_margin [%default]') parser.add_option('-z', '--extrusion', type='int', metavar = 'int', dest='extrusion', help='number of repetitions in z-direction [%default]') parser.add_option('-i', '--imagesize', type='int', metavar = 'int', @@ -861,7 +860,7 @@ parser.set_defaults(output = [], port = 40007, xmargin = 0.0, ymargin = 0.0, - resolution = 64, + grid = 64, extrusion = 2, imgsize = 512, M = (0.0,1.0,1.0,0.0), # M_11, M_12, M_21, M_22. x,y in RCB is y,x of Eulers!! @@ -903,14 +902,14 @@ rcData = rcbParser(boundarySegments,options.M,options.size,options.tolerance,opt Minv = np.linalg.inv(np.array(options.M).reshape(2,2)) if 'rcb' in options.output: - print """# Header: -# -# Column 1-3: right hand average orientation (phi1, PHI, phi2 in radians) -# Column 4-6: left hand average orientation (phi1, PHI, phi2 in radians) -# Column 7: length (in microns) -# Column 8: trace angle (in degrees) -# Column 9-12: x,y coordinates of endpoints (in microns) -# Column 13-14: IDs of right hand and left hand grains""" + print('# Header:\n'+ + '# \n'+ + '# Column 1-3: right hand average orientation (phi1, PHI, phi2 in radians)\n'+ + '# Column 4-6: left hand average orientation (phi1, PHI, phi2 in radians)\n'+ + '# Column 7: length (in microns)\n'+ + '# Column 8: trace angle (in degrees)\n'+ + '# Column 9-12: x,y coordinates of endpoints (in microns)\n'+ + '# Column 13-14: IDs of right hand and left hand grains') for i,(left,right) in enumerate(rcData['neighbors']): if rcData['segment'][i]: first = np.dot(Minv,np.array([rcData['bounds'][0][0]+rcData['point'][rcData['segment'][i][0]][0]/rcData['scale'], @@ -919,12 +918,12 @@ if 'rcb' in options.output: second = np.dot(Minv,np.array([rcData['bounds'][0][0]+rcData['point'][rcData['segment'][i][1]][0]/rcData['scale'], rcData['bounds'][0][1]+rcData['point'][rcData['segment'][i][1]][1]/rcData['scale'], ])) - print ' '.join(map(str,orientationData[left-1]+orientationData[right-1])), - print np.linalg.norm(first-second), - print '0', - print ' '.join(map(str,first)), - print ' '.join(map(str,second)), - print ' '.join(map(str,[left,right])) + print(' '.join(map(str,orientationData[left-1]+orientationData[right-1]))+ + str(np.linalg.norm(first-second))+ + '0'+ + ' '.join(map(str,first))+ + ' '.join(map(str,second))+ + ' '.join(map(str,[left,right]))) # ----- write image ----- @@ -934,28 +933,67 @@ if 'image' in options.output and options.imgsize > 0: else: damask.util.croak('...no image drawing possible (PIL missing)...') +# ----- generate material.config ----- + +if any(output in options.output for output in ['spectral','mentat']): + config = [] + config.append('') + + for i,grain in enumerate(rcData['grainMapping']): + config+=['[grain{}]'.format(grain), + 'crystallite\t1', + '(constituent)\tphase 1\ttexture {}\tfraction 1.0'.format(i+1)] + if (options.xmargin > 0.0): + config+=['[x-margin]', + 'crystallite\t1', + '(constituent)\tphase 2\ttexture {}\tfraction 1.0\n'.format(len(rcData['grainMapping'])+1)] + if (options.ymargin > 0.0): + config+=['[y-margin]', + 'crystallite\t1', + '(constituent)\tphase 2\ttexture {}\tfraction 1.0\n'.format(len(rcData['grainMapping'])+1)] + if (options.xmargin > 0.0 and options.ymargin > 0.0): + config+=['[xy-margin]', + 'crystallite\t1', + '(constituent)\tphase 2\ttexture {}\tfraction 1.0\n'.format(len(rcData['grainMapping'])+1)] + + if (options.xmargin > 0.0 or options.ymargin > 0.0): + config.append('[margin]') + + config.append('') + for grain in rcData['grainMapping']: + config+=['[grain{}]'.format(grain), + '(gauss)\tphi1\t%f\tphi\t%f\tphi2\t%f\tscatter\t%f\tfraction\t1.0'\ + %(math.degrees(orientationData[grain-1][0]),math.degrees(orientationData[grain-1][1]),\ + math.degrees(orientationData[grain-1][2]),options.scatter)] + if (options.xmargin > 0.0 or options.ymargin > 0.0): + config+=['[margin]', + '(random)\t\tscatter\t0.0\tfraction\t1.0'] + # ----- write spectral geom ----- if 'spectral' in options.output: - fftdata = fftbuild(rcData, options.size, options.xmargin, options.ymargin, options.resolution, options.extrusion) - - geomFile = open(myName+'_'+str(int(fftdata['resolution'][0]))+'.geom','w') # open geom file for writing - geomFile.write('3\theader\n') # write header info - geomFile.write('grid a %i b %i c %i\n'%(fftdata['resolution'])) # grid resolution - geomFile.write('size x %f y %f z %f\n'%(fftdata['dimension'])) # size - geomFile.write('homogenization 1\n') # homogenization - for z in xrange(fftdata['resolution'][2]): # z repetions - for y in xrange(fftdata['resolution'][1]): # each x-row separately - geomFile.write('\t'.join(map(str,fftdata['fftpoints'][ y *fftdata['resolution'][0]: - (y+1)*fftdata['resolution'][0]]))+'\n') # grain indexes, x-row per line - geomFile.close() # close geom file - - damask.util.croak('assigned {} out of {} (2D) Fourier points...' - .format(len(fftdata['fftpoints']), - int(fftdata['resolution'][0])*int(fftdata['resolution'][1]))) + fftdata = fftbuild(rcData, options.size, options.xmargin, options.ymargin, options.grid, options.extrusion) + table = damask.ASCIItable(outname = myName+'_'+str(int(fftdata['grid'][0]))+'.geom', + labeled = False, + buffered = False) + table.labels_clear() + table.info_clear() + table.info_append([ + scriptID + ' ' + ' '.join(sys.argv[1:]), + "grid\ta {grid[0]}\tb {grid[1]}\tc {grid[2]}".format(grid=fftdata['grid']), + "size\tx {size[0]}\ty {size[1]}\tz {size[2]}".format(size=fftdata['size']), + "homogenization\t1", + ]) + table.info_append(config) + table.head_write() + + table.data = np.array(fftdata['fftpoints']*options.extrusion).\ + reshape(fftdata['grid'][1]*fftdata['grid'][2],fftdata['grid'][0]) + formatwidth = 1+int(math.log10(np.max(table.data))) + table.data_writeArray('%%%ii'%(formatwidth),delimiter=' ') + table.close() -# ----- write Mentat procedure ----- if 'mentat' in options.output: if MentatCapability: @@ -964,19 +1002,19 @@ if 'mentat' in options.output: cmds = [\ init(), - sample(options.size,rcData['dimension'][1]/rcData['dimension'][0],12,options.xmargin,options.ymargin), - patch(options.size,options.resolution,options.mesh,rcData), + sample(options.size,rcData['dimension'][1]/rcData['size'][0],12,options.xmargin,options.ymargin), + patch(options.size,options.grid,options.mesh,rcData), gage(options.mesh,rcData), ] if not options.twoD: - cmds += [expand3D(options.size*(1.0+2.0*options.xmargin)/options.resolution*options.extrusion,options.extrusion),] + cmds += [expand3D(options.size*(1.0+2.0*options.xmargin)/options.grid*options.extrusion,options.extrusion),] cmds += [\ cleanUp(options.size), materials(), initial_conditions(len(rcData['grain']),rcData['grainMapping']), - boundary_conditions(options.strainrate,options.size*(1.0+2.0*options.xmargin)/options.resolution*options.extrusion,\ + boundary_conditions(options.strainrate,options.size*(1.0+2.0*options.xmargin)/options.grid*options.extrusion,\ options.size,rcData['dimension'][1]/rcData['dimension'][0],options.xmargin,options.ymargin), loadcase(options.strain/options.strainrate,options.increments,0.01), job(len(rcData['grain']),rcData['grainMapping'],options.twoD), @@ -996,51 +1034,5 @@ if 'mentat' in options.output: else: damask.util.croak('...no interaction with Mentat possible...') - -# ----- write config data to file ----- - -if 'mentat' in options.output or 'spectral' in options.output: - output = '' - output += '\n\n\n' + \ - '\n[SX]\n' + \ - 'type\tisostrain\n' + \ - 'Ngrains\t1\n' + \ - '\n\n\n' - - for i,grain in enumerate(rcData['grainMapping']): - output += '\n[grain %i]\n'%grain + \ - 'crystallite\t1\n' + \ - '(constituent)\tphase 1\ttexture %i\tfraction 1.0\n'%(i+1) - if (options.xmargin > 0.0): - output += '\n[x-margin]\n' + \ - 'crystallite\t1\n' + \ - '(constituent)\tphase 2\ttexture %i\tfraction 1.0\n'%(len(rcData['grainMapping'])+1) - if (options.ymargin > 0.0): - output += '\n[y-margin]\n' + \ - 'crystallite\t1\n' + \ - '(constituent)\tphase 2\ttexture %i\tfraction 1.0\n'%(len(rcData['grainMapping'])+1) - if (options.xmargin > 0.0 and options.ymargin > 0.0): - output += '\n[margin edge]\n' + \ - 'crystallite\t1\n' + \ - '(constituent)\tphase 2\ttexture %i\tfraction 1.0\n'%(len(rcData['grainMapping'])+1) - - output += '\n\n\n' + \ - '\n[fillMeIn]\n' + \ - '\n\n\n' + \ - '\n[patch]\n' - if (options.xmargin > 0.0 or options.ymargin > 0.0): - output += '\n[margin]\n' - - output += '\n\n\n\n' - for grain in rcData['grainMapping']: - output += '\n[grain %i]\n'%grain + \ - '(gauss)\tphi1\t%f\tphi\t%f\tphi2\t%f\tscatter\t%f\tfraction\t1.0\n'\ - %(math.degrees(orientationData[grain-1][0]),math.degrees(orientationData[grain-1][1]),\ - math.degrees(orientationData[grain-1][2]),options.scatter) - if (options.xmargin > 0.0 or options.ymargin > 0.0): - output += '\n[margin]\n' + \ - '(random)\t\tscatter\t0.0\tfraction\t1.0\n' - - configFile = open(myName+'.config','w') - configFile.write(output) - configFile.close() + with open(myName+'.config','w') as configFile: + configFile.write('\n'.join(config)) From 8d3b49ff2bbaefb1d804932b28382145fe20bf6b Mon Sep 17 00:00:00 2001 From: Test User Date: Fri, 28 Oct 2016 16:44:37 +0200 Subject: [PATCH 337/412] updated version information after successful test of v2.0.1-263-gb34a60d --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index f1fec661a..83bd5fe58 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-261-ge43e37a +v2.0.1-263-gb34a60d From 6378cb1ff143c92da1433c6669b25512ac824fa9 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 29 Oct 2016 09:39:08 +0200 Subject: [PATCH 338/412] using improved dEq0/dNeq instead of dEq/dNeq with 0.0 argument --- code/crystallite.f90 | 18 ++++++++--------- code/homogenization_RGC.f90 | 4 ++-- code/plastic_disloUCLA.f90 | 10 +++++----- code/plastic_dislotwin.f90 | 30 ++++++++++++++--------------- code/plastic_isotropic.f90 | 4 ++-- code/plastic_nonlocal.f90 | 35 +++++++++++++++++----------------- code/plastic_phenoplus.f90 | 13 ++++++------- code/plastic_phenopowerlaw.f90 | 13 ++++++------- 8 files changed, 63 insertions(+), 64 deletions(-) diff --git a/code/crystallite.f90 b/code/crystallite.f90 index 2212ba9a1..a570ad714 100644 --- a/code/crystallite.f90 +++ b/code/crystallite.f90 @@ -508,7 +508,7 @@ end subroutine crystallite_init subroutine crystallite_stressAndItsTangent(updateJaco) use prec, only: & tol_math_check, & - dNeq + dNeq0 use numerics, only: & subStepMinCryst, & subStepSizeCryst, & @@ -776,7 +776,7 @@ subroutine crystallite_stressAndItsTangent(updateJaco) endif else subFracIntermediate = maxval(crystallite_subFrac, mask=.not.crystallite_localPlasticity) - if (dNeq(subFracIntermediate,0.0_pReal)) then + if (dNeq0(subFracIntermediate)) then crystallite_neighborEnforcedCutback = .false. ! look for ips that require a cutback because of a nonconverged neighbor !$OMP PARALLEL !$OMP DO PRIVATE(neighboring_e,neighboring_i) @@ -817,7 +817,7 @@ subroutine crystallite_stressAndItsTangent(updateJaco) !$OMP DO PRIVATE(neighboring_e,neighboring_i) do e = FEsolving_execElem(1),FEsolving_execElem(2) do i = FEsolving_execIP(1,e),FEsolving_execIP(2,e) - if (.not. crystallite_localPlasticity(1,i,e) .and. dNeq(crystallite_subFrac(1,i,e),0.0_pReal)) then + if (.not. crystallite_localPlasticity(1,i,e) .and. dNeq0(crystallite_subFrac(1,i,e))) then do n = 1_pInt,FE_NipNeighbors(FE_celltype(FE_geomtype(mesh_element(2,e)))) neighboring_e = mesh_ipNeighborhood(1,n,i,e) neighboring_i = mesh_ipNeighborhood(2,n,i,e) @@ -3070,7 +3070,7 @@ end subroutine crystallite_integrateStateFPI logical function crystallite_stateJump(ipc,ip,el) use prec, only: & prec_isNaN, & - dNeq + dNeq0 use debug, only: & debug_level, & debug_crystallite, & @@ -3122,7 +3122,7 @@ logical function crystallite_stateJump(ipc,ip,el) enddo #ifndef _OPENMP - if (any(dNeq(plasticState(p)%deltaState(1:mySizePlasticDeltaState,c),0.0_pReal)) & + if (any(dNeq0(plasticState(p)%deltaState(1:mySizePlasticDeltaState,c))) & .and. iand(debug_level(debug_crystallite), debug_levelExtensive) /= 0_pInt & .and. ((el == debug_e .and. ip == debug_i .and. ipc == debug_g) & .or. .not. iand(debug_level(debug_crystallite), debug_levelSelective) /= 0_pInt)) then @@ -3178,7 +3178,7 @@ logical function crystallite_integrateStress(& use prec, only: pLongInt, & tol_math_check, & prec_isNaN, & - dEq + dEq0 use numerics, only: nStress, & aTol_crystalliteStress, & rTol_crystalliteStress, & @@ -3325,7 +3325,7 @@ logical function crystallite_integrateStress(& !* inversion of Fp_current... invFp_current = math_inv33(Fp_current) - failedInversionFp: if (all(dEq(invFp_current,0.0_pReal))) then + failedInversionFp: if (all(dEq0(invFp_current))) then #ifndef _OPENMP if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then write(6,'(a,i8,1x,a,i8,a,1x,i2,1x,i3)') '<< CRYST >> integrateStress failed on inversion of Fp_current at el (elFE) ip g ',& @@ -3341,7 +3341,7 @@ logical function crystallite_integrateStress(& !* inversion of Fi_current... invFi_current = math_inv33(Fi_current) - failedInversionFi: if (all(dEq(invFi_current,0.0_pReal))) then + failedInversionFi: if (all(dEq0(invFi_current))) then #ifndef _OPENMP if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then write(6,'(a,i8,1x,a,i8,a,1x,i2,1x,i3)') '<< CRYST >> integrateStress failed on inversion of Fi_current at el (elFE) ip ipc ',& @@ -3600,7 +3600,7 @@ logical function crystallite_integrateStress(& invFp_new = math_mul33x33(invFp_current,B) invFp_new = invFp_new / math_det33(invFp_new)**(1.0_pReal/3.0_pReal) ! regularize by det Fp_new = math_inv33(invFp_new) - failedInversionInvFp: if (all(dEq(Fp_new,0.0_pReal))) then + failedInversionInvFp: if (all(dEq0(Fp_new))) then #ifndef _OPENMP if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0_pInt) then write(6,'(a,i8,1x,a,i8,a,1x,i2,1x,i3,a,i3)') '<< CRYST >> integrateStress failed on invFp_new inversion at el ip ipc ',& diff --git a/code/homogenization_RGC.f90 b/code/homogenization_RGC.f90 index 3b75ec016..ef293fc22 100644 --- a/code/homogenization_RGC.f90 +++ b/code/homogenization_RGC.f90 @@ -387,7 +387,7 @@ end subroutine homogenization_RGC_partitionDeformation !-------------------------------------------------------------------------------------------------- function homogenization_RGC_updateState(P,F,F0,avgF,dt,dPdF,ip,el) use prec, only: & - dEq + dEq0 use debug, only: & debug_level, & debug_homogenization,& @@ -443,7 +443,7 @@ function homogenization_RGC_updateState(P,F,F0,avgF,dt,dPdF,ip,el) real(pReal), dimension(:,:), allocatable :: tract,jmatrix,jnverse,smatrix,pmatrix,rmatrix real(pReal), dimension(:), allocatable :: resid,relax,p_relax,p_resid,drelax - zeroTimeStep: if(dEq(dt,0.0_pReal)) then + zeroTimeStep: if(dEq0(dt)) then homogenization_RGC_updateState = .true. ! pretend everything is fine and return return endif zeroTimeStep diff --git a/code/plastic_disloUCLA.f90 b/code/plastic_disloUCLA.f90 index e91883173..147be2f54 100644 --- a/code/plastic_disloUCLA.f90 +++ b/code/plastic_disloUCLA.f90 @@ -974,7 +974,7 @@ end subroutine plastic_disloUCLA_LpAndItsTangent subroutine plastic_disloUCLA_dotState(Tstar_v,Temperature,ipc,ip,el) use prec, only: & tol_math_check, & - dEq + dEq0 use math, only: & pi use material, only: & @@ -1112,7 +1112,7 @@ subroutine plastic_disloUCLA_dotState(Tstar_v,Temperature,ipc,ip,el) !* Dipole formation EdgeDipMinDistance = & plastic_disloUCLA_CEdgeDipMinDistance(instance)*plastic_disloUCLA_burgersPerSlipSystem(j,instance) - if (dEq(tau_slip_pos,0.0_pReal)) then + if (dEq0(tau_slip_pos)) then DotRhoDipFormation = 0.0_pReal else EdgeDipDistance = & @@ -1140,7 +1140,7 @@ subroutine plastic_disloUCLA_dotState(Tstar_v,Temperature,ipc,ip,el) plastic_disloUCLA_CAtomicVolume(instance)*plastic_disloUCLA_burgersPerSlipSystem(j,instance)**(3.0_pReal) VacancyDiffusion = & plastic_disloUCLA_D0(instance)*exp(-plastic_disloUCLA_Qsd(instance)/(kB*Temperature)) - if (dEq(tau_slip_pos,0.0_pReal)) then + if (dEq0(tau_slip_pos)) then DotRhoEdgeDipClimb = 0.0_pReal else ClimbVelocity = & @@ -1174,7 +1174,7 @@ end subroutine plastic_disloUCLA_dotState function plastic_disloUCLA_postResults(Tstar_v,Temperature,ipc,ip,el) use prec, only: & tol_math_check, & - dEq + dEq0 use math, only: & pi use material, only: & @@ -1402,7 +1402,7 @@ function plastic_disloUCLA_postResults(Tstar_v,Temperature,ipc,ip,el) c = c + ns elseif(plastic_disloUCLA_outputID(o,instance) == stress_exponent_ID) then do j = 1_pInt, ns - if (dEq(gdot_slip_pos(j)+gdot_slip_neg(j),0.0_pReal)) then + if (dEq0(gdot_slip_pos(j)+gdot_slip_neg(j))) then plastic_disloUCLA_postResults(c+j) = 0.0_pReal else plastic_disloUCLA_postResults(c+j) = (tau_slip_pos(j)+tau_slip_neg(j))/& diff --git a/code/plastic_dislotwin.f90 b/code/plastic_dislotwin.f90 index e205f5abb..43fe0c6d8 100644 --- a/code/plastic_dislotwin.f90 +++ b/code/plastic_dislotwin.f90 @@ -200,7 +200,8 @@ contains subroutine plastic_dislotwin_init(fileUnit) use, intrinsic :: iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment) use prec, only: & - dEq, & + dEq0, & + dNeq0, & dNeq use debug, only: & debug_level,& @@ -748,8 +749,8 @@ subroutine plastic_dislotwin_init(fileUnit) if (plastic_dislotwin_Qsd(instance) <= 0.0_pReal) & call IO_error(211_pInt,el=instance,ext_msg='Qsd ('//PLASTICITY_DISLOTWIN_label//')') if (sum(plastic_dislotwin_Ntwin(:,instance)) > 0_pInt) then - if (dEq(plastic_dislotwin_SFE_0K(instance), 0.0_pReal) .and. & - dEq(plastic_dislotwin_dSFE_dT(instance),0.0_pReal) .and. & + if (dEq0(plastic_dislotwin_SFE_0K(instance)) .and. & + dEq0(plastic_dislotwin_dSFE_dT(instance)) .and. & lattice_structure(phase) == LATTICE_fcc_ID) & call IO_error(211_pInt,el=instance,ext_msg='SFE0K ('//PLASTICITY_DISLOTWIN_label//')') if (plastic_dislotwin_aTolRho(instance) <= 0.0_pReal) & @@ -758,8 +759,8 @@ subroutine plastic_dislotwin_init(fileUnit) call IO_error(211_pInt,el=instance,ext_msg='aTolTwinFrac ('//PLASTICITY_DISLOTWIN_label//')') endif if (sum(plastic_dislotwin_Ntrans(:,instance)) > 0_pInt) then - if (dEq(plastic_dislotwin_SFE_0K(instance), 0.0_pReal) .and. & - dEq(plastic_dislotwin_dSFE_dT(instance),0.0_pReal) .and. & + if (dEq0(plastic_dislotwin_SFE_0K(instance)) .and. & + dEq0(plastic_dislotwin_dSFE_dT(instance)) .and. & lattice_structure(phase) == LATTICE_fcc_ID) & call IO_error(211_pInt,el=instance,ext_msg='SFE0K ('//PLASTICITY_DISLOTWIN_label//')') if (plastic_dislotwin_aTolTransFrac(instance) <= 0.0_pReal) & @@ -772,7 +773,7 @@ subroutine plastic_dislotwin_init(fileUnit) if (plastic_dislotwin_sbVelocity(instance) > 0.0_pReal .and. & plastic_dislotwin_pShearBand(instance) <= 0.0_pReal) & call IO_error(211_pInt,el=instance,ext_msg='pShearBand ('//PLASTICITY_DISLOTWIN_label//')') - if (dNeq(plastic_dislotwin_dipoleFormationFactor(instance), 0.0_pReal) .and. & + if (dNeq0(plastic_dislotwin_dipoleFormationFactor(instance)) .and. & dNeq(plastic_dislotwin_dipoleFormationFactor(instance), 1.0_pReal)) & call IO_error(211_pInt,el=instance,ext_msg='dipoleFormationFactor ('//PLASTICITY_DISLOTWIN_label//')') if (plastic_dislotwin_sbVelocity(instance) > 0.0_pReal .and. & @@ -1624,7 +1625,7 @@ end subroutine plastic_dislotwin_microstructure subroutine plastic_dislotwin_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,Temperature,ipc,ip,el) use prec, only: & tol_math_check, & - dNeq + dNeq0 use math, only: & math_Plain3333to99, & math_Mandel6to33, & @@ -1771,8 +1772,7 @@ subroutine plastic_dislotwin_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,Temperature !-------------------------------------------------------------------------------------------------- ! Shear banding (shearband) part - if(dNeq(plastic_dislotwin_sbVelocity(instance), 0.0_pReal) .and. & - dNeq(plastic_dislotwin_sbResistance(instance),0.0_pReal)) then + if(dNeq0(plastic_dislotwin_sbVelocity(instance)) .and. dNeq0(plastic_dislotwin_sbResistance(instance))) then gdot_sb = 0.0_pReal dgdot_dtausb = 0.0_pReal call math_eigenValuesVectorsSym(math_Mandel6to33(Tstar_v),eigValues,eigVectors,error) @@ -1939,7 +1939,7 @@ end subroutine plastic_dislotwin_LpAndItsTangent subroutine plastic_dislotwin_dotState(Tstar_v,Temperature,ipc,ip,el) use prec, only: & tol_math_check, & - dEq + dEq0 use math, only: & pi use material, only: & @@ -2040,7 +2040,7 @@ subroutine plastic_dislotwin_dotState(Tstar_v,Temperature,ipc,ip,el) !* Dipole formation EdgeDipMinDistance = & plastic_dislotwin_CEdgeDipMinDistance(instance)*plastic_dislotwin_burgersPerSlipSystem(j,instance) - if (dEq(tau_slip(j),0.0_pReal)) then + if (dEq0(tau_slip(j))) then DotRhoDipFormation = 0.0_pReal else EdgeDipDistance = & @@ -2068,10 +2068,10 @@ subroutine plastic_dislotwin_dotState(Tstar_v,Temperature,ipc,ip,el) plastic_dislotwin_CAtomicVolume(instance)*plastic_dislotwin_burgersPerSlipSystem(j,instance)**(3.0_pReal) VacancyDiffusion = & plastic_dislotwin_D0(instance)*exp(-plastic_dislotwin_Qsd(instance)/(kB*Temperature)) - if (dEq(tau_slip(j),0.0_pReal)) then + if (dEq0(tau_slip(j))) then DotRhoEdgeDipClimb = 0.0_pReal else - if (dEq(EdgeDipDistance-EdgeDipMinDistance,0.0_pReal)) then + if (dEq0(EdgeDipDistance-EdgeDipMinDistance)) then DotRhoEdgeDipClimb = 0.0_pReal else ClimbVelocity = 3.0_pReal*lattice_mu(ph)*VacancyDiffusion*AtomicVolume/ & @@ -2187,7 +2187,7 @@ end subroutine plastic_dislotwin_dotState function plastic_dislotwin_postResults(Tstar_v,Temperature,ipc,ip,el) use prec, only: & tol_math_check, & - dEq + dEq0 use math, only: & pi, & math_Mandel6to33, & @@ -2503,7 +2503,7 @@ function plastic_dislotwin_postResults(Tstar_v,Temperature,ipc,ip,el) !* Stress exponent plastic_dislotwin_postResults(c+j) = & - merge(0.0_pReal,(tau/gdot_slip(j))*dgdot_dtauslip,dEq(gdot_slip(j),0.0_pReal)) + merge(0.0_pReal,(tau/gdot_slip(j))*dgdot_dtauslip,dEq0(gdot_slip(j))) enddo ; enddo c = c + ns case (sb_eigenvalues_ID) diff --git a/code/plastic_isotropic.f90 b/code/plastic_isotropic.f90 index 9f8129fac..c26b63cfe 100644 --- a/code/plastic_isotropic.f90 +++ b/code/plastic_isotropic.f90 @@ -517,7 +517,7 @@ end subroutine plastic_isotropic_LiAndItsTangent !-------------------------------------------------------------------------------------------------- subroutine plastic_isotropic_dotState(Tstar_v,ipc,ip,el) use prec, only: & - dEq + dEq0 use math, only: & math_mul6x6 use material, only: & @@ -564,7 +564,7 @@ subroutine plastic_isotropic_dotState(Tstar_v,ipc,ip,el) !-------------------------------------------------------------------------------------------------- ! hardening coefficient if (abs(gamma_dot) > 1e-12_pReal) then - if (dEq(param(instance)%tausat_SinhFitA,0.0_pReal)) then + if (dEq0(param(instance)%tausat_SinhFitA)) then saturation = param(instance)%tausat else saturation = ( param(instance)%tausat & diff --git a/code/plastic_nonlocal.f90 b/code/plastic_nonlocal.f90 index f7b36897a..0c0a48523 100644 --- a/code/plastic_nonlocal.f90 +++ b/code/plastic_nonlocal.f90 @@ -1542,7 +1542,7 @@ end subroutine plastic_nonlocal_aTolState !-------------------------------------------------------------------------------------------------- subroutine plastic_nonlocal_microstructure(Fe, Fp, ip, el) use prec, only: & - dEq + dEq0 use IO, only: & IO_error use math, only: & @@ -1786,7 +1786,7 @@ if (.not. phase_localPlasticity(ph) .and. shortRangeStressCorrection(instance)) - neighbor_rhoExcess(c,s,neighbors(2)) enddo invConnections = math_inv33(connections) - if (all(dEq(invConnections,0.0_pReal))) & + if (all(dEq0(invConnections))) & call IO_error(-1_pInt,ext_msg='back stress calculation: inversion error') rhoExcessGradient(c) = math_mul3x3(m(1:3,s,c), & math_mul33x3(invConnections,rhoExcessDifferences)) @@ -2195,7 +2195,7 @@ end subroutine plastic_nonlocal_LpAndItsTangent !-------------------------------------------------------------------------------------------------- subroutine plastic_nonlocal_deltaState(Tstar_v,ip,el) use prec, only: & - dNeq + dNeq0 use debug, only: debug_level, & debug_constitutive, & debug_levelBasic, & @@ -2318,8 +2318,8 @@ dUpper(1:ns,2) = lattice_mu(ph) * burgers(1:ns,instance) / (4.0_pReal * pi * abs forall (c = 1_pInt:2_pInt) - where(dNeq(sqrt(rhoSgl(1:ns,2*c-1)+rhoSgl(1:ns,2*c)+& - abs(rhoSgl(1:ns,2*c+3))+abs(rhoSgl(1:ns,2*c+4))+rhoDip(1:ns,c)),0.0_pReal)) & + where(dNeq0(sqrt(rhoSgl(1:ns,2*c-1)+rhoSgl(1:ns,2*c)+abs(rhoSgl(1:ns,2*c+3))& + +abs(rhoSgl(1:ns,2*c+4))+rhoDip(1:ns,c)))) & dUpper(1:ns,c) = min(1.0_pReal / sqrt(rhoSgl(1:ns,2*c-1) + rhoSgl(1:ns,2*c) & + abs(rhoSgl(1:ns,2*c+3)) + abs(rhoSgl(1:ns,2*c+4)) + rhoDip(1:ns,c)), & dUpper(1:ns,c)) @@ -2331,7 +2331,7 @@ deltaDUpper = dUpper - dUpperOld !*** dissociation by stress increase deltaRhoDipole2SingleStress = 0.0_pReal forall (c=1_pInt:2_pInt, s=1_pInt:ns, deltaDUpper(s,c) < 0.0_pReal .and. & - dNeq(dUpperOld(s,c) - dLower(s,c),0.0_pReal)) & + dNeq0(dUpperOld(s,c) - dLower(s,c))) & deltaRhoDipole2SingleStress(s,8_pInt+c) = rhoDip(s,c) * deltaDUpper(s,c) & / (dUpperOld(s,c) - dLower(s,c)) @@ -2379,8 +2379,9 @@ subroutine plastic_nonlocal_dotState(Tstar_v, Fe, Fp, Temperature, & timestep,subfrac, ip,el) use prec, only: DAMASK_NaN, & + dNeq0, & dNeq, & - dEq + dEq0 use numerics, only: numerics_integrationMode, & numerics_timeSyncing use IO, only: IO_error @@ -2614,8 +2615,8 @@ dUpper(1:ns,1) = lattice_mu(ph) * burgers(1:ns,instance) & dUpper(1:ns,2) = lattice_mu(ph) * burgers(1:ns,instance) & / (4.0_pReal * pi * abs(tau)) forall (c = 1_pInt:2_pInt) - where(dNeq(sqrt(rhoSgl(1:ns,2*c-1)+rhoSgl(1:ns,2*c)+& - abs(rhoSgl(1:ns,2*c+3))+abs(rhoSgl(1:ns,2*c+4))+rhoDip(1:ns,c)),0.0_pReal)) & + where(dNeq0(sqrt(rhoSgl(1:ns,2*c-1)+rhoSgl(1:ns,2*c)+abs(rhoSgl(1:ns,2*c+3))& + +abs(rhoSgl(1:ns,2*c+4))+rhoDip(1:ns,c)))) & dUpper(1:ns,c) = min(1.0_pReal / sqrt(rhoSgl(1:ns,2*c-1) + rhoSgl(1:ns,2*c) & + abs(rhoSgl(1:ns,2*c+3)) + abs(rhoSgl(1:ns,2*c+4)) + rhoDip(1:ns,c)), & dUpper(1:ns,c)) @@ -2827,11 +2828,11 @@ if (.not. phase_localPlasticity(material_phase(1_pInt,ip,el))) then my_rhoSgl = rhoSgl my_v = v if(numerics_timeSyncing) then - if (dEq(subfrac(1_pInt,ip,el),0.0_pReal)) then + if (dEq0(subfrac(1_pInt,ip,el))) then my_rhoSgl = rhoSgl0 my_v = v0 elseif (neighbor_n > 0_pInt) then - if (dEq(subfrac(1_pInt,neighbor_ip,neighbor_el),0.0_pReal)) then + if (dEq0(subfrac(1_pInt,neighbor_ip,neighbor_el))) then my_rhoSgl = rhoSgl0 my_v = v0 endif @@ -3170,7 +3171,7 @@ end subroutine plastic_nonlocal_updateCompatibility !********************************************************************* function plastic_nonlocal_dislocationstress(Fe, ip, el) use prec, only: & - dEq + dEq0 use math, only: math_mul33x33, & math_mul33x3, & math_inv33, & @@ -3383,7 +3384,7 @@ if (.not. phase_localPlasticity(ph)) then Rsquare = R * R Rcube = Rsquare * R denominator = R * (R + flipSign * lambda) - if (dEq(denominator,0.0_pReal)) exit ipLoop + if (dEq0(denominator)) exit ipLoop sigma(1,1) = sigma(1,1) - real(side,pReal) & * flipSign * z / denominator & @@ -3428,7 +3429,7 @@ if (.not. phase_localPlasticity(ph)) then Rsquare = R * R Rcube = Rsquare * R denominator = R * (R + flipSign * lambda) - if (dEq(denominator,0.0_pReal)) exit ipLoop + if (dEq0(denominator)) exit ipLoop sigma(1,2) = sigma(1,2) - real(side,pReal) * flipSign * z & * (1.0_pReal - lattice_nu(ph)) / denominator & @@ -3518,7 +3519,7 @@ end function plastic_nonlocal_dislocationstress !-------------------------------------------------------------------------------------------------- function plastic_nonlocal_postResults(Tstar_v,Fe,ip,el) use prec, only: & - dNeq + dNeq0 use math, only: & math_mul6x6, & math_mul33x3, & @@ -3635,8 +3636,8 @@ dUpper(1:ns,1) = lattice_mu(ph) * burgers(1:ns,instance) & dUpper(1:ns,2) = lattice_mu(ph) * burgers(1:ns,instance) & / (4.0_pReal * pi * abs(tau)) forall (c = 1_pInt:2_pInt) - where(dNeq(sqrt(rhoSgl(1:ns,2*c-1)+rhoSgl(1:ns,2*c)+& - abs(rhoSgl(1:ns,2*c+3))+abs(rhoSgl(1:ns,2*c+4))+rhoDip(1:ns,c)),0.0_pReal)) & + where(dNeq0(sqrt(rhoSgl(1:ns,2*c-1)+rhoSgl(1:ns,2*c)+abs(rhoSgl(1:ns,2*c+3))& + +abs(rhoSgl(1:ns,2*c+4))+rhoDip(1:ns,c)))) & dUpper(1:ns,c) = min(1.0_pReal / sqrt(rhoSgl(1:ns,2*c-1) + rhoSgl(1:ns,2*c) & + abs(rhoSgl(1:ns,2*c+3)) + abs(rhoSgl(1:ns,2*c+4)) + rhoDip(1:ns,c)), & dUpper(1:ns,c)) diff --git a/code/plastic_phenoplus.f90 b/code/plastic_phenoplus.f90 index b9d09fb3d..105a64b34 100644 --- a/code/plastic_phenoplus.f90 +++ b/code/plastic_phenoplus.f90 @@ -113,7 +113,7 @@ contains subroutine plastic_phenoplus_init(fileUnit) use, intrinsic :: iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment) use prec, only: & - dEq + dEq0 use debug, only: & debug_level, & debug_constitutive,& @@ -479,8 +479,7 @@ subroutine plastic_phenoplus_init(fileUnit) if (any(plastic_phenoplus_tausat_slip(:,instance) <= 0.0_pReal .and. & plastic_phenoplus_Nslip(:,instance) > 0)) & call IO_error(211_pInt,el=instance,ext_msg='tausat_slip ('//PLASTICITY_PHENOPLUS_label//')') - if (any(dEq(plastic_phenoplus_a_slip(instance),0.0_pReal) .and. & - plastic_phenoplus_Nslip(:,instance) > 0)) & + if (any(dEq0(plastic_phenoplus_a_slip(instance)) .and. plastic_phenoplus_Nslip(:,instance) > 0)) & call IO_error(211_pInt,el=instance,ext_msg='a_slip ('//PLASTICITY_PHENOPLUS_label//')') if (any(plastic_phenoplus_tau0_twin(:,instance) < 0.0_pReal .and. & plastic_phenoplus_Ntwin(:,instance) > 0)) & @@ -918,7 +917,7 @@ end subroutine plastic_phenoplus_microstructure !-------------------------------------------------------------------------------------------------- subroutine plastic_phenoplus_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip,el) use prec, only: & - dNeq + dNeq0 use math, only: & math_Plain3333to99, & math_Mandel6to33 @@ -1034,7 +1033,7 @@ subroutine plastic_phenoplus_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip,el) (gdot_slip_pos+gdot_slip_neg)*lattice_Sslip(1:3,1:3,1,index_myFamily+i,ph) ! Calculation of the tangent of Lp - if (dNeq(gdot_slip_pos,0.0_pReal)) then + if (dNeq0(gdot_slip_pos)) then dgdot_dtauslip_pos = gdot_slip_pos*plastic_phenoplus_n_slip(instance)/tau_slip_pos forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt,m=1_pInt:3_pInt,n=1_pInt:3_pInt) & dLp_dTstar3333(k,l,m,n) = dLp_dTstar3333(k,l,m,n) + & @@ -1042,7 +1041,7 @@ subroutine plastic_phenoplus_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip,el) nonSchmid_tensor(m,n,1) endif - if (dNeq(gdot_slip_neg,0.0_pReal)) then + if (dNeq0(gdot_slip_neg)) then dgdot_dtauslip_neg = gdot_slip_neg*plastic_phenoplus_n_slip(instance)/tau_slip_neg forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt,m=1_pInt:3_pInt,n=1_pInt:3_pInt) & dLp_dTstar3333(k,l,m,n) = dLp_dTstar3333(k,l,m,n) + & @@ -1069,7 +1068,7 @@ subroutine plastic_phenoplus_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip,el) Lp = Lp + gdot_twin*lattice_Stwin(1:3,1:3,index_myFamily+i,ph) ! Calculation of the tangent of Lp - if (dNeq(gdot_twin,0.0_pReal)) then + if (dNeq0(gdot_twin)) then dgdot_dtautwin = gdot_twin*plastic_phenoplus_n_twin(instance)/tau_twin forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt,m=1_pInt:3_pInt,n=1_pInt:3_pInt) & dLp_dTstar3333(k,l,m,n) = dLp_dTstar3333(k,l,m,n) + & diff --git a/code/plastic_phenopowerlaw.f90 b/code/plastic_phenopowerlaw.f90 index 0db6a6072..a7c7b10e6 100644 --- a/code/plastic_phenopowerlaw.f90 +++ b/code/plastic_phenopowerlaw.f90 @@ -125,7 +125,7 @@ contains subroutine plastic_phenopowerlaw_init(fileUnit) use, intrinsic :: iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment) use prec, only: & - dEq + dEq0 use debug, only: & debug_level, & debug_constitutive,& @@ -485,8 +485,7 @@ subroutine plastic_phenopowerlaw_init(fileUnit) if (any(plastic_phenopowerlaw_tausat_slip(:,instance) <= 0.0_pReal .and. & plastic_phenopowerlaw_Nslip(:,instance) > 0)) & call IO_error(211_pInt,el=instance,ext_msg='tausat_slip ('//PLASTICITY_PHENOPOWERLAW_label//')') - if (any(dEq(plastic_phenopowerlaw_a_slip(instance),0.0_pReal) .and. & - plastic_phenopowerlaw_Nslip(:,instance) > 0)) & + if (any(dEq0(plastic_phenopowerlaw_a_slip(instance)) .and. plastic_phenopowerlaw_Nslip(:,instance) > 0)) & call IO_error(211_pInt,el=instance,ext_msg='a_slip ('//PLASTICITY_PHENOPOWERLAW_label//')') if (any(plastic_phenopowerlaw_tau0_twin(:,instance) < 0.0_pReal .and. & plastic_phenopowerlaw_Ntwin(:,instance) > 0)) & @@ -769,7 +768,7 @@ end subroutine plastic_phenopowerlaw_aTolState !-------------------------------------------------------------------------------------------------- subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip,el) use prec, only: & - dNeq + dNeq0 use math, only: & math_Plain3333to99, & math_Mandel6to33 @@ -859,7 +858,7 @@ subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip, (gdot_slip_pos+gdot_slip_neg)*lattice_Sslip(1:3,1:3,1,index_myFamily+i,ph) ! Calculation of the tangent of Lp - if (dNeq(gdot_slip_pos,0.0_pReal)) then + if (dNeq0(gdot_slip_pos)) then dgdot_dtauslip_pos = gdot_slip_pos*plastic_phenopowerlaw_n_slip(instance)/tau_slip_pos forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt,m=1_pInt:3_pInt,n=1_pInt:3_pInt) & dLp_dTstar3333(k,l,m,n) = dLp_dTstar3333(k,l,m,n) + & @@ -867,7 +866,7 @@ subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip, nonSchmid_tensor(m,n,1) endif - if (dNeq(gdot_slip_neg,0.0_pReal)) then + if (dNeq0(gdot_slip_neg)) then dgdot_dtauslip_neg = gdot_slip_neg*plastic_phenopowerlaw_n_slip(instance)/tau_slip_neg forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt,m=1_pInt:3_pInt,n=1_pInt:3_pInt) & dLp_dTstar3333(k,l,m,n) = dLp_dTstar3333(k,l,m,n) + & @@ -894,7 +893,7 @@ subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar99,Tstar_v,ipc,ip, Lp = Lp + gdot_twin*lattice_Stwin(1:3,1:3,index_myFamily+i,ph) ! Calculation of the tangent of Lp - if (dNeq(gdot_twin,0.0_pReal)) then + if (dNeq0(gdot_twin)) then dgdot_dtautwin = gdot_twin*plastic_phenopowerlaw_n_twin(instance)/tau_twin forall (k=1_pInt:3_pInt,l=1_pInt:3_pInt,m=1_pInt:3_pInt,n=1_pInt:3_pInt) & dLp_dTstar3333(k,l,m,n) = dLp_dTstar3333(k,l,m,n) + & From 1a56ad7a72d284a91339e0c39a13550099e0b4dc Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 29 Oct 2016 10:21:00 +0200 Subject: [PATCH 339/412] no logic change yet --- processing/pre/geom_pack.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/processing/pre/geom_pack.py b/processing/pre/geom_pack.py index cfa329698..106b37b5f 100755 --- a/processing/pre/geom_pack.py +++ b/processing/pre/geom_pack.py @@ -93,7 +93,7 @@ for name in filenames: elif type == '.': table.data = [former] elif type == 'to': - table.data = [former-reps+1,'to',former] + table.data = [start,'to',former] elif type == 'of': table.data = [reps,'of',former] From 7e6e2e1c84cf623950ea42c34f671a3f381b16c2 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 29 Oct 2016 10:28:34 +0200 Subject: [PATCH 340/412] not using reserverd keyword "type" --- processing/pre/geom_pack.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/processing/pre/geom_pack.py b/processing/pre/geom_pack.py index 106b37b5f..d251cdf36 100755 --- a/processing/pre/geom_pack.py +++ b/processing/pre/geom_pack.py @@ -67,7 +67,7 @@ for name in filenames: # --- write packed microstructure information ----------------------------------------------------- - type = '' + compressType = '' former = start = -1 reps = 0 @@ -82,24 +82,24 @@ for name in filenames: for current in items: if current == former+1 and start+reps == former+1: - type = 'to' + compressType = 'to' reps += 1 elif current == former and start == former: - type = 'of' + compressType = 'of' reps += 1 else: - if type == '': + if compressType == '': table.data = [] - elif type == '.': + elif compressType == '.': table.data = [former] - elif type == 'to': + elif compressType == 'to': table.data = [start,'to',former] - elif type == 'of': + elif compressType == 'of': table.data = [reps,'of',former] outputAlive = table.data_write(delimiter = ' ') # output processed line - type = '.' + compressType = '.' start = current reps = 1 @@ -109,7 +109,7 @@ for name in filenames: '.' : [former], 'to': [former-reps+1,'to',former], 'of': [reps,'of',former], - }[type] + }[compressType] outputAlive = table.data_write(delimiter = ' ') # output processed line From aa3dc5694927b845b0688da240b51d4528cf2d3d Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 29 Oct 2016 10:30:42 +0200 Subject: [PATCH 341/412] fixed handling of last line (bug fix for second but last commit) --- processing/pre/geom_pack.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/processing/pre/geom_pack.py b/processing/pre/geom_pack.py index d251cdf36..bf528a052 100755 --- a/processing/pre/geom_pack.py +++ b/processing/pre/geom_pack.py @@ -107,7 +107,7 @@ for name in filenames: table.data = { '.' : [former], - 'to': [former-reps+1,'to',former], + 'to': [start,'to',former], 'of': [reps,'of',former], }[compressType] From 8eb93a327410cf43d2d3338fe746d0e508c6ed10 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 29 Oct 2016 10:49:40 +0200 Subject: [PATCH 342/412] python scripts now pack "a a-1 a-2 ... a-n" to "a to a-n" --- lib/damask/asciitable.py | 7 +++++-- processing/pre/geom_pack.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/damask/asciitable.py b/lib/damask/asciitable.py index 3509a5284..d3a7ad693 100644 --- a/lib/damask/asciitable.py +++ b/lib/damask/asciitable.py @@ -600,8 +600,11 @@ class ASCIItable(): while i < N and self.data_read(): items = self.data if len(items) > 2: - if items[1].lower() == 'of': items = np.ones(datatype(items[0]))*datatype(items[2]) - elif items[1].lower() == 'to': items = np.arange(datatype(items[0]),1+datatype(items[2])) + if items[1].lower() == 'of': + items = np.ones(datatype(items[0]))*datatype(items[2]) + elif items[1].lower() == 'to': + items = np.linspace(datatype(items[0]),datatype(items[2]), + abs(datatype(items[2])-datatype(items[0]))+1,dtype=int) else: items = list(map(datatype,items)) else: items = list(map(datatype,items)) diff --git a/processing/pre/geom_pack.py b/processing/pre/geom_pack.py index bf528a052..286abd180 100755 --- a/processing/pre/geom_pack.py +++ b/processing/pre/geom_pack.py @@ -81,7 +81,7 @@ for name in filenames: else: items = map(int,items) for current in items: - if current == former+1 and start+reps == former+1: + if abs(current - former) == 1 and abs(start-former) == reps - 1: compressType = 'to' reps += 1 elif current == former and start == former: From 97867806f71e17c9ec775f79444c8c4d76050493 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 29 Oct 2016 11:04:19 +0200 Subject: [PATCH 343/412] Fortran code also ready for negative range --- code/IO.f90 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/code/IO.f90 b/code/IO.f90 index 060fcf01f..894e81852 100644 --- a/code/IO.f90 +++ b/code/IO.f90 @@ -1267,8 +1267,8 @@ integer(pInt) function IO_countContinuousIntValues(fileUnit) line = IO_read(fileUnit, .true.) ! reset IO_read exit elseif (IO_lc(IO_stringValue(line,chunkPos,2_pInt)) == 'to' ) then ! found range indicator - IO_countContinuousIntValues = 1_pInt + IO_intValue(line,chunkPos,3_pInt) & - - IO_intValue(line,chunkPos,1_pInt) + IO_countContinuousIntValues = 1_pInt + abs( IO_intValue(line,chunkPos,3_pInt) & + - IO_intValue(line,chunkPos,1_pInt)) line = IO_read(fileUnit, .true.) ! reset IO_read exit ! only one single range indicator allowed else if (IO_lc(IO_stringValue(line,chunkPos,2_pInt)) == 'of' ) then ! found multiple entries indicator @@ -1321,9 +1321,9 @@ function IO_continuousIntValues(fileUnit,maxN,lookupName,lookupMap,lookupMaxN) lookupMaxN integer(pInt), dimension(:,:), intent(in) :: lookupMap character(len=64), dimension(:), intent(in) :: lookupName - integer(pInt) :: i + integer(pInt) :: i,first,last #ifdef Abaqus - integer(pInt) :: j,l,c,first,last + integer(pInt) :: j,l,c #endif integer(pInt), allocatable, dimension(:) :: chunkPos @@ -1348,7 +1348,9 @@ function IO_continuousIntValues(fileUnit,maxN,lookupName,lookupMap,lookupMaxN) enddo exit else if (chunkPos(1) > 2_pInt .and. IO_lc(IO_stringValue(line,chunkPos,2_pInt)) == 'to' ) then ! found range indicator - do i = IO_intValue(line,chunkPos,1_pInt),IO_intValue(line,chunkPos,3_pInt) + first = IO_intValue(line,chunkPos,1_pInt) + last = IO_intValue(line,chunkPos,3_pInt) + do i = first, last, sign(1_pInt,last-first) IO_continuousIntValues(1) = IO_continuousIntValues(1) + 1_pInt IO_continuousIntValues(1+IO_continuousIntValues(1)) = i enddo From 3dc5bc4379f39c20cd24bcb9c43f626c018e0654 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Mon, 31 Oct 2016 09:33:23 -0400 Subject: [PATCH 344/412] Fixed some language and syntax --- lib/damask/colormaps.py | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/lib/damask/colormaps.py b/lib/damask/colormaps.py index 4466840cc..4eec0cd94 100644 --- a/lib/damask/colormaps.py +++ b/lib/damask/colormaps.py @@ -8,9 +8,9 @@ class Color(): """ Conversion of colors between different color-spaces. - Colors should be given in the form - Color('model',[vector]).To convert and copy color from one space to other, use the methods - convertTo('model') and expressAs('model')spectively + Colors should be given in the form Color('model',[vector]). + To convert or copy color from one space to other, use the methods + convertTo('model') or expressAs('model'), respectively. """ __slots__ = [ @@ -88,7 +88,7 @@ class Color(): """ Convert H(ue) S(aturation) L(uminance) to R(red) G(reen) B(lue) - with S,L,H,R,G,B running from 0 to 1 + with all values in the range of 0 to 1 from http://en.wikipedia.org/wiki/HSL_and_HSV """ if self.model != 'HSL': return @@ -114,7 +114,7 @@ class Color(): """ Convert R(ed) G(reen) B(lue) to H(ue) S(aturation) L(uminance) - with S,L,H,R,G,B running from 0 to 1 + with all values in the range of 0 to 1 from http://130.113.54.154/~monger/hsl-rgb.html """ if self.model != 'RGB': return @@ -240,7 +240,8 @@ class Color(): Convert CIE XYZ to CIE Lab with XYZ in the range of 0 to 1 - from http://en.wikipedia.org/wiki/Lab_color_space, http://www.cs.rit.edu/~ncs/color/t_convert.html + from http://en.wikipedia.org/wiki/Lab_color_space, + http://www.cs.rit.edu/~ncs/color/t_convert.html """ if self.model != 'XYZ': return @@ -282,7 +283,7 @@ class Color(): """ Convert Msh colorspace to CIE Lab - s,h in radians + with s,h in radians from http://www.cs.unm.edu/~kmorel/documents/ColorMaps/DivergingColorMapWorkshop.xls """ if self.model != 'MSH': return @@ -419,8 +420,7 @@ class Colormap(): def interpolate_linear(lo, hi, frac): """ Linearly interpolate color at given fraction between lower and - - higher color in model of lower color + higher color using model of lower color. """ interpolation = (1.0 - frac) * np.array(lo.color[:]) \ + frac * np.array(hi.expressAs(lo.model).color[:]) @@ -445,10 +445,10 @@ class Colormap(): """ [RGB] colormap for use in paraview or gmsh, or as raw string, or array. - arguments: name, format, steps, crop. - format is one of (paraview, gmsh, raw, list). - crop selects a (sub)range in [-1.0,1.0]. - generates sequential map if one limiting color is either white or black, + Arguments: name, format, steps, crop. + Format is one of (paraview, gmsh, raw, list). + Crop selects a (sub)range in [-1.0,1.0]. + Generates sequential map if one limiting color is either white or black, diverging map otherwise. """ format = format.lower() # consistent comparison basis @@ -482,4 +482,3 @@ class Colormap(): raise NameError('unknown color export format') return '\n'.join(colormap) + '\n' if type(colormap[0]) is str else colormap - From 94fcc9ad247a69d9f94c3917d87a29a21860f971 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Mon, 31 Oct 2016 10:40:58 -0400 Subject: [PATCH 345/412] fixed language and syntax --- lib/damask/h5table.py | 18 +++---- lib/damask/orientation.py | 74 ++++++++++++++--------------- processing/post/addPK2.py | 2 +- processing/pre/abq_addUserOutput.py | 16 +++---- 4 files changed, 55 insertions(+), 55 deletions(-) diff --git a/lib/damask/h5table.py b/lib/damask/h5table.py index bf8069e37..67d5853b6 100644 --- a/lib/damask/h5table.py +++ b/lib/damask/h5table.py @@ -24,7 +24,7 @@ except(NameError): def lables_to_path(label, dsXMLPath=None): - """Read the xml definition file and return the path.""" + """Read the XML definition file and return the path.""" if dsXMLPath is None: # use the default storage layout in DS_HDF5.xml if "h5table.pyc" in __file__: @@ -49,31 +49,31 @@ def lables_to_path(label, dsXMLPath=None): class H5Table(object): """ - Light weight interface class for h5py + Lightweight interface class for h5py DESCRIPTION ----------- Interface/wrapper class for manipulating data in HDF5 with DAMASK specialized data structure. - -->try to maintain a minimal API design. + --> try to maintain a minimal API design. PARAMETERS ---------- h5f_path: str - Absolute path the HDF5 file + Absolute path of the HDF5 file METHOD ------ - del_entry() -- Force delete attributes/group/datasets (Dangerous) + del_entry() -- Force delete attributes/group/datasets (dangerous) get_attr() -- Return attributes if possible add_attr() -- Add NEW attributes to dataset/group (no force overwrite) get_data() -- Retrieve data in numpy.ndarray add_data() -- Add dataset to H5 file - get_cmdlog() -- Return the command used to generate the data if possible. + get_cmdlog() -- Return the command used to generate the data if possible NOTE ---- 1. As an interface class, it uses the lazy evaluation design - that read the data only when its absolutely necessary. - 2. The command line used to generate new feature is stored with - each dataset as dataset attribute. + that reads the data only when it is absolutely necessary. + 2. The command line used to generate each new feature is stored with + each dataset as dataset attribute. """ diff --git a/lib/damask/orientation.py b/lib/damask/orientation.py index 898a431bb..ef1d8be22 100644 --- a/lib/damask/orientation.py +++ b/lib/damask/orientation.py @@ -28,14 +28,14 @@ class Rodrigues: # ****************************************************************************************** class Quaternion: """ - Orientation represented as unit quaternion + Orientation represented as unit quaternion. - All methods and naming conventions based on http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions + All methods and naming conventions based on http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions. - w is the real part, (x, y, z) are the imaginary parts + w is the real part, (x, y, z) are the imaginary parts. Representation of rotation is in ACTIVE form! - (derived directly or through angleAxis, Euler angles, or active matrix) - vector "a" (defined in coordinate system "A") is actively rotated to new coordinates "b" + (Derived directly or through angleAxis, Euler angles, or active matrix) + Vector "a" (defined in coordinate system "A") is actively rotated to new coordinates "b". b = Q * a b = np.dot(Q.asMatrix(),a) """ @@ -77,7 +77,7 @@ class Quaternion: return Q def __ipow__(self, exponent): - """In place power""" + """In-place power""" omega = math.acos(self.w) vRescale = math.sin(exponent*omega)/math.sin(omega) self.w = np.cos(exponent*omega) @@ -135,7 +135,7 @@ class Quaternion: return self.copy() def __imul__(self, other): - """In place multiplication""" + """In-place multiplication""" try: # Quaternion Ax = self.x Ay = self.y @@ -164,7 +164,7 @@ class Quaternion: return NotImplemented def __idiv__(self, other): - """In place division""" + """In-place division""" if isinstance(other, (int,float)): self.w /= other self.x /= other @@ -184,7 +184,7 @@ class Quaternion: return NotImplemented def __iadd__(self, other): - """In place division""" + """In-place addition""" if isinstance(other, Quaternion): self.w += other.w self.x += other.x @@ -205,7 +205,7 @@ class Quaternion: return self.copy() def __isub__(self, other): - """In place subtraction""" + """In-place subtraction""" if isinstance(other, Quaternion): self.w -= other.w self.x -= other.x @@ -339,12 +339,12 @@ class Quaternion: degrees = False, standardRange = False): """ - Orientation as Bunge-Euler angles + Orientation as Bunge-Euler angles. - conversion of ACTIVE rotation to Euler angles taken from: + Conversion of ACTIVE rotation to Euler angles taken from: Melcher, A.; Unser, A.; Reichhardt, M.; Nestler, B.; Poetschke, M.; Selzer, M. Conversion of EBSD data by a quaternion based algorithm to be used for grain structure simulations - Technische Mechanik 30 (2010) pp 401--413 + Technische Mechanik 30 (2010) pp 401--413. """ angles = [0.0,0.0,0.0] @@ -510,8 +510,8 @@ class Quaternion: """ Interpolation - see http://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/20070017872_2007014421.pdf - for (another?) way to interpolate quaternions + See http://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/20070017872_2007014421.pdf + for (another?) way to interpolate quaternions. """ assert isinstance(q1, Quaternion) and isinstance(q2, Quaternion) Q = cls() @@ -744,39 +744,39 @@ class Symmetry: if self.lattice == 'cubic': basis = {'improper':np.array([ [-1. , 0. , 1. ], - [ np.sqrt(2.) , -np.sqrt(2.) , 0. ], - [ 0. , np.sqrt(3.) , 0. ] ]), - 'proper':np.array([ [ 0. , -1. , 1. ], - [-np.sqrt(2.) , np.sqrt(2.) , 0. ], - [ np.sqrt(3.) , 0. , 0. ] ]), + [ np.sqrt(2.) , -np.sqrt(2.) , 0. ], + [ 0. , np.sqrt(3.) , 0. ] ]), + 'proper':np.array([ [ 0. , -1. , 1. ], + [-np.sqrt(2.) , np.sqrt(2.) , 0. ], + [ np.sqrt(3. ) , 0. , 0. ] ]), } elif self.lattice == 'hexagonal': basis = {'improper':np.array([ [ 0. , 0. , 1. ], - [ 1. , -np.sqrt(3.), 0. ], - [ 0. , 2. , 0. ] ]), - 'proper':np.array([ [ 0. , 0. , 1. ], - [-1. , np.sqrt(3.) , 0. ], - [ np.sqrt(3) , -1. , 0. ] ]), + [ 1. , -np.sqrt(3.) , 0. ], + [ 0. , 2. , 0. ] ]), + 'proper':np.array([ [ 0. , 0. , 1. ], + [-1. , np.sqrt(3.) , 0. ], + [ np.sqrt(3) , -1. , 0. ] ]), } elif self.lattice == 'tetragonal': basis = {'improper':np.array([ [ 0. , 0. , 1. ], - [ 1. , -1. , 0. ], - [ 0. , np.sqrt(2.), 0. ] ]), - 'proper':np.array([ [ 0. , 0. , 1. ], - [-1. , 1. , 0. ], - [ np.sqrt(2.) , 0. , 0. ] ]), + [ 1. , -1. , 0. ], + [ 0. , np.sqrt(2.) , 0. ] ]), + 'proper':np.array([ [ 0. , 0. , 1. ], + [-1. , 1. , 0. ], + [ np.sqrt(2.) , 0. , 0. ] ]), } elif self.lattice == 'orthorhombic': basis = {'improper':np.array([ [ 0., 0., 1.], - [ 1., 0., 0.], - [ 0., 1., 0.] ]), - 'proper':np.array([ [ 0., 0., 1.], - [-1., 0., 0.], - [ 0., 1., 0.] ]), + [ 1., 0., 0.], + [ 0., 1., 0.] ]), + 'proper':np.array([ [ 0., 0., 1.], + [-1., 0., 0.], + [ 0., 1., 0.] ]), } else: - basis = {'improper':np.zeros((3,3),dtype=float), - 'proper':np.zeros((3,3),dtype=float), + basis = {'improper': np.zeros((3,3),dtype=float), + 'proper': np.zeros((3,3),dtype=float), } if np.all(basis == 0.0): diff --git a/processing/post/addPK2.py b/processing/post/addPK2.py index 25fb33c3e..9e6308c39 100755 --- a/processing/post/addPK2.py +++ b/processing/post/addPK2.py @@ -69,7 +69,7 @@ for name in filenames: # ------------------------------------------ assemble header -------------------------------------- table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) - table.labels_append(['%i_S'%(i+1) for i in range(9)]) # extend ASCII header with new labels + table.labels_append(['{}_S'.format(i+1) for i in range(9)]) # extend ASCII header with new labels table.head_write() # ------------------------------------------ process data ------------------------------------------ diff --git a/processing/pre/abq_addUserOutput.py b/processing/pre/abq_addUserOutput.py index 80b31f15b..a084fcbed 100755 --- a/processing/pre/abq_addUserOutput.py +++ b/processing/pre/abq_addUserOutput.py @@ -51,7 +51,7 @@ def ParseOutputFormat(filename,what,me): parser = OptionParser(option_class=damask.extendableOption, usage='%prog [option(s)] Abaqus.Inputfile(s)', description = """ Transfer the output variables requested in the material.config to -properly labelled user defined variables within the Abaqus input file (*.inp). +properly labelled user-defined variables within the Abaqus input file (*.inp). Requires the files .output @@ -84,7 +84,7 @@ parser.set_defaults(number = 0, (options, files) = parser.parse_args() if not files: - parser.error('no file(s) specified...') + parser.error('no file(s) specified.') me = { 'Homogenization': options.homog, 'Crystallite': options.cryst, @@ -93,7 +93,7 @@ me = { 'Homogenization': options.homog, for myFile in files: - print('\033[1m'+scriptName+'\033[0m: '+myFile+'\n') + damask.util.report(scriptName,myFile) if options.useFile: formatFile = os.path.splitext(options.useFile)[0] else: @@ -103,7 +103,7 @@ for myFile in files: print('{} not found'.format(myFile)) continue - print('Scanning format files of: %s'%formatFile) + print('Scanning format files of: {}'.format(formatFile)) if options.number < 1: outputFormat = {} @@ -140,7 +140,7 @@ for myFile in files: UserVars += ['%i_%s'%(grain+1,var[0]) for i in range(var[1])] # Now change *.inp file(s) - print('Adding labels to: %s'%myFile) + print('Adding labels to: {}'.format(myFile)) inFile = open(myFile) input = inFile.readlines() inFile.close() @@ -154,11 +154,11 @@ for myFile in files: if m: lastSection = thisSection thisSection = m.group(1) - if (lastSection.upper() == '*DEPVAR' and thisSection.upper() == '*USER'): #Abaqus keyword can be upper or lower case + if (lastSection.upper() == '*DEPVAR' and thisSection.upper() == '*USER'): # Abaqus keyword can be upper or lower case if options.number > 0: - output.write('%i\n'%options.number) #Abaqus needs total number of SDVs in the line after *Depvar keyword + output.write('{}\n'.format(options.number)) # Abaqus needs total number of SDVs in the line after *Depvar keyword else: - output.write('%i\n'%len(UserVars)) + output.write('{}\n'.format(len(UserVars))) for i in range(len(UserVars)): output.write('%i,"%i%s","%i%s"\n'%(i+1,0,UserVars[i],0,UserVars[i])) #index,output variable key,output variable description From cb26ecb8c2d214c69094476803fae44ea9f5a947 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Mon, 31 Oct 2016 11:07:30 -0400 Subject: [PATCH 346/412] fixed two-line summary --- lib/damask/colormaps.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/damask/colormaps.py b/lib/damask/colormaps.py index 4eec0cd94..646950118 100644 --- a/lib/damask/colormaps.py +++ b/lib/damask/colormaps.py @@ -418,10 +418,7 @@ class Colormap(): return Color('MSH',Msh) def interpolate_linear(lo, hi, frac): - """ - Linearly interpolate color at given fraction between lower and - higher color using model of lower color. - """ + """Linear interpolation between lo and hi color at given fraction; output in model of lo color.""" interpolation = (1.0 - frac) * np.array(lo.color[:]) \ + frac * np.array(hi.expressAs(lo.model).color[:]) From 8593fb3ed75618fe2b7890b4ea5444ae0dcc1cf6 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 31 Oct 2016 22:11:16 +0100 Subject: [PATCH 347/412] unifying scripts --- processing/pre/abq_addUserOutput.py | 5 +-- processing/pre/marc_addUserOutput.py | 65 ++++++++++++---------------- 2 files changed, 29 insertions(+), 41 deletions(-) diff --git a/processing/pre/abq_addUserOutput.py b/processing/pre/abq_addUserOutput.py index a084fcbed..6df80ee82 100755 --- a/processing/pre/abq_addUserOutput.py +++ b/processing/pre/abq_addUserOutput.py @@ -94,7 +94,7 @@ me = { 'Homogenization': options.homog, for myFile in files: damask.util.report(scriptName,myFile) - if options.useFile: + if options.useFile is not None: formatFile = os.path.splitext(options.useFile)[0] else: formatFile = os.path.splitext(myFile)[0] @@ -146,7 +146,7 @@ for myFile in files: inFile.close() output = open(myFile,'w') thisSection = '' - if options.damaskOption: + if options.damaskOption is not None: output.write('$damask {0}\n'.format(options.damaskOption)) for line in input: #Abaqus keyword line begins with: *keyword, argument1, ... @@ -165,4 +165,3 @@ for myFile in files: if (thisSection.upper() != '*DEPVAR' or not re.match('\s*\d',line)): output.write(line) output.close() - diff --git a/processing/pre/marc_addUserOutput.py b/processing/pre/marc_addUserOutput.py index 048f5330a..bf84b46aa 100755 --- a/processing/pre/marc_addUserOutput.py +++ b/processing/pre/marc_addUserOutput.py @@ -48,9 +48,9 @@ def ParseOutputFormat(filename,what,me): format['outputs'].append([output,length]) return format -parser = OptionParser(option_class=damask.extendableOption, usage='%prog [option(s)] Marc.Inputfile(s)', description=""" +parser = OptionParser(option_class=damask.extendableOption, usage='%prog [option(s)] Marc.Inputfile(s)', description = """ Transfer the output variables requested in the material.config to -properly labelled user defined variables within the Marc input file (*.dat). +properly labelled user-defined variables within the Marc input file (*.dat). Requires the files .output @@ -61,40 +61,29 @@ Or have an existing set of user variables copied over from another *.dat file. """, version = scriptID) - -parser.add_option('-n','--number', dest='number', type='int', \ - metavar='int', - help='maximum requested User Defined Variable [%default]') -parser.add_option('--homogenization', dest='homog', \ - metavar='string', - help='homogenization identifier (as string or integer [%default])') -parser.add_option('--crystallite', dest='cryst', \ - metavar='string', - help='crystallite identifier (as string or integer [%default])') -parser.add_option('--phase', dest='phase', \ - metavar='string', - help='phase identifier (as string or integer [%default])') -parser.add_option('--use', dest='useFile', \ - metavar='string', - help='Optionally parse output descriptors from '+ - 'different .outputZZZ file. Saves the effort '+ - 'to start a calculation for each job)') -parser.add_option('--option', dest='damaskOption', \ - metavar='string', - help='Add damask option to input file '+ - 'for example: "periodic x z"') -parser.set_defaults(number = 0) -parser.set_defaults(homog = '1') -parser.set_defaults(cryst = '1') -parser.set_defaults(phase = '1') -parser.set_defaults(useFile = '') -parser.set_defaults(damaskOption = '') +parser.add_option('-m', dest='number', type='int', metavar = 'int', + help='maximum requested User Defined Variable [%default]') +parser.add_option('--homogenization', dest='homog', metavar = 'string', + help='homogenization name or index [%default]') +parser.add_option('--crystallite', dest='cryst', metavar = 'string', + help='crystallite identifier name or index [%default]') +parser.add_option('--phase', dest='phase', metavar = 'string', + help='phase identifier name or index [%default]') +parser.add_option('--use', dest='useFile', metavar = 'string', + help='optionally parse output descriptors from '+ + 'outputXXX files of given name') +parser.add_option('--option', dest='damaskOption', metavar = 'string', + help='Add DAMASK option to input file, e.g. "periodic x z"') + +parser.set_defaults(number = 0, + homog = '1', + cryst = '1', + phase = '1') (options, files) = parser.parse_args() if not files: - parser.print_help() - parser.error('no file(s) specified...') + parser.error('no file(s) specified.') me = { 'Homogenization': options.homog, 'Crystallite': options.cryst, @@ -103,8 +92,8 @@ me = { 'Homogenization': options.homog, for myFile in files: - print('\033[1m'+scriptName+'\033[0m: '+myFile+'\n') - if options.useFile != '': + damask.util.report(scriptName,myFile) + if options.useFile is not None: formatFile = os.path.splitext(options.useFile)[0] else: formatFile = os.path.splitext(myFile)[0] @@ -113,7 +102,7 @@ for myFile in files: print('{} not found'.format(myFile)) continue - print('Scanning format files of: %s'%formatFile) + print('Scanning format files of: {}'.format(formatFile)) if options.number < 1: outputFormat = {} @@ -121,7 +110,7 @@ for myFile in files: for what in me: outputFormat[what] = ParseOutputFormat(formatFile,what,me[what]) if '_id' not in outputFormat[what]['specials']: - print("'{}' not found in <{}>"%(me[what],what)) + print("'{}' not found in <{}>".format(me[what],what)) print('\n'.join(map(lambda x:' '+x,outputFormat[what]['specials']['brothers']))) sys.exit(1) @@ -150,13 +139,13 @@ for myFile in files: UserVars += ['%i_%s'%(grain+1,var[0]) for i in range(var[1])] # Now change *.dat file(s) - print('Adding labels to: %s'%myFile) + print('Adding labels to: {}'.format(myFile)) inFile = open(myFile) input = inFile.readlines() inFile.close() output = open(myFile,'w') thisSection = '' - if options.damaskOption: + if options.damaskOption is not None: output.write('$damask {0}\n'.format(options.damaskOption)) for line in input: m = re.match('(\w+)\s',line) From 9e76b510148c4998dfe64a8a23e21664c0b1f732 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 31 Oct 2016 22:50:47 +0100 Subject: [PATCH 348/412] fixing global variables handling (need to be defined before being used) --- processing/misc/yieldSurface.py | 71 ++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 33 deletions(-) diff --git a/processing/misc/yieldSurface.py b/processing/misc/yieldSurface.py index f3b6f0425..28f52062f 100755 --- a/processing/misc/yieldSurface.py +++ b/processing/misc/yieldSurface.py @@ -11,15 +11,10 @@ scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptID = ' '.join([scriptName,damask.version]) def runFit(exponent, eqStress, dimension, criterion): - global s, threads, myFit, myLoad - global fitResults, fitErrors, fitResidual, stressAll, strainAll - global N_simulations, Guess, dDim - - fitResults = [] - fitErrors = [] - fitResidual = [] - Guess = [] - threads=[] + global threads, myFit, myLoad + global fitResidual + global Guess, dDim + dDim = dimension - 3 nParas = len(fitCriteria[criterion]['bound'][dDim]) nExpo = fitCriteria[criterion]['nExpo'] @@ -37,13 +32,9 @@ def runFit(exponent, eqStress, dimension, criterion): if g == 0: g = temp[1]*0.5 Guess.append(g) - N_simulations=0 - s=threading.Semaphore(1) myLoad = Loadcase(options.load[0],options.load[1],options.load[2], nSet = 10, dimension = dimension, vegter = options.criterion=='vegter') - stressAll= [np.zeros(0,'d').reshape(0,0) for i in range(int(options.yieldValue[2]))] - strainAll= [np.zeros(0,'d').reshape(0,0) for i in range(int(options.yieldValue[2]))] myFit = Criterion(exponent,eqStress, dimension, criterion) for t in range(options.threads): @@ -1222,17 +1213,17 @@ class myThread (threading.Thread): threading.Thread.__init__(self) self.threadID = threadID def run(self): - s.acquire() + semaphore.acquire() conv=converged() - s.release() + semaphore.release() while not conv: doSim(self.name) - s.acquire() + semaphore.acquire() conv=converged() - s.release() + semaphore.release() def doSim(thread): - s.acquire() + semaphore.acquire() global myLoad loadNo=loadcaseNo() if not os.path.isfile('%s.load'%loadNo): @@ -1240,22 +1231,22 @@ def doSim(thread): f=open('%s.load'%loadNo,'w') f.write(myLoad.getLoadcase(loadNo)) f.close() - s.release() - else: s.release() + semaphore.release() + else: semaphore.release() # if spectralOut does not exist, run simulation - s.acquire() + semaphore.acquire() if not os.path.isfile('%s_%i.spectralOut'%(options.geometry,loadNo)): damask.util.croak('Starting simulation %i (%s)'%(loadNo,thread)) - s.release() + semaphore.release() damask.util.execute('DAMASK_spectral -g %s -l %i'%(options.geometry,loadNo)) - else: s.release() + else: semaphore.release() # if ASCII tables do not exist, run postprocessing - s.acquire() + semaphore.acquire() if not os.path.isfile('./postProc/%s_%i.txt'%(options.geometry,loadNo)): damask.util.croak('Starting post processing for simulation %i (%s)'%(loadNo,thread)) - s.release() + semaphore.release() try: damask.util.execute('postResults --cr f,p --co totalshear %s_%i.spectralOut'%(options.geometry,loadNo)) except: @@ -1263,10 +1254,10 @@ def doSim(thread): damask.util.execute('addCauchy ./postProc/%s_%i.txt'%(options.geometry,loadNo)) damask.util.execute('addStrainTensors -0 -v ./postProc/%s_%i.txt'%(options.geometry,loadNo)) damask.util.execute('addMises -s Cauchy -e ln(V) ./postProc/%s_%i.txt'%(options.geometry,loadNo)) - else: s.release() + else: semaphore.release() # reading values from ASCII table (including linear interpolation between points) - s.acquire() + semaphore.acquire() damask.util.croak('Reading values from simulation %i (%s)'%(loadNo,thread)) refFile = './postProc/%s_%i.txt'%(options.geometry,loadNo) table = damask.ASCIItable(refFile,readonly=True) @@ -1278,7 +1269,7 @@ def doSim(thread): for l in [thresholdKey,'1_Cauchy']: if l not in table.labels(raw = True): damask.util.croak('%s not found'%l) - s.release() + semaphore.release() table.data_readArray(['%i_Cauchy'%(i+1) for i in range(9)]+[thresholdKey]+['%i_ln(V)'%(i+1) for i in range(9)]) @@ -1303,13 +1294,13 @@ def doSim(thread): else: line+=1 if not validity[i]: - s.acquire() + semaphore.acquire() damask.util.croak('The data of result %i at the threshold %f is invalid,'%(loadNo,threshold)\ +'the fitting at this point is skipped') - s.release() + semaphore.release() # do the actual fitting procedure and write results to file - s.acquire() + semaphore.acquire() global stressAll, strainAll f=open(options.geometry+'_'+options.criterion+'_'+str(time.time())+'.txt','w') f.write(' '.join([options.fitting]+myFit.report_labels())+'\n') @@ -1322,10 +1313,10 @@ def doSim(thread): ' '.join(map(str,myFit.fit(stressAll[i].reshape(len(stressAll[i])//6,6).transpose())))+'\n') except Exception: damask.util.croak('Could not fit results of simulation (%s)'%thread) - s.release() + semaphore.release() return damask.util.croak('\n') - s.release() + semaphore.release() def loadcaseNo(): global N_simulations @@ -1420,6 +1411,20 @@ if options.dimension not in fitCriteria[options.criterion]['dimen']: if options.criterion not in ['vonmises','tresca','drucker','hill1948'] and options.eqStress is None: parser.error('please specify an equivalent stress (e.g. fitting to von Mises)') + +# global variables +fitResults = [] +fitErrors = [] +fitResidual = [] +stressAll= [np.zeros(0,'d').reshape(0,0) for i in range(int(options.yieldValue[2]))] +strainAll= [np.zeros(0,'d').reshape(0,0) for i in range(int(options.yieldValue[2]))] +N_simulations=0 +Guess = [] +threads=[] +semaphore=threading.Semaphore(1) +dDim = None +myLoad = None +myFit = None run = runFit(options.exponent, options.eqStress, options.dimension, options.criterion) From d2b89a16e9464bb7dcff32ffed34ef20afd81974 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 1 Nov 2016 09:34:46 +0100 Subject: [PATCH 349/412] output differs when using dEq0 instead of dEq(x,0.0) revert this change for the moment, even though dEq0 seems to be more safe --- code/plastic_disloUCLA.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/plastic_disloUCLA.f90 b/code/plastic_disloUCLA.f90 index 147be2f54..62d09186f 100644 --- a/code/plastic_disloUCLA.f90 +++ b/code/plastic_disloUCLA.f90 @@ -1174,7 +1174,7 @@ end subroutine plastic_disloUCLA_dotState function plastic_disloUCLA_postResults(Tstar_v,Temperature,ipc,ip,el) use prec, only: & tol_math_check, & - dEq0 + dEq use math, only: & pi use material, only: & @@ -1402,7 +1402,7 @@ function plastic_disloUCLA_postResults(Tstar_v,Temperature,ipc,ip,el) c = c + ns elseif(plastic_disloUCLA_outputID(o,instance) == stress_exponent_ID) then do j = 1_pInt, ns - if (dEq0(gdot_slip_pos(j)+gdot_slip_neg(j))) then + if (dEq(gdot_slip_pos(j)+gdot_slip_neg(j),0.0_pReal)) then plastic_disloUCLA_postResults(c+j) = 0.0_pReal else plastic_disloUCLA_postResults(c+j) = (tau_slip_pos(j)+tau_slip_neg(j))/& From fef05621c4ade59593a391461a760f5ebdea1987 Mon Sep 17 00:00:00 2001 From: Test User Date: Tue, 1 Nov 2016 16:39:44 +0100 Subject: [PATCH 350/412] updated version information after successful test of v2.0.1-284-gd2b89a1 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 83bd5fe58..f981c9349 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-263-gb34a60d +v2.0.1-284-gd2b89a1 From d03f0bb80f674977ab1f4745a0fb93e113676113 Mon Sep 17 00:00:00 2001 From: Test User Date: Wed, 2 Nov 2016 04:39:41 +0100 Subject: [PATCH 351/412] updated version information after successful test of v2.0.1-292-gae05bdd --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index f981c9349..718668003 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-284-gd2b89a1 +v2.0.1-292-gae05bdd From 2fa4e48cf003893e4736fc5ddab2da2a0b22d5bb Mon Sep 17 00:00:00 2001 From: Franz Roters Date: Wed, 2 Nov 2016 13:53:12 +0100 Subject: [PATCH 352/412] modified mkl libraries as to also work with Intel Fortran 17 --- installation/mods_MarcMentat/2016/Marc_tools/include_linux64 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/installation/mods_MarcMentat/2016/Marc_tools/include_linux64 b/installation/mods_MarcMentat/2016/Marc_tools/include_linux64 index c939bbd9d..39562d9d0 100644 --- a/installation/mods_MarcMentat/2016/Marc_tools/include_linux64 +++ b/installation/mods_MarcMentat/2016/Marc_tools/include_linux64 @@ -701,9 +701,9 @@ else fi if test "$MARC_INTEGER_SIZE" = "i4" ; then - MKLLIB="$MARC_MKL/libmkl_scalapack_lp64.a $MARC_MKL/libmkl_blacs_lp64.a -Wl,--start-group $MARC_MKL/libmkl_intel_lp64.a $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_core.a -Wl,--end-group" + MKLLIB="$MARC_MKL/libmkl_scalapack_lp64.a -Wl,--start-group $MARC_MKL/libmkl_intel_lp64.a $MARC_MKL/libmkl_core.a $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_blacs_intelmpi_lp64.a -Wl,--end-group" else - MKLLIB="$MARC_MKL/libmkl_scalapack_ilp64.a $MARC_MKL/libmkl_blacs_ilp64.a -Wl,--start-group $MARC_MKL/libmkl_intel_ilp64.a $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_core.a -Wl,--end-group" + MKLLIB="$MARC_MKL/libmkl_scalapack_ilp64.a -Wl,--start-group $MARC_MKL/libmkl_intel_ilp64.a $MARC_MKL/libmkl_core.a $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_blacs_intelmpi_ilp64.a -Wl,--end-group" fi SECLIBS="-L$MARC_LIB -llapi" From 2d1421c09a0de05534b023d00649c30a6037196d Mon Sep 17 00:00:00 2001 From: Test User Date: Thu, 3 Nov 2016 04:40:20 +0100 Subject: [PATCH 353/412] updated version information after successful test of v2.0.1-294-g2fa4e48 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 718668003..146bd7483 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-292-gae05bdd +v2.0.1-294-g2fa4e48 From d35c9dd4316412aa72e2cb661a60d645f9e21b68 Mon Sep 17 00:00:00 2001 From: Chuanlai Liu Date: Fri, 4 Nov 2016 18:50:39 +0100 Subject: [PATCH 354/412] using Einstein sum to replace 'for loop' --- processing/post/addCurl.py | 51 ++++++++++++-------------------- processing/post/addDivergence.py | 35 +++++++++------------- processing/post/addGradient.py | 36 +++++++++------------- 3 files changed, 47 insertions(+), 75 deletions(-) diff --git a/processing/post/addCurl.py b/processing/post/addCurl.py index fd358703f..ba310750b 100755 --- a/processing/post/addCurl.py +++ b/processing/post/addCurl.py @@ -22,39 +22,26 @@ def curlFFT(geomdim,field): curl_fourier = np.empty(field_fourier.shape,'c16') # differentiation in Fourier space - k_s = np.zeros([3],'i') TWOPIIMG = 2.0j*math.pi - for i in range(grid[2]): - k_s[0] = i - if grid[2]%2 == 0 and i == grid[2]//2: k_s[0] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) - elif i > grid[2]//2: k_s[0] -= grid[2] - - for j in range(grid[1]): - k_s[1] = j - if grid[1]%2 == 0 and j == grid[1]//2: k_s[1] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) - elif j > grid[1]//2: k_s[1] -= grid[1] - - for k in range(grid[0]//2+1): - k_s[2] = k - if grid[0]%2 == 0 and k == grid[0]//2: k_s[2] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) - - xi = (k_s/geomdim)[2::-1].astype('c16') # reversing the field input order - - if dataType == 'tensor': - for l in range(3): - curl_fourier[i,j,k,0,l] = ( field_fourier[i,j,k,l,2]*xi[1]\ - -field_fourier[i,j,k,l,1]*xi[2]) *TWOPIIMG - curl_fourier[i,j,k,1,l] = (-field_fourier[i,j,k,l,2]*xi[0]\ - +field_fourier[i,j,k,l,0]*xi[2]) *TWOPIIMG - curl_fourier[i,j,k,2,l] = ( field_fourier[i,j,k,l,1]*xi[0]\ - -field_fourier[i,j,k,l,0]*xi[1]) *TWOPIIMG - elif dataType == 'vector': - curl_fourier[i,j,k,0] = ( field_fourier[i,j,k,2]*xi[1]\ - -field_fourier[i,j,k,1]*xi[2]) *TWOPIIMG - curl_fourier[i,j,k,1] = (-field_fourier[i,j,k,2]*xi[0]\ - +field_fourier[i,j,k,0]*xi[2]) *TWOPIIMG - curl_fourier[i,j,k,2] = ( field_fourier[i,j,k,1]*xi[0]\ - -field_fourier[i,j,k,0]*xi[1]) *TWOPIIMG + k_sk = np.where(np.arange(grid[2])>grid[2]//2,np.arange(grid[2])-grid[2],np.arange(grid[2]))/geomdim[0] + if grid[2]%2 == 0: k_sk[grid[2]//2] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) + + k_sj = np.where(np.arange(grid[1])>grid[1]//2,np.arange(grid[1])-grid[1],np.arange(grid[1]))/geomdim[1] + if grid[1]%2 == 0: k_sj[grid[1]//2] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) + + k_si = np.arange(grid[0]//2+1)/geomdim[2] + + kk, kj, ki = np.meshgrid(k_sk,k_sj,k_si,indexing = 'ij') + k_s = np.concatenate((ki[:,:,:,None],kj[:,:,:,None],kk[:,:,:,None]),axis = 3).astype('c16') + + e = np.zeros((3, 3, 3)) + e[0, 1, 2] = e[1, 2, 0] = e[2, 0, 1] = 1.0 # Levi-Civita symbols + e[0, 2, 1] = e[2, 1, 0] = e[1, 0, 2] = -1.0 + + if dataType == 'tensor': + curl_fourier = np.einsum('slm,ijkl,ijknm->ijksn',e,k_s,field_fourier)*TWOPIIMG + elif dataType == 'vector': + curl_fourier = np.einsum('slm,ijkl,ijkm->ijks',e,k_s,field_fourier)*TWOPIIMG return np.fft.irfftn(curl_fourier,axes=(0,1,2),s=shapeFFT).reshape([N,n]) diff --git a/processing/post/addDivergence.py b/processing/post/addDivergence.py index bbb7ac8d4..3ce35d275 100755 --- a/processing/post/addDivergence.py +++ b/processing/post/addDivergence.py @@ -19,29 +19,22 @@ def divFFT(geomdim,field): div_fourier = np.empty(field_fourier.shape[0:len(np.shape(field))-1],'c16') # size depents on whether tensor or vector # differentiation in Fourier space - k_s = np.zeros([3],'i') TWOPIIMG = 2.0j*math.pi - for i in range(grid[2]): - k_s[0] = i - if grid[2]%2 == 0 and i == grid[2]//2: k_s[0] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) - elif i > grid[2]//2: k_s[0] -= grid[2] - - for j in range(grid[1]): - k_s[1] = j - if grid[1]%2 == 0 and j == grid[1]//2: k_s[1] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) - elif j > grid[1]//2: k_s[1] -= grid[1] - - for k in range(grid[0]//2+1): - k_s[2] = k - if grid[0]%2 == 0 and k == grid[0]//2: k_s[2] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) - - xi = (k_s/geomdim)[2::-1].astype('c16') # reversing the field input order - if n == 9: # tensor, 3x3 -> 3 - for l in range(3): - div_fourier[i,j,k,l] = sum(field_fourier[i,j,k,l,0:3]*xi) *TWOPIIMG - elif n == 3: # vector, 3 -> 1 - div_fourier[i,j,k] = sum(field_fourier[i,j,k,0:3]*xi) *TWOPIIMG + k_sk = np.where(np.arange(grid[2])>grid[2]//2,np.arange(grid[2])-grid[2],np.arange(grid[2]))/geomdim[0] + if grid[2]%2 == 0: k_sk[grid[2]//2] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) + + k_sj = np.where(np.arange(grid[1])>grid[1]//2,np.arange(grid[1])-grid[1],np.arange(grid[1]))/geomdim[1] + if grid[1]%2 == 0: k_sj[grid[1]//2] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) + k_si = np.arange(grid[0]//2+1)/geomdim[2] + + kk, kj, ki = np.meshgrid(k_sk,k_sj,k_si,indexing = 'ij') + k_s = np.concatenate((ki[:,:,:,None],kj[:,:,:,None],kk[:,:,:,None]),axis = 3).astype('c16') + if n == 9: # tensor, 3x3 -> 3 + div_fourier = np.einsum('ijklm,ijkm->ijkl',field_fourier,k_s)*TWOPIIMG + elif n == 3: # vector, 3 -> 1 + div_fourier = np.einsum('ijkl,ijkl->ijk',field_fourier,k_s)*TWOPIIMG + return np.fft.irfftn(div_fourier,axes=(0,1,2),s=shapeFFT).reshape([N,n/3]) diff --git a/processing/post/addGradient.py b/processing/post/addGradient.py index da6852ac2..d28a6f813 100755 --- a/processing/post/addGradient.py +++ b/processing/post/addGradient.py @@ -22,29 +22,21 @@ def gradFFT(geomdim,field): grad_fourier = np.empty(field_fourier.shape+(3,),'c16') # differentiation in Fourier space - k_s = np.zeros([3],'i') TWOPIIMG = 2.0j*math.pi - for i in range(grid[2]): - k_s[0] = i - if grid[2]%2 == 0 and i == grid[2]//2: k_s[0] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) - elif i > grid[2]//2: k_s[0] -= grid[2] - - for j in range(grid[1]): - k_s[1] = j - if grid[1]%2 == 0 and j == grid[1]//2: k_s[1] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) - elif j > grid[1]//2: k_s[1] -= grid[1] - - for k in range(grid[0]//2+1): - k_s[2] = k - if grid[0]%2 == 0 and k == grid[0]//2: k_s[2] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) - - xi = (k_s/geomdim)[2::-1].astype('c16') # reversing the field order - - grad_fourier[i,j,k,0,:] = field_fourier[i,j,k,0]*xi *TWOPIIMG # vector field from scalar data - - if dataType == 'vector': - grad_fourier[i,j,k,1,:] = field_fourier[i,j,k,1]*xi *TWOPIIMG # tensor field from vector data - grad_fourier[i,j,k,2,:] = field_fourier[i,j,k,2]*xi *TWOPIIMG + k_sk = np.where(np.arange(grid[2])>grid[2]//2,np.arange(grid[2])-grid[2],np.arange(grid[2]))/geomdim[0] + if grid[2]%2 == 0: k_sk[grid[2]//2] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) + + k_sj = np.where(np.arange(grid[1])>grid[1]//2,np.arange(grid[1])-grid[1],np.arange(grid[1]))/geomdim[1] + if grid[1]%2 == 0: k_sj[grid[1]//2] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) + + k_si = np.arange(grid[0]//2+1)/geomdim[2] + + kk, kj, ki = np.meshgrid(k_sk,k_sj,k_si,indexing = 'ij') + k_s = np.concatenate((ki[:,:,:,None],kj[:,:,:,None],kk[:,:,:,None]),axis = 3).astype('c16') + if n == 3: # vector, 3 -> 3x3 + grad_fourier = np.einsum('ijkl,ijkm->ijklm',field_fourier,k_s)*TWOPIIMG + elif n == 1: # scalar, 1 -> 3 + grad_fourier = np.einsum('ijkl,ijkl->ijkl',field_fourier,k_s)*TWOPIIMG return np.fft.irfftn(grad_fourier,axes=(0,1,2),s=shapeFFT).reshape([N,3*n]) From 4e4fa35ca09d827069175e48d631a2ef4353d61e Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 5 Nov 2016 12:55:07 +0100 Subject: [PATCH 355/412] reordered for better readibility, do not limit heap for zsh limiting the heap causes problem on my arch linux, where it is set to unlimited by default. Since I'm probably the only zshell user, I'll test it for a while and If I don't observe any problems do the same changes for bash/dash and C shell --- DAMASK_env.csh | 4 ++-- DAMASK_env.sh | 2 +- DAMASK_env.zsh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DAMASK_env.csh b/DAMASK_env.csh index 96ddbf8c2..81d4de421 100644 --- a/DAMASK_env.csh +++ b/DAMASK_env.csh @@ -25,11 +25,11 @@ endif # this seems to make sense for the stack size if ( `which free` != "free: Command not found." ) then set freeMem=`free -k | grep -E '(Mem|Speicher):' | awk '{print $4;}'` - set stack=`expr $freeMem / $DAMASK_NUM_THREADS / 2` set heap=` expr $freeMem / 2` + set stack=`expr $freeMem / $DAMASK_NUM_THREADS / 2` # http://superuser.com/questions/220059/what-parameters-has-ulimit - limit stacksize $stack # maximum stack size (kB) limit datasize $heap # maximum heap size (kB) + limit stacksize $stack # maximum stack size (kB) endif if ( `limit | grep memoryuse` != "" ) then limit memoryuse unlimited # maximum physical memory size diff --git a/DAMASK_env.sh b/DAMASK_env.sh index 6abaff19b..e45e16d42 100644 --- a/DAMASK_env.sh +++ b/DAMASK_env.sh @@ -40,8 +40,8 @@ FREE=$(which free 2>/dev/null) if [ "x$FREE" != "x" ]; then freeMem=$(free -k | grep -E '(Mem|Speicher):' | awk '{print $4;}') # http://superuser.com/questions/220059/what-parameters-has-ulimit - ulimit -s $(expr $freeMem / $DAMASK_NUM_THREADS / 2) 2>/dev/null # maximum stack size (kB) ulimit -d $(expr $freeMem / 2) 2>/dev/null # maximum heap size (kB) + ulimit -s $(expr $freeMem / $DAMASK_NUM_THREADS / 2) 2>/dev/null # maximum stack size (kB) fi ulimit -v unlimited 2>/dev/null # maximum virtual memory size ulimit -m unlimited 2>/dev/null # maximum physical memory size diff --git a/DAMASK_env.zsh b/DAMASK_env.zsh index ccb534b99..557397630 100644 --- a/DAMASK_env.zsh +++ b/DAMASK_env.zsh @@ -28,8 +28,8 @@ if [ "`which free 2>/dev/null`" != "free not found" ]; then freeMem=`free -k | grep -E '(Mem|Speicher):' | awk '{print $4;}'` # http://superuser.com/questions/220059/what-parameters-has-ulimit + #ulimit -d `expr $freeMem / 2` 2>/dev/null # maximum heap size (kB) ulimit -s `expr $freeMem / $DAMASK_NUM_THREADS / 2` 2>/dev/null # maximum stack size (kB) - ulimit -d `expr $freeMem / 2` 2>/dev/null # maximum heap size (kB) fi ulimit -v unlimited 2>/dev/null # maximum virtual memory size ulimit -m unlimited 2>/dev/null # maximum physical memory size From e57fd8e01ad921c75ce11064e1e7369de717a5c5 Mon Sep 17 00:00:00 2001 From: Test User Date: Sun, 6 Nov 2016 16:39:51 +0100 Subject: [PATCH 356/412] updated version information after successful test of v2.0.1-296-g4e4fa35 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 146bd7483..9243d70f9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-294-g2fa4e48 +v2.0.1-296-g4e4fa35 From 8179a703fb27d2380104c1449181d1bf18c0ac9f Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 6 Nov 2016 22:57:34 +0100 Subject: [PATCH 357/412] now more flexible, works for synthetic data and user selected data --- processing/misc/DREAM3D_toTable.py | 66 +++++++++++++++++------------- 1 file changed, 38 insertions(+), 28 deletions(-) diff --git a/processing/misc/DREAM3D_toTable.py b/processing/misc/DREAM3D_toTable.py index 4cd93cf5b..c09a77717 100755 --- a/processing/misc/DREAM3D_toTable.py +++ b/processing/misc/DREAM3D_toTable.py @@ -14,14 +14,28 @@ scriptID = ' '.join([scriptName,damask.version]) # MAIN #-------------------------------------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog [geomfile[s]]', description = """ -Convert DREAM3D file to ASCIItable +parser = OptionParser(option_class=damask.extendableOption, usage='%prog [dream3dfile[s]]', description = """ +Convert DREAM3D file to ASCIItable. Works for 3D datasets, but, hey, its not called DREAM2D ;) """, version = scriptID) +parser.add_option('-d','--data', + dest = 'data', + action = 'extend', metavar = '', + help = 'data to extract from DREAM3D file') +parser.add_option('-c','--container', + dest = 'container', metavar = 'string', + help = 'root container(group) in which data is stored [%default]') + +parser.set_defaults(container="ImageDataContainer", + ) + (options, filenames) = parser.parse_args() -rootDir ='DataContainers/ImageDataContainer' +if options.data is None: + parser.error('No data selected') + +rootDir ='DataContainers/'+options.container # --- loop over input files ------------------------------------------------------------------------- @@ -36,33 +50,29 @@ for name in filenames: damask.util.report(scriptName,name) inFile = h5py.File(name, 'r') - - grid = inFile[rootDir+'/_SIMPL_GEOMETRY/DIMENSIONS'][...] - + try: + grid = inFile[rootDir+'/_SIMPL_GEOMETRY/DIMENSIONS'][...] + except: + damask.util.croak('Group {} not found'.format(options.container)) + table.close(dismiss = True) + continue # --- read comments -------------------------------------------------------------------------------- - coords = (np.mgrid[0:grid[2], 0:grid[1], 0: grid[0]]).reshape(3, -1).T - coords = (np.fliplr(coords)*inFile[rootDir+'/_SIMPL_GEOMETRY/SPACING'][...] \ - + inFile[rootDir+'/_SIMPL_GEOMETRY/ORIGIN'][...] \ - + inFile[rootDir+'/_SIMPL_GEOMETRY/SPACING'][...]*0.5) - - table.data = np.hstack( (coords, - inFile[rootDir+'/CellData/EulerAngles'][...].reshape(grid.prod(),3), - inFile[rootDir+'/CellData/Phases'][...].reshape(grid.prod(),1), - inFile[rootDir+'/CellData/Confidence Index'][...].reshape(grid.prod(),1), - inFile[rootDir+'/CellData/Fit'][...].reshape(grid.prod(),1), - inFile[rootDir+'/CellData/Image Quality'][...].reshape(grid.prod(),1))) - - - labels = ['1_pos','2_pos','3_pos', - '1_Euler','2_Euler','3_Euler', - 'PhaseID','CI','Fit','IQ'] - try: - table.data = np.hstack((table.data, inFile[rootDir+'/CellData/FeatureIds'][...].reshape(grid.prod(),1))) - labels.append(['FeatureID']) - except Exception: - pass + coords = (np.mgrid[0:grid[2], 0:grid[1], 0: grid[0]]).reshape(3, -1).T + table.data = (np.fliplr(coords)*inFile[rootDir+'/_SIMPL_GEOMETRY/SPACING'][...] \ + + inFile[rootDir+'/_SIMPL_GEOMETRY/ORIGIN'][...] \ + + inFile[rootDir+'/_SIMPL_GEOMETRY/SPACING'][...]*0.5) + labels = ['1_pos','2_pos','3_pos'] + for data in options.data: + try: + l = np.prod(inFile[rootDir+'/CellData/'+data].shape[3:]) + labels+=['{}_{}'.format(i+1,data.replace(' ','')) for i in range(l)] if l >1 else [data.replace(' ','')] + except KeyError: + damask.util.croak('Data {} not found'.format(data)) + pass + table.data = np.hstack((table.data, + inFile[rootDir+'/CellData/'+data][...].reshape(grid.prod(),l))) # ------------------------------------------ assemble header --------------------------------------- table.labels_clear() @@ -70,5 +80,5 @@ for name in filenames: table.head_write() # ------------------------------------------ finalize output --------------------------------------- - table.data_writeArray() #(fmt='%e2.2') + table.data_writeArray() table.close() From 0653383c95651023d15c15f72695a8c15abaf1c7 Mon Sep 17 00:00:00 2001 From: Test User Date: Mon, 7 Nov 2016 04:39:27 +0100 Subject: [PATCH 358/412] updated version information after successful test of v2.0.1-298-g8179a70 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 9243d70f9..02b19f674 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-296-g4e4fa35 +v2.0.1-298-g8179a70 From 551b4369a196632aaa83c307cd1a62ec368de58d Mon Sep 17 00:00:00 2001 From: Chuanlai Liu Date: Mon, 7 Nov 2016 09:06:35 +0100 Subject: [PATCH 359/412] improved readability --- processing/post/addCurl.py | 4 ++-- processing/post/addDivergence.py | 7 +++++-- processing/post/addGradient.py | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/processing/post/addCurl.py b/processing/post/addCurl.py index ba310750b..bec3e3a81 100755 --- a/processing/post/addCurl.py +++ b/processing/post/addCurl.py @@ -38,9 +38,9 @@ def curlFFT(geomdim,field): e[0, 1, 2] = e[1, 2, 0] = e[2, 0, 1] = 1.0 # Levi-Civita symbols e[0, 2, 1] = e[2, 1, 0] = e[1, 0, 2] = -1.0 - if dataType == 'tensor': + if dataType == 'tensor': # tensor, 3x3 -> 3x3 curl_fourier = np.einsum('slm,ijkl,ijknm->ijksn',e,k_s,field_fourier)*TWOPIIMG - elif dataType == 'vector': + elif dataType == 'vector': # vector, 3 -> 3 curl_fourier = np.einsum('slm,ijkl,ijkm->ijks',e,k_s,field_fourier)*TWOPIIMG return np.fft.irfftn(curl_fourier,axes=(0,1,2),s=shapeFFT).reshape([N,n]) diff --git a/processing/post/addDivergence.py b/processing/post/addDivergence.py index 3ce35d275..84cdf4593 100755 --- a/processing/post/addDivergence.py +++ b/processing/post/addDivergence.py @@ -15,6 +15,9 @@ def divFFT(geomdim,field): N = grid.prod() # field size n = np.array(np.shape(field)[3:]).prod() # data size + if n == 3: dataType = 'vector' + elif n == 9: dataType = 'tensor' + field_fourier = np.fft.rfftn(field,axes=(0,1,2),s=shapeFFT) div_fourier = np.empty(field_fourier.shape[0:len(np.shape(field))-1],'c16') # size depents on whether tensor or vector @@ -30,9 +33,9 @@ def divFFT(geomdim,field): kk, kj, ki = np.meshgrid(k_sk,k_sj,k_si,indexing = 'ij') k_s = np.concatenate((ki[:,:,:,None],kj[:,:,:,None],kk[:,:,:,None]),axis = 3).astype('c16') - if n == 9: # tensor, 3x3 -> 3 + if dataType == 'tensor': # tensor, 3x3 -> 3 div_fourier = np.einsum('ijklm,ijkm->ijkl',field_fourier,k_s)*TWOPIIMG - elif n == 3: # vector, 3 -> 1 + elif dataType == 'vector': # vector, 3 -> 1 div_fourier = np.einsum('ijkl,ijkl->ijk',field_fourier,k_s)*TWOPIIMG return np.fft.irfftn(div_fourier,axes=(0,1,2),s=shapeFFT).reshape([N,n/3]) diff --git a/processing/post/addGradient.py b/processing/post/addGradient.py index d28a6f813..5ac784c01 100755 --- a/processing/post/addGradient.py +++ b/processing/post/addGradient.py @@ -33,9 +33,9 @@ def gradFFT(geomdim,field): kk, kj, ki = np.meshgrid(k_sk,k_sj,k_si,indexing = 'ij') k_s = np.concatenate((ki[:,:,:,None],kj[:,:,:,None],kk[:,:,:,None]),axis = 3).astype('c16') - if n == 3: # vector, 3 -> 3x3 + if dataType == 'vector': # vector, 3 -> 3x3 grad_fourier = np.einsum('ijkl,ijkm->ijklm',field_fourier,k_s)*TWOPIIMG - elif n == 1: # scalar, 1 -> 3 + elif dataType == 'scalar': # scalar, 1 -> 3 grad_fourier = np.einsum('ijkl,ijkl->ijkl',field_fourier,k_s)*TWOPIIMG return np.fft.irfftn(grad_fourier,axes=(0,1,2),s=shapeFFT).reshape([N,3*n]) From b27c9388e68c1f1fe48f179b8cdb92d0df55fb93 Mon Sep 17 00:00:00 2001 From: Franz Roters Date: Mon, 7 Nov 2016 11:54:27 +0100 Subject: [PATCH 360/412] adopted linker string for earlier Marc versions to work with Intel Fortran 17 --- .../mods_MarcMentat/2014.2/Marc_tools/include_linux64 | 4 ++-- installation/mods_MarcMentat/2014/Marc_tools/include_linux64 | 4 ++-- installation/mods_MarcMentat/2015/Marc_tools/include_linux64 | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/installation/mods_MarcMentat/2014.2/Marc_tools/include_linux64 b/installation/mods_MarcMentat/2014.2/Marc_tools/include_linux64 index 8fa7da85b..ba9258f1e 100644 --- a/installation/mods_MarcMentat/2014.2/Marc_tools/include_linux64 +++ b/installation/mods_MarcMentat/2014.2/Marc_tools/include_linux64 @@ -679,9 +679,9 @@ else fi if test "$MARC_INTEGER_SIZE" = "i4" ; then - MKLLIB="$MARC_MKL/libmkl_scalapack_lp64.a $MARC_MKL/libmkl_blacs_lp64.a -Wl,--start-group $MARC_MKL/libmkl_intel_lp64.a $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_core.a -Wl,--end-group" + MKLLIB="$MARC_MKL/libmkl_scalapack_lp64.a -Wl,--start-group $MARC_MKL/libmkl_intel_lp64.a $MARC_MKL/libmkl_core.a $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_blacs_intelmpi_lp64.a -Wl,--end-group" else - MKLLIB="$MARC_MKL/libmkl_scalapack_ilp64.a $MARC_MKL/libmkl_blacs_ilp64.a -Wl,--start-group $MARC_MKL/libmkl_intel_ilp64.a $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_core.a -Wl,--end-group" + MKLLIB="$MARC_MKL/libmkl_scalapack_ilp64.a -Wl,--start-group $MARC_MKL/libmkl_intel_ilp64.a $MARC_MKL/libmkl_core.a $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_blacs_intelmpi_ilp64.a -Wl,--end-group" fi SECLIBS="-L$MARC_LIB -llapi" diff --git a/installation/mods_MarcMentat/2014/Marc_tools/include_linux64 b/installation/mods_MarcMentat/2014/Marc_tools/include_linux64 index 07bd73778..b7e6bb140 100644 --- a/installation/mods_MarcMentat/2014/Marc_tools/include_linux64 +++ b/installation/mods_MarcMentat/2014/Marc_tools/include_linux64 @@ -673,9 +673,9 @@ else fi if test "$MARC_INTEGER_SIZE" = "i4" ; then - MKLLIB="$MARC_MKL/libmkl_blacs_lp64.a $MARC_MKL/libmkl_scalapack_lp64.a $MARC_MKL/libmkl_intel_lp64.a $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_core.a " + MKLLIB="$MARC_MKL/libmkl_scalapack_lp64.a -Wl,--start-group $MARC_MKL/libmkl_intel_lp64.a $MARC_MKL/libmkl_core.a $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_blacs_intelmpi_lp64.a -Wl,--end-group" else - MKLLIB="$MARC_MKL/libmkl_blacs_ilp64.a $MARC_MKL/libmkl_scalapack_ilp64.a $MARC_MKL/libmkl_intel_ilp64.a $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_core.a " + MKLLIB="$MARC_MKL/libmkl_scalapack_ilp64.a -Wl,--start-group $MARC_MKL/libmkl_intel_ilp64.a $MARC_MKL/libmkl_core.a $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_blacs_intelmpi_ilp64.a -Wl,--end-group" fi SECLIBS="-L$MARC_LIB -llapi" diff --git a/installation/mods_MarcMentat/2015/Marc_tools/include_linux64 b/installation/mods_MarcMentat/2015/Marc_tools/include_linux64 index 1395d75b1..9b1e2bec7 100644 --- a/installation/mods_MarcMentat/2015/Marc_tools/include_linux64 +++ b/installation/mods_MarcMentat/2015/Marc_tools/include_linux64 @@ -682,9 +682,9 @@ else fi if test "$MARC_INTEGER_SIZE" = "i4" ; then - MKLLIB="$MARC_MKL/libmkl_scalapack_lp64.a $MARC_MKL/libmkl_blacs_lp64.a -Wl,--start-group $MARC_MKL/libmkl_intel_lp64.a $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_core.a -Wl,--end-group" + MKLLIB="$MARC_MKL/libmkl_scalapack_lp64.a -Wl,--start-group $MARC_MKL/libmkl_intel_lp64.a $MARC_MKL/libmkl_core.a $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_blacs_intelmpi_lp64.a -Wl,--end-group" else - MKLLIB="$MARC_MKL/libmkl_scalapack_ilp64.a $MARC_MKL/libmkl_blacs_ilp64.a -Wl,--start-group $MARC_MKL/libmkl_intel_ilp64.a $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_core.a -Wl,--end-group" + MKLLIB="$MARC_MKL/libmkl_scalapack_ilp64.a -Wl,--start-group $MARC_MKL/libmkl_intel_ilp64.a $MARC_MKL/libmkl_core.a $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_blacs_intelmpi_ilp64.a -Wl,--end-group" fi SECLIBS="-L$MARC_LIB -llapi" From cbe2fb8d57a86de6224b2ab1d0f0322787905fe7 Mon Sep 17 00:00:00 2001 From: Franz Roters Date: Mon, 7 Nov 2016 11:56:39 +0100 Subject: [PATCH 361/412] removed support for old Marc versions --- .../2011/Marc_tools/comp_damask | 52 - .../2011/Marc_tools/comp_damask_h | 52 - .../2011/Marc_tools/comp_damask_hmp | 52 - .../2011/Marc_tools/comp_damask_l | 52 - .../2011/Marc_tools/comp_damask_lmp | 52 - .../2011/Marc_tools/comp_damask_mp | 52 - .../2011/Marc_tools/comp_user.original | 41 - .../2011/Marc_tools/include_linux64 | 704 --- .../2011/Marc_tools/include_linux64.original | 641 --- .../2011/Marc_tools/run_damask | 3624 --------------- .../2011/Marc_tools/run_damask_h | 3625 --------------- .../2011/Marc_tools/run_damask_hmp | 3624 --------------- .../2011/Marc_tools/run_damask_l | 3624 --------------- .../2011/Marc_tools/run_damask_lmp | 3624 --------------- .../2011/Marc_tools/run_damask_mp | 3625 --------------- .../2011/Marc_tools/run_marc.original | 3675 --------------- .../2011/Mentat_bin/edit_window | 12 - .../2011/Mentat_bin/edit_window.org | 11 - .../mods_MarcMentat/2011/Mentat_bin/kill4 | 8 - .../mods_MarcMentat/2011/Mentat_bin/kill5 | 8 - .../mods_MarcMentat/2011/Mentat_bin/kill6 | 8 - .../mods_MarcMentat/2011/Mentat_bin/kill7 | 8 - .../mods_MarcMentat/2011/Mentat_bin/kill8 | 8 - .../mods_MarcMentat/2011/Mentat_bin/kill9 | 8 - .../2011/Mentat_bin/submit1.org | 156 - .../mods_MarcMentat/2011/Mentat_bin/submit4 | 157 - .../mods_MarcMentat/2011/Mentat_bin/submit5 | 157 - .../mods_MarcMentat/2011/Mentat_bin/submit6 | 157 - .../mods_MarcMentat/2011/Mentat_bin/submit7 | 157 - .../mods_MarcMentat/2011/Mentat_bin/submit8 | 157 - .../mods_MarcMentat/2011/Mentat_bin/submit9 | 157 - .../2011/Mentat_menus/job_run.ms | 2867 ------------ .../2011/Mentat_menus/job_run.ms.org | 2664 ----------- .../2012/Marc_tools/comp_damask | 52 - .../2012/Marc_tools/comp_damask_h | 52 - .../2012/Marc_tools/comp_damask_hmp | 52 - .../2012/Marc_tools/comp_damask_l | 52 - .../2012/Marc_tools/comp_damask_lmp | 52 - .../2012/Marc_tools/comp_damask_mp | 52 - .../2012/Marc_tools/comp_user.original | 41 - .../2012/Marc_tools/include_linux64 | 703 --- .../2012/Marc_tools/include_linux64.original | 641 --- .../2012/Marc_tools/run_damask | 3690 --------------- .../2012/Marc_tools/run_damask_h | 3690 --------------- .../2012/Marc_tools/run_damask_hmp | 3690 --------------- .../2012/Marc_tools/run_damask_l | 3690 --------------- .../2012/Marc_tools/run_damask_lmp | 3690 --------------- .../2012/Marc_tools/run_damask_mp | 3690 --------------- .../2012/Marc_tools/run_marc.original | 3732 --------------- .../2012/Mentat_bin/edit_window | 12 - .../2012/Mentat_bin/edit_window.org | 11 - .../mods_MarcMentat/2012/Mentat_bin/kill4 | 8 - .../mods_MarcMentat/2012/Mentat_bin/kill5 | 8 - .../mods_MarcMentat/2012/Mentat_bin/kill6 | 8 - .../mods_MarcMentat/2012/Mentat_bin/kill7 | 8 - .../mods_MarcMentat/2012/Mentat_bin/kill8 | 8 - .../mods_MarcMentat/2012/Mentat_bin/kill9 | 8 - .../2012/Mentat_bin/submit1.org | 163 - .../mods_MarcMentat/2012/Mentat_bin/submit4 | 164 - .../mods_MarcMentat/2012/Mentat_bin/submit5 | 164 - .../mods_MarcMentat/2012/Mentat_bin/submit6 | 164 - .../mods_MarcMentat/2012/Mentat_bin/submit7 | 164 - .../mods_MarcMentat/2012/Mentat_bin/submit8 | 164 - .../mods_MarcMentat/2012/Mentat_bin/submit9 | 164 - .../2012/Mentat_menus/job_run.ms | 2942 ------------ .../2012/Mentat_menus/job_run.ms.org | 2739 ----------- .../2013.1/Marc_tools/comp_damask | 52 - .../2013.1/Marc_tools/comp_damask_h | 52 - .../2013.1/Marc_tools/comp_damask_hmp | 52 - .../2013.1/Marc_tools/comp_damask_l | 52 - .../2013.1/Marc_tools/comp_damask_lmp | 52 - .../2013.1/Marc_tools/comp_damask_mp | 52 - .../2013.1/Marc_tools/comp_user.original | 41 - .../2013.1/Marc_tools/include_linux64 | 742 --- .../Marc_tools/include_linux64.original | 679 --- .../2013.1/Marc_tools/run_damask | 4053 ---------------- .../2013.1/Marc_tools/run_damask_h | 4053 ---------------- .../2013.1/Marc_tools/run_damask_hmp | 4053 ---------------- .../2013.1/Marc_tools/run_damask_l | 4053 ---------------- .../2013.1/Marc_tools/run_damask_lmp | 4053 ---------------- .../2013.1/Marc_tools/run_damask_mp | 4053 ---------------- .../2013.1/Marc_tools/run_marc.original | 4105 ----------------- .../2013.1/Mentat_bin/edit_window | 5 - .../2013.1/Mentat_bin/edit_window.org | 18 - .../mods_MarcMentat/2013.1/Mentat_bin/kill4 | 8 - .../mods_MarcMentat/2013.1/Mentat_bin/kill5 | 8 - .../mods_MarcMentat/2013.1/Mentat_bin/kill6 | 8 - .../mods_MarcMentat/2013.1/Mentat_bin/kill7 | 8 - .../mods_MarcMentat/2013.1/Mentat_bin/kill8 | 8 - .../mods_MarcMentat/2013.1/Mentat_bin/kill9 | 8 - .../2013.1/Mentat_bin/submit1.org | 185 - .../mods_MarcMentat/2013.1/Mentat_bin/submit4 | 186 - .../mods_MarcMentat/2013.1/Mentat_bin/submit5 | 186 - .../mods_MarcMentat/2013.1/Mentat_bin/submit6 | 186 - .../mods_MarcMentat/2013.1/Mentat_bin/submit7 | 186 - .../mods_MarcMentat/2013.1/Mentat_bin/submit8 | 186 - .../mods_MarcMentat/2013.1/Mentat_bin/submit9 | 186 - .../2013.1/Mentat_menus/job_run.ms | 3215 ------------- .../2013.1/Mentat_menus/job_run.ms.org | 3078 ------------ .../2013/Marc_tools/comp_damask | 52 - .../2013/Marc_tools/comp_damask_h | 52 - .../2013/Marc_tools/comp_damask_hmp | 52 - .../2013/Marc_tools/comp_damask_l | 52 - .../2013/Marc_tools/comp_damask_lmp | 52 - .../2013/Marc_tools/comp_damask_mp | 52 - .../2013/Marc_tools/comp_user.original | 41 - .../2013/Marc_tools/include_linux64 | 709 --- .../2013/Marc_tools/include_linux64.original | 647 --- .../2013/Marc_tools/run_damask | 3849 ---------------- .../2013/Marc_tools/run_damask_h | 3849 ---------------- .../2013/Marc_tools/run_damask_hmp | 3849 ---------------- .../2013/Marc_tools/run_damask_l | 3849 ---------------- .../2013/Marc_tools/run_damask_lmp | 3849 ---------------- .../2013/Marc_tools/run_damask_mp | 3849 ---------------- .../2013/Marc_tools/run_marc.original | 3890 ---------------- .../2013/Mentat_bin/edit_window | 5 - .../2013/Mentat_bin/edit_window.org | 18 - .../mods_MarcMentat/2013/Mentat_bin/kill4 | 8 - .../mods_MarcMentat/2013/Mentat_bin/kill5 | 8 - .../mods_MarcMentat/2013/Mentat_bin/kill6 | 8 - .../mods_MarcMentat/2013/Mentat_bin/kill7 | 8 - .../mods_MarcMentat/2013/Mentat_bin/kill8 | 8 - .../mods_MarcMentat/2013/Mentat_bin/kill9 | 8 - .../2013/Mentat_bin/submit1.org | 163 - .../mods_MarcMentat/2013/Mentat_bin/submit4 | 164 - .../mods_MarcMentat/2013/Mentat_bin/submit5 | 164 - .../mods_MarcMentat/2013/Mentat_bin/submit6 | 164 - .../mods_MarcMentat/2013/Mentat_bin/submit7 | 164 - .../mods_MarcMentat/2013/Mentat_bin/submit8 | 164 - .../mods_MarcMentat/2013/Mentat_bin/submit9 | 164 - .../2013/Mentat_menus/job_run.ms | 3206 ------------- .../2013/Mentat_menus/job_run.ms.org | 3003 ------------ installation/symlink_Code.py | 4 - 133 files changed, 142273 deletions(-) delete mode 100644 installation/mods_MarcMentat/2011/Marc_tools/comp_damask delete mode 100644 installation/mods_MarcMentat/2011/Marc_tools/comp_damask_h delete mode 100644 installation/mods_MarcMentat/2011/Marc_tools/comp_damask_hmp delete mode 100644 installation/mods_MarcMentat/2011/Marc_tools/comp_damask_l delete mode 100644 installation/mods_MarcMentat/2011/Marc_tools/comp_damask_lmp delete mode 100644 installation/mods_MarcMentat/2011/Marc_tools/comp_damask_mp delete mode 100644 installation/mods_MarcMentat/2011/Marc_tools/comp_user.original delete mode 100644 installation/mods_MarcMentat/2011/Marc_tools/include_linux64 delete mode 100644 installation/mods_MarcMentat/2011/Marc_tools/include_linux64.original delete mode 100644 installation/mods_MarcMentat/2011/Marc_tools/run_damask delete mode 100644 installation/mods_MarcMentat/2011/Marc_tools/run_damask_h delete mode 100644 installation/mods_MarcMentat/2011/Marc_tools/run_damask_hmp delete mode 100644 installation/mods_MarcMentat/2011/Marc_tools/run_damask_l delete mode 100644 installation/mods_MarcMentat/2011/Marc_tools/run_damask_lmp delete mode 100644 installation/mods_MarcMentat/2011/Marc_tools/run_damask_mp delete mode 100644 installation/mods_MarcMentat/2011/Marc_tools/run_marc.original delete mode 100644 installation/mods_MarcMentat/2011/Mentat_bin/edit_window delete mode 100644 installation/mods_MarcMentat/2011/Mentat_bin/edit_window.org delete mode 100644 installation/mods_MarcMentat/2011/Mentat_bin/kill4 delete mode 100644 installation/mods_MarcMentat/2011/Mentat_bin/kill5 delete mode 100644 installation/mods_MarcMentat/2011/Mentat_bin/kill6 delete mode 100644 installation/mods_MarcMentat/2011/Mentat_bin/kill7 delete mode 100644 installation/mods_MarcMentat/2011/Mentat_bin/kill8 delete mode 100644 installation/mods_MarcMentat/2011/Mentat_bin/kill9 delete mode 100644 installation/mods_MarcMentat/2011/Mentat_bin/submit1.org delete mode 100644 installation/mods_MarcMentat/2011/Mentat_bin/submit4 delete mode 100644 installation/mods_MarcMentat/2011/Mentat_bin/submit5 delete mode 100644 installation/mods_MarcMentat/2011/Mentat_bin/submit6 delete mode 100644 installation/mods_MarcMentat/2011/Mentat_bin/submit7 delete mode 100644 installation/mods_MarcMentat/2011/Mentat_bin/submit8 delete mode 100644 installation/mods_MarcMentat/2011/Mentat_bin/submit9 delete mode 100644 installation/mods_MarcMentat/2011/Mentat_menus/job_run.ms delete mode 100644 installation/mods_MarcMentat/2011/Mentat_menus/job_run.ms.org delete mode 100644 installation/mods_MarcMentat/2012/Marc_tools/comp_damask delete mode 100644 installation/mods_MarcMentat/2012/Marc_tools/comp_damask_h delete mode 100644 installation/mods_MarcMentat/2012/Marc_tools/comp_damask_hmp delete mode 100644 installation/mods_MarcMentat/2012/Marc_tools/comp_damask_l delete mode 100644 installation/mods_MarcMentat/2012/Marc_tools/comp_damask_lmp delete mode 100644 installation/mods_MarcMentat/2012/Marc_tools/comp_damask_mp delete mode 100644 installation/mods_MarcMentat/2012/Marc_tools/comp_user.original delete mode 100644 installation/mods_MarcMentat/2012/Marc_tools/include_linux64 delete mode 100644 installation/mods_MarcMentat/2012/Marc_tools/include_linux64.original delete mode 100644 installation/mods_MarcMentat/2012/Marc_tools/run_damask delete mode 100644 installation/mods_MarcMentat/2012/Marc_tools/run_damask_h delete mode 100644 installation/mods_MarcMentat/2012/Marc_tools/run_damask_hmp delete mode 100644 installation/mods_MarcMentat/2012/Marc_tools/run_damask_l delete mode 100644 installation/mods_MarcMentat/2012/Marc_tools/run_damask_lmp delete mode 100644 installation/mods_MarcMentat/2012/Marc_tools/run_damask_mp delete mode 100644 installation/mods_MarcMentat/2012/Marc_tools/run_marc.original delete mode 100644 installation/mods_MarcMentat/2012/Mentat_bin/edit_window delete mode 100644 installation/mods_MarcMentat/2012/Mentat_bin/edit_window.org delete mode 100644 installation/mods_MarcMentat/2012/Mentat_bin/kill4 delete mode 100644 installation/mods_MarcMentat/2012/Mentat_bin/kill5 delete mode 100644 installation/mods_MarcMentat/2012/Mentat_bin/kill6 delete mode 100644 installation/mods_MarcMentat/2012/Mentat_bin/kill7 delete mode 100644 installation/mods_MarcMentat/2012/Mentat_bin/kill8 delete mode 100644 installation/mods_MarcMentat/2012/Mentat_bin/kill9 delete mode 100644 installation/mods_MarcMentat/2012/Mentat_bin/submit1.org delete mode 100644 installation/mods_MarcMentat/2012/Mentat_bin/submit4 delete mode 100644 installation/mods_MarcMentat/2012/Mentat_bin/submit5 delete mode 100644 installation/mods_MarcMentat/2012/Mentat_bin/submit6 delete mode 100644 installation/mods_MarcMentat/2012/Mentat_bin/submit7 delete mode 100644 installation/mods_MarcMentat/2012/Mentat_bin/submit8 delete mode 100644 installation/mods_MarcMentat/2012/Mentat_bin/submit9 delete mode 100644 installation/mods_MarcMentat/2012/Mentat_menus/job_run.ms delete mode 100644 installation/mods_MarcMentat/2012/Mentat_menus/job_run.ms.org delete mode 100644 installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask delete mode 100644 installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_h delete mode 100644 installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_hmp delete mode 100644 installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_l delete mode 100644 installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_lmp delete mode 100644 installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_mp delete mode 100644 installation/mods_MarcMentat/2013.1/Marc_tools/comp_user.original delete mode 100644 installation/mods_MarcMentat/2013.1/Marc_tools/include_linux64 delete mode 100644 installation/mods_MarcMentat/2013.1/Marc_tools/include_linux64.original delete mode 100644 installation/mods_MarcMentat/2013.1/Marc_tools/run_damask delete mode 100644 installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_h delete mode 100644 installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_hmp delete mode 100644 installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_l delete mode 100644 installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_lmp delete mode 100644 installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_mp delete mode 100644 installation/mods_MarcMentat/2013.1/Marc_tools/run_marc.original delete mode 100644 installation/mods_MarcMentat/2013.1/Mentat_bin/edit_window delete mode 100644 installation/mods_MarcMentat/2013.1/Mentat_bin/edit_window.org delete mode 100644 installation/mods_MarcMentat/2013.1/Mentat_bin/kill4 delete mode 100644 installation/mods_MarcMentat/2013.1/Mentat_bin/kill5 delete mode 100644 installation/mods_MarcMentat/2013.1/Mentat_bin/kill6 delete mode 100644 installation/mods_MarcMentat/2013.1/Mentat_bin/kill7 delete mode 100644 installation/mods_MarcMentat/2013.1/Mentat_bin/kill8 delete mode 100644 installation/mods_MarcMentat/2013.1/Mentat_bin/kill9 delete mode 100644 installation/mods_MarcMentat/2013.1/Mentat_bin/submit1.org delete mode 100644 installation/mods_MarcMentat/2013.1/Mentat_bin/submit4 delete mode 100644 installation/mods_MarcMentat/2013.1/Mentat_bin/submit5 delete mode 100644 installation/mods_MarcMentat/2013.1/Mentat_bin/submit6 delete mode 100644 installation/mods_MarcMentat/2013.1/Mentat_bin/submit7 delete mode 100644 installation/mods_MarcMentat/2013.1/Mentat_bin/submit8 delete mode 100644 installation/mods_MarcMentat/2013.1/Mentat_bin/submit9 delete mode 100644 installation/mods_MarcMentat/2013.1/Mentat_menus/job_run.ms delete mode 100644 installation/mods_MarcMentat/2013.1/Mentat_menus/job_run.ms.org delete mode 100644 installation/mods_MarcMentat/2013/Marc_tools/comp_damask delete mode 100644 installation/mods_MarcMentat/2013/Marc_tools/comp_damask_h delete mode 100644 installation/mods_MarcMentat/2013/Marc_tools/comp_damask_hmp delete mode 100644 installation/mods_MarcMentat/2013/Marc_tools/comp_damask_l delete mode 100644 installation/mods_MarcMentat/2013/Marc_tools/comp_damask_lmp delete mode 100644 installation/mods_MarcMentat/2013/Marc_tools/comp_damask_mp delete mode 100644 installation/mods_MarcMentat/2013/Marc_tools/comp_user.original delete mode 100644 installation/mods_MarcMentat/2013/Marc_tools/include_linux64 delete mode 100644 installation/mods_MarcMentat/2013/Marc_tools/include_linux64.original delete mode 100644 installation/mods_MarcMentat/2013/Marc_tools/run_damask delete mode 100644 installation/mods_MarcMentat/2013/Marc_tools/run_damask_h delete mode 100644 installation/mods_MarcMentat/2013/Marc_tools/run_damask_hmp delete mode 100644 installation/mods_MarcMentat/2013/Marc_tools/run_damask_l delete mode 100644 installation/mods_MarcMentat/2013/Marc_tools/run_damask_lmp delete mode 100644 installation/mods_MarcMentat/2013/Marc_tools/run_damask_mp delete mode 100644 installation/mods_MarcMentat/2013/Marc_tools/run_marc.original delete mode 100644 installation/mods_MarcMentat/2013/Mentat_bin/edit_window delete mode 100644 installation/mods_MarcMentat/2013/Mentat_bin/edit_window.org delete mode 100644 installation/mods_MarcMentat/2013/Mentat_bin/kill4 delete mode 100644 installation/mods_MarcMentat/2013/Mentat_bin/kill5 delete mode 100644 installation/mods_MarcMentat/2013/Mentat_bin/kill6 delete mode 100644 installation/mods_MarcMentat/2013/Mentat_bin/kill7 delete mode 100644 installation/mods_MarcMentat/2013/Mentat_bin/kill8 delete mode 100644 installation/mods_MarcMentat/2013/Mentat_bin/kill9 delete mode 100644 installation/mods_MarcMentat/2013/Mentat_bin/submit1.org delete mode 100644 installation/mods_MarcMentat/2013/Mentat_bin/submit4 delete mode 100644 installation/mods_MarcMentat/2013/Mentat_bin/submit5 delete mode 100644 installation/mods_MarcMentat/2013/Mentat_bin/submit6 delete mode 100644 installation/mods_MarcMentat/2013/Mentat_bin/submit7 delete mode 100644 installation/mods_MarcMentat/2013/Mentat_bin/submit8 delete mode 100644 installation/mods_MarcMentat/2013/Mentat_bin/submit9 delete mode 100644 installation/mods_MarcMentat/2013/Mentat_menus/job_run.ms delete mode 100644 installation/mods_MarcMentat/2013/Mentat_menus/job_run.ms.org diff --git a/installation/mods_MarcMentat/2011/Marc_tools/comp_damask b/installation/mods_MarcMentat/2011/Marc_tools/comp_damask deleted file mode 100644 index 2d144b8a4..000000000 --- a/installation/mods_MarcMentat/2011/Marc_tools/comp_damask +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/ksh -# 1st arg: $DIR -# 2nd arg: $DIRJOB -# 3rd arg: $user -# 4th arg: $program -DIR=$1 -user=$3 -program=$4 -usernoext=$user -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - -# add BLAS options for linking - BLAS="%BLAS%" - -. $DIR/tools/include -DIRJOB=$2 -cd $DIRJOB -echo "Compiling and linking user subroutine $user on host `hostname`" -echo "program: $program" - $DFORTRAN $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - userobj=$usernoext.o - - - $LOAD ${program} $DIR/lib/main.o\ - $DIR/lib/blkdta.o $DIR/lib/comm?.o \ - ${userobj-} \ - $DIR/lib/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ../lib/mdsrc.a \ - ../lib/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $BLAS \ - $SYSLIBS || \ - { - echo "$0: link failed for $usernoext.o on host `hostname`" - exit 1 - } - /bin/rm $userobj - /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2011/Marc_tools/comp_damask_h b/installation/mods_MarcMentat/2011/Marc_tools/comp_damask_h deleted file mode 100644 index 01464f095..000000000 --- a/installation/mods_MarcMentat/2011/Marc_tools/comp_damask_h +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/ksh -# 1st arg: $DIR -# 2nd arg: $DIRJOB -# 3rd arg: $user -# 4th arg: $program -DIR=$1 -user=$3 -program=$4 -usernoext=$user -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - -# add BLAS options for linking - BLAS="%BLAS%" - -. $DIR/tools/include -DIRJOB=$2 -cd $DIRJOB -echo "Compiling and linking user subroutine $user on host `hostname`" -echo "program: $program" - $DFORTHIGH $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - userobj=$usernoext.o - - - $LOAD ${program} $DIR/lib/main.o\ - $DIR/lib/blkdta.o $DIR/lib/comm?.o \ - ${userobj-} \ - $DIR/lib/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ../lib/mdsrc.a \ - ../lib/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $BLAS \ - $SYSLIBS || \ - { - echo "$0: link failed for $usernoext.o on host `hostname`" - exit 1 - } - /bin/rm $userobj - /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2011/Marc_tools/comp_damask_hmp b/installation/mods_MarcMentat/2011/Marc_tools/comp_damask_hmp deleted file mode 100644 index 36ced6543..000000000 --- a/installation/mods_MarcMentat/2011/Marc_tools/comp_damask_hmp +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/ksh -# 1st arg: $DIR -# 2nd arg: $DIRJOB -# 3rd arg: $user -# 4th arg: $program -DIR=$1 -user=$3 -program=$4 -usernoext=$user -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - -# add BLAS options for linking - BLAS="%BLAS%" - -. $DIR/tools/include -DIRJOB=$2 -cd $DIRJOB -echo "Compiling and linking user subroutine $user on host `hostname`" -echo "program: $program" - $DFORTHIGHMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - userobj=$usernoext.o - - - $LOAD ${program} $DIR/lib/main.o\ - $DIR/lib/blkdta.o $DIR/lib/comm?.o \ - ${userobj-} \ - $DIR/lib/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ../lib/mdsrc.a \ - ../lib/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $BLAS \ - $SYSLIBS || \ - { - echo "$0: link failed for $usernoext.o on host `hostname`" - exit 1 - } - /bin/rm $userobj - /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2011/Marc_tools/comp_damask_l b/installation/mods_MarcMentat/2011/Marc_tools/comp_damask_l deleted file mode 100644 index 31b5cd175..000000000 --- a/installation/mods_MarcMentat/2011/Marc_tools/comp_damask_l +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/ksh -# 1st arg: $DIR -# 2nd arg: $DIRJOB -# 3rd arg: $user -# 4th arg: $program -DIR=$1 -user=$3 -program=$4 -usernoext=$user -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - -# add BLAS options for linking - BLAS="%BLAS%" - -. $DIR/tools/include -DIRJOB=$2 -cd $DIRJOB -echo "Compiling and linking user subroutine $user on host `hostname`" -echo "program: $program" - $DFORTLOW $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - userobj=$usernoext.o - - - $LOAD ${program} $DIR/lib/main.o\ - $DIR/lib/blkdta.o $DIR/lib/comm?.o \ - ${userobj-} \ - $DIR/lib/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ../lib/mdsrc.a \ - ../lib/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $BLAS \ - $SYSLIBS || \ - { - echo "$0: link failed for $usernoext.o on host `hostname`" - exit 1 - } - /bin/rm $userobj - /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2011/Marc_tools/comp_damask_lmp b/installation/mods_MarcMentat/2011/Marc_tools/comp_damask_lmp deleted file mode 100644 index f9744338b..000000000 --- a/installation/mods_MarcMentat/2011/Marc_tools/comp_damask_lmp +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/ksh -# 1st arg: $DIR -# 2nd arg: $DIRJOB -# 3rd arg: $user -# 4th arg: $program -DIR=$1 -user=$3 -program=$4 -usernoext=$user -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - -# add BLAS options for linking - BLAS="%BLAS%" - -. $DIR/tools/include -DIRJOB=$2 -cd $DIRJOB -echo "Compiling and linking user subroutine $user on host `hostname`" -echo "program: $program" - $DFORTLOWMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - userobj=$usernoext.o - - - $LOAD ${program} $DIR/lib/main.o\ - $DIR/lib/blkdta.o $DIR/lib/comm?.o \ - ${userobj-} \ - $DIR/lib/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ../lib/mdsrc.a \ - ../lib/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $BLAS \ - $SYSLIBS || \ - { - echo "$0: link failed for $usernoext.o on host `hostname`" - exit 1 - } - /bin/rm $userobj - /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2011/Marc_tools/comp_damask_mp b/installation/mods_MarcMentat/2011/Marc_tools/comp_damask_mp deleted file mode 100644 index 986d9ae04..000000000 --- a/installation/mods_MarcMentat/2011/Marc_tools/comp_damask_mp +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/ksh -# 1st arg: $DIR -# 2nd arg: $DIRJOB -# 3rd arg: $user -# 4th arg: $program -DIR=$1 -user=$3 -program=$4 -usernoext=$user -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - -# add BLAS options for linking - BLAS="%BLAS%" - -. $DIR/tools/include -DIRJOB=$2 -cd $DIRJOB -echo "Compiling and linking user subroutine $user on host `hostname`" -echo "program: $program" - $DFORTRANMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - userobj=$usernoext.o - - - $LOAD ${program} $DIR/lib/main.o\ - $DIR/lib/blkdta.o $DIR/lib/comm?.o \ - ${userobj-} \ - $DIR/lib/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ../lib/mdsrc.a \ - ../lib/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $BLAS \ - $SYSLIBS || \ - { - echo "$0: link failed for $usernoext.o on host `hostname`" - exit 1 - } - /bin/rm $userobj - /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2011/Marc_tools/comp_user.original b/installation/mods_MarcMentat/2011/Marc_tools/comp_user.original deleted file mode 100644 index 8679bb041..000000000 --- a/installation/mods_MarcMentat/2011/Marc_tools/comp_user.original +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/ksh -# 1st arg: $DIR -# 2nd arg: $DIRJOB -# 3rd arg: $user -# 4th arg: $program -DIR=$1 -user=$3 -program=$4 -. $DIR/tools/include -DIRJOB=$2 -cd $DIRJOB -echo "Compiling and linking user subroutine $user.f on host `hostname`" -echo "program: $program" - $FORTRAN $user.f || \ - { - echo "$0: compile failed for $user.f" - exit 1 - } - /bin/rm $program 2>/dev/null - userobj=$user.o - - - $LOAD ${program} $DIR/lib/main.o\ - $DIR/lib/blkdta.o $DIR/lib/comm?.o \ - ${userobj-} \ - $DIR/lib/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ../lib/mdsrc.a \ - ../lib/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $SYSLIBS || \ - { - echo "$0: link failed for $user.o on host `hostname`" - exit 1 - } - /bin/rm $userobj diff --git a/installation/mods_MarcMentat/2011/Marc_tools/include_linux64 b/installation/mods_MarcMentat/2011/Marc_tools/include_linux64 deleted file mode 100644 index ecbea3033..000000000 --- a/installation/mods_MarcMentat/2011/Marc_tools/include_linux64 +++ /dev/null @@ -1,704 +0,0 @@ -# -# General definitions for the Marc 2011 version -# -# EM64T -# ( LP64 - i4 version) -# (ILP64 - i8 version) -# -# Linux RedHat 5.4 -# -# 64 bit MPI version -# -# Intel(R) Fortran Compiler -# Version 12.0.4 -# -# Intel(R) C Compiler -# Version 12.0.4 -# -# DATE -# -# To check the O/S level, type: -# uname -a -# -# Distributed parallel MPI libraries: -# 1) HP MPI 2.3 -# To check the mpi version, type: -# mpirun -version -# 2) Intel MPI 4.0.1.007 -# To check the mpi version, type: -# mpirun -version -# -# MKL Libraries: -# Intel(R) MKL 10.3.0.084 -# -# To check the Compiler level, type using the compiler -# installation path: -# ifort -V -# icc -V -# -# REMARKS : This file contains the definitions of variables used during -# compilation loading and use of the MARC programmes . The -# current machine type is identified by means of the variable -# MACHINE , defined below. -# -# -# MPI_ROOT: root directory in which mpi shared libraries, etc. are located -# DIRJOB : directory in which spawned jobs should look for Marc input -# MPI_ARCH: system architecture -# MPI_EPATH: path where executable resides -# - -REVISION="VERSION, BUILD" -HOSTNAME=`hostname` - -# find available memory in Mbyte on the machine -# can be set explicitly -MEMLIMIT=`free -m | awk '/Mem:/ {print $2}'` - -# set _OEM_NASTRAN to 1 for MD Nastran build -# override _OEM_NASTRAN setting with MARC_MD_NASTRAN environment variable -_OEM_NASTRAN="${MARC_MD_NASTRAN:-0}" - -# uncomment the following line for an autoforge build -#AUTOFORGE=1 -AUTOFORGE=0 -export AUTOFORGE - -# integer size -if test "$MARC_INTEGER_SIZE" = "" ; then - INTEGER_PATH= -else - INTEGER_PATH=/$MARC_INTEGER_SIZE -fi - -FCOMP=ifort - -# -# settings for Metis -# -METIS="-I$METIS_SOURCE" -METISLIBS="$MARC_LIB/metis.a " - -# -# settings for MPI -# -# RCP and RSH are used for parallel network runs -# replace with similar commands like rsh if needed -RCP=/usr/bin/scp -RSH=/usr/bin/ssh -# -# select MPITYPE based upon what is installed - MPITYPE=none -if test -d $MARC_INTELMPI -then - MPITYPE=intelmpi -fi -if test -d $MARC_HPMPI -then - MPITYPE=hpmpi -fi - -if test $AUTOFORGE -then - if test $AUTOFORGE = 1 - then - MPITYPE=none - fi -fi -# uncomment one of the definitions of MPITYPE below to -# explicitly choose the type of MPI to use -#MPITYPE=none -#MPITYPE=hpmpi -#MPITYPE=intelmpi - -MPI_DEFAULT=hpmpi -MPI_OTHER=intelmpi - -INTELMPI_VERSION=HYDRA - -# overrule MPITYPE setting with environmental variable MARC_MPITYPE -if test $MARC_MPITYPE -then - MPITYPE=$MARC_MPITYPE -fi - -# always set MPITYPE to none for MD Nastran -if test "$_OEM_NASTRAN" -ne 0 -then - MPITYPE=none -fi - -# -# settings for MPI -# -DDM= -if test $MPITYPE != none -then - if test $MPITYPE = hpmpi - then - FCOMPMPI=mpif90 - export MPI_ROOT=$MARC_HPMPI - export MPI_REMSH=$RSH - export MPI_F77=$FCOMP - ARCHITECTURE=linux_amd64 - DDM="-I$MPI_ROOT/include/64 -DDDM -DHPMPI" - MPI_CLEAN= - export MPI_EPATH=$MARC_BIN - export LD_LIBRARY_PATH=$MPI_ROOT/lib/$ARCHITECTURE:$MARC_LIB:$MARC_LIB_SHARED:$LD_LIBRARY_PATH - export MPIHPSPECIAL="-e MPI_FLAGS=E,T" - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - export MPIHPSPECIAL="$MPIHPSPECIAL -e BINDIR=$MARC_BIN" - if test -n "$MSC_LICENSE_FILE" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e MSC_LICENSE_FILE=$MSC_LICENSE_FILE" - fi - if test -n "$LM_LICENSE_FILE" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LM_LICENSE_FILE=$LM_LICENSE_FILE" - fi - export MPIHPSPECIAL="$MPIHPSPECIAL -e MPI_LIC_CHECKER=$MPI_ROOT/bin/licensing/amd64_s8/lichk.x" - RUN_JOB2="$MPI_ROOT/bin/mpirun ${MPIRUNOPTIONS} -prot -f " - RUN_JOB1="$MPI_ROOT/bin/mpirun ${MPIRUNOPTIONS} -prot -w $MPIHPSPECIAL -np " - RUN_JOB0= - fi - if test $MPITYPE = intelmpi - then - FCOMPMPI=mpiifort - MPI_ROOT=$MARC_INTELMPI - DDM="-I${MPI_ROOT}/include64 -DDDM" - PATH=$MPI_ROOT/bin64:$PATH - export PATH - LD_LIBRARY_PATH=$MPI_ROOT/lib64:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - if test $INTELMPI_VERSION = HYDRA - then - RUN_JOB1="${MPI_ROOT}/bin64/mpiexec.hydra -n " - RUN_JOB2="${MPI_ROOT}/bin64/mpiexec.hydra " - else - RUN_JOB1="${MPI_ROOT}/bin64/mpiexec -n " - RUN_JOB2="${MPI_ROOT}/bin64/mpiexec -configfile " - fi - RUN_JOB0= - MPI_CLEAN= - MPI_EPATH=$MARC_BIN - MPIR_HOME=$MPI_ROOT - MPICH_F77=$FCOMP - MPICH_F77LINKER=$FCOMP - export MPI_ROOT MPI_EPATH MPIR_HOME MPICH_F77 MPICH_F77LINKER - I_MPI_PIN_DOMAIN=node - export I_MPI_PIN_DOMAIN - fi -else - MPI_ROOT=$MARC_DUMMYMPI - export MPI_ROOT=$MARC_DUMMYMPI - DDM="-I$MPI_ROOT/include" -fi - -# -# variables for the "maintain" script -# - -MACHINENAME=LINUX -MACHINE64BIT=yes -MACHINE=Linux_EM64T -DEV=/dev/tape -GETLOG="whoami" -CLEAR="clear" -MY_UNAME=`uname -a` - -# Edit following 2 lines to build with VKI Solver -#VKISOLVER=VKI -VKISOLVER=NONE - -# Edit following 2 lines to build with CASI Solver -CASISOLVER=CASI -#CASISOLVER=NONE - -# Edit following 2 lines to build with MF2 Solver -MF2SOLVER=NONE -#MF2SOLVER=SERIAL -#MF2SOLVER=MF2PARALLEL - -# Edit following lines to build with Intel(c) Multithreaded solver (PARDISO) -#INTELSOLVER=NONE -INTELSOLVER=PARDISO - -# Edit following lines to build with MUMPS -if test "$MARC_INTEGER_SIZE" = "i4" ; then - #MUMPSSOLVER=NONE - MUMPSSOLVER=MUMPS -else - #MUMPSSOLVER=NONE - MUMPSSOLVER=MUMPS -fi - -# Edit following lines to build with GPGPU version of BCS Solver for -# NVIDIA platforms -BCSGPUSOLVER=NONE -#BCSGPUSOLVER=BCSGPU - -# Edit following 2 lines to build MARC dynamic shared library -MARC_DLL=MARC_DLL -#MARC_DLL=NONE - -# always set VKISOLVER, CASISOLVER, BCSGPUSOLVER, and MARC_DLL to NONE for MD Nastran -if test "$_OEM_NASTRAN" -ne 0 -then - VKISOLVER=NONE - CASISOLVER=NONE - MF2SOLVER=NONE - INTELSOLVER=NONE - MUMPSSOLVER=NONE - BCSGPUSOLVER=NONE - MARC_DLL=NONE -fi - -# -# define Fortran and C compile syntax -# -SOLVERFLAGS= -if test "$VKISOLVER" = VKI -then - SOLVERFLAGS="$SOLVERFLAGS -DVKI" -fi - -if test "$CASISOLVER" = CASI -then - SOLVERFLAGS="$SOLVERFLAGS -DCASI" -fi - -if test "$MF2SOLVER" = MF2PARALLEL -then - SOLVERFLAGS="$SOLVERFLAGS -DMF2PARALLEL" -fi -if test "$MF2SOLVER" = MF2SERIAL -then - SOLVERFLAGS="$SOLVERFLAGS -DMF2SERIAL" -fi - -if test "$INTELSOLVER" = PARDISO -then - SOLVERFLAGS="$SOLVERFLAGS -DPARDISO" -fi - -if test "$MUMPSSOLVER" = MUMPS -then - SOLVERFLAGS="$SOLVERFLAGS -DMUMPS" -fi - -if test "$BCSGPUSOLVER" = BCSGPU -then - SOLVERFLAGS="$SOLVERFLAGS -DBCSGPU" -fi - -if test "$MARC_DLL" = MARC_DLL -then - SOLVERFLAGS="$SOLVERFLAGS -DMARC_DLL" -fi - -LINK_OPT= -DEBUG_OPT= -C_DEBUG_OPT= - -#Uncomment following line to build Marc in debuggable mode -MARCDEBUG= -#MARCDEBUG="ON" - -if test "$MARCDEBUG" = "ON" -then - LINK_OPT="-debug -traceback" - DEBUG_OPT="-debug -traceback" - C_DEBUG_OPT="-debug -traceback" -fi - - -MARCCHECK= -#MARCCHECK="ON" -if test "$MARCCHECK" = "ON" -then - DEBUG_OPT="$DEBUG_OPT -fpe0 -fp-stack-check -check all -ftrapuv " - C_DEBUG_OPT="$C_DEBUG_OPT -fp-stack-check -check-uninit -Wformat -ftrapuv " -fi - -if test "$MARC_INTEGER_SIZE" = "i4" ; then - I8FFLAGS="-real-size 64 -integer-size 32" - I8DEFINES="-DFLOAT=8 -DINT=4" - I8CDEFINES= - I8CASIDEFS= -else - I8FFLAGS="-i8 -real-size 64 -integer-size 64" - I8DEFINES="-DI64 -DFLOAT=8 -DINT=8" - I8CDEFINES="-U_DOUBLE -D_SINGLE" - I8CASIDEFS="-DCASI_64BIT_INT=1" -fi - - -CDEFINES= -FDEFINES= - -if test "$_OEM_NASTRAN" -ne 0 -then - CDEFINES="$CDEFINES -D_OEM_NASTRAN" - FDEFINES="$FDEFINES -D_OEM_NASTRAN" -fi - -FDEFINES="$FDEFINES -D_IMPLICITNONE" - -if test "$_OEM_NASTRAN" -eq 0 -then - FDEFINES="$FDEFINES -DOPENMP -DMKL" -fi - -# -D_MSCMARC -FDEFINES="$FDEFINES -D_MSCMARC $DEBUG_OPT" -CDEFINES="$CDEFINES -D_MSCMARC $C_DEBUG_OPT $I8CDEFINES" - -CINCL="-I$MARC_SOURCE/mdsrc -I$MARC_SOURCE/csource" -if test "$_OEM_NASTRAN" -ne 0 -then - CINCL="$CINCL -I../../include" -fi - -CC="icc -c -O1 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL" -CCLOW="icc -c -O0 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL" -CCHIGH="icc -c -O3 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL" - -if test "$MARCDEBUG" = "ON" -then - CC="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL" - CCLOW="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL" - CCHIGH="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL" -fi - -LOAD_CC="icc -O1 -DLinux -DLINUX -DLinux_intel" -CCT="$CC" -CCTLOW="$CCLOW" -CCTHIGH="$CCHIGH" - -CC_CASI="$CC -c99 $I8CASIDEFS" -CCLOW_CASI="$CCLOW -c99 $I8CASIDEFS" -CCHIGH_CASI="$CCHIGH -c99 $I8CASIDEFS" - -CCT_CASI="$CCT -c99 $I8CASIDEFS" -CCTLOW_CASI="$CCLOW -c99 $I8CASIDEFS" -CCTHIGH_CASI="$CCHIGH -c99 $I8CASIDEFS" - -#PROFILE="-Mprof=func" -#PROFILE="-Mprof=lines" -#PROFILE="-Mprof=func,mpi" -PROFILE= - -FORTLOW="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -O0 $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/bcssolver/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -FORTRAN="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -O1 $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/bcssolver/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -FORTHIGH="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/bcssolver/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -FORTNA="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr -save -zero -mp1 -WB -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/bcssolver/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" - -# determine DAMASK version -HIT=0 -for arg in "$@" -do - if [ $HIT = 1 ] - then - DAMASKPATH=`dirname $arg` - break - elif [ ${arg:0:2} = -u -o ${arg:0:2} = -U ] - then - HIT=1 - fi -done -read DAMASKVERSION < $DAMASKPATH/../VERSION -DAMASKVERSION="'"$DAMASKVERSION"'" - -# DAMASK compiler calls: additional flags are in line 2 OpenMP flags in line 3; removed -save for calls with openMP -DFORTLOW="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -O0 $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2011 -DDAMASKVERSION=$DAMASKVERSION \ - -I$MARC_SOURCE/bcssolver/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -DFORTLOWMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB -O0 $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2011 -DDAMASKVERSION=$DAMASKVERSION \ - -openmp -openmp_report2 \ - -I$MARC_SOURCE/bcssolver/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -DFORTRAN="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -O1 $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2011 -DDAMASKVERSION=$DAMASKVERSION \ - -I$MARC_SOURCE/bcssolver/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -DFORTRANMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB -O1 $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2011 -DDAMASKVERSION=$DAMASKVERSION \ - -openmp -openmp_report2 \ - -I$MARC_SOURCE/bcssolver/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -DFORTHIGH="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2011 -DDAMASKVERSION=$DAMASKVERSION \ - -I$MARC_SOURCE/bcssolver/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -DFORTHIGHMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2011 -DDAMASKVERSION=$DAMASKVERSION \ - -openmp -openmp_report2 \ - -I$MARC_SOURCE/bcssolver/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - -if test "$MARCDEBUG" = "ON" -then - FORTLOW="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/bcssolver/common -I$MARC_SOURCE/mumpssolver/include $I8FFLAGS -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - FORTRAN="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/bcssolver/common -I$MARC_SOURCE/mumpssolver/include $I8FFLAGS -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - FORTHIGH="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/bcssolver/common -I$MARC_SOURCE/mumpssolver/include $I8FFLAGS -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - FORTNA="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr -save -zero -mp1 -WB -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/bcssolver/common -I$MARC_SOURCE/mumpssolver/include $I8FFLAGS -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" - -# DAMASK compiler calls: additional flags are in line 2 OpenMP flags in line 3; removed -save for calls with openMP - DFORTLOW="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2011 -DDAMASKVERSION=$DAMASKVERSION \ - -I$MARC_SOURCE/bcssolver/common -I$MARC_SOURCE/mumpssolver/include $I8FFLAGS -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - DFORTLOWMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2011 -DDAMASKVERSION=$DAMASKVERSION \ - -openmp -openmp_report2 \ - -I$MARC_SOURCE/bcssolver/common -I$MARC_SOURCE/mumpssolver/include $I8FFLAGS -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - DFORTRAN="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2011 -DDAMASKVERSION=$DAMASKVERSION \ - -I$MARC_SOURCE/bcssolver/common -I$MARC_SOURCE/mumpssolver/include $I8FFLAGS -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - DFORTRANMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2011 -DDAMASKVERSION=$DAMASKVERSION \ - -openmp -openmp_report2 \ - -I$MARC_SOURCE/bcssolver/common -I$MARC_SOURCE/mumpssolver/include $I8FFLAGS -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - DFORTHIGH="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2011 -DDAMASKVERSION=$DAMASKVERSION \ - -I$MARC_SOURCE/bcssolver/common -I$MARC_SOURCE/mumpssolver/include $I8FFLAGS -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - DFORTHIGHMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2011 -DDAMASKVERSION=$DAMASKVERSION \ - -openmp -openmp_report2 \ - -I$MARC_SOURCE/bcssolver/common -I$MARC_SOURCE/mumpssolver/include $I8FFLAGS -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - -fi - -FORTLOWT="$FORTLOW" -FORTRANT="$FORTRAN" -FORTHIGHT="$FORTHIGH" - -FORTRANMNF="$FCOMP -c $FDEFINES " -CCMNF="icc -c -O1 -DLinux -DLINUX -DLinux_intel -Dport2egcs -I$MARC_SOURCE/marctoadams/mnf/include -D_LARGEFILE64_SOURCE" - - -FORTRANMUMPS="$FCOMP -c -fpp -D_IMPLICITNONE $I8FFLAGS $I8DEFINES $DDM -I$MARC_SOURCE/mumpssolver/include -Dintel_ -DALLOW_NON_INIT -Dmetis -nofor_main" -CCMUMPS="icc -c -DAdd_ -Dmetis -I$MARC_SOURCE/mumpssolver/include" - - -BCSCC="icc -c -O3 -DLOWERCASE_ -I${MARC_SOURCE}/bcsgpusolver/bcslib_csrc $CDEFINES $CINCL" -NVCC="nvcc -c -O3 -arch sm_13 -DLOWERCASE_ -I${MARC_SOURCE}/bcsgpusolver/bcslib_cuda/include " -BCSFORTLOW="$FORTLOW -I${MARC_SOURCE}/bcsgpusolver/common" -BCSFORTRAN="$FORTRAN -I${MARC_SOURCE}/bcsgpusolver/common" -BCSFORTHIGH="$FORTHIGH -I${MARC_SOURCE}/bcsgpusolver/common" -BCSFORT90HIGH="$BCSFORTHIGH" -if test "$MARCDEBUG" = "ON" -then - BCSFORTRAN=$BCSFORTLOW - BCSFORTHIGH=$BCSFORTLOW - BCSFORT90HIGH=$BCSFORTLOW -fi - -if test $MPITYPE != none -then - if test $MPITYPE = hpmpi - then - LOAD="$MPI_ROOT/bin/$FCOMPMPI ${LOADOPTIONS} -L$MPI_ROOT/lib/$ARCHITECTURE $PROFILE $LINK_OPT -o " - LOADT="$MPI_ROOT/bin/$FCOMPMPI ${LOADOPTIONS} -L$MPI_ROOT/lib/$ARCHITECTURE $PROFILE $LINK_OPT -o " - fi -# Uncomment the following lines to turn on the tracer and commnet out the next 5 lines -# if test $MPITYPE = intelmpi -# then -# INCLUDEMPI="-I$MPI_ROOT/include64 -I$VT_ROOT/include" -# LOAD="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " -# LOADT="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " -# fi - if test $MPITYPE = intelmpi - then - LOAD="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $LINK_OPT -o " - LOADT="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $LINK_OPT -o " - fi -else - LOAD="$FCOMP $LINK_OPT -o " - LOADT="$FCOMP $LINK_OPT -o " -fi - -if test "$MARC_DLL" = MARC_DLL -then - FORTLOW="$FORTLOW -fpp -fPIC" - FORTRAN="$FORTRAN -fpp -fPIC" - FORTHIGH="$FORTHIGH -fpp -fPIC" - FORTRANMNF="$FORTRANMNF -fpp -fPIC" - CC="$CC -fPIC" - CCMNF="$CCMNF -fPIC" - CC_CASI="$CC_CASI -fPIC" - CCLOW_CASI="$CCLOW_CASI -fPIC" - CCHIGH_CASI="$CCHIGH_CASI -fPIC" - LINK_EXE_MARC="-L$MARC_LIB -lmarc -L$MARC_LIB_SHARED -lguide -lpthread" - LINK_MARC_DLL="-shared -fPIC" - LOAD_DLL=$LOAD - LOADT_DLL=$LOADT - EXT_DLL="so" -fi - - -XLIBS="-L/usr/X11/lib -lX11 " - -# -# define archive and ranlib syntax -# - -ARC="ar rvl" -ARD="ar dvl" -ARX="ar xl" -RAN="" - -# -# choose which libraries you want to use ( e.g. blas ) -# - -if test "$VKISOLVER" = VKI -then - VKISOLVERLIBS="$MARC_LIB/vkisolver.a" -else - VKISOLVERLIBS= -fi - -if test "$CASISOLVER" = CASI -then - CASISOLVERLIBS="$MARC_LIB/casilib.a" -else - CASISOLVERLIBS= -fi - -MF2SOLVERLIBS= -if test "$MF2SOLVER" = MF2PARALLEL -then - MF2SOLVERLIBS="$MARC_LIB/mf2parallel/libseq.a \ - $MARC_LIB/mf2parallel/libsym.a \ - $MARC_LIB/mf2parallel/libmet.a \ - $MARC_LIB/mf2parallel/libmf2.a \ - $MARC_LIB/mf2parallel/libgauss.a \ - $MARC_LIB/mf2parallel/libmf2.a \ - $MARC_LIB/mf2parallel/libgauss.a \ - $MARC_LIB/mf2parallel/libnum.a \ - $MARC_LIB/mf2parallel/libutl.a \ - $MARC_LIB/mf2parallel/libr8.a \ - $MARC_LIB/mf2parallel/libz.a " -fi - -if test "$INTELSOLVER" = PARDISO -then - if test "$MARC_INTEGER_SIZE" = "i4" ; then - INTELSOLVERLIBS="$MARC_MKL/libmkl_solver_lp64.a" - else - INTELSOLVERLIBS="$MARC_MKL/libmkl_solver_ilp64.a" - fi -else - INTELSOLVERLIBS= -fi - -if test "$MUMPSSOLVER" = MUMPS -then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - if test $MPITYPE = none - then - MUMPSSOLVERLIBS2= - echo hello > /dev/null - fi - if test $MPITYPE = intelmpi - then - if test "$MARC_INTEGER_SIZE" = "i4" ; then - MUMPSSOLVERLIBS2="$MARC_MKL/libmkl_scalapack_lp64.a $MARC_MKL/libmkl_blacs_intelmpi_lp64.a" - else - MUMPSSOLVERLIBS2="$MARC_MKL/libmkl_scalapack_ilp64.a $MARC_MKL/libmkl_blacs_intelmpi_ilp64.a" - fi - fi - if test $MPITYPE = hpmpi - then - if test "$MARC_INTEGER_SIZE" = "i4" ; then - MUMPSSOLVERLIBS2="$MARC_MKL/libmkl_scalapack_lp64.a $MARC_MKL/libmkl_blacs_lp64.a" - else - MUMPSSOLVERLIBS2="$MARC_MKL/libmkl_scalapack_ilp64.a $MARC_MKL/libmkl_blacs_ilp64.a" - fi - fi -else - MUMPSSOLVERLIBS= - MUMPSSOLVERLIBS2= -fi - -if test "$BCSGPUSOLVER" = BCSGPU -then - BCSSOLVERLIBS="${MARC_LIB}/bcsgpulib.a -L/usr/local/cuda/lib -lcudart -lcublas -lcuda " -else - BCSSOLVERLIBS="${MARC_LIB}/bcslib.a " -fi - -if test "$MARC_INTEGER_SIZE" = "i4" ; then - MKLLIB=$MARC_MKL/libmkl_intel_lp64.a -else - MKLLIB=$MARC_MKL/libmkl_intel_ilp64.a -fi - -SECLIBS="-L$MARC_LIB -llapi" - -SOLVERLIBS="${BCSSOLVERLIBS} \ - ${INTELSOLVERLIBS} ${MUMPSSOLVERLIBS2} ${MF2SOLVERLIBS} \ - -Wl,--start-group $MKLLIB $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_core.a -Wl,--end-group \ - $MARC_MKL/libguide.a \ - $MARC_LIB/blas_src.a ${VKISOLVERLIBS} ${CASISOLVERLIBS} " -SOLVERLIBS_DLL=${SOLVERLIBS} - -MRCLIBS="$MARC_LIB/clib.a ${CASISOLVERLIBS}" -MRCLIBSPAR="$MARC_LIB/clib.a" -STUBS="$MARC_LIB/stubs.a " -MNFLIBS="$MARC_LIB/libmnf.a" -MDUSER="$MARC_LIB/md_user.a" - - -OPENMP="-openmp" - -SYSLIBS=" $OPENMP -lpthread " - -# Uncomment the following lines to turn on the trace and comment out the next 4 lines -# if test $MPITYPE = intelmpi -# then -# SYSLIBS="-L${VT_ROOT}/lib -lVT -ldwarf -lelf -lm -lpthread \ -# -L${MPI_ROOT}/lib64 -lmpi -lmpiif -lmpigi -lrt" -# fi -if test $MPITYPE = intelmpi -then - SYSLIBS="-L${MPI_ROOT}/lib64 -lmpi -lmpiif -lmpigi -lrt $OPENMP -lpthread" -fi - -SYSLIBSPAR=" " - -MARC_DLL_CODES="runmarc.f" - - -BLAS_SRC="dzero.f icopy.f izero.f" -if test "$_OEM_NASTRAN" -ne 0 -then - if test "$MARC_INTEGER_SIZE" = "i4" ; then - BLAS_SRC="$BLAS_SRC dsctr.f zsctr.f dzasum.f daxpyi.f zaxpyi.f dgthr.f zgthr.f" - else - BLAS_SRC="ALL" - fi -fi - -LOW_OPT_CODES="are163.f contro.f ndext.f omarc.f omarca.f omarcb.f omarcc.f \ - omars.f fixbc.f triang.f bet049.f norst3.f eldata.f \ - elec*.f elct*.f fmeig.f oada00.f ogeig.f updtrbe2.f cycrota.f \ - cordef.f ogpk.f ogtan.f eldam.f formrbe3.f \ - inertie.f em_sso072.f cn_fol3d_qpatch6.f" -if test "$MARC_INTEGER_SIZE" = "i8" ; then - LOW_OPT_CODES="$LOW_OPT_CODES bbcseg.f" -fi -LOW_OPT_CODES_CASI="" - -HIGH_OPT_CODES="dpsmsa1.f dpsmsa2.f dpsmsa3.f dpsmsa4.f dpsmsa5.f dpsmsa6.f \ - dpsmsa7.f dpsmsa8.f dpsmsa9.f dpsmsa10.f dpsmsa11.f dpsmsa12.f \ - dpsmsa13.f dpsmsa14.f dpsmsa15.f dpsmsa16.f " - - -HIGH_OPT_CODES_CASI="arithkernels.c blockedroutines.c blockedroutines_fd.c elemmatgenkernels.c longvecroutines.c sfmultutils.c solvewithbd.c" - -MAXNUM=1000000 diff --git a/installation/mods_MarcMentat/2011/Marc_tools/include_linux64.original b/installation/mods_MarcMentat/2011/Marc_tools/include_linux64.original deleted file mode 100644 index c93974f56..000000000 --- a/installation/mods_MarcMentat/2011/Marc_tools/include_linux64.original +++ /dev/null @@ -1,641 +0,0 @@ -# -# General definitions for the Marc 2011 version -# -# EM64T -# ( LP64 - i4 version) -# (ILP64 - i8 version) -# -# Linux RedHat 5.4 -# -# 64 bit MPI version -# -# Intel(R) Fortran Compiler -# Version 12.0.4 -# -# Intel(R) C Compiler -# Version 12.0.4 -# -# DATE -# -# To check the O/S level, type: -# uname -a -# -# Distributed parallel MPI libraries: -# 1) HP MPI 2.3 -# To check the mpi version, type: -# mpirun -version -# 2) Intel MPI 4.0.1.007 -# To check the mpi version, type: -# mpirun -version -# -# MKL Libraries: -# Intel(R) MKL 10.3.0.084 -# -# To check the Compiler level, type using the compiler -# installation path: -# ifort -V -# icc -V -# -# REMARKS : This file contains the definitions of variables used during -# compilation loading and use of the MARC programmes . The -# current machine type is identified by means of the variable -# MACHINE , defined below. -# -# -# MPI_ROOT: root directory in which mpi shared libraries, etc. are located -# DIRJOB : directory in which spawned jobs should look for Marc input -# MPI_ARCH: system architecture -# MPI_EPATH: path where executable resides -# - -REVISION="VERSION, BUILD" -HOSTNAME=`hostname` - -# find available memory in Mbyte on the machine -# can be set explicitly -MEMLIMIT=`free -m | awk '/Mem:/ {print $2}'` - -# set _OEM_NASTRAN to 1 for MD Nastran build -# override _OEM_NASTRAN setting with MARC_MD_NASTRAN environment variable -_OEM_NASTRAN="${MARC_MD_NASTRAN:-0}" - -# uncomment the following line for an autoforge build -#AUTOFORGE=1 -AUTOFORGE=0 -export AUTOFORGE - -# integer size -if test "$MARC_INTEGER_SIZE" = "" ; then - INTEGER_PATH= -else - INTEGER_PATH=/$MARC_INTEGER_SIZE -fi - -FCOMP=ifort - -# -# settings for Metis -# -METIS="-I$METIS_SOURCE" -METISLIBS="$MARC_LIB/metis.a " - -# -# settings for MPI -# -# RCP and RSH are used for parallel network runs -# replace with similar commands like rsh if needed -RCP=/usr/bin/scp -RSH=/usr/bin/ssh -# -# select MPITYPE based upon what is installed - MPITYPE=none -if test -d $MARC_INTELMPI -then - MPITYPE=intelmpi -fi -if test -d $MARC_HPMPI -then - MPITYPE=hpmpi -fi - -if test $AUTOFORGE -then - if test $AUTOFORGE = 1 - then - MPITYPE=none - fi -fi -# uncomment one of the definitions of MPITYPE below to -# explicitly choose the type of MPI to use -#MPITYPE=none -#MPITYPE=hpmpi -#MPITYPE=intelmpi - -MPI_DEFAULT=hpmpi -MPI_OTHER=intelmpi - -INTELMPI_VERSION=HYDRA - -# overrule MPITYPE setting with environmental variable MARC_MPITYPE -if test $MARC_MPITYPE -then - MPITYPE=$MARC_MPITYPE -fi - -# always set MPITYPE to none for MD Nastran -if test "$_OEM_NASTRAN" -ne 0 -then - MPITYPE=none -fi - -# -# settings for MPI -# -DDM= -if test $MPITYPE != none -then - if test $MPITYPE = hpmpi - then - FCOMPMPI=mpif90 - export MPI_ROOT=$MARC_HPMPI - export MPI_REMSH=$RSH - export MPI_F77=$FCOMP - ARCHITECTURE=linux_amd64 - DDM="-I$MPI_ROOT/include/64 -DDDM -DHPMPI" - MPI_CLEAN= - export MPI_EPATH=$MARC_BIN - export LD_LIBRARY_PATH=$MPI_ROOT/lib/$ARCHITECTURE:$MARC_LIB:$MARC_LIB_SHARED:$LD_LIBRARY_PATH - export MPIHPSPECIAL="-e MPI_FLAGS=E,T" - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - export MPIHPSPECIAL="$MPIHPSPECIAL -e BINDIR=$MARC_BIN" - if test -n "$MSC_LICENSE_FILE" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e MSC_LICENSE_FILE=$MSC_LICENSE_FILE" - fi - if test -n "$LM_LICENSE_FILE" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LM_LICENSE_FILE=$LM_LICENSE_FILE" - fi - export MPIHPSPECIAL="$MPIHPSPECIAL -e MPI_LIC_CHECKER=$MPI_ROOT/bin/licensing/amd64_s8/lichk.x" - RUN_JOB2="$MPI_ROOT/bin/mpirun ${MPIRUNOPTIONS} -prot -f " - RUN_JOB1="$MPI_ROOT/bin/mpirun ${MPIRUNOPTIONS} -prot -w $MPIHPSPECIAL -np " - RUN_JOB0= - fi - if test $MPITYPE = intelmpi - then - FCOMPMPI=mpiifort - MPI_ROOT=$MARC_INTELMPI - DDM="-I${MPI_ROOT}/include64 -DDDM" - PATH=$MPI_ROOT/bin64:$PATH - export PATH - LD_LIBRARY_PATH=$MPI_ROOT/lib64:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - if test $INTELMPI_VERSION = HYDRA - then - RUN_JOB1="${MPI_ROOT}/bin64/mpiexec.hydra -n " - RUN_JOB2="${MPI_ROOT}/bin64/mpiexec.hydra " - else - RUN_JOB1="${MPI_ROOT}/bin64/mpiexec -n " - RUN_JOB2="${MPI_ROOT}/bin64/mpiexec -configfile " - fi - RUN_JOB0= - MPI_CLEAN= - MPI_EPATH=$MARC_BIN - MPIR_HOME=$MPI_ROOT - MPICH_F77=$FCOMP - MPICH_F77LINKER=$FCOMP - export MPI_ROOT MPI_EPATH MPIR_HOME MPICH_F77 MPICH_F77LINKER - I_MPI_PIN_DOMAIN=node - export I_MPI_PIN_DOMAIN - fi -else - MPI_ROOT=$MARC_DUMMYMPI - export MPI_ROOT=$MARC_DUMMYMPI - DDM="-I$MPI_ROOT/include" -fi - -# -# variables for the "maintain" script -# - -MACHINENAME=LINUX -MACHINE64BIT=yes -MACHINE=Linux_EM64T -DEV=/dev/tape -GETLOG="whoami" -CLEAR="clear" -MY_UNAME=`uname -a` - -# Edit following 2 lines to build with VKI Solver -#VKISOLVER=VKI -VKISOLVER=NONE - -# Edit following 2 lines to build with CASI Solver -CASISOLVER=CASI -#CASISOLVER=NONE - -# Edit following 2 lines to build with MF2 Solver -MF2SOLVER=NONE -#MF2SOLVER=SERIAL -#MF2SOLVER=MF2PARALLEL - -# Edit following lines to build with Intel(c) Multithreaded solver (PARDISO) -#INTELSOLVER=NONE -INTELSOLVER=PARDISO - -# Edit following lines to build with MUMPS -if test "$MARC_INTEGER_SIZE" = "i4" ; then - #MUMPSSOLVER=NONE - MUMPSSOLVER=MUMPS -else - #MUMPSSOLVER=NONE - MUMPSSOLVER=MUMPS -fi - -# Edit following lines to build with GPGPU version of BCS Solver for -# NVIDIA platforms -BCSGPUSOLVER=NONE -#BCSGPUSOLVER=BCSGPU - -# Edit following 2 lines to build MARC dynamic shared library -MARC_DLL=MARC_DLL -#MARC_DLL=NONE - -# always set VKISOLVER, CASISOLVER, BCSGPUSOLVER, and MARC_DLL to NONE for MD Nastran -if test "$_OEM_NASTRAN" -ne 0 -then - VKISOLVER=NONE - CASISOLVER=NONE - MF2SOLVER=NONE - INTELSOLVER=NONE - MUMPSSOLVER=NONE - BCSGPUSOLVER=NONE - MARC_DLL=NONE -fi - -# -# define Fortran and C compile syntax -# -SOLVERFLAGS= -if test "$VKISOLVER" = VKI -then - SOLVERFLAGS="$SOLVERFLAGS -DVKI" -fi - -if test "$CASISOLVER" = CASI -then - SOLVERFLAGS="$SOLVERFLAGS -DCASI" -fi - -if test "$MF2SOLVER" = MF2PARALLEL -then - SOLVERFLAGS="$SOLVERFLAGS -DMF2PARALLEL" -fi -if test "$MF2SOLVER" = MF2SERIAL -then - SOLVERFLAGS="$SOLVERFLAGS -DMF2SERIAL" -fi - -if test "$INTELSOLVER" = PARDISO -then - SOLVERFLAGS="$SOLVERFLAGS -DPARDISO" -fi - -if test "$MUMPSSOLVER" = MUMPS -then - SOLVERFLAGS="$SOLVERFLAGS -DMUMPS" -fi - -if test "$BCSGPUSOLVER" = BCSGPU -then - SOLVERFLAGS="$SOLVERFLAGS -DBCSGPU" -fi - -if test "$MARC_DLL" = MARC_DLL -then - SOLVERFLAGS="$SOLVERFLAGS -DMARC_DLL" -fi - -LINK_OPT= -DEBUG_OPT= -C_DEBUG_OPT= - -#Uncomment following line to build Marc in debuggable mode -MARCDEBUG= -#MARCDEBUG="ON" - -if test "$MARCDEBUG" = "ON" -then - LINK_OPT="-debug -traceback" - DEBUG_OPT="-debug -traceback" - C_DEBUG_OPT="-debug -traceback" -fi - - -MARCCHECK= -#MARCCHECK="ON" -if test "$MARCCHECK" = "ON" -then - DEBUG_OPT="$DEBUG_OPT -fpe0 -fp-stack-check -check all -ftrapuv " - C_DEBUG_OPT="$C_DEBUG_OPT -fp-stack-check -check-uninit -Wformat -ftrapuv " -fi - -if test "$MARC_INTEGER_SIZE" = "i4" ; then - I8FFLAGS= - I8DEFINES= - I8CDEFINES= - I8CASIDEFS= -else - I8FFLAGS="-i8" - I8DEFINES="-DI64" - I8CDEFINES="-U_DOUBLE -D_SINGLE" - I8CASIDEFS="-DCASI_64BIT_INT=1" -fi - - -CDEFINES= -FDEFINES= - -if test "$_OEM_NASTRAN" -ne 0 -then - CDEFINES="$CDEFINES -D_OEM_NASTRAN" - FDEFINES="$FDEFINES -D_OEM_NASTRAN" -fi - -FDEFINES="$FDEFINES -D_IMPLICITNONE" - -if test "$_OEM_NASTRAN" -eq 0 -then - FDEFINES="$FDEFINES -DOPENMP -DMKL" -fi - -# -D_MSCMARC -FDEFINES="$FDEFINES -D_MSCMARC $DEBUG_OPT" -CDEFINES="$CDEFINES -D_MSCMARC $C_DEBUG_OPT $I8CDEFINES" - -CINCL="-I$MARC_SOURCE/mdsrc -I$MARC_SOURCE/csource" -if test "$_OEM_NASTRAN" -ne 0 -then - CINCL="$CINCL -I../../include" -fi - -CC="icc -c -O1 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL" -CCLOW="icc -c -O0 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL" -CCHIGH="icc -c -O3 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL" - -if test "$MARCDEBUG" = "ON" -then - CC="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL" - CCLOW="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL" - CCHIGH="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL" -fi - -LOAD_CC="icc -O1 -DLinux -DLINUX -DLinux_intel" -CCT="$CC" -CCTLOW="$CCLOW" -CCTHIGH="$CCHIGH" - -CC_CASI="$CC -c99 $I8CASIDEFS" -CCLOW_CASI="$CCLOW -c99 $I8CASIDEFS" -CCHIGH_CASI="$CCHIGH -c99 $I8CASIDEFS" - -CCT_CASI="$CCT -c99 $I8CASIDEFS" -CCTLOW_CASI="$CCLOW -c99 $I8CASIDEFS" -CCTHIGH_CASI="$CCHIGH -c99 $I8CASIDEFS" - -#PROFILE="-Mprof=func" -#PROFILE="-Mprof=lines" -#PROFILE="-Mprof=func,mpi" -PROFILE= - -FORTLOW="$FCOMP -c -assume byterecl -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -O0 $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/bcssolver/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -FORTRAN="$FCOMP -c -assume byterecl -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -O1 $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/bcssolver/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -FORTHIGH="$FCOMP -c -assume byterecl -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/bcssolver/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -FORTNA="$FCOMP -c -assume byterecl -safe_cray_ptr -save -zero -mp1 -WB -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/bcssolver/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" - -if test "$MARCDEBUG" = "ON" -then - FORTLOW="$FCOMP -c -assume byterecl -safe_cray_ptr $PROFILE -save -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/bcssolver/common -I$MARC_SOURCE/mumpssolver/include $I8FFLAGS -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - FORTRAN="$FCOMP -c -assume byterecl -safe_cray_ptr $PROFILE -save -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/bcssolver/common -I$MARC_SOURCE/mumpssolver/include $I8FFLAGS -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - FORTHIGH="$FCOMP -c -assume byterecl -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/bcssolver/common -I$MARC_SOURCE/mumpssolver/include $I8FFLAGS -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - FORTNA="$FCOMP -c -assume byterecl -safe_cray_ptr -save -zero -mp1 -WB -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/bcssolver/common -I$MARC_SOURCE/mumpssolver/include $I8FFLAGS -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" -fi - -FORTLOWT="$FORTLOW" -FORTRANT="$FORTRAN" -FORTHIGHT="$FORTHIGH" - -FORTRANMNF="$FCOMP -c $FDEFINES " -CCMNF="icc -c -O1 -DLinux -DLINUX -DLinux_intel -Dport2egcs -I$MARC_SOURCE/marctoadams/mnf/include -D_LARGEFILE64_SOURCE" - - -FORTRANMUMPS="$FCOMP -c -fpp -D_IMPLICITNONE $I8FFLAGS $I8DEFINES $DDM -I$MARC_SOURCE/mumpssolver/include -Dintel_ -DALLOW_NON_INIT -Dmetis -nofor_main" -CCMUMPS="icc -c -DAdd_ -Dmetis -I$MARC_SOURCE/mumpssolver/include" - - -BCSCC="icc -c -O3 -DLOWERCASE_ -I${MARC_SOURCE}/bcsgpusolver/bcslib_csrc $CDEFINES $CINCL" -NVCC="nvcc -c -O3 -arch sm_13 -DLOWERCASE_ -I${MARC_SOURCE}/bcsgpusolver/bcslib_cuda/include " -BCSFORTLOW="$FORTLOW -I${MARC_SOURCE}/bcsgpusolver/common" -BCSFORTRAN="$FORTRAN -I${MARC_SOURCE}/bcsgpusolver/common" -BCSFORTHIGH="$FORTHIGH -I${MARC_SOURCE}/bcsgpusolver/common" -BCSFORT90HIGH="$BCSFORTHIGH" -if test "$MARCDEBUG" = "ON" -then - BCSFORTRAN=$BCSFORTLOW - BCSFORTHIGH=$BCSFORTLOW - BCSFORT90HIGH=$BCSFORTLOW -fi - -if test $MPITYPE != none -then - if test $MPITYPE = hpmpi - then - LOAD="$MPI_ROOT/bin/$FCOMPMPI ${LOADOPTIONS} -L$MPI_ROOT/lib/$ARCHITECTURE $PROFILE $LINK_OPT -o " - LOADT="$MPI_ROOT/bin/$FCOMPMPI ${LOADOPTIONS} -L$MPI_ROOT/lib/$ARCHITECTURE $PROFILE $LINK_OPT -o " - fi -# Uncomment the following lines to turn on the tracer and commnet out the next 5 lines -# if test $MPITYPE = intelmpi -# then -# INCLUDEMPI="-I$MPI_ROOT/include64 -I$VT_ROOT/include" -# LOAD="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " -# LOADT="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " -# fi - if test $MPITYPE = intelmpi - then - LOAD="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $LINK_OPT -o " - LOADT="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $LINK_OPT -o " - fi -else - LOAD="$FCOMP $LINK_OPT -o " - LOADT="$FCOMP $LINK_OPT -o " -fi - -if test "$MARC_DLL" = MARC_DLL -then - FORTLOW="$FORTLOW -fpp -fPIC" - FORTRAN="$FORTRAN -fpp -fPIC" - FORTHIGH="$FORTHIGH -fpp -fPIC" - FORTRANMNF="$FORTRANMNF -fpp -fPIC" - CC="$CC -fPIC" - CCMNF="$CCMNF -fPIC" - CC_CASI="$CC_CASI -fPIC" - CCLOW_CASI="$CCLOW_CASI -fPIC" - CCHIGH_CASI="$CCHIGH_CASI -fPIC" - LINK_EXE_MARC="-L$MARC_LIB -lmarc -L$MARC_LIB_SHARED -lguide -lpthread" - LINK_MARC_DLL="-shared -fPIC" - LOAD_DLL=$LOAD - LOADT_DLL=$LOADT - EXT_DLL="so" -fi - - -XLIBS="-L/usr/X11/lib -lX11 " - -# -# define archive and ranlib syntax -# - -ARC="ar rvl" -ARD="ar dvl" -ARX="ar xl" -RAN="" - -# -# choose which libraries you want to use ( e.g. blas ) -# - -if test "$VKISOLVER" = VKI -then - VKISOLVERLIBS="$MARC_LIB/vkisolver.a" -else - VKISOLVERLIBS= -fi - -if test "$CASISOLVER" = CASI -then - CASISOLVERLIBS="$MARC_LIB/casilib.a" -else - CASISOLVERLIBS= -fi - -MF2SOLVERLIBS= -if test "$MF2SOLVER" = MF2PARALLEL -then - MF2SOLVERLIBS="$MARC_LIB/mf2parallel/libseq.a \ - $MARC_LIB/mf2parallel/libsym.a \ - $MARC_LIB/mf2parallel/libmet.a \ - $MARC_LIB/mf2parallel/libmf2.a \ - $MARC_LIB/mf2parallel/libgauss.a \ - $MARC_LIB/mf2parallel/libmf2.a \ - $MARC_LIB/mf2parallel/libgauss.a \ - $MARC_LIB/mf2parallel/libnum.a \ - $MARC_LIB/mf2parallel/libutl.a \ - $MARC_LIB/mf2parallel/libr8.a \ - $MARC_LIB/mf2parallel/libz.a " -fi - -if test "$INTELSOLVER" = PARDISO -then - if test "$MARC_INTEGER_SIZE" = "i4" ; then - INTELSOLVERLIBS="$MARC_MKL/libmkl_solver_lp64.a" - else - INTELSOLVERLIBS="$MARC_MKL/libmkl_solver_ilp64.a" - fi -else - INTELSOLVERLIBS= -fi - -if test "$MUMPSSOLVER" = MUMPS -then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - if test $MPITYPE = none - then - MUMPSSOLVERLIBS2= - echo hello > /dev/null - fi - if test $MPITYPE = intelmpi - then - if test "$MARC_INTEGER_SIZE" = "i4" ; then - MUMPSSOLVERLIBS2="$MARC_MKL/libmkl_scalapack_lp64.a $MARC_MKL/libmkl_blacs_intelmpi_lp64.a" - else - MUMPSSOLVERLIBS2="$MARC_MKL/libmkl_scalapack_ilp64.a $MARC_MKL/libmkl_blacs_intelmpi_ilp64.a" - fi - fi - if test $MPITYPE = hpmpi - then - if test "$MARC_INTEGER_SIZE" = "i4" ; then - MUMPSSOLVERLIBS2="$MARC_MKL/libmkl_scalapack_lp64.a $MARC_MKL/libmkl_blacs_lp64.a" - else - MUMPSSOLVERLIBS2="$MARC_MKL/libmkl_scalapack_ilp64.a $MARC_MKL/libmkl_blacs_ilp64.a" - fi - fi -else - MUMPSSOLVERLIBS= - MUMPSSOLVERLIBS2= -fi - -if test "$BCSGPUSOLVER" = BCSGPU -then - BCSSOLVERLIBS="${MARC_LIB}/bcsgpulib.a -L/usr/local/cuda/lib -lcudart -lcublas -lcuda " -else - BCSSOLVERLIBS="${MARC_LIB}/bcslib.a " -fi - -if test "$MARC_INTEGER_SIZE" = "i4" ; then - MKLLIB=$MARC_MKL/libmkl_intel_lp64.a -else - MKLLIB=$MARC_MKL/libmkl_intel_ilp64.a -fi - -SECLIBS="-L$MARC_LIB -llapi" - -SOLVERLIBS="${BCSSOLVERLIBS} \ - ${INTELSOLVERLIBS} ${MUMPSSOLVERLIBS2} ${MF2SOLVERLIBS} \ - -Wl,--start-group $MKLLIB $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_core.a -Wl,--end-group \ - $MARC_MKL/libguide.a \ - $MARC_LIB/blas_src.a ${VKISOLVERLIBS} ${CASISOLVERLIBS} " -SOLVERLIBS_DLL=${SOLVERLIBS} - -MRCLIBS="$MARC_LIB/clib.a ${CASISOLVERLIBS}" -MRCLIBSPAR="$MARC_LIB/clib.a" -STUBS="$MARC_LIB/stubs.a " -MNFLIBS="$MARC_LIB/libmnf.a" -MDUSER="$MARC_LIB/md_user.a" - - -OPENMP="-openmp" - -SYSLIBS=" $OPENMP -lpthread " - -# Uncomment the following lines to turn on the trace and comment out the next 4 lines -# if test $MPITYPE = intelmpi -# then -# SYSLIBS="-L${VT_ROOT}/lib -lVT -ldwarf -lelf -lm -lpthread \ -# -L${MPI_ROOT}/lib64 -lmpi -lmpiif -lmpigi -lrt" -# fi -if test $MPITYPE = intelmpi -then - SYSLIBS="-L${MPI_ROOT}/lib64 -lmpi -lmpiif -lmpigi -lrt $OPENMP -lpthread" -fi - -SYSLIBSPAR=" " - -MARC_DLL_CODES="runmarc.f" - - -BLAS_SRC="dzero.f icopy.f izero.f" -if test "$_OEM_NASTRAN" -ne 0 -then - if test "$MARC_INTEGER_SIZE" = "i4" ; then - BLAS_SRC="$BLAS_SRC dsctr.f zsctr.f dzasum.f daxpyi.f zaxpyi.f dgthr.f zgthr.f" - else - BLAS_SRC="ALL" - fi -fi - -LOW_OPT_CODES="are163.f contro.f ndext.f omarc.f omarca.f omarcb.f omarcc.f \ - omars.f fixbc.f triang.f bet049.f norst3.f eldata.f \ - elec*.f elct*.f fmeig.f oada00.f ogeig.f updtrbe2.f cycrota.f \ - cordef.f ogpk.f ogtan.f eldam.f formrbe3.f \ - inertie.f em_sso072.f cn_fol3d_qpatch6.f" -if test "$MARC_INTEGER_SIZE" = "i8" ; then - LOW_OPT_CODES="$LOW_OPT_CODES bbcseg.f" -fi -LOW_OPT_CODES_CASI="" - -HIGH_OPT_CODES="dpsmsa1.f dpsmsa2.f dpsmsa3.f dpsmsa4.f dpsmsa5.f dpsmsa6.f \ - dpsmsa7.f dpsmsa8.f dpsmsa9.f dpsmsa10.f dpsmsa11.f dpsmsa12.f \ - dpsmsa13.f dpsmsa14.f dpsmsa15.f dpsmsa16.f " - - -HIGH_OPT_CODES_CASI="arithkernels.c blockedroutines.c blockedroutines_fd.c elemmatgenkernels.c longvecroutines.c sfmultutils.c solvewithbd.c" - -MAXNUM=1000000 diff --git a/installation/mods_MarcMentat/2011/Marc_tools/run_damask b/installation/mods_MarcMentat/2011/Marc_tools/run_damask deleted file mode 100644 index 7c58c5326..000000000 --- a/installation/mods_MarcMentat/2011/Marc_tools/run_damask +++ /dev/null @@ -1,3624 +0,0 @@ -#!/bin/ksh -############################################################################## -# # -# run_marc - run a marc job # -# ------------------------- # -# # -# usage: run_marc -j jid { options } # -# # -# where standard options are: required: defaults: # -# -------------------------- # -# # -# -j* jid job id number. ** YES ** . # -# -pr* prog program name. . marc # -# -v* y|n do or do not verify inputs. . yes # -# -q* s|l|v|b|f batch queue name or background, . short # -# foreground. # -# -b* as alternative to option -q* # -# # -# ( batch queues only : # -# -pq* intra queue priority. . . # -# -at DATE/TIME delay start of job. . . # -# format : January,1,1990,12:31 # -# or : today,5pm # -# -cpu* secs job CPU limit . . ) # -# # -# -r* rid restart file job id. . . # -# -si* sid substructure file id. . . # -# -pi* post post file job id. . . # -# -de* did defaults file . no # -# -vf vid viewfactor . no # -# # -# -u* user user subroutine. . . # -# -obj obj user objects or libraries. . . # -# -sa* y|n do or do not save load module. . no # -# -autorst auto restart flag for auto forge . no # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo selects i4 or i8 version # -# default: i4 or via defaults file run_marc_defaults # -# the -mo option will override # -# -mpi selects MPI version # -# each platform has a default MPI version and some # -# have an alternative version. see the include file # -# for the respective platform # -# MPI_DEFAULT defines the default MPI version # -# MPI_OTHER defines versions one can switch to # -# -dcoup for contact decoupling # -# currently not supported # -# -dir directory where the job i/o should take place. # -# defaults to current directory. # -# -sdir directory where scratch files are created # -# defaults to current directory. # -# # -# -alloc only perform memory allocation test, no analysis # -# -list y only list options in the input file, no analysis # -# -fe num set feature number "num" for the run. only one allowed # -# -dytran flag to switch from Dytran to Marc # -# dytran = 0, program will run w/o Marc-Dytran Switch # -# = 1, program will restart Marc after Dytran run # -# >= 2, Not supported yet. # -# currently not supported # -# -ou force analysis to use out-of-core control # -# =0, not used # -# =1, element storage out-of-core # -# -dll run marc using shared library libmarc.so and exe_marc # -# =1, used # -# =2, do not free streaming input memory # -# =3, run with marc input deck # -# -trk run marc for post-tracking # -# # -# where parallel options are: # -# -------------------------- # -# # -# itree, host, and comp options are available for the domain # -# decomposition only. # -# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # -# # -# # -# -nprocd number of domains. # -# defaults to single domain solution. # -# -nprocds number of domains if single input file. # -# defaults to single domain solution. # -# -nps same as -nprocds. # -# -nsolver number of solver tasks for solver types 12 and 13 # -# these are distributed tasks operating via MPI # -# -nthread number of solver threads for solver types 6, 8, and 11 # -# also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. if both specified, nthread option# -# will be used. # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by 6, 8, and 11 # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor nthread specified. # -# -itree message passing tree type for domain decomposition. # -# for debugging purposes; should not normally be used. # -# -host hostfile name for distributed execution on network. # -# defaults to no hostfile, unless jobid.defhost exists. # -# if jobid.defhost exists, only -np(s) necessary # -# -comp* y|n to be used with user routines on a network of # -# incompatible machines. # -# if set to no, a separate executable will be created # -# for each machine on the network. # -# if set to yes, the executable located on the machine # -# from which marc is started will be used on all machines.# -# defaults to no if O/S versions different on machines. # -# # -# -ci y|n copy input files to remote hosts (default: yes) # -# if "yes", input files are automatically copied to # -# remote hosts for a network run if necessary. # -# -cr y|n copy post files from remote hosts (default: yes) # -# if "yes", post files are automatically copied back from # -# remote hosts for a network run if necessary. # -############################################################################## -# set DIR to the directory in which this script is -REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" -DIR=`dirname $REALCOM` -# make sure DIR has an absolute path -case $DIR in - \/*) - ;; - *) - DIR=`pwd`/$DIR - ;; -esac -DIRSCRIPT=$DIR -AWK=awk -ARCH=`uname -a | cut -f 1 -d " "` -# Sun has a bad awk, use nawk instead -if test $ARCH = "SunOS" -then - AWK=nawk -fi -BASENAME=basename -# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists -if test $ARCH = "SunOS" -then - if test -x /usr/ucb/basename - then - BASENAME=/usr/ucb/basename - fi -fi - -# echo command line in the case of ECHO_COMMAND is true -if test "$ECHO_COMMAND" = true ; then - echo command "$0" "$@" -fi - -# -# "mode" selects version, i4 or i8 -# default is i4 -# this can be changed by a file run_marc_defaults -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MODE i8 -# it can also be set by the environmental variable MARC_INTEGER_SIZE -# and by the command line option "-mo" -# -mode= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -f $HOME/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -n "$MARC_INTEGER_SIZE" ; then - mode=$MARC_INTEGER_SIZE -fi -if test -z "$mode" ; then - mode=i4 -fi -case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "error, version mode must be i4 or i8" - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i4 or i8" - echo " " - echo " use -mo i4 or -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - setmode=true - fi - if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - fi - if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -done - -# set to i4 version for 32 bit Linux -if test "`uname -s`" = "Linux"; then - if test "`uname -m`" = "i686"; then - mode=i4 - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -fi - - -. "$DIR/getarch" - -# Change_me -. $MARC_INCLUDE -# - -# -# Dynamically determine the echo syntax -# - -case "`echo '\c'`" in - '\c') - ECHO='echo -n' - ECHOTXT=' ' - ;; - *) - ECHO='echo' - ECHOTXT=' \c' - ;; -esac - -# -# Variables for the MARC environment -# - -PRODUCT="Marc" -EXITMSG=$MARC_TOOLS/MESSAGES -export EXITMSG -FLEXDIR=$DIR/../flexlm/licenses -export FLEXDIR -TIMCHK=3600 -export TIMCHK -BINDIR=$MARC_BIN -export BINDIR -AFMATDAT=$MARC_RUNTIME/AF_flowmat/ -export AFMATDAT -# -# define directory path to global unified material database -# -MATFILE= -export MATFILE - -# -# define memory limit -# first set to MEMLIMIT from include -# -ml option overrules if specified -memlimit=$MEMLIMIT -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -# -if test $MACHINENAME = "HP" -then - SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH - export SHLIB_PATH -fi -# the one for IBM is defined futher down - -LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH -LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH -export LD_LIBRARY_PATH -export LD_LIBRARY64_PATH -export LD_LIBRARYN32_PATH - -atexit() { -kill -15 $$ -# -if test $MPITYPE = "myrinet" -then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi -fi -} - -trap "atexit" 2 - -# -# defaults -# - -prog=marc -exefile=marc -jid= -rid= -pid= -sid= -did= -vid= -user= -usernoext= -objs= -qid=background -cpu= -priority= -att= -trk= -verify=yes -prgsav=no -rmdll=no -cpdll=no -progdll= -pathdll= -error= -nprocd=0 -nprocdddm=1 -nprocdddmprint= -icreated=0 -nprocdarg= -nsolver=0 -nsolverarg=-nsolver -if test $nprocds -then - if test $nprocds -gt 1 - then - nprocdddm=$nprocds - nprocdddmprint=$nprocds - icreated=1 - nprocdarg=-nprocds - fi -fi -nthread=-1 -nauto=0 -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -nthreadprint=0 -itree=0 -iam= -link= -trkrun=0 -DIRJOB=`pwd` -DIRSCR=$DIRJOB -DIRSCRSET= -autoforge=0 -dotdat=.dat -dotdefhost=.defhost -host= -numhost= -mfile= -userhost= -makebdf= -cpinput=yes -cpresults=yes -marcdll=libmarc.$EXT_DLL -# define hostname and strip off extensions (alpha.aaa.com) -thishost=`hostname` -thishost=${thishost%%.*} -compatible=unknown -numfield=1 -justlist= -feature= -mpioption=false -MDSRCLIB=$MARC_LIB/mdsrc.a -# -# check run_marc_defaults file for default MPI setting -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MPI -# -value= -file= -if test -f $DIRSCRIPT/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$DIRSCRIPT/run_marc_defaults - fi -fi -if test -f $HOME/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$HOME/run_marc_defaults - fi -fi -if test -n "$value"; then - MARC_MPITYPE=$value - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - echo " " - echo " error, incorrect option for MARC_MPI" - echo " defined in $file: $MARC_MPITYPE" - echo " valid options: $MPI_DEFAULT $MPI_OTHER" - echo " " - exit - fi - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - fi -fi -# -# -# allow scratch directory to be specified with environmental variable -# MARCSCRATCH -if test $MARCSCRATCH -then - if test -d $MARCSCRATCH - then - DIRSCR=$MARCSCRATCH - else - echo "error, scratch directory '$MARCSCRATCH'" - echo " specified via environmental variable MARCSCRATCH does not exist" - exit - fi -fi -# -############################################################################## -# parse input - arguments always come in pairs # -############################################################################## - -arg=$1 -if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - shift - arg=$1 -fi -while [ -n "$arg" ] -do - shift - value=$1 - case $arg in - -al* | -AL*) - $MARC_BIN/marc -alloc 1 - exit - ;; - -li* | -LI*) - justlist=yes - ;; - -fe* | -FE*) - feature=$value - ;; - -pr* | -PR*) - if test `dirname $value` = '.' - then - prog=`$BASENAME $value .marc` - progdll=`$BASENAME $value` - else - prog=`dirname $value`/`$BASENAME $value .marc` - progdll=`dirname $value`/`$BASENAME $value` - fi - prdir=`dirname $value` - case $prdir in - \/*) - ;; - *) - prog=`pwd`/$prdir/$prog - ;; - esac - ;; - -j* | -J*) - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - ;; - -r* | -R*) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - -si* | -SI*) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - -pi* | -PI*) - if test -f $value.t19 - then - pid=`$BASENAME $value .t19` - else - pid=`$BASENAME $value .t16` - fi - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - -bdf | -BDF) - makebdf=1 - ;; - -de* | -DE*) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - -vf | -VF) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - -u* | -U*) - - user=$value - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - -obj | -OBJ) - objs="$value" - ;; - -q* | -Q*) - qid=$value - ;; - -b* | -B*) - case $value in - y* | Y*) - qid=background - ;; - n* | N*) - qid=foreground - ;; - *) - ;; - esac - ;; - -at | -AT) - att=$value - ;; - -cpu* | -CPU*) - cpu=$value - ;; - -pq | -PQ*) - priority=$value - ;; - -v* | -V*) - verify=$value - ;; - -sa* | -SA*) - prgsav=$value - ;; - -np* | -NP*) - nprocdddm=$value - nprocdddmprint=$value - case $arg in - -nps* | -NPS* | -nprocds* | -NPROCDS*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - case $arg in - -np | -NP | -nprocd | -NPROCD) - icreated=0 - nprocdarg=-nprocd - ;; - esac - ;; - -ns* | -NS*) - nsolver=$value - ;; - -nt* | -NT*) - nthread=$value - ;; - -it* | -IT*) - itree=$value - ;; - -iam | -IAM) - iam=$value - ;; - -au* | -AU*) - nauto=$value - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -me | -ME ) - mesh=$value - ;; - -ml | -ML ) - memlimit=$value - ;; - -mo | -MO ) - ;; - -mpi | -MPI ) - mpioption=true - MARC_MPITYPE=$value - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - fi - fi - ;; - -dir* | -DIR*) - DIRJOB=$value - case $DIRJOB in - \/*) - ;; - *) - DIRJOB=`pwd`/$DIRJOB - ;; - esac - if test -z "$DIRSCRSET" - then - DIRSCR=$DIRJOB - fi - ;; - -sd* | -SD*) - DIRSCR=$value - DIRSCRSET=yes - case $DIRSCR in - \/*) - ;; - *) - DIRSCR=`pwd`/$DIRSCR - ;; - esac - ;; - -ho* | -HO*) - host=$value - ;; - -co* | -CO*) - compatible=$value - ;; - -ci* | -CI*) - cpinput=$value - ;; - -cr* | -CR*) - cpresults=$value - ;; - *) - error="$error -$arg: invalid option" - break - ;; - esac - case $value in - -*) - error="$error -$arg: invalid name $value" - break - ;; - esac - shift - arg=$1 - if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - shift - arg=$1 - fi -done -argc=`expr $# % 2` -if test $argc -eq 1 -then -# -# odd number of arguments -# - error="$error -argument list incomplete" -fi - -if test $nprocdddm -gt 0 -then -nprocd=$nprocdddm -fi - -if test $nsolver -gt 0 -then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi -fi - -if test $nthread -eq -1 -then -nthread=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nthread -lt 0 -then -nthread=0 -fi - -nthreadprint=$nthread -if test $nthreadprint -eq 0 -then -nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi -fi - -nthread=$nthreadprint - - - -if test $nprocd -gt 1; then - if test -f $jid$dotdefhost; then - if test "$host" = ""; then - host=$jid$dotdefhost - fi - fi - if test -f hostfile_qa_$nprocd; then - if test "$host" = ""; then - host=hostfile_qa_$nprocd - fi - fi -fi - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then - dotdat=.inp - fi - - if test "$progdll"; then - /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll - rmdll=yes - pathdll=yes - progdll=${progdll}_$marcdll - else - progdll=$marcdll - fi - - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - pathdll=yes - fi -fi - -############################################################################## -# check parameter validity # -############################################################################## - -while test forever; do - -# -# check for input file existence -# -if test $nprocdddm -gt 1 -a $icreated -eq 0; then - if test ! -f $DIRJID/1$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/1$jid$dotdat not accessible" - fi - fi -else - if test ! -f $DIRJID/$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/$jid$dotdat not accessible" - fi - fi -fi - if test $nprocd -gt 1; then - if test "$host" ; then - if test ! -f $host; then - error="$error -host name file $host not accessible" - fi - fi - fi - -# -# check if the job is already running in the background -# -if test -f $DIRJOB/$jid.pid; then - error="$error -job is already running (the file $jid.pid exists)" -fi - -# -# if the program name is other than marc, then -# assume that this is a program in the users local directory -# - -bd=$MARC_BIN/ - -case $prog in - marc | MARC | $exefile) - program=$exefile - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - if test ! -f $user - then - error="$error -user subroutine file $user not accessible" - fi - fi - if test "$objs" - then - missingobjs= - for o in $objs - do - if test ! -f "$o" - then - if test -z "$missingobjs" - then - missingobjs="$o" - else - missingobjs="$missingobjs $o" - fi - fi - done - if test -n "$missingobjs" - then - error="$error -user object/library file(s) $missingobjs not accessible" - fi - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$vid" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRVID/1$vid.vfs - then - error="$error -view factor file $DIRVID/1$vid.vfs not accessible" - fi - else - if test ! -f $DIRVID/$vid.vfs - then - error="$error -view factor file $DIRVID/$vid.vfs not accessible" - fi - fi - fi - if $mpioption - then - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" - fi - fi - ;; - *) - program=$prog.marc - case $prog in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - error="$error -program option may not be used with user subroutine" - fi - if test "$objs" - then - error="$error -program option may not be used with user objects or libraries" - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$nauto" - then - if test $nauto -gt 2 - then - error="$error -incorrect option for auto restart " - fi - fi - if test "$ndcoup" - then - if test $ndcoup -gt 3 - then - error="$error -incorrect option for contact decoupling " - fi - fi - if test "$ndytran" - then - if test $ndytran -gt 1 - then - error="$error -incorrect option for Marc-Dytran Switch " - fi - fi - if $mpioption - then - if test ! -x $MARC_BIN/$exefile - then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE " - fi - fi - ;; -esac - -############################################################################## -# check argument integrity # -############################################################################## - -if test "$jid" -then - : -else - error="$error -job id required" -fi - -if test $nprocd -gt 1 -then - if test $nauto -gt 0 - then - error="$error -cannot run DDM job with auto restart (-au) option " - fi -fi -case $qid in - S* | s*) - qid=short - ;; - L* | l*) - qid=long - ;; - V* | v*) - qid=verylong - ;; - B* | b*) - qid=background - ;; - F* | f*) - qid=foreground - ;; - A* | a*) - qid=at - ;; - *) - error="$error -bad value for queue_id option" - ;; -esac - -case $prgsav in - N* | n*) - prgsav=no - ;; - Y* | y*) - prgsav=yes - ;; - *) - error="$error -bad value for save option" - ;; -esac - -case $verify in - N* | n*) - verify=no - ;; - Y* | y*) - verify=yes - ;; - *) - error="$error -bad value for verify option" - ;; -esac - -case $nprocdddm in - -* ) - error="$error -bad value for nprocd option" - ;; -esac - -case $nthread in - -* ) - error="$error -bad value for nthread option" - ;; -esac - -case $itree in - -* ) - error="$error -bad value for itree option" - ;; -esac -case $iam in - -* ) - error="$error -bad value for iam option" - ;; -esac -case $compatible in - N* | n*) - compatible=no - ;; - Y* | y*) - compatible=yes - ;; - unknown) - ;; - *) - error="$error -bad value for comp option" - ;; -esac -case $cpinput in - N* | n*) - cpinput=no - ;; - Y* | y*) - cpinput=yes - ;; - *) - error="$error -bad value for copy input option" - ;; -esac -case $cpresults in - N* | n*) - cpresults=no - ;; - Y* | y*) - cpresults=yes - ;; - *) - error="$error -bad value for copy results option" - ;; -esac - -# -# check for external file to run -# -if test -f $MARC_TOOLS/run_marc_check -then - . $MARC_TOOLS/run_marc_check -fi - -# -# pick up version data from bin/VERSION if it exists -# -if test -f $MARC_BIN/VERSION; then - ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` - if test -n "$ppp" ;then - PRODUCT=$ppp - fi - ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` - if test -n "$ppp" ;then - REVISION=", Build $ppp" - fi -fi -############################################################################## -# interact with the user to get the required information to run marc or # -# other marc system program # -############################################################################## - -deletelog=yes -if test $qid = background -a $verify = no -then -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto " > $jid.log -deletelog=no -fi -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto" - - -case $qid in - s* | S* | l* | L* | v* | V* ) - echo \ -"Queue priority : $priority -Queue CPU limit : $cpu -Queue start time : $att" - ;; -# * ) -# echo \ -#" " -# ;; -esac - -if test "$error" -then - if test $verify = yes - then - $ECHO "$error - -Please correct or quit(correct,quit,): $ECHOTXT" - error= - read answer - case $answer in - q* | Q*) - answer=quit - ;; - *) - answer=correct - ;; - esac - else - $ECHO "$error - $ECHOTXT" - echo " " - if test "$deletelog" = no - then - $ECHO "$error - $ECHOTXT" >> $jid.log - echo " " >> $jid.log - fi - answer=quit - fi -else - if test $verify = yes - then - $ECHO " -Are these parameters correct (yes,no,quit,)? $ECHOTXT" - read answer - case $answer in - q* | Q*) - answer=quit - ;; - y* | Y*) - answer=yes - ;; - *) - answer=no - ;; - esac - else - answer=yes - fi -fi - -case $answer in - no | correct) - -############################################################################## -# prompt for each value # -############################################################################## - - $ECHO " -Program name ($prog)? $ECHOTXT" - read value - if test "$value" - then - prog=$value - fi - $ECHO "Job ID ($jid)? $ECHOTXT" - read value - if test "$value" - then - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - fi - $ECHO "User subroutine name ($user)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - user= - ;; - *) - user=$value - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - esac - fi - $ECHO "User objects or libraries ($objs)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - objs= - ;; - *) - objs="$value" - ;; - esac - fi - $ECHO "Restart File Job ID ($rid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - rid= - ;; - *) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - esac - fi - $ECHO "Substructure File ID ($sid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - sid= - ;; - *) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - esac - fi - $ECHO "Post File Job ID ($pid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - pid= - ;; - *) - pid=$value - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - esac - fi - $ECHO "Defaults File ID ($did)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - did= - ;; - *) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - esac - fi - $ECHO "View Factor File ID ($vid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - vid= - ;; - *) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - esac - fi - $ECHO "Save generated module ($prgsav)? $ECHOTXT" - read value - if test "$value" - then - prgsav=$value - fi - $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" - read value - if test "$value" - then - nprocdddm=$value - nprocdddmprint=$value - fi - $ECHO "Run on ($nthread) threads ? $ECHOTXT" - read value - if test "$value" - then - nthread=$value - fi - $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" - read value - if test "$value" - then - nsolver=$value - fi -# - if test $nprocdddm -gt 0 - then - nprocd=$nprocdddm - fi - if test $nsolver -gt 0 - then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi - fi - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - nthreadprint=$nthread - if test $nthreadprint -eq 0 - then - nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi - fi -# - if test $nprocd -gt 1 - then - $ECHO "Message passing type ($itree)? $ECHOTXT" - read value - if test "$value" - then - itree=$value - fi - $ECHO "Host file name ($host)? $ECHOTXT" - read value - if test "$value" - then - host=$value - fi - if test $nprocdddm -gt 1 - then - $ECHO "Single input file? $ECHOTXT" - read value - case $value in - y* | Y*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" - read value - if test "$value" - then - compatible=$value - fi - $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" - read value - if test "$value" - then - cpinput=$value - fi - $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" - read value - if test "$value" - then - cpresults=$value - fi - fi - fi - $ECHO "Run the job in the queue ($qid)? $ECHOTXT" - read value - if test "$value" - then - qid=$value - fi - case $qid in - s* | S* | l* | L* | v* | V* ) - $ECHO "Queue priority ($priority)? $ECHOTXT" - read value - if test "$value" - then - priority=$value - fi - $ECHO "Job starts at ($att)? $ECHOTXT" - read value - if test "$value" - then - att=$value - fi - $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" - read value - if test "$value" - then - cpu=$value - fi - ;; - * ) - ;; - esac - $ECHO "Auto Restart option ($nauto)? $ECHOTXT" - read value - if test "$value" - then - nauto=$value - fi - $ECHO "Run directory ($DIRJOB)? $ECHOTXT" - read value - if test "$value" - then - DIRJOB=$value - DIRSCR=$DIRJOB - fi - $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" - read value - if test "$value" - then - DIRSCR=$value - fi - ;; - quit) - exit 1 - ;; - *) - break - ;; - -esac - - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - -done - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - pathdll=yes - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - fi - - if test "$pathdll"; then -# -# reset share lib path -# - if test $MACHINENAME = "HP" - then - SHLIB_PATH=$DIRJOB:$SHLIB_PATH - export SHLIB_PATH - fi - if test $MACHINENAME = "IBM" - then - LIBPATH=$DIRJOB:$LIBPATH - export LIBPATH - fi -# - LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH - LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH - LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH - export LD_LIBRARY_PATH - export LD_LIBRARY64_PATH - export LD_LIBRARYN32_PATH - fi -fi -# end of dllrun>0 - - -if test $program = $exefile -o $program = $prog.marc -then - -# delete the old .log file unless we run in the background -if test "$deletelog" = yes -then - /bin/rm $jid.log 2>/dev/null -else - echo - echo running the job in the background, see $jid.log - echo -fi - -# -# check if this is an autoforge or rezoning or radiation job -# -if test $nprocd -eq 1 -then - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` - if test "$line" - then - autoforge=1 - fi -fi -# -# check that jobname for restarted run is not the same -# as restart file basename -# -if test "$rid" -then - if test "$jid" = "$rid" - then - echo " " - echo "ERROR: job name of current run is the same as job name" - echo " of the restarted job" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "ERROR: job name of current run is the same as job name" >> $jid.log - echo " of the restarted job" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi -fi - -# -# user objects/libraries used -# - - if test "$objs" - then - program="$DIRJOB/$jid.marc" - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# user subroutine used -# -# add DAMASK options for linking - DAMASK="" - - if test "$user" - then - program=$usernoext.marc - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# Special case for IBM using POE but not an SP machine -# in this case we always need a host file, also for serial jobs. -# -if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP -then - MP_HOSTFILE=${jid}.host - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $nprocd -gt 1 - then - numdom=$nprocd - while test $numdom -gt 0 - do - hostname -s >> $MP_HOSTFILE - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - else - hostname -s > $MP_HOSTFILE - fi -fi -# -# check correctness of host file; fix for user sub -# - if test $nprocd -gt 1 - then - -# construct the path name to the executable (execpath) - execpath=$MARC_BIN/$exefile - usersub=0 - if test $program = $prog.marc - then - execpath=$prog.marc - usersub=1 - fi - if test "$objs" - then - execpath="$DIRJOB/$jid.marc" - usersub=1 - fi - if test "$user" - then - execpath=$usernoext.marc - usersub=1 - fi - export execpath - execname=`$BASENAME $execpath` - - if test "$host" - then - userhost=$host - case $userhost in - \/* | \.\/*) - ;; - *) - userhost=`pwd`/$userhost - ;; - esac - -# check that the number of processes specified in the hostfile is -# equal to nprocd specified by -nprocd. - numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` - if test $nprocd -ne $numproc - then - echo " " - echo "error, the number of processes specified in the host file" - echo "must be equal to the number of processes given by -nprocd/-nsolver" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, the number of processes specified in the host file" >> $jid.log - echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - -# check for Myrinet that the number of processes per host is -# less than number of available user ports, 5 -# .gmpi directory must exist in user's home directory -# and must have write permission from remote hosts - if test $MPITYPE = "myrinet" - then - numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` - if test $numproc -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes specified " - echo "in the hostfile must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes specified " >> $jid.log - echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - if test ! -d ~/.gmpi - then - echo " " - echo "error, for Myrinet a .gmpi directory must exist " - echo "under the user's home directory" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log - echo "under the user's home directory" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - homedir=`echo ~` - for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - echo " " - echo "error, for Myrinet a shared .gmpi directory must exist " - echo "under the user's home directory " - echo "with remote write permission" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log - echo "under the user's home directory " >> $jid.log - echo "with remote write permission" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - /bin/rm tmp.$$ - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - fi - fi - done - fi - fi - -# construct the host file $jid.host which is used by mpirun -# skip lines starting with # and only consider lines with more than -# one word in them. Note that the hostfile given to this script -# has two columns: the host name and the number of shared processes -# to run on this host. mpirun wants the number of _other_ -# processes to run in addition to the one being run on the machine -# on which the job is started. hence the $2-1 for fnr == 1. - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then -# HPMPI or HP hardware MPI - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ - -v mpihpspecial="$MPIHPSPECIAL" \ -'{if ( NF > 0) {\ - fnr++ ; \ - printf("-h %s -np %s",$1,$2); \ - printf(" %s",mpihpspecial); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ - if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ - }\ - }' > $jid.host -# end HPMPI or HP hardware MPI - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then -# IBM using hardware MPI (POE) - MP_HOSTFILE=$jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host -# end IBM using hardware MPI (POE) -# for Intel MPI, need to create a machinefile for DMP - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then -# Intel MPI - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - /bin/cp $host $jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Intel MPI for DMP -# for Solaris HPC 7.1, need to create a machinefile for DMP - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then -# Solaris HPC 7.1 - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Solaris HPC 7.1 for DMP -# for Myrinet, construct a configuration file in ~/.gmpi -# this must be readable by each process -# format is (hostname) (port number) for each process - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - grep -v '^#' $host | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ -{if ( NF > 0 ) \ - for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ -}' >> ~/.gmpi/$jid.host - else -# this is for mpich-1.2.5 and later, using the -pg option -# format: host nproc executable user arguments -# the arguments are added later - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s %s\n",path,user);\ - if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ - }\ - }' > $jid.host - fi -# end Myrinet - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then -# Compaq MPI via Memory Channel - grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host -# end Compaq MPI - else -# MPICH - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ - }\ - }' > $jid.host - fi -# define the variable host and host_filt -# host_filt is used for loops over hosts -# for Myrinet we need to use a filtered variant of userhost -# for others we can use $host - if test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - host=~/.gmpi/$jid.host - host_filt=$jid.host_tMp - grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt - else - host=$jid.host - host_filt=$host - fi - else - host=$jid.host - host_filt=$host - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - host_filt=$jid.mfile - fi - fi -# figure out if the machines in the hostfile are nfs mounted -# or distributed and set the variable "dirstatus" accordingly. -# only perform the check if user subroutine is used -# or a user subroutine executable is used - - numfield=1 - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - numfield=2 - fi - DIR1=$DIRJOB - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - counter=0 - echo " " - echo "checking if local or shared directories for host" - if test "$deletelog" = no - then - echo "checking if local or shared directories for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - dirstatus[$counter]="shared" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - dirstatus[$counter]="local" - /bin/rm tmp.$$ - else - if test ! -f $jid.$$ - then - dirstatus[$counter]="local" - $RSH $i /bin/rm $DIR1/$jid.$$ - else - /bin/rm $jid.$$ - fi - fi - if test -f tmp.$$ - then - /bin/rm tmp.$$ - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - echo " ${dirstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${dirstatus[$counter]}" >> $jid.log - fi - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - fi - -# figure out if this is a compatible set of machines -# unless explicitly specified with flag -comp -# only perform the check if user subroutine is used -# or a user subroutine executable is used -# Myrinet does not support heterogeneous - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - if test $compatible = "unknown" - then - thisname=$ARCH - compatible=yes - counter=0 - echo "checking if machines are compatible for host" - if test "$deletelog" = no - then - echo "checking if machines are compatible for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]="yes" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - othername=`$RSH $i uname -a | cut -f 1 -d " "` - if test $thisname != $othername - then - compatible=no - compstatus[$counter]="no" - fi - fi - echo " ${compstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${compstatus[$counter]}" >> $jid.log - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - else - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]=$compatible - fi - done - if test $compatible = "no" - then - echo "all machines assumed incompatible" - if test "$deletelog" = no - then - echo "all machines assumed incompatible" >> $jid.log - fi - else - echo "all machines compatible" - if test "$deletelog" = no - then - echo "all machines compatible" >> $jid.log - fi - fi - fi -# error out if user objects or libraries are used on incompatible machines - if test "$compatible" = "no" -a -n "$objs" - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" - if test "$deletelog" = no - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log - fi - exit 1 - fi -# modify new host file if NFS mounted heterogeneous machine - doit= - if test $program = $prog.marc - then - doit=yes - fi - if test "$user" - then - doit=yes - fi - if test "$doit" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - $AWK -v hst=$i '{fnr++ ; \ -if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ -printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} - /bin/mv $jid.host{$$} $jid.host - host=$jid.host - fi - fi - done - fi - fi # if test $program = $prog.marc -o $user -o $obj - - else # if test $host - # assume shared memory machine if no hostfile given and - # MPITYPE is set to mpich or Myrinet - # check for Myrinet that the total number of processes is - # less than number of available user ports, 5 - if test $MPITYPE = "mpich" -o $MPITYPE = "scali" - then - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - host=$jid.host - elif test $MPITYPE = "myrinet" - then - if test $nprocd -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes " - echo "must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes " >> $jid.log - echo "must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - echo `hostname` $nprocd | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ - {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ -' >> ~/.gmpi/$jid.host - host=~/.gmpi/$jid.host - else - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - - fi - fi # if test myrinet - - fi # if test $host - - fi # if test $nprocd -gt 1 - -fi # if test $program = $exefile -o $program = $prog.marc - -############################################################################## -# construct run stream (Marc only) # -############################################################################## - -# set maximum message length for ddm to a large number -# for vendor provided mpi -if test $itree -eq 0 -a $MPITYPE = hardware -then - itree=100000000 - if test $MACHINENAME = SGI - then - itree=100000001 - fi -fi -if test $itree -eq 0 -a $MPITYPE = hpmpi -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = myrinet -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = nec -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = scali -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = intelmpi -then - itree=100000000 -fi -if test $nprocdddm -lt 2 -then - nprocdarg= -else - nprocdarg="$nprocdarg $nprocdddm" -fi -if test $nsolver -eq 0 -then - nsolverarg= -else - nsolverarg="$nsolverarg $nsolver" -fi -if test $nprocdddm -lt 2 -a $nsolver -eq 0 -then -nprocd=0 -fi -if test $nprocd -gt 0 -then - if test "$host" - then - if test -z "$RUN_JOB2" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then - RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - else - RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" - RUN_JOB=" -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - fi - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - numhost=`uniq $jid.mfile | wc -l` - if test "$INTELMPI_VERSION" = "HYDRA" - then - RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n $numhost -r $RSH -f $jid.mfile - RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" - fi - -# intelmpi uses configfile. format: -# -host host1 -n n1 executable marcargs -# one such line per host -# collect the marcargs in RUN_JOB and construct the config file later -# collect the run stream in RUN_JOB_TMP - RUN_JOB="-jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - - - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then - RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - fi - if test "$userhost" - then - RUN_JOB="$RUN_JOB -mhost $userhost" - fi - if test $MPITYPE = "scali" - then -# set default working directory to /tmp to allow -# different directory names - SCAMPI_WORKING_DIRECTORY=/tmp - export SCAMPI_WORKING_DIRECTORY - fi - else - if test -z "$RUN_JOB1" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - RUNNPROCD=$nprocd - if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" - then - RUNNPROCD= - MP_PROCS=$nprocd - export MP_PROCS - fi - if test $MPITYPE = "myrinet" - then - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread -dirjob $DIRJOB " - fi - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - touch $jid.hosts - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n 1 -f $jid.hosts - fi -# /bin/rm $jid.hosts 2> /dev/null - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread -dirjob $DIRJOB " - fi - fi -else - if test $nauto -gt 0 -o $ndcoup -gt 0 - then - RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ - -nthread $nthread -dirjob $DIRJOB " - else -# this is for a serial job without auto restart: - RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ --nthread $nthread -dirjob $DIRJOB " - fi -fi -if test "$rid" -then - RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" -fi -if test "$pid" -then - RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" -fi -if test "$sid" -then - RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" -fi -if test "$did" -then - RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" -fi -if test "$vid" -then - RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" -fi -if test $nauto -gt 0 -then - RUN_JOB="$RUN_JOB -autorst $nauto " -fi -if test $ndcoup -gt 0 -then - RUN_JOB="$RUN_JOB -dcoup $ndcoup " -fi -if test $ndytran -gt 0 -then - RUN_JOB="$RUN_JOB -dytran $ndytran " -fi -if test $mesh -gt 0 -then - RUN_JOB="$RUN_JOB -me $mesh " -fi -if test $noutcore -gt 0 -then - RUN_JOB="$RUN_JOB -outcore $noutcore " -fi -if test "$dllrun" -gt 0 -then - RUN_JOB="$RUN_JOB -dll $dllrun " -fi -if test "$trkrun" -gt 0 -then - RUN_JOB="$RUN_JOB -trk $trkrun " -fi -if test "$iam" -then - RUN_JOB="$RUN_JOB -iam $iam " -fi -if test "$justlist" -then - RUN_JOB="$RUN_JOB -list 1 " -fi -if test "$feature" -then - RUN_JOB="$RUN_JOB -feature $feature " -fi -if test "$memlimit" -ne 0 -then - RUN_JOB="$RUN_JOB -ml $memlimit " -fi -if test "$cpinput" -then - RUN_JOB="$RUN_JOB -ci $cpinput " -fi -if test "$cpresults" -then - RUN_JOB="$RUN_JOB -cr $cpresults " -fi -if test "$DIRSCR" != "$DIRJOB" -then - RUN_JOB="$RUN_JOB -dirscr $DIRSCR" -else - DIRSCR=$DIRJOB -fi -if test "$makebdf" -then - RUN_JOB="$RUN_JOB -bdf $makebdf " -fi -if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" -then - # append $RUN_JOB to all lines of the host file - # and set RUN_JOB - $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ - /bin/mv $host.$$ $host - RUN_JOB=$RUN_JOB_TMP -fi -if test $MPITYPE = "intelmpi" -a "$host" -then - # construct config file, append $RUN_JOB to all lines of the config file - # and set RUN_JOB - if test "$INTELMPI_VERSION" = "HYDRA" - then - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - else - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-host %s -n %s",$1,$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - fi - RUN_JOB=$RUN_JOB_TMP -fi -echo " " -echo "Final run stream value" -echo " RUNJOB="$RUN_JOB -if test "$deletelog" = no -then -echo " " >> $jid.log -echo "Final run stream value" >> $jid.log -echo " RUNJOB="$RUN_JOB >> $jid.log -fi - - -############################################################################## -# run marc using valgrind # -############################################################################## -#RUN_JOB="valgrind $RUN_JOB" -#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" -############################################################################## - - -############################################################################## -# run the requested program in a queue # -############################################################################## - -if test "$deletelog" = yes -then - echo - date -else - echo >> $jid.log - date >> $jid.log -fi -if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] -then - -/bin/rm -f $jid.runmarcscript - - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - userobj=$usernoext.o - fi - cat > $jid.runmarcscript << END4 - if test "$user" - then - if test $MACHINENAME = "CRAY" - then - $DFORTRAN $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTRAN $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } -END4 -else - prgsav=yes -fi -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# - -cat >> $jid.runmarcscript << END5 - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -# first remove all .out files and incremental restart files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null - /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null -fi - -if test $nprocdddm -gt 1 -then - $RUN_JOB 2>>$jid.log -else - $RUN_JOB 2>>$jid.log -fi - -if test $dllrun -eq 0; then - if test $prgsav = no - then - /bin/rm -f $bd$program 2>/dev/null - fi -else - if test $cpdll = yes; then - filename=`basename $usersubname .f` - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes - then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -END5 - - -# Submit to marc batch queue -# -if [ $qid = at ] -then -QUENAME=at -SUBMCMD= -else -# -# Submit to qsub queue -# -QUENAME=qsub -SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" -if test "$priority" -then - SUBMCMD=$SUBMCMD" -p $priority" -fi -if test "$att" -then - SUBMCMD=$SUBMCMD" -a $att" -fi -if test "$cpu" -then - SUBMCMD=$SUBMCMD" -lt $cpu" -fi - -fi -echo $QUENAME $SUBMCMD -#cat $jid.runmarcscript -$QUENAME $SUBMCMD < $jid.runmarcscript - -/bin/rm -f $jid.runmarcscript - -############################################################################## -# run the requested program in the background # -############################################################################## - -else -if test $qid = background -then - -# -# first remove all old .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi -# -# compile user subroutine if present -# -( -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - echo " $PRODUCT Exit number 3" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTRAN $user || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTRAN $user -o $userobj || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - echo " $PRODUCT Exit number 3" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc - -# - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -$RUN_JOB & - -marcpid=$! -echo $marcpid > $DIRJOB/$jid.pid -wait $marcpid - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=`basename $usersubname .f` - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -) 1>>$jid.log 2>&1 & - - -############################################################################## -# run the requested program in the foreground # -############################################################################## - -else - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTRAN $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTRAN $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi -# first remove all .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi - -$RUN_JOB - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - if test "$host" - then - mpdcleanup -a -f $jid.mfile - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.mfile 2> /dev/null - else - mpdcleanup -a -f $jid.hosts - /bin/rm $jid.hosts 2> /dev/null - fi - fi - fi -fi - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=`basename $usersubname .f` - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi - - -fi -fi diff --git a/installation/mods_MarcMentat/2011/Marc_tools/run_damask_h b/installation/mods_MarcMentat/2011/Marc_tools/run_damask_h deleted file mode 100644 index 3f24d83d6..000000000 --- a/installation/mods_MarcMentat/2011/Marc_tools/run_damask_h +++ /dev/null @@ -1,3625 +0,0 @@ -#!/bin/ksh -############################################################################## -# # -# run_marc - run a marc job # -# ------------------------- # -# # -# usage: run_marc -j jid { options } # -# # -# where standard options are: required: defaults: # -# -------------------------- # -# # -# -j* jid job id number. ** YES ** . # -# -pr* prog program name. . marc # -# -v* y|n do or do not verify inputs. . yes # -# -q* s|l|v|b|f batch queue name or background, . short # -# foreground. # -# -b* as alternative to option -q* # -# # -# ( batch queues only : # -# -pq* intra queue priority. . . # -# -at DATE/TIME delay start of job. . . # -# format : January,1,1990,12:31 # -# or : today,5pm # -# -cpu* secs job CPU limit . . ) # -# # -# -r* rid restart file job id. . . # -# -si* sid substructure file id. . . # -# -pi* post post file job id. . . # -# -de* did defaults file . no # -# -vf vid viewfactor . no # -# # -# -u* user user subroutine. . . # -# -obj obj user objects or libraries. . . # -# -sa* y|n do or do not save load module. . no # -# -autorst auto restart flag for auto forge . no # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo selects i4 or i8 version # -# default: i4 or via defaults file run_marc_defaults # -# the -mo option will override # -# -mpi selects MPI version # -# each platform has a default MPI version and some # -# have an alternative version. see the include file # -# for the respective platform # -# MPI_DEFAULT defines the default MPI version # -# MPI_OTHER defines versions one can switch to # -# -dcoup for contact decoupling # -# currently not supported # -# -dir directory where the job i/o should take place. # -# defaults to current directory. # -# -sdir directory where scratch files are created # -# defaults to current directory. # -# # -# -alloc only perform memory allocation test, no analysis # -# -list y only list options in the input file, no analysis # -# -fe num set feature number "num" for the run. only one allowed # -# -dytran flag to switch from Dytran to Marc # -# dytran = 0, program will run w/o Marc-Dytran Switch # -# = 1, program will restart Marc after Dytran run # -# >= 2, Not supported yet. # -# currently not supported # -# -ou force analysis to use out-of-core control # -# =0, not used # -# =1, element storage out-of-core # -# -dll run marc using shared library libmarc.so and exe_marc # -# =1, used # -# =2, do not free streaming input memory # -# =3, run with marc input deck # -# -trk run marc for post-tracking # -# # -# where parallel options are: # -# -------------------------- # -# # -# itree, host, and comp options are available for the domain # -# decomposition only. # -# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # -# # -# # -# -nprocd number of domains. # -# defaults to single domain solution. # -# -nprocds number of domains if single input file. # -# defaults to single domain solution. # -# -nps same as -nprocds. # -# -nsolver number of solver tasks for solver types 12 and 13 # -# these are distributed tasks operating via MPI # -# -nthread number of solver threads for solver types 6, 8, and 11 # -# also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. if both specified, nthread option# -# will be used. # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by 6, 8, and 11 # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor nthread specified. # -# -itree message passing tree type for domain decomposition. # -# for debugging purposes; should not normally be used. # -# -host hostfile name for distributed execution on network. # -# defaults to no hostfile, unless jobid.defhost exists. # -# if jobid.defhost exists, only -np(s) necessary # -# -comp* y|n to be used with user routines on a network of # -# incompatible machines. # -# if set to no, a separate executable will be created # -# for each machine on the network. # -# if set to yes, the executable located on the machine # -# from which marc is started will be used on all machines.# -# defaults to no if O/S versions different on machines. # -# # -# -ci y|n copy input files to remote hosts (default: yes) # -# if "yes", input files are automatically copied to # -# remote hosts for a network run if necessary. # -# -cr y|n copy post files from remote hosts (default: yes) # -# if "yes", post files are automatically copied back from # -# remote hosts for a network run if necessary. # -############################################################################## -# set DIR to the directory in which this script is -REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" -DIR=`dirname $REALCOM` -# make sure DIR has an absolute path -case $DIR in - \/*) - ;; - *) - DIR=`pwd`/$DIR - ;; -esac -DIRSCRIPT=$DIR -AWK=awk -ARCH=`uname -a | cut -f 1 -d " "` -# Sun has a bad awk, use nawk instead -if test $ARCH = "SunOS" -then - AWK=nawk -fi -BASENAME=basename -# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists -if test $ARCH = "SunOS" -then - if test -x /usr/ucb/basename - then - BASENAME=/usr/ucb/basename - fi -fi - -# echo command line in the case of ECHO_COMMAND is true -if test "$ECHO_COMMAND" = true ; then - echo command "$0" "$@" -fi - -# -# "mode" selects version, i4 or i8 -# default is i4 -# this can be changed by a file run_marc_defaults -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MODE i8 -# it can also be set by the environmental variable MARC_INTEGER_SIZE -# and by the command line option "-mo" -# -mode= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -f $HOME/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -n "$MARC_INTEGER_SIZE" ; then - mode=$MARC_INTEGER_SIZE -fi -if test -z "$mode" ; then - mode=i4 -fi -case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "error, version mode must be i4 or i8" - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i4 or i8" - echo " " - echo " use -mo i4 or -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - setmode=true - fi - if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - fi - if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -done - -# set to i4 version for 32 bit Linux -if test "`uname -s`" = "Linux"; then - if test "`uname -m`" = "i686"; then - mode=i4 - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -fi - - -. "$DIR/getarch" - -# Change_me -. $MARC_INCLUDE -# - -# -# Dynamically determine the echo syntax -# - -case "`echo '\c'`" in - '\c') - ECHO='echo -n' - ECHOTXT=' ' - ;; - *) - ECHO='echo' - ECHOTXT=' \c' - ;; -esac - -# -# Variables for the MARC environment -# - -PRODUCT="Marc" -EXITMSG=$MARC_TOOLS/MESSAGES -export EXITMSG -FLEXDIR=$DIR/../flexlm/licenses -export FLEXDIR -TIMCHK=3600 -export TIMCHK -BINDIR=$MARC_BIN -export BINDIR -AFMATDAT=$MARC_RUNTIME/AF_flowmat/ -export AFMATDAT -# -# define directory path to global unified material database -# -MATFILE= -export MATFILE - -# -# define memory limit -# first set to MEMLIMIT from include -# -ml option overrules if specified -memlimit=$MEMLIMIT -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -# -if test $MACHINENAME = "HP" -then - SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH - export SHLIB_PATH -fi -# the one for IBM is defined futher down - -LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH -LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH -export LD_LIBRARY_PATH -export LD_LIBRARY64_PATH -export LD_LIBRARYN32_PATH - -atexit() { -kill -15 $$ -# -if test $MPITYPE = "myrinet" -then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi -fi -} - -trap "atexit" 2 - -# -# defaults -# - -prog=marc -exefile=marc -jid= -rid= -pid= -sid= -did= -vid= -user= -usernoext= -objs= -qid=background -cpu= -priority= -att= -trk= -verify=yes -prgsav=no -rmdll=no -cpdll=no -progdll= -pathdll= -error= -nprocd=0 -nprocdddm=1 -nprocdddmprint= -icreated=0 -nprocdarg= -nsolver=0 -nsolverarg=-nsolver -if test $nprocds -then - if test $nprocds -gt 1 - then - nprocdddm=$nprocds - nprocdddmprint=$nprocds - icreated=1 - nprocdarg=-nprocds - fi -fi -nthread=-1 -nauto=0 -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -nthreadprint=0 -itree=0 -iam= -link= -trkrun=0 -DIRJOB=`pwd` -DIRSCR=$DIRJOB -DIRSCRSET= -autoforge=0 -dotdat=.dat -dotdefhost=.defhost -host= -numhost= -mfile= -userhost= -makebdf= -cpinput=yes -cpresults=yes -marcdll=libmarc.$EXT_DLL -# define hostname and strip off extensions (alpha.aaa.com) -thishost=`hostname` -thishost=${thishost%%.*} -compatible=unknown -numfield=1 -justlist= -feature= -mpioption=false -MDSRCLIB=$MARC_LIB/mdsrc.a -# -# check run_marc_defaults file for default MPI setting -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MPI -# -value= -file= -if test -f $DIRSCRIPT/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$DIRSCRIPT/run_marc_defaults - fi -fi -if test -f $HOME/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$HOME/run_marc_defaults - fi -fi -if test -n "$value"; then - MARC_MPITYPE=$value - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - echo " " - echo " error, incorrect option for MARC_MPI" - echo " defined in $file: $MARC_MPITYPE" - echo " valid options: $MPI_DEFAULT $MPI_OTHER" - echo " " - exit - fi - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - fi -fi -# -# -# allow scratch directory to be specified with environmental variable -# MARCSCRATCH -if test $MARCSCRATCH -then - if test -d $MARCSCRATCH - then - DIRSCR=$MARCSCRATCH - else - echo "error, scratch directory '$MARCSCRATCH'" - echo " specified via environmental variable MARCSCRATCH does not exist" - exit - fi -fi -# -############################################################################## -# parse input - arguments always come in pairs # -############################################################################## - -arg=$1 -if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - shift - arg=$1 -fi -while [ -n "$arg" ] -do - shift - value=$1 - case $arg in - -al* | -AL*) - $MARC_BIN/marc -alloc 1 - exit - ;; - -li* | -LI*) - justlist=yes - ;; - -fe* | -FE*) - feature=$value - ;; - -pr* | -PR*) - if test `dirname $value` = '.' - then - prog=`$BASENAME $value .marc` - progdll=`$BASENAME $value` - else - prog=`dirname $value`/`$BASENAME $value .marc` - progdll=`dirname $value`/`$BASENAME $value` - fi - prdir=`dirname $value` - case $prdir in - \/*) - ;; - *) - prog=`pwd`/$prdir/$prog - ;; - esac - ;; - -j* | -J*) - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - ;; - -r* | -R*) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - -si* | -SI*) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - -pi* | -PI*) - if test -f $value.t19 - then - pid=`$BASENAME $value .t19` - else - pid=`$BASENAME $value .t16` - fi - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - -bdf | -BDF) - makebdf=1 - ;; - -de* | -DE*) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - -vf | -VF) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - -u* | -U*) - - user=$value - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - -obj | -OBJ) - objs="$value" - ;; - -q* | -Q*) - qid=$value - ;; - -b* | -B*) - case $value in - y* | Y*) - qid=background - ;; - n* | N*) - qid=foreground - ;; - *) - ;; - esac - ;; - -at | -AT) - att=$value - ;; - -cpu* | -CPU*) - cpu=$value - ;; - -pq | -PQ*) - priority=$value - ;; - -v* | -V*) - verify=$value - ;; - -sa* | -SA*) - prgsav=$value - ;; - -np* | -NP*) - nprocdddm=$value - nprocdddmprint=$value - case $arg in - -nps* | -NPS* | -nprocds* | -NPROCDS*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - case $arg in - -np | -NP | -nprocd | -NPROCD) - icreated=0 - nprocdarg=-nprocd - ;; - esac - ;; - -ns* | -NS*) - nsolver=$value - ;; - -nt* | -NT*) - nthread=$value - ;; - -it* | -IT*) - itree=$value - ;; - -iam | -IAM) - iam=$value - ;; - -au* | -AU*) - nauto=$value - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -me | -ME ) - mesh=$value - ;; - -ml | -ML ) - memlimit=$value - ;; - -mo | -MO ) - ;; - -mpi | -MPI ) - mpioption=true - MARC_MPITYPE=$value - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - fi - fi - ;; - -dir* | -DIR*) - DIRJOB=$value - case $DIRJOB in - \/*) - ;; - *) - DIRJOB=`pwd`/$DIRJOB - ;; - esac - if test -z "$DIRSCRSET" - then - DIRSCR=$DIRJOB - fi - ;; - -sd* | -SD*) - DIRSCR=$value - DIRSCRSET=yes - case $DIRSCR in - \/*) - ;; - *) - DIRSCR=`pwd`/$DIRSCR - ;; - esac - ;; - -ho* | -HO*) - host=$value - ;; - -co* | -CO*) - compatible=$value - ;; - -ci* | -CI*) - cpinput=$value - ;; - -cr* | -CR*) - cpresults=$value - ;; - *) - error="$error -$arg: invalid option" - break - ;; - esac - case $value in - -*) - error="$error -$arg: invalid name $value" - break - ;; - esac - shift - arg=$1 - if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - shift - arg=$1 - fi -done -argc=`expr $# % 2` -if test $argc -eq 1 -then -# -# odd number of arguments -# - error="$error -argument list incomplete" -fi - -if test $nprocdddm -gt 0 -then -nprocd=$nprocdddm -fi - -if test $nsolver -gt 0 -then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi -fi - -if test $nthread -eq -1 -then -nthread=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nthread -lt 0 -then -nthread=0 -fi - -nthreadprint=$nthread -if test $nthreadprint -eq 0 -then -nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi -fi - -nthread=$nthreadprint - - - -if test $nprocd -gt 1; then - if test -f $jid$dotdefhost; then - if test "$host" = ""; then - host=$jid$dotdefhost - fi - fi - if test -f hostfile_qa_$nprocd; then - if test "$host" = ""; then - host=hostfile_qa_$nprocd - fi - fi -fi - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then - dotdat=.inp - fi - - if test "$progdll"; then - /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll - rmdll=yes - pathdll=yes - progdll=${progdll}_$marcdll - else - progdll=$marcdll - fi - - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - pathdll=yes - fi -fi - -############################################################################## -# check parameter validity # -############################################################################## - -while test forever; do - -# -# check for input file existence -# -if test $nprocdddm -gt 1 -a $icreated -eq 0; then - if test ! -f $DIRJID/1$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/1$jid$dotdat not accessible" - fi - fi -else - if test ! -f $DIRJID/$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/$jid$dotdat not accessible" - fi - fi -fi - if test $nprocd -gt 1; then - if test "$host" ; then - if test ! -f $host; then - error="$error -host name file $host not accessible" - fi - fi - fi - -# -# check if the job is already running in the background -# -if test -f $DIRJOB/$jid.pid; then - error="$error -job is already running (the file $jid.pid exists)" -fi - -# -# if the program name is other than marc, then -# assume that this is a program in the users local directory -# - -bd=$MARC_BIN/ - -case $prog in - marc | MARC | $exefile) - program=$exefile - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - if test ! -f $user - then - error="$error -user subroutine file $user not accessible" - fi - fi - if test "$objs" - then - missingobjs= - for o in $objs - do - if test ! -f "$o" - then - if test -z "$missingobjs" - then - missingobjs="$o" - else - missingobjs="$missingobjs $o" - fi - fi - done - if test -n "$missingobjs" - then - error="$error -user object/library file(s) $missingobjs not accessible" - fi - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$vid" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRVID/1$vid.vfs - then - error="$error -view factor file $DIRVID/1$vid.vfs not accessible" - fi - else - if test ! -f $DIRVID/$vid.vfs - then - error="$error -view factor file $DIRVID/$vid.vfs not accessible" - fi - fi - fi - if $mpioption - then - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" - fi - fi - ;; - *) - program=$prog.marc - case $prog in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - error="$error -program option may not be used with user subroutine" - fi - if test "$objs" - then - error="$error -program option may not be used with user objects or libraries" - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$nauto" - then - if test $nauto -gt 2 - then - error="$error -incorrect option for auto restart " - fi - fi - if test "$ndcoup" - then - if test $ndcoup -gt 3 - then - error="$error -incorrect option for contact decoupling " - fi - fi - if test "$ndytran" - then - if test $ndytran -gt 1 - then - error="$error -incorrect option for Marc-Dytran Switch " - fi - fi - if $mpioption - then - if test ! -x $MARC_BIN/$exefile - then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE " - fi - fi - ;; -esac - -############################################################################## -# check argument integrity # -############################################################################## - -if test "$jid" -then - : -else - error="$error -job id required" -fi - -if test $nprocd -gt 1 -then - if test $nauto -gt 0 - then - error="$error -cannot run DDM job with auto restart (-au) option " - fi -fi -case $qid in - S* | s*) - qid=short - ;; - L* | l*) - qid=long - ;; - V* | v*) - qid=verylong - ;; - B* | b*) - qid=background - ;; - F* | f*) - qid=foreground - ;; - A* | a*) - qid=at - ;; - *) - error="$error -bad value for queue_id option" - ;; -esac - -case $prgsav in - N* | n*) - prgsav=no - ;; - Y* | y*) - prgsav=yes - ;; - *) - error="$error -bad value for save option" - ;; -esac - -case $verify in - N* | n*) - verify=no - ;; - Y* | y*) - verify=yes - ;; - *) - error="$error -bad value for verify option" - ;; -esac - -case $nprocdddm in - -* ) - error="$error -bad value for nprocd option" - ;; -esac - -case $nthread in - -* ) - error="$error -bad value for nthread option" - ;; -esac - -case $itree in - -* ) - error="$error -bad value for itree option" - ;; -esac -case $iam in - -* ) - error="$error -bad value for iam option" - ;; -esac -case $compatible in - N* | n*) - compatible=no - ;; - Y* | y*) - compatible=yes - ;; - unknown) - ;; - *) - error="$error -bad value for comp option" - ;; -esac -case $cpinput in - N* | n*) - cpinput=no - ;; - Y* | y*) - cpinput=yes - ;; - *) - error="$error -bad value for copy input option" - ;; -esac -case $cpresults in - N* | n*) - cpresults=no - ;; - Y* | y*) - cpresults=yes - ;; - *) - error="$error -bad value for copy results option" - ;; -esac - -# -# check for external file to run -# -if test -f $MARC_TOOLS/run_marc_check -then - . $MARC_TOOLS/run_marc_check -fi - -# -# pick up version data from bin/VERSION if it exists -# -if test -f $MARC_BIN/VERSION; then - ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` - if test -n "$ppp" ;then - PRODUCT=$ppp - fi - ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` - if test -n "$ppp" ;then - REVISION=", Build $ppp" - fi -fi -############################################################################## -# interact with the user to get the required information to run marc or # -# other marc system program # -############################################################################## - -deletelog=yes -if test $qid = background -a $verify = no -then -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto " > $jid.log -deletelog=no -fi -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto" - - -case $qid in - s* | S* | l* | L* | v* | V* ) - echo \ -"Queue priority : $priority -Queue CPU limit : $cpu -Queue start time : $att" - ;; -# * ) -# echo \ -#" " -# ;; -esac - -if test "$error" -then - if test $verify = yes - then - $ECHO "$error - -Please correct or quit(correct,quit,): $ECHOTXT" - error= - read answer - case $answer in - q* | Q*) - answer=quit - ;; - *) - answer=correct - ;; - esac - else - $ECHO "$error - $ECHOTXT" - echo " " - if test "$deletelog" = no - then - $ECHO "$error - $ECHOTXT" >> $jid.log - echo " " >> $jid.log - fi - answer=quit - fi -else - if test $verify = yes - then - $ECHO " -Are these parameters correct (yes,no,quit,)? $ECHOTXT" - read answer - case $answer in - q* | Q*) - answer=quit - ;; - y* | Y*) - answer=yes - ;; - *) - answer=no - ;; - esac - else - answer=yes - fi -fi - -case $answer in - no | correct) - -############################################################################## -# prompt for each value # -############################################################################## - - $ECHO " -Program name ($prog)? $ECHOTXT" - read value - if test "$value" - then - prog=$value - fi - $ECHO "Job ID ($jid)? $ECHOTXT" - read value - if test "$value" - then - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - fi - $ECHO "User subroutine name ($user)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - user= - ;; - *) - user=$value - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - esac - fi - $ECHO "User objects or libraries ($objs)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - objs= - ;; - *) - objs="$value" - ;; - esac - fi - $ECHO "Restart File Job ID ($rid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - rid= - ;; - *) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - esac - fi - $ECHO "Substructure File ID ($sid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - sid= - ;; - *) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - esac - fi - $ECHO "Post File Job ID ($pid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - pid= - ;; - *) - pid=$value - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - esac - fi - $ECHO "Defaults File ID ($did)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - did= - ;; - *) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - esac - fi - $ECHO "View Factor File ID ($vid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - vid= - ;; - *) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - esac - fi - $ECHO "Save generated module ($prgsav)? $ECHOTXT" - read value - if test "$value" - then - prgsav=$value - fi - $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" - read value - if test "$value" - then - nprocdddm=$value - nprocdddmprint=$value - fi - $ECHO "Run on ($nthread) threads ? $ECHOTXT" - read value - if test "$value" - then - nthread=$value - fi - $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" - read value - if test "$value" - then - nsolver=$value - fi -# - if test $nprocdddm -gt 0 - then - nprocd=$nprocdddm - fi - if test $nsolver -gt 0 - then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi - fi - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - nthreadprint=$nthread - if test $nthreadprint -eq 0 - then - nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi - fi -# - if test $nprocd -gt 1 - then - $ECHO "Message passing type ($itree)? $ECHOTXT" - read value - if test "$value" - then - itree=$value - fi - $ECHO "Host file name ($host)? $ECHOTXT" - read value - if test "$value" - then - host=$value - fi - if test $nprocdddm -gt 1 - then - $ECHO "Single input file? $ECHOTXT" - read value - case $value in - y* | Y*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" - read value - if test "$value" - then - compatible=$value - fi - $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" - read value - if test "$value" - then - cpinput=$value - fi - $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" - read value - if test "$value" - then - cpresults=$value - fi - fi - fi - $ECHO "Run the job in the queue ($qid)? $ECHOTXT" - read value - if test "$value" - then - qid=$value - fi - case $qid in - s* | S* | l* | L* | v* | V* ) - $ECHO "Queue priority ($priority)? $ECHOTXT" - read value - if test "$value" - then - priority=$value - fi - $ECHO "Job starts at ($att)? $ECHOTXT" - read value - if test "$value" - then - att=$value - fi - $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" - read value - if test "$value" - then - cpu=$value - fi - ;; - * ) - ;; - esac - $ECHO "Auto Restart option ($nauto)? $ECHOTXT" - read value - if test "$value" - then - nauto=$value - fi - $ECHO "Run directory ($DIRJOB)? $ECHOTXT" - read value - if test "$value" - then - DIRJOB=$value - DIRSCR=$DIRJOB - fi - $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" - read value - if test "$value" - then - DIRSCR=$value - fi - ;; - quit) - exit 1 - ;; - *) - break - ;; - -esac - - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - -done - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - pathdll=yes - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - fi - - if test "$pathdll"; then -# -# reset share lib path -# - if test $MACHINENAME = "HP" - then - SHLIB_PATH=$DIRJOB:$SHLIB_PATH - export SHLIB_PATH - fi - if test $MACHINENAME = "IBM" - then - LIBPATH=$DIRJOB:$LIBPATH - export LIBPATH - fi -# - LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH - LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH - LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH - export LD_LIBRARY_PATH - export LD_LIBRARY64_PATH - export LD_LIBRARYN32_PATH - fi -fi -# end of dllrun>0 - - -if test $program = $exefile -o $program = $prog.marc -then - -# delete the old .log file unless we run in the background -if test "$deletelog" = yes -then - /bin/rm $jid.log 2>/dev/null -else - echo - echo running the job in the background, see $jid.log - echo -fi - -# -# check if this is an autoforge or rezoning or radiation job -# -if test $nprocd -eq 1 -then - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` - if test "$line" - then - autoforge=1 - fi -fi -# -# check that jobname for restarted run is not the same -# as restart file basename -# -if test "$rid" -then - if test "$jid" = "$rid" - then - echo " " - echo "ERROR: job name of current run is the same as job name" - echo " of the restarted job" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "ERROR: job name of current run is the same as job name" >> $jid.log - echo " of the restarted job" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi -fi - -# -# user objects/libraries used -# - - if test "$objs" - then - program="$DIRJOB/$jid.marc" - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# user subroutine used -# -# add DAMASK options for linking - DAMASK="" - - - if test "$user" - then - program=$usernoext.marc - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# Special case for IBM using POE but not an SP machine -# in this case we always need a host file, also for serial jobs. -# -if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP -then - MP_HOSTFILE=${jid}.host - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $nprocd -gt 1 - then - numdom=$nprocd - while test $numdom -gt 0 - do - hostname -s >> $MP_HOSTFILE - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - else - hostname -s > $MP_HOSTFILE - fi -fi -# -# check correctness of host file; fix for user sub -# - if test $nprocd -gt 1 - then - -# construct the path name to the executable (execpath) - execpath=$MARC_BIN/$exefile - usersub=0 - if test $program = $prog.marc - then - execpath=$prog.marc - usersub=1 - fi - if test "$objs" - then - execpath="$DIRJOB/$jid.marc" - usersub=1 - fi - if test "$user" - then - execpath=$usernoext.marc - usersub=1 - fi - export execpath - execname=`$BASENAME $execpath` - - if test "$host" - then - userhost=$host - case $userhost in - \/* | \.\/*) - ;; - *) - userhost=`pwd`/$userhost - ;; - esac - -# check that the number of processes specified in the hostfile is -# equal to nprocd specified by -nprocd. - numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` - if test $nprocd -ne $numproc - then - echo " " - echo "error, the number of processes specified in the host file" - echo "must be equal to the number of processes given by -nprocd/-nsolver" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, the number of processes specified in the host file" >> $jid.log - echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - -# check for Myrinet that the number of processes per host is -# less than number of available user ports, 5 -# .gmpi directory must exist in user's home directory -# and must have write permission from remote hosts - if test $MPITYPE = "myrinet" - then - numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` - if test $numproc -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes specified " - echo "in the hostfile must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes specified " >> $jid.log - echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - if test ! -d ~/.gmpi - then - echo " " - echo "error, for Myrinet a .gmpi directory must exist " - echo "under the user's home directory" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log - echo "under the user's home directory" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - homedir=`echo ~` - for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - echo " " - echo "error, for Myrinet a shared .gmpi directory must exist " - echo "under the user's home directory " - echo "with remote write permission" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log - echo "under the user's home directory " >> $jid.log - echo "with remote write permission" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - /bin/rm tmp.$$ - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - fi - fi - done - fi - fi - -# construct the host file $jid.host which is used by mpirun -# skip lines starting with # and only consider lines with more than -# one word in them. Note that the hostfile given to this script -# has two columns: the host name and the number of shared processes -# to run on this host. mpirun wants the number of _other_ -# processes to run in addition to the one being run on the machine -# on which the job is started. hence the $2-1 for fnr == 1. - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then -# HPMPI or HP hardware MPI - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ - -v mpihpspecial="$MPIHPSPECIAL" \ -'{if ( NF > 0) {\ - fnr++ ; \ - printf("-h %s -np %s",$1,$2); \ - printf(" %s",mpihpspecial); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ - if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ - }\ - }' > $jid.host -# end HPMPI or HP hardware MPI - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then -# IBM using hardware MPI (POE) - MP_HOSTFILE=$jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host -# end IBM using hardware MPI (POE) -# for Intel MPI, need to create a machinefile for DMP - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then -# Intel MPI - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - /bin/cp $host $jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Intel MPI for DMP -# for Solaris HPC 7.1, need to create a machinefile for DMP - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then -# Solaris HPC 7.1 - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Solaris HPC 7.1 for DMP -# for Myrinet, construct a configuration file in ~/.gmpi -# this must be readable by each process -# format is (hostname) (port number) for each process - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - grep -v '^#' $host | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ -{if ( NF > 0 ) \ - for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ -}' >> ~/.gmpi/$jid.host - else -# this is for mpich-1.2.5 and later, using the -pg option -# format: host nproc executable user arguments -# the arguments are added later - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s %s\n",path,user);\ - if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ - }\ - }' > $jid.host - fi -# end Myrinet - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then -# Compaq MPI via Memory Channel - grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host -# end Compaq MPI - else -# MPICH - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ - }\ - }' > $jid.host - fi -# define the variable host and host_filt -# host_filt is used for loops over hosts -# for Myrinet we need to use a filtered variant of userhost -# for others we can use $host - if test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - host=~/.gmpi/$jid.host - host_filt=$jid.host_tMp - grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt - else - host=$jid.host - host_filt=$host - fi - else - host=$jid.host - host_filt=$host - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - host_filt=$jid.mfile - fi - fi -# figure out if the machines in the hostfile are nfs mounted -# or distributed and set the variable "dirstatus" accordingly. -# only perform the check if user subroutine is used -# or a user subroutine executable is used - - numfield=1 - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - numfield=2 - fi - DIR1=$DIRJOB - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - counter=0 - echo " " - echo "checking if local or shared directories for host" - if test "$deletelog" = no - then - echo "checking if local or shared directories for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - dirstatus[$counter]="shared" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - dirstatus[$counter]="local" - /bin/rm tmp.$$ - else - if test ! -f $jid.$$ - then - dirstatus[$counter]="local" - $RSH $i /bin/rm $DIR1/$jid.$$ - else - /bin/rm $jid.$$ - fi - fi - if test -f tmp.$$ - then - /bin/rm tmp.$$ - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - echo " ${dirstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${dirstatus[$counter]}" >> $jid.log - fi - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - fi - -# figure out if this is a compatible set of machines -# unless explicitly specified with flag -comp -# only perform the check if user subroutine is used -# or a user subroutine executable is used -# Myrinet does not support heterogeneous - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - if test $compatible = "unknown" - then - thisname=$ARCH - compatible=yes - counter=0 - echo "checking if machines are compatible for host" - if test "$deletelog" = no - then - echo "checking if machines are compatible for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]="yes" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - othername=`$RSH $i uname -a | cut -f 1 -d " "` - if test $thisname != $othername - then - compatible=no - compstatus[$counter]="no" - fi - fi - echo " ${compstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${compstatus[$counter]}" >> $jid.log - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - else - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]=$compatible - fi - done - if test $compatible = "no" - then - echo "all machines assumed incompatible" - if test "$deletelog" = no - then - echo "all machines assumed incompatible" >> $jid.log - fi - else - echo "all machines compatible" - if test "$deletelog" = no - then - echo "all machines compatible" >> $jid.log - fi - fi - fi -# error out if user objects or libraries are used on incompatible machines - if test "$compatible" = "no" -a -n "$objs" - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" - if test "$deletelog" = no - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log - fi - exit 1 - fi -# modify new host file if NFS mounted heterogeneous machine - doit= - if test $program = $prog.marc - then - doit=yes - fi - if test "$user" - then - doit=yes - fi - if test "$doit" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - $AWK -v hst=$i '{fnr++ ; \ -if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ -printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} - /bin/mv $jid.host{$$} $jid.host - host=$jid.host - fi - fi - done - fi - fi # if test $program = $prog.marc -o $user -o $obj - - else # if test $host - # assume shared memory machine if no hostfile given and - # MPITYPE is set to mpich or Myrinet - # check for Myrinet that the total number of processes is - # less than number of available user ports, 5 - if test $MPITYPE = "mpich" -o $MPITYPE = "scali" - then - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - host=$jid.host - elif test $MPITYPE = "myrinet" - then - if test $nprocd -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes " - echo "must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes " >> $jid.log - echo "must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - echo `hostname` $nprocd | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ - {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ -' >> ~/.gmpi/$jid.host - host=~/.gmpi/$jid.host - else - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - - fi - fi # if test myrinet - - fi # if test $host - - fi # if test $nprocd -gt 1 - -fi # if test $program = $exefile -o $program = $prog.marc - -############################################################################## -# construct run stream (Marc only) # -############################################################################## - -# set maximum message length for ddm to a large number -# for vendor provided mpi -if test $itree -eq 0 -a $MPITYPE = hardware -then - itree=100000000 - if test $MACHINENAME = SGI - then - itree=100000001 - fi -fi -if test $itree -eq 0 -a $MPITYPE = hpmpi -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = myrinet -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = nec -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = scali -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = intelmpi -then - itree=100000000 -fi -if test $nprocdddm -lt 2 -then - nprocdarg= -else - nprocdarg="$nprocdarg $nprocdddm" -fi -if test $nsolver -eq 0 -then - nsolverarg= -else - nsolverarg="$nsolverarg $nsolver" -fi -if test $nprocdddm -lt 2 -a $nsolver -eq 0 -then -nprocd=0 -fi -if test $nprocd -gt 0 -then - if test "$host" - then - if test -z "$RUN_JOB2" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then - RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - else - RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" - RUN_JOB=" -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - fi - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - numhost=`uniq $jid.mfile | wc -l` - if test "$INTELMPI_VERSION" = "HYDRA" - then - RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n $numhost -r $RSH -f $jid.mfile - RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" - fi - -# intelmpi uses configfile. format: -# -host host1 -n n1 executable marcargs -# one such line per host -# collect the marcargs in RUN_JOB and construct the config file later -# collect the run stream in RUN_JOB_TMP - RUN_JOB="-jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - - - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then - RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - fi - if test "$userhost" - then - RUN_JOB="$RUN_JOB -mhost $userhost" - fi - if test $MPITYPE = "scali" - then -# set default working directory to /tmp to allow -# different directory names - SCAMPI_WORKING_DIRECTORY=/tmp - export SCAMPI_WORKING_DIRECTORY - fi - else - if test -z "$RUN_JOB1" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - RUNNPROCD=$nprocd - if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" - then - RUNNPROCD= - MP_PROCS=$nprocd - export MP_PROCS - fi - if test $MPITYPE = "myrinet" - then - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread -dirjob $DIRJOB " - fi - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - touch $jid.hosts - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n 1 -f $jid.hosts - fi -# /bin/rm $jid.hosts 2> /dev/null - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread -dirjob $DIRJOB " - fi - fi -else - if test $nauto -gt 0 -o $ndcoup -gt 0 - then - RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ - -nthread $nthread -dirjob $DIRJOB " - else -# this is for a serial job without auto restart: - RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ --nthread $nthread -dirjob $DIRJOB " - fi -fi -if test "$rid" -then - RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" -fi -if test "$pid" -then - RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" -fi -if test "$sid" -then - RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" -fi -if test "$did" -then - RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" -fi -if test "$vid" -then - RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" -fi -if test $nauto -gt 0 -then - RUN_JOB="$RUN_JOB -autorst $nauto " -fi -if test $ndcoup -gt 0 -then - RUN_JOB="$RUN_JOB -dcoup $ndcoup " -fi -if test $ndytran -gt 0 -then - RUN_JOB="$RUN_JOB -dytran $ndytran " -fi -if test $mesh -gt 0 -then - RUN_JOB="$RUN_JOB -me $mesh " -fi -if test $noutcore -gt 0 -then - RUN_JOB="$RUN_JOB -outcore $noutcore " -fi -if test "$dllrun" -gt 0 -then - RUN_JOB="$RUN_JOB -dll $dllrun " -fi -if test "$trkrun" -gt 0 -then - RUN_JOB="$RUN_JOB -trk $trkrun " -fi -if test "$iam" -then - RUN_JOB="$RUN_JOB -iam $iam " -fi -if test "$justlist" -then - RUN_JOB="$RUN_JOB -list 1 " -fi -if test "$feature" -then - RUN_JOB="$RUN_JOB -feature $feature " -fi -if test "$memlimit" -ne 0 -then - RUN_JOB="$RUN_JOB -ml $memlimit " -fi -if test "$cpinput" -then - RUN_JOB="$RUN_JOB -ci $cpinput " -fi -if test "$cpresults" -then - RUN_JOB="$RUN_JOB -cr $cpresults " -fi -if test "$DIRSCR" != "$DIRJOB" -then - RUN_JOB="$RUN_JOB -dirscr $DIRSCR" -else - DIRSCR=$DIRJOB -fi -if test "$makebdf" -then - RUN_JOB="$RUN_JOB -bdf $makebdf " -fi -if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" -then - # append $RUN_JOB to all lines of the host file - # and set RUN_JOB - $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ - /bin/mv $host.$$ $host - RUN_JOB=$RUN_JOB_TMP -fi -if test $MPITYPE = "intelmpi" -a "$host" -then - # construct config file, append $RUN_JOB to all lines of the config file - # and set RUN_JOB - if test "$INTELMPI_VERSION" = "HYDRA" - then - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - else - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-host %s -n %s",$1,$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - fi - RUN_JOB=$RUN_JOB_TMP -fi -echo " " -echo "Final run stream value" -echo " RUNJOB="$RUN_JOB -if test "$deletelog" = no -then -echo " " >> $jid.log -echo "Final run stream value" >> $jid.log -echo " RUNJOB="$RUN_JOB >> $jid.log -fi - - -############################################################################## -# run marc using valgrind # -############################################################################## -#RUN_JOB="valgrind $RUN_JOB" -#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" -############################################################################## - - -############################################################################## -# run the requested program in a queue # -############################################################################## - -if test "$deletelog" = yes -then - echo - date -else - echo >> $jid.log - date >> $jid.log -fi -if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] -then - -/bin/rm -f $jid.runmarcscript - - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - userobj=$usernoext.o - fi - cat > $jid.runmarcscript << END4 - if test "$user" - then - if test $MACHINENAME = "CRAY" - then - $DFORTHIGH $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTHIGH $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } -END4 -else - prgsav=yes -fi -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# - -cat >> $jid.runmarcscript << END5 - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -# first remove all .out files and incremental restart files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null - /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null -fi - -if test $nprocdddm -gt 1 -then - $RUN_JOB 2>>$jid.log -else - $RUN_JOB 2>>$jid.log -fi - -if test $dllrun -eq 0; then - if test $prgsav = no - then - /bin/rm -f $bd$program 2>/dev/null - fi -else - if test $cpdll = yes; then - filename=`basename $usersubname .f` - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes - then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -END5 - - -# Submit to marc batch queue -# -if [ $qid = at ] -then -QUENAME=at -SUBMCMD= -else -# -# Submit to qsub queue -# -QUENAME=qsub -SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" -if test "$priority" -then - SUBMCMD=$SUBMCMD" -p $priority" -fi -if test "$att" -then - SUBMCMD=$SUBMCMD" -a $att" -fi -if test "$cpu" -then - SUBMCMD=$SUBMCMD" -lt $cpu" -fi - -fi -echo $QUENAME $SUBMCMD -#cat $jid.runmarcscript -$QUENAME $SUBMCMD < $jid.runmarcscript - -/bin/rm -f $jid.runmarcscript - -############################################################################## -# run the requested program in the background # -############################################################################## - -else -if test $qid = background -then - -# -# first remove all old .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi -# -# compile user subroutine if present -# -( -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_h $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - echo " $PRODUCT Exit number 3" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTHIGH $user || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTHIGH $user -o $userobj || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - echo " $PRODUCT Exit number 3" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc - -# - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -$RUN_JOB & - -marcpid=$! -echo $marcpid > $DIRJOB/$jid.pid -wait $marcpid - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=`basename $usersubname .f` - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -) 1>>$jid.log 2>&1 & - - -############################################################################## -# run the requested program in the foreground # -############################################################################## - -else - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_h $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTHIGH $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTHIGH $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi -# first remove all .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi - -$RUN_JOB - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - if test "$host" - then - mpdcleanup -a -f $jid.mfile - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.mfile 2> /dev/null - else - mpdcleanup -a -f $jid.hosts - /bin/rm $jid.hosts 2> /dev/null - fi - fi - fi -fi - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=`basename $usersubname .f` - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi - - -fi -fi diff --git a/installation/mods_MarcMentat/2011/Marc_tools/run_damask_hmp b/installation/mods_MarcMentat/2011/Marc_tools/run_damask_hmp deleted file mode 100644 index de1ef519a..000000000 --- a/installation/mods_MarcMentat/2011/Marc_tools/run_damask_hmp +++ /dev/null @@ -1,3624 +0,0 @@ -#!/bin/ksh -############################################################################## -# # -# run_marc - run a marc job # -# ------------------------- # -# # -# usage: run_marc -j jid { options } # -# # -# where standard options are: required: defaults: # -# -------------------------- # -# # -# -j* jid job id number. ** YES ** . # -# -pr* prog program name. . marc # -# -v* y|n do or do not verify inputs. . yes # -# -q* s|l|v|b|f batch queue name or background, . short # -# foreground. # -# -b* as alternative to option -q* # -# # -# ( batch queues only : # -# -pq* intra queue priority. . . # -# -at DATE/TIME delay start of job. . . # -# format : January,1,1990,12:31 # -# or : today,5pm # -# -cpu* secs job CPU limit . . ) # -# # -# -r* rid restart file job id. . . # -# -si* sid substructure file id. . . # -# -pi* post post file job id. . . # -# -de* did defaults file . no # -# -vf vid viewfactor . no # -# # -# -u* user user subroutine. . . # -# -obj obj user objects or libraries. . . # -# -sa* y|n do or do not save load module. . no # -# -autorst auto restart flag for auto forge . no # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo selects i4 or i8 version # -# default: i4 or via defaults file run_marc_defaults # -# the -mo option will override # -# -mpi selects MPI version # -# each platform has a default MPI version and some # -# have an alternative version. see the include file # -# for the respective platform # -# MPI_DEFAULT defines the default MPI version # -# MPI_OTHER defines versions one can switch to # -# -dcoup for contact decoupling # -# currently not supported # -# -dir directory where the job i/o should take place. # -# defaults to current directory. # -# -sdir directory where scratch files are created # -# defaults to current directory. # -# # -# -alloc only perform memory allocation test, no analysis # -# -list y only list options in the input file, no analysis # -# -fe num set feature number "num" for the run. only one allowed # -# -dytran flag to switch from Dytran to Marc # -# dytran = 0, program will run w/o Marc-Dytran Switch # -# = 1, program will restart Marc after Dytran run # -# >= 2, Not supported yet. # -# currently not supported # -# -ou force analysis to use out-of-core control # -# =0, not used # -# =1, element storage out-of-core # -# -dll run marc using shared library libmarc.so and exe_marc # -# =1, used # -# =2, do not free streaming input memory # -# =3, run with marc input deck # -# -trk run marc for post-tracking # -# # -# where parallel options are: # -# -------------------------- # -# # -# itree, host, and comp options are available for the domain # -# decomposition only. # -# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # -# # -# # -# -nprocd number of domains. # -# defaults to single domain solution. # -# -nprocds number of domains if single input file. # -# defaults to single domain solution. # -# -nps same as -nprocds. # -# -nsolver number of solver tasks for solver types 12 and 13 # -# these are distributed tasks operating via MPI # -# -nthread number of solver threads for solver types 6, 8, and 11 # -# also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. if both specified, nthread option# -# will be used. # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by 6, 8, and 11 # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor nthread specified. # -# -itree message passing tree type for domain decomposition. # -# for debugging purposes; should not normally be used. # -# -host hostfile name for distributed execution on network. # -# defaults to no hostfile, unless jobid.defhost exists. # -# if jobid.defhost exists, only -np(s) necessary # -# -comp* y|n to be used with user routines on a network of # -# incompatible machines. # -# if set to no, a separate executable will be created # -# for each machine on the network. # -# if set to yes, the executable located on the machine # -# from which marc is started will be used on all machines.# -# defaults to no if O/S versions different on machines. # -# # -# -ci y|n copy input files to remote hosts (default: yes) # -# if "yes", input files are automatically copied to # -# remote hosts for a network run if necessary. # -# -cr y|n copy post files from remote hosts (default: yes) # -# if "yes", post files are automatically copied back from # -# remote hosts for a network run if necessary. # -############################################################################## -# set DIR to the directory in which this script is -REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" -DIR=`dirname $REALCOM` -# make sure DIR has an absolute path -case $DIR in - \/*) - ;; - *) - DIR=`pwd`/$DIR - ;; -esac -DIRSCRIPT=$DIR -AWK=awk -ARCH=`uname -a | cut -f 1 -d " "` -# Sun has a bad awk, use nawk instead -if test $ARCH = "SunOS" -then - AWK=nawk -fi -BASENAME=basename -# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists -if test $ARCH = "SunOS" -then - if test -x /usr/ucb/basename - then - BASENAME=/usr/ucb/basename - fi -fi - -# echo command line in the case of ECHO_COMMAND is true -if test "$ECHO_COMMAND" = true ; then - echo command "$0" "$@" -fi - -# -# "mode" selects version, i4 or i8 -# default is i4 -# this can be changed by a file run_marc_defaults -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MODE i8 -# it can also be set by the environmental variable MARC_INTEGER_SIZE -# and by the command line option "-mo" -# -mode= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -f $HOME/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -n "$MARC_INTEGER_SIZE" ; then - mode=$MARC_INTEGER_SIZE -fi -if test -z "$mode" ; then - mode=i4 -fi -case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "error, version mode must be i4 or i8" - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i4 or i8" - echo " " - echo " use -mo i4 or -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - setmode=true - fi - if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - fi - if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -done - -# set to i4 version for 32 bit Linux -if test "`uname -s`" = "Linux"; then - if test "`uname -m`" = "i686"; then - mode=i4 - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -fi - - -. "$DIR/getarch" - -# Change_me -. $MARC_INCLUDE -# - -# -# Dynamically determine the echo syntax -# - -case "`echo '\c'`" in - '\c') - ECHO='echo -n' - ECHOTXT=' ' - ;; - *) - ECHO='echo' - ECHOTXT=' \c' - ;; -esac - -# -# Variables for the MARC environment -# - -PRODUCT="Marc" -EXITMSG=$MARC_TOOLS/MESSAGES -export EXITMSG -FLEXDIR=$DIR/../flexlm/licenses -export FLEXDIR -TIMCHK=3600 -export TIMCHK -BINDIR=$MARC_BIN -export BINDIR -AFMATDAT=$MARC_RUNTIME/AF_flowmat/ -export AFMATDAT -# -# define directory path to global unified material database -# -MATFILE= -export MATFILE - -# -# define memory limit -# first set to MEMLIMIT from include -# -ml option overrules if specified -memlimit=$MEMLIMIT -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -# -if test $MACHINENAME = "HP" -then - SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH - export SHLIB_PATH -fi -# the one for IBM is defined futher down - -LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH -LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH -export LD_LIBRARY_PATH -export LD_LIBRARY64_PATH -export LD_LIBRARYN32_PATH - -atexit() { -kill -15 $$ -# -if test $MPITYPE = "myrinet" -then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi -fi -} - -trap "atexit" 2 - -# -# defaults -# - -prog=marc -exefile=marc -jid= -rid= -pid= -sid= -did= -vid= -user= -usernoext= -objs= -qid=background -cpu= -priority= -att= -trk= -verify=yes -prgsav=no -rmdll=no -cpdll=no -progdll= -pathdll= -error= -nprocd=0 -nprocdddm=1 -nprocdddmprint= -icreated=0 -nprocdarg= -nsolver=0 -nsolverarg=-nsolver -if test $nprocds -then - if test $nprocds -gt 1 - then - nprocdddm=$nprocds - nprocdddmprint=$nprocds - icreated=1 - nprocdarg=-nprocds - fi -fi -nthread=-1 -nauto=0 -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -nthreadprint=0 -itree=0 -iam= -link= -trkrun=0 -DIRJOB=`pwd` -DIRSCR=$DIRJOB -DIRSCRSET= -autoforge=0 -dotdat=.dat -dotdefhost=.defhost -host= -numhost= -mfile= -userhost= -makebdf= -cpinput=yes -cpresults=yes -marcdll=libmarc.$EXT_DLL -# define hostname and strip off extensions (alpha.aaa.com) -thishost=`hostname` -thishost=${thishost%%.*} -compatible=unknown -numfield=1 -justlist= -feature= -mpioption=false -MDSRCLIB=$MARC_LIB/mdsrc.a -# -# check run_marc_defaults file for default MPI setting -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MPI -# -value= -file= -if test -f $DIRSCRIPT/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$DIRSCRIPT/run_marc_defaults - fi -fi -if test -f $HOME/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$HOME/run_marc_defaults - fi -fi -if test -n "$value"; then - MARC_MPITYPE=$value - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - echo " " - echo " error, incorrect option for MARC_MPI" - echo " defined in $file: $MARC_MPITYPE" - echo " valid options: $MPI_DEFAULT $MPI_OTHER" - echo " " - exit - fi - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - fi -fi -# -# -# allow scratch directory to be specified with environmental variable -# MARCSCRATCH -if test $MARCSCRATCH -then - if test -d $MARCSCRATCH - then - DIRSCR=$MARCSCRATCH - else - echo "error, scratch directory '$MARCSCRATCH'" - echo " specified via environmental variable MARCSCRATCH does not exist" - exit - fi -fi -# -############################################################################## -# parse input - arguments always come in pairs # -############################################################################## - -arg=$1 -if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - shift - arg=$1 -fi -while [ -n "$arg" ] -do - shift - value=$1 - case $arg in - -al* | -AL*) - $MARC_BIN/marc -alloc 1 - exit - ;; - -li* | -LI*) - justlist=yes - ;; - -fe* | -FE*) - feature=$value - ;; - -pr* | -PR*) - if test `dirname $value` = '.' - then - prog=`$BASENAME $value .marc` - progdll=`$BASENAME $value` - else - prog=`dirname $value`/`$BASENAME $value .marc` - progdll=`dirname $value`/`$BASENAME $value` - fi - prdir=`dirname $value` - case $prdir in - \/*) - ;; - *) - prog=`pwd`/$prdir/$prog - ;; - esac - ;; - -j* | -J*) - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - ;; - -r* | -R*) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - -si* | -SI*) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - -pi* | -PI*) - if test -f $value.t19 - then - pid=`$BASENAME $value .t19` - else - pid=`$BASENAME $value .t16` - fi - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - -bdf | -BDF) - makebdf=1 - ;; - -de* | -DE*) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - -vf | -VF) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - -u* | -U*) - - user=$value - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - -obj | -OBJ) - objs="$value" - ;; - -q* | -Q*) - qid=$value - ;; - -b* | -B*) - case $value in - y* | Y*) - qid=background - ;; - n* | N*) - qid=foreground - ;; - *) - ;; - esac - ;; - -at | -AT) - att=$value - ;; - -cpu* | -CPU*) - cpu=$value - ;; - -pq | -PQ*) - priority=$value - ;; - -v* | -V*) - verify=$value - ;; - -sa* | -SA*) - prgsav=$value - ;; - -np* | -NP*) - nprocdddm=$value - nprocdddmprint=$value - case $arg in - -nps* | -NPS* | -nprocds* | -NPROCDS*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - case $arg in - -np | -NP | -nprocd | -NPROCD) - icreated=0 - nprocdarg=-nprocd - ;; - esac - ;; - -ns* | -NS*) - nsolver=$value - ;; - -nt* | -NT*) - nthread=$value - ;; - -it* | -IT*) - itree=$value - ;; - -iam | -IAM) - iam=$value - ;; - -au* | -AU*) - nauto=$value - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -me | -ME ) - mesh=$value - ;; - -ml | -ML ) - memlimit=$value - ;; - -mo | -MO ) - ;; - -mpi | -MPI ) - mpioption=true - MARC_MPITYPE=$value - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - fi - fi - ;; - -dir* | -DIR*) - DIRJOB=$value - case $DIRJOB in - \/*) - ;; - *) - DIRJOB=`pwd`/$DIRJOB - ;; - esac - if test -z "$DIRSCRSET" - then - DIRSCR=$DIRJOB - fi - ;; - -sd* | -SD*) - DIRSCR=$value - DIRSCRSET=yes - case $DIRSCR in - \/*) - ;; - *) - DIRSCR=`pwd`/$DIRSCR - ;; - esac - ;; - -ho* | -HO*) - host=$value - ;; - -co* | -CO*) - compatible=$value - ;; - -ci* | -CI*) - cpinput=$value - ;; - -cr* | -CR*) - cpresults=$value - ;; - *) - error="$error -$arg: invalid option" - break - ;; - esac - case $value in - -*) - error="$error -$arg: invalid name $value" - break - ;; - esac - shift - arg=$1 - if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - shift - arg=$1 - fi -done -argc=`expr $# % 2` -if test $argc -eq 1 -then -# -# odd number of arguments -# - error="$error -argument list incomplete" -fi - -if test $nprocdddm -gt 0 -then -nprocd=$nprocdddm -fi - -if test $nsolver -gt 0 -then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi -fi - -if test $nthread -eq -1 -then -nthread=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nthread -lt 0 -then -nthread=0 -fi - -nthreadprint=$nthread -if test $nthreadprint -eq 0 -then -nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi -fi - -nthread=$nthreadprint - - - -if test $nprocd -gt 1; then - if test -f $jid$dotdefhost; then - if test "$host" = ""; then - host=$jid$dotdefhost - fi - fi - if test -f hostfile_qa_$nprocd; then - if test "$host" = ""; then - host=hostfile_qa_$nprocd - fi - fi -fi - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then - dotdat=.inp - fi - - if test "$progdll"; then - /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll - rmdll=yes - pathdll=yes - progdll=${progdll}_$marcdll - else - progdll=$marcdll - fi - - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - pathdll=yes - fi -fi - -############################################################################## -# check parameter validity # -############################################################################## - -while test forever; do - -# -# check for input file existence -# -if test $nprocdddm -gt 1 -a $icreated -eq 0; then - if test ! -f $DIRJID/1$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/1$jid$dotdat not accessible" - fi - fi -else - if test ! -f $DIRJID/$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/$jid$dotdat not accessible" - fi - fi -fi - if test $nprocd -gt 1; then - if test "$host" ; then - if test ! -f $host; then - error="$error -host name file $host not accessible" - fi - fi - fi - -# -# check if the job is already running in the background -# -if test -f $DIRJOB/$jid.pid; then - error="$error -job is already running (the file $jid.pid exists)" -fi - -# -# if the program name is other than marc, then -# assume that this is a program in the users local directory -# - -bd=$MARC_BIN/ - -case $prog in - marc | MARC | $exefile) - program=$exefile - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - if test ! -f $user - then - error="$error -user subroutine file $user not accessible" - fi - fi - if test "$objs" - then - missingobjs= - for o in $objs - do - if test ! -f "$o" - then - if test -z "$missingobjs" - then - missingobjs="$o" - else - missingobjs="$missingobjs $o" - fi - fi - done - if test -n "$missingobjs" - then - error="$error -user object/library file(s) $missingobjs not accessible" - fi - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$vid" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRVID/1$vid.vfs - then - error="$error -view factor file $DIRVID/1$vid.vfs not accessible" - fi - else - if test ! -f $DIRVID/$vid.vfs - then - error="$error -view factor file $DIRVID/$vid.vfs not accessible" - fi - fi - fi - if $mpioption - then - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" - fi - fi - ;; - *) - program=$prog.marc - case $prog in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - error="$error -program option may not be used with user subroutine" - fi - if test "$objs" - then - error="$error -program option may not be used with user objects or libraries" - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$nauto" - then - if test $nauto -gt 2 - then - error="$error -incorrect option for auto restart " - fi - fi - if test "$ndcoup" - then - if test $ndcoup -gt 3 - then - error="$error -incorrect option for contact decoupling " - fi - fi - if test "$ndytran" - then - if test $ndytran -gt 1 - then - error="$error -incorrect option for Marc-Dytran Switch " - fi - fi - if $mpioption - then - if test ! -x $MARC_BIN/$exefile - then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE " - fi - fi - ;; -esac - -############################################################################## -# check argument integrity # -############################################################################## - -if test "$jid" -then - : -else - error="$error -job id required" -fi - -if test $nprocd -gt 1 -then - if test $nauto -gt 0 - then - error="$error -cannot run DDM job with auto restart (-au) option " - fi -fi -case $qid in - S* | s*) - qid=short - ;; - L* | l*) - qid=long - ;; - V* | v*) - qid=verylong - ;; - B* | b*) - qid=background - ;; - F* | f*) - qid=foreground - ;; - A* | a*) - qid=at - ;; - *) - error="$error -bad value for queue_id option" - ;; -esac - -case $prgsav in - N* | n*) - prgsav=no - ;; - Y* | y*) - prgsav=yes - ;; - *) - error="$error -bad value for save option" - ;; -esac - -case $verify in - N* | n*) - verify=no - ;; - Y* | y*) - verify=yes - ;; - *) - error="$error -bad value for verify option" - ;; -esac - -case $nprocdddm in - -* ) - error="$error -bad value for nprocd option" - ;; -esac - -case $nthread in - -* ) - error="$error -bad value for nthread option" - ;; -esac - -case $itree in - -* ) - error="$error -bad value for itree option" - ;; -esac -case $iam in - -* ) - error="$error -bad value for iam option" - ;; -esac -case $compatible in - N* | n*) - compatible=no - ;; - Y* | y*) - compatible=yes - ;; - unknown) - ;; - *) - error="$error -bad value for comp option" - ;; -esac -case $cpinput in - N* | n*) - cpinput=no - ;; - Y* | y*) - cpinput=yes - ;; - *) - error="$error -bad value for copy input option" - ;; -esac -case $cpresults in - N* | n*) - cpresults=no - ;; - Y* | y*) - cpresults=yes - ;; - *) - error="$error -bad value for copy results option" - ;; -esac - -# -# check for external file to run -# -if test -f $MARC_TOOLS/run_marc_check -then - . $MARC_TOOLS/run_marc_check -fi - -# -# pick up version data from bin/VERSION if it exists -# -if test -f $MARC_BIN/VERSION; then - ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` - if test -n "$ppp" ;then - PRODUCT=$ppp - fi - ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` - if test -n "$ppp" ;then - REVISION=", Build $ppp" - fi -fi -############################################################################## -# interact with the user to get the required information to run marc or # -# other marc system program # -############################################################################## - -deletelog=yes -if test $qid = background -a $verify = no -then -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto " > $jid.log -deletelog=no -fi -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto" - - -case $qid in - s* | S* | l* | L* | v* | V* ) - echo \ -"Queue priority : $priority -Queue CPU limit : $cpu -Queue start time : $att" - ;; -# * ) -# echo \ -#" " -# ;; -esac - -if test "$error" -then - if test $verify = yes - then - $ECHO "$error - -Please correct or quit(correct,quit,): $ECHOTXT" - error= - read answer - case $answer in - q* | Q*) - answer=quit - ;; - *) - answer=correct - ;; - esac - else - $ECHO "$error - $ECHOTXT" - echo " " - if test "$deletelog" = no - then - $ECHO "$error - $ECHOTXT" >> $jid.log - echo " " >> $jid.log - fi - answer=quit - fi -else - if test $verify = yes - then - $ECHO " -Are these parameters correct (yes,no,quit,)? $ECHOTXT" - read answer - case $answer in - q* | Q*) - answer=quit - ;; - y* | Y*) - answer=yes - ;; - *) - answer=no - ;; - esac - else - answer=yes - fi -fi - -case $answer in - no | correct) - -############################################################################## -# prompt for each value # -############################################################################## - - $ECHO " -Program name ($prog)? $ECHOTXT" - read value - if test "$value" - then - prog=$value - fi - $ECHO "Job ID ($jid)? $ECHOTXT" - read value - if test "$value" - then - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - fi - $ECHO "User subroutine name ($user)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - user= - ;; - *) - user=$value - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - esac - fi - $ECHO "User objects or libraries ($objs)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - objs= - ;; - *) - objs="$value" - ;; - esac - fi - $ECHO "Restart File Job ID ($rid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - rid= - ;; - *) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - esac - fi - $ECHO "Substructure File ID ($sid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - sid= - ;; - *) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - esac - fi - $ECHO "Post File Job ID ($pid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - pid= - ;; - *) - pid=$value - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - esac - fi - $ECHO "Defaults File ID ($did)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - did= - ;; - *) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - esac - fi - $ECHO "View Factor File ID ($vid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - vid= - ;; - *) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - esac - fi - $ECHO "Save generated module ($prgsav)? $ECHOTXT" - read value - if test "$value" - then - prgsav=$value - fi - $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" - read value - if test "$value" - then - nprocdddm=$value - nprocdddmprint=$value - fi - $ECHO "Run on ($nthread) threads ? $ECHOTXT" - read value - if test "$value" - then - nthread=$value - fi - $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" - read value - if test "$value" - then - nsolver=$value - fi -# - if test $nprocdddm -gt 0 - then - nprocd=$nprocdddm - fi - if test $nsolver -gt 0 - then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi - fi - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - nthreadprint=$nthread - if test $nthreadprint -eq 0 - then - nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi - fi -# - if test $nprocd -gt 1 - then - $ECHO "Message passing type ($itree)? $ECHOTXT" - read value - if test "$value" - then - itree=$value - fi - $ECHO "Host file name ($host)? $ECHOTXT" - read value - if test "$value" - then - host=$value - fi - if test $nprocdddm -gt 1 - then - $ECHO "Single input file? $ECHOTXT" - read value - case $value in - y* | Y*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" - read value - if test "$value" - then - compatible=$value - fi - $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" - read value - if test "$value" - then - cpinput=$value - fi - $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" - read value - if test "$value" - then - cpresults=$value - fi - fi - fi - $ECHO "Run the job in the queue ($qid)? $ECHOTXT" - read value - if test "$value" - then - qid=$value - fi - case $qid in - s* | S* | l* | L* | v* | V* ) - $ECHO "Queue priority ($priority)? $ECHOTXT" - read value - if test "$value" - then - priority=$value - fi - $ECHO "Job starts at ($att)? $ECHOTXT" - read value - if test "$value" - then - att=$value - fi - $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" - read value - if test "$value" - then - cpu=$value - fi - ;; - * ) - ;; - esac - $ECHO "Auto Restart option ($nauto)? $ECHOTXT" - read value - if test "$value" - then - nauto=$value - fi - $ECHO "Run directory ($DIRJOB)? $ECHOTXT" - read value - if test "$value" - then - DIRJOB=$value - DIRSCR=$DIRJOB - fi - $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" - read value - if test "$value" - then - DIRSCR=$value - fi - ;; - quit) - exit 1 - ;; - *) - break - ;; - -esac - - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - -done - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - pathdll=yes - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - fi - - if test "$pathdll"; then -# -# reset share lib path -# - if test $MACHINENAME = "HP" - then - SHLIB_PATH=$DIRJOB:$SHLIB_PATH - export SHLIB_PATH - fi - if test $MACHINENAME = "IBM" - then - LIBPATH=$DIRJOB:$LIBPATH - export LIBPATH - fi -# - LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH - LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH - LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH - export LD_LIBRARY_PATH - export LD_LIBRARY64_PATH - export LD_LIBRARYN32_PATH - fi -fi -# end of dllrun>0 - - -if test $program = $exefile -o $program = $prog.marc -then - -# delete the old .log file unless we run in the background -if test "$deletelog" = yes -then - /bin/rm $jid.log 2>/dev/null -else - echo - echo running the job in the background, see $jid.log - echo -fi - -# -# check if this is an autoforge or rezoning or radiation job -# -if test $nprocd -eq 1 -then - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` - if test "$line" - then - autoforge=1 - fi -fi -# -# check that jobname for restarted run is not the same -# as restart file basename -# -if test "$rid" -then - if test "$jid" = "$rid" - then - echo " " - echo "ERROR: job name of current run is the same as job name" - echo " of the restarted job" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "ERROR: job name of current run is the same as job name" >> $jid.log - echo " of the restarted job" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi -fi - -# -# user objects/libraries used -# - - if test "$objs" - then - program="$DIRJOB/$jid.marc" - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# user subroutine used -# -# add DAMASK options for linking - DAMASK="" - - if test "$user" - then - program=$usernoext.marc - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# Special case for IBM using POE but not an SP machine -# in this case we always need a host file, also for serial jobs. -# -if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP -then - MP_HOSTFILE=${jid}.host - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $nprocd -gt 1 - then - numdom=$nprocd - while test $numdom -gt 0 - do - hostname -s >> $MP_HOSTFILE - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - else - hostname -s > $MP_HOSTFILE - fi -fi -# -# check correctness of host file; fix for user sub -# - if test $nprocd -gt 1 - then - -# construct the path name to the executable (execpath) - execpath=$MARC_BIN/$exefile - usersub=0 - if test $program = $prog.marc - then - execpath=$prog.marc - usersub=1 - fi - if test "$objs" - then - execpath="$DIRJOB/$jid.marc" - usersub=1 - fi - if test "$user" - then - execpath=$usernoext.marc - usersub=1 - fi - export execpath - execname=`$BASENAME $execpath` - - if test "$host" - then - userhost=$host - case $userhost in - \/* | \.\/*) - ;; - *) - userhost=`pwd`/$userhost - ;; - esac - -# check that the number of processes specified in the hostfile is -# equal to nprocd specified by -nprocd. - numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` - if test $nprocd -ne $numproc - then - echo " " - echo "error, the number of processes specified in the host file" - echo "must be equal to the number of processes given by -nprocd/-nsolver" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, the number of processes specified in the host file" >> $jid.log - echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - -# check for Myrinet that the number of processes per host is -# less than number of available user ports, 5 -# .gmpi directory must exist in user's home directory -# and must have write permission from remote hosts - if test $MPITYPE = "myrinet" - then - numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` - if test $numproc -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes specified " - echo "in the hostfile must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes specified " >> $jid.log - echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - if test ! -d ~/.gmpi - then - echo " " - echo "error, for Myrinet a .gmpi directory must exist " - echo "under the user's home directory" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log - echo "under the user's home directory" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - homedir=`echo ~` - for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - echo " " - echo "error, for Myrinet a shared .gmpi directory must exist " - echo "under the user's home directory " - echo "with remote write permission" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log - echo "under the user's home directory " >> $jid.log - echo "with remote write permission" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - /bin/rm tmp.$$ - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - fi - fi - done - fi - fi - -# construct the host file $jid.host which is used by mpirun -# skip lines starting with # and only consider lines with more than -# one word in them. Note that the hostfile given to this script -# has two columns: the host name and the number of shared processes -# to run on this host. mpirun wants the number of _other_ -# processes to run in addition to the one being run on the machine -# on which the job is started. hence the $2-1 for fnr == 1. - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then -# HPMPI or HP hardware MPI - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ - -v mpihpspecial="$MPIHPSPECIAL" \ -'{if ( NF > 0) {\ - fnr++ ; \ - printf("-h %s -np %s",$1,$2); \ - printf(" %s",mpihpspecial); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ - if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ - }\ - }' > $jid.host -# end HPMPI or HP hardware MPI - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then -# IBM using hardware MPI (POE) - MP_HOSTFILE=$jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host -# end IBM using hardware MPI (POE) -# for Intel MPI, need to create a machinefile for DMP - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then -# Intel MPI - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - /bin/cp $host $jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Intel MPI for DMP -# for Solaris HPC 7.1, need to create a machinefile for DMP - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then -# Solaris HPC 7.1 - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Solaris HPC 7.1 for DMP -# for Myrinet, construct a configuration file in ~/.gmpi -# this must be readable by each process -# format is (hostname) (port number) for each process - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - grep -v '^#' $host | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ -{if ( NF > 0 ) \ - for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ -}' >> ~/.gmpi/$jid.host - else -# this is for mpich-1.2.5 and later, using the -pg option -# format: host nproc executable user arguments -# the arguments are added later - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s %s\n",path,user);\ - if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ - }\ - }' > $jid.host - fi -# end Myrinet - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then -# Compaq MPI via Memory Channel - grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host -# end Compaq MPI - else -# MPICH - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ - }\ - }' > $jid.host - fi -# define the variable host and host_filt -# host_filt is used for loops over hosts -# for Myrinet we need to use a filtered variant of userhost -# for others we can use $host - if test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - host=~/.gmpi/$jid.host - host_filt=$jid.host_tMp - grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt - else - host=$jid.host - host_filt=$host - fi - else - host=$jid.host - host_filt=$host - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - host_filt=$jid.mfile - fi - fi -# figure out if the machines in the hostfile are nfs mounted -# or distributed and set the variable "dirstatus" accordingly. -# only perform the check if user subroutine is used -# or a user subroutine executable is used - - numfield=1 - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - numfield=2 - fi - DIR1=$DIRJOB - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - counter=0 - echo " " - echo "checking if local or shared directories for host" - if test "$deletelog" = no - then - echo "checking if local or shared directories for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - dirstatus[$counter]="shared" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - dirstatus[$counter]="local" - /bin/rm tmp.$$ - else - if test ! -f $jid.$$ - then - dirstatus[$counter]="local" - $RSH $i /bin/rm $DIR1/$jid.$$ - else - /bin/rm $jid.$$ - fi - fi - if test -f tmp.$$ - then - /bin/rm tmp.$$ - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - echo " ${dirstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${dirstatus[$counter]}" >> $jid.log - fi - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - fi - -# figure out if this is a compatible set of machines -# unless explicitly specified with flag -comp -# only perform the check if user subroutine is used -# or a user subroutine executable is used -# Myrinet does not support heterogeneous - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - if test $compatible = "unknown" - then - thisname=$ARCH - compatible=yes - counter=0 - echo "checking if machines are compatible for host" - if test "$deletelog" = no - then - echo "checking if machines are compatible for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]="yes" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - othername=`$RSH $i uname -a | cut -f 1 -d " "` - if test $thisname != $othername - then - compatible=no - compstatus[$counter]="no" - fi - fi - echo " ${compstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${compstatus[$counter]}" >> $jid.log - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - else - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]=$compatible - fi - done - if test $compatible = "no" - then - echo "all machines assumed incompatible" - if test "$deletelog" = no - then - echo "all machines assumed incompatible" >> $jid.log - fi - else - echo "all machines compatible" - if test "$deletelog" = no - then - echo "all machines compatible" >> $jid.log - fi - fi - fi -# error out if user objects or libraries are used on incompatible machines - if test "$compatible" = "no" -a -n "$objs" - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" - if test "$deletelog" = no - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log - fi - exit 1 - fi -# modify new host file if NFS mounted heterogeneous machine - doit= - if test $program = $prog.marc - then - doit=yes - fi - if test "$user" - then - doit=yes - fi - if test "$doit" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - $AWK -v hst=$i '{fnr++ ; \ -if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ -printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} - /bin/mv $jid.host{$$} $jid.host - host=$jid.host - fi - fi - done - fi - fi # if test $program = $prog.marc -o $user -o $obj - - else # if test $host - # assume shared memory machine if no hostfile given and - # MPITYPE is set to mpich or Myrinet - # check for Myrinet that the total number of processes is - # less than number of available user ports, 5 - if test $MPITYPE = "mpich" -o $MPITYPE = "scali" - then - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - host=$jid.host - elif test $MPITYPE = "myrinet" - then - if test $nprocd -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes " - echo "must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes " >> $jid.log - echo "must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - echo `hostname` $nprocd | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ - {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ -' >> ~/.gmpi/$jid.host - host=~/.gmpi/$jid.host - else - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - - fi - fi # if test myrinet - - fi # if test $host - - fi # if test $nprocd -gt 1 - -fi # if test $program = $exefile -o $program = $prog.marc - -############################################################################## -# construct run stream (Marc only) # -############################################################################## - -# set maximum message length for ddm to a large number -# for vendor provided mpi -if test $itree -eq 0 -a $MPITYPE = hardware -then - itree=100000000 - if test $MACHINENAME = SGI - then - itree=100000001 - fi -fi -if test $itree -eq 0 -a $MPITYPE = hpmpi -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = myrinet -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = nec -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = scali -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = intelmpi -then - itree=100000000 -fi -if test $nprocdddm -lt 2 -then - nprocdarg= -else - nprocdarg="$nprocdarg $nprocdddm" -fi -if test $nsolver -eq 0 -then - nsolverarg= -else - nsolverarg="$nsolverarg $nsolver" -fi -if test $nprocdddm -lt 2 -a $nsolver -eq 0 -then -nprocd=0 -fi -if test $nprocd -gt 0 -then - if test "$host" - then - if test -z "$RUN_JOB2" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then - RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - else - RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" - RUN_JOB=" -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - fi - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - numhost=`uniq $jid.mfile | wc -l` - if test "$INTELMPI_VERSION" = "HYDRA" - then - RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n $numhost -r $RSH -f $jid.mfile - RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" - fi - -# intelmpi uses configfile. format: -# -host host1 -n n1 executable marcargs -# one such line per host -# collect the marcargs in RUN_JOB and construct the config file later -# collect the run stream in RUN_JOB_TMP - RUN_JOB="-jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - - - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then - RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - fi - if test "$userhost" - then - RUN_JOB="$RUN_JOB -mhost $userhost" - fi - if test $MPITYPE = "scali" - then -# set default working directory to /tmp to allow -# different directory names - SCAMPI_WORKING_DIRECTORY=/tmp - export SCAMPI_WORKING_DIRECTORY - fi - else - if test -z "$RUN_JOB1" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - RUNNPROCD=$nprocd - if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" - then - RUNNPROCD= - MP_PROCS=$nprocd - export MP_PROCS - fi - if test $MPITYPE = "myrinet" - then - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread -dirjob $DIRJOB " - fi - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - touch $jid.hosts - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n 1 -f $jid.hosts - fi -# /bin/rm $jid.hosts 2> /dev/null - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread -dirjob $DIRJOB " - fi - fi -else - if test $nauto -gt 0 -o $ndcoup -gt 0 - then - RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ - -nthread $nthread -dirjob $DIRJOB " - else -# this is for a serial job without auto restart: - RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ --nthread $nthread -dirjob $DIRJOB " - fi -fi -if test "$rid" -then - RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" -fi -if test "$pid" -then - RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" -fi -if test "$sid" -then - RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" -fi -if test "$did" -then - RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" -fi -if test "$vid" -then - RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" -fi -if test $nauto -gt 0 -then - RUN_JOB="$RUN_JOB -autorst $nauto " -fi -if test $ndcoup -gt 0 -then - RUN_JOB="$RUN_JOB -dcoup $ndcoup " -fi -if test $ndytran -gt 0 -then - RUN_JOB="$RUN_JOB -dytran $ndytran " -fi -if test $mesh -gt 0 -then - RUN_JOB="$RUN_JOB -me $mesh " -fi -if test $noutcore -gt 0 -then - RUN_JOB="$RUN_JOB -outcore $noutcore " -fi -if test "$dllrun" -gt 0 -then - RUN_JOB="$RUN_JOB -dll $dllrun " -fi -if test "$trkrun" -gt 0 -then - RUN_JOB="$RUN_JOB -trk $trkrun " -fi -if test "$iam" -then - RUN_JOB="$RUN_JOB -iam $iam " -fi -if test "$justlist" -then - RUN_JOB="$RUN_JOB -list 1 " -fi -if test "$feature" -then - RUN_JOB="$RUN_JOB -feature $feature " -fi -if test "$memlimit" -ne 0 -then - RUN_JOB="$RUN_JOB -ml $memlimit " -fi -if test "$cpinput" -then - RUN_JOB="$RUN_JOB -ci $cpinput " -fi -if test "$cpresults" -then - RUN_JOB="$RUN_JOB -cr $cpresults " -fi -if test "$DIRSCR" != "$DIRJOB" -then - RUN_JOB="$RUN_JOB -dirscr $DIRSCR" -else - DIRSCR=$DIRJOB -fi -if test "$makebdf" -then - RUN_JOB="$RUN_JOB -bdf $makebdf " -fi -if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" -then - # append $RUN_JOB to all lines of the host file - # and set RUN_JOB - $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ - /bin/mv $host.$$ $host - RUN_JOB=$RUN_JOB_TMP -fi -if test $MPITYPE = "intelmpi" -a "$host" -then - # construct config file, append $RUN_JOB to all lines of the config file - # and set RUN_JOB - if test "$INTELMPI_VERSION" = "HYDRA" - then - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - else - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-host %s -n %s",$1,$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - fi - RUN_JOB=$RUN_JOB_TMP -fi -echo " " -echo "Final run stream value" -echo " RUNJOB="$RUN_JOB -if test "$deletelog" = no -then -echo " " >> $jid.log -echo "Final run stream value" >> $jid.log -echo " RUNJOB="$RUN_JOB >> $jid.log -fi - - -############################################################################## -# run marc using valgrind # -############################################################################## -#RUN_JOB="valgrind $RUN_JOB" -#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" -############################################################################## - - -############################################################################## -# run the requested program in a queue # -############################################################################## - -if test "$deletelog" = yes -then - echo - date -else - echo >> $jid.log - date >> $jid.log -fi -if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] -then - -/bin/rm -f $jid.runmarcscript - - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - userobj=$usernoext.o - fi - cat > $jid.runmarcscript << END4 - if test "$user" - then - if test $MACHINENAME = "CRAY" - then - $DFORTHIGHMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTHIGHMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } -END4 -else - prgsav=yes -fi -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# - -cat >> $jid.runmarcscript << END5 - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -# first remove all .out files and incremental restart files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null - /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null -fi - -if test $nprocdddm -gt 1 -then - $RUN_JOB 2>>$jid.log -else - $RUN_JOB 2>>$jid.log -fi - -if test $dllrun -eq 0; then - if test $prgsav = no - then - /bin/rm -f $bd$program 2>/dev/null - fi -else - if test $cpdll = yes; then - filename=`basename $usersubname .f` - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes - then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -END5 - - -# Submit to marc batch queue -# -if [ $qid = at ] -then -QUENAME=at -SUBMCMD= -else -# -# Submit to qsub queue -# -QUENAME=qsub -SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" -if test "$priority" -then - SUBMCMD=$SUBMCMD" -p $priority" -fi -if test "$att" -then - SUBMCMD=$SUBMCMD" -a $att" -fi -if test "$cpu" -then - SUBMCMD=$SUBMCMD" -lt $cpu" -fi - -fi -echo $QUENAME $SUBMCMD -#cat $jid.runmarcscript -$QUENAME $SUBMCMD < $jid.runmarcscript - -/bin/rm -f $jid.runmarcscript - -############################################################################## -# run the requested program in the background # -############################################################################## - -else -if test $qid = background -then - -# -# first remove all old .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi -# -# compile user subroutine if present -# -( -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_hmp $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - echo " $PRODUCT Exit number 3" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTHIGHMP $user || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTHIGHMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - echo " $PRODUCT Exit number 3" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc - -# - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -$RUN_JOB & - -marcpid=$! -echo $marcpid > $DIRJOB/$jid.pid -wait $marcpid - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=`basename $usersubname .f` - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -) 1>>$jid.log 2>&1 & - - -############################################################################## -# run the requested program in the foreground # -############################################################################## - -else - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_hmp $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTHIGHMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTHIGHMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi -# first remove all .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi - -$RUN_JOB - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - if test "$host" - then - mpdcleanup -a -f $jid.mfile - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.mfile 2> /dev/null - else - mpdcleanup -a -f $jid.hosts - /bin/rm $jid.hosts 2> /dev/null - fi - fi - fi -fi - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=`basename $usersubname .f` - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi - - -fi -fi diff --git a/installation/mods_MarcMentat/2011/Marc_tools/run_damask_l b/installation/mods_MarcMentat/2011/Marc_tools/run_damask_l deleted file mode 100644 index 6afe0819d..000000000 --- a/installation/mods_MarcMentat/2011/Marc_tools/run_damask_l +++ /dev/null @@ -1,3624 +0,0 @@ -#!/bin/ksh -############################################################################## -# # -# run_marc - run a marc job # -# ------------------------- # -# # -# usage: run_marc -j jid { options } # -# # -# where standard options are: required: defaults: # -# -------------------------- # -# # -# -j* jid job id number. ** YES ** . # -# -pr* prog program name. . marc # -# -v* y|n do or do not verify inputs. . yes # -# -q* s|l|v|b|f batch queue name or background, . short # -# foreground. # -# -b* as alternative to option -q* # -# # -# ( batch queues only : # -# -pq* intra queue priority. . . # -# -at DATE/TIME delay start of job. . . # -# format : January,1,1990,12:31 # -# or : today,5pm # -# -cpu* secs job CPU limit . . ) # -# # -# -r* rid restart file job id. . . # -# -si* sid substructure file id. . . # -# -pi* post post file job id. . . # -# -de* did defaults file . no # -# -vf vid viewfactor . no # -# # -# -u* user user subroutine. . . # -# -obj obj user objects or libraries. . . # -# -sa* y|n do or do not save load module. . no # -# -autorst auto restart flag for auto forge . no # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo selects i4 or i8 version # -# default: i4 or via defaults file run_marc_defaults # -# the -mo option will override # -# -mpi selects MPI version # -# each platform has a default MPI version and some # -# have an alternative version. see the include file # -# for the respective platform # -# MPI_DEFAULT defines the default MPI version # -# MPI_OTHER defines versions one can switch to # -# -dcoup for contact decoupling # -# currently not supported # -# -dir directory where the job i/o should take place. # -# defaults to current directory. # -# -sdir directory where scratch files are created # -# defaults to current directory. # -# # -# -alloc only perform memory allocation test, no analysis # -# -list y only list options in the input file, no analysis # -# -fe num set feature number "num" for the run. only one allowed # -# -dytran flag to switch from Dytran to Marc # -# dytran = 0, program will run w/o Marc-Dytran Switch # -# = 1, program will restart Marc after Dytran run # -# >= 2, Not supported yet. # -# currently not supported # -# -ou force analysis to use out-of-core control # -# =0, not used # -# =1, element storage out-of-core # -# -dll run marc using shared library libmarc.so and exe_marc # -# =1, used # -# =2, do not free streaming input memory # -# =3, run with marc input deck # -# -trk run marc for post-tracking # -# # -# where parallel options are: # -# -------------------------- # -# # -# itree, host, and comp options are available for the domain # -# decomposition only. # -# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # -# # -# # -# -nprocd number of domains. # -# defaults to single domain solution. # -# -nprocds number of domains if single input file. # -# defaults to single domain solution. # -# -nps same as -nprocds. # -# -nsolver number of solver tasks for solver types 12 and 13 # -# these are distributed tasks operating via MPI # -# -nthread number of solver threads for solver types 6, 8, and 11 # -# also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. if both specified, nthread option# -# will be used. # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by 6, 8, and 11 # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor nthread specified. # -# -itree message passing tree type for domain decomposition. # -# for debugging purposes; should not normally be used. # -# -host hostfile name for distributed execution on network. # -# defaults to no hostfile, unless jobid.defhost exists. # -# if jobid.defhost exists, only -np(s) necessary # -# -comp* y|n to be used with user routines on a network of # -# incompatible machines. # -# if set to no, a separate executable will be created # -# for each machine on the network. # -# if set to yes, the executable located on the machine # -# from which marc is started will be used on all machines.# -# defaults to no if O/S versions different on machines. # -# # -# -ci y|n copy input files to remote hosts (default: yes) # -# if "yes", input files are automatically copied to # -# remote hosts for a network run if necessary. # -# -cr y|n copy post files from remote hosts (default: yes) # -# if "yes", post files are automatically copied back from # -# remote hosts for a network run if necessary. # -############################################################################## -# set DIR to the directory in which this script is -REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" -DIR=`dirname $REALCOM` -# make sure DIR has an absolute path -case $DIR in - \/*) - ;; - *) - DIR=`pwd`/$DIR - ;; -esac -DIRSCRIPT=$DIR -AWK=awk -ARCH=`uname -a | cut -f 1 -d " "` -# Sun has a bad awk, use nawk instead -if test $ARCH = "SunOS" -then - AWK=nawk -fi -BASENAME=basename -# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists -if test $ARCH = "SunOS" -then - if test -x /usr/ucb/basename - then - BASENAME=/usr/ucb/basename - fi -fi - -# echo command line in the case of ECHO_COMMAND is true -if test "$ECHO_COMMAND" = true ; then - echo command "$0" "$@" -fi - -# -# "mode" selects version, i4 or i8 -# default is i4 -# this can be changed by a file run_marc_defaults -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MODE i8 -# it can also be set by the environmental variable MARC_INTEGER_SIZE -# and by the command line option "-mo" -# -mode= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -f $HOME/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -n "$MARC_INTEGER_SIZE" ; then - mode=$MARC_INTEGER_SIZE -fi -if test -z "$mode" ; then - mode=i4 -fi -case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "error, version mode must be i4 or i8" - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i4 or i8" - echo " " - echo " use -mo i4 or -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - setmode=true - fi - if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - fi - if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -done - -# set to i4 version for 32 bit Linux -if test "`uname -s`" = "Linux"; then - if test "`uname -m`" = "i686"; then - mode=i4 - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -fi - - -. "$DIR/getarch" - -# Change_me -. $MARC_INCLUDE -# - -# -# Dynamically determine the echo syntax -# - -case "`echo '\c'`" in - '\c') - ECHO='echo -n' - ECHOTXT=' ' - ;; - *) - ECHO='echo' - ECHOTXT=' \c' - ;; -esac - -# -# Variables for the MARC environment -# - -PRODUCT="Marc" -EXITMSG=$MARC_TOOLS/MESSAGES -export EXITMSG -FLEXDIR=$DIR/../flexlm/licenses -export FLEXDIR -TIMCHK=3600 -export TIMCHK -BINDIR=$MARC_BIN -export BINDIR -AFMATDAT=$MARC_RUNTIME/AF_flowmat/ -export AFMATDAT -# -# define directory path to global unified material database -# -MATFILE= -export MATFILE - -# -# define memory limit -# first set to MEMLIMIT from include -# -ml option overrules if specified -memlimit=$MEMLIMIT -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -# -if test $MACHINENAME = "HP" -then - SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH - export SHLIB_PATH -fi -# the one for IBM is defined futher down - -LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH -LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH -export LD_LIBRARY_PATH -export LD_LIBRARY64_PATH -export LD_LIBRARYN32_PATH - -atexit() { -kill -15 $$ -# -if test $MPITYPE = "myrinet" -then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi -fi -} - -trap "atexit" 2 - -# -# defaults -# - -prog=marc -exefile=marc -jid= -rid= -pid= -sid= -did= -vid= -user= -usernoext= -objs= -qid=background -cpu= -priority= -att= -trk= -verify=yes -prgsav=no -rmdll=no -cpdll=no -progdll= -pathdll= -error= -nprocd=0 -nprocdddm=1 -nprocdddmprint= -icreated=0 -nprocdarg= -nsolver=0 -nsolverarg=-nsolver -if test $nprocds -then - if test $nprocds -gt 1 - then - nprocdddm=$nprocds - nprocdddmprint=$nprocds - icreated=1 - nprocdarg=-nprocds - fi -fi -nthread=-1 -nauto=0 -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -nthreadprint=0 -itree=0 -iam= -link= -trkrun=0 -DIRJOB=`pwd` -DIRSCR=$DIRJOB -DIRSCRSET= -autoforge=0 -dotdat=.dat -dotdefhost=.defhost -host= -numhost= -mfile= -userhost= -makebdf= -cpinput=yes -cpresults=yes -marcdll=libmarc.$EXT_DLL -# define hostname and strip off extensions (alpha.aaa.com) -thishost=`hostname` -thishost=${thishost%%.*} -compatible=unknown -numfield=1 -justlist= -feature= -mpioption=false -MDSRCLIB=$MARC_LIB/mdsrc.a -# -# check run_marc_defaults file for default MPI setting -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MPI -# -value= -file= -if test -f $DIRSCRIPT/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$DIRSCRIPT/run_marc_defaults - fi -fi -if test -f $HOME/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$HOME/run_marc_defaults - fi -fi -if test -n "$value"; then - MARC_MPITYPE=$value - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - echo " " - echo " error, incorrect option for MARC_MPI" - echo " defined in $file: $MARC_MPITYPE" - echo " valid options: $MPI_DEFAULT $MPI_OTHER" - echo " " - exit - fi - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - fi -fi -# -# -# allow scratch directory to be specified with environmental variable -# MARCSCRATCH -if test $MARCSCRATCH -then - if test -d $MARCSCRATCH - then - DIRSCR=$MARCSCRATCH - else - echo "error, scratch directory '$MARCSCRATCH'" - echo " specified via environmental variable MARCSCRATCH does not exist" - exit - fi -fi -# -############################################################################## -# parse input - arguments always come in pairs # -############################################################################## - -arg=$1 -if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - shift - arg=$1 -fi -while [ -n "$arg" ] -do - shift - value=$1 - case $arg in - -al* | -AL*) - $MARC_BIN/marc -alloc 1 - exit - ;; - -li* | -LI*) - justlist=yes - ;; - -fe* | -FE*) - feature=$value - ;; - -pr* | -PR*) - if test `dirname $value` = '.' - then - prog=`$BASENAME $value .marc` - progdll=`$BASENAME $value` - else - prog=`dirname $value`/`$BASENAME $value .marc` - progdll=`dirname $value`/`$BASENAME $value` - fi - prdir=`dirname $value` - case $prdir in - \/*) - ;; - *) - prog=`pwd`/$prdir/$prog - ;; - esac - ;; - -j* | -J*) - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - ;; - -r* | -R*) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - -si* | -SI*) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - -pi* | -PI*) - if test -f $value.t19 - then - pid=`$BASENAME $value .t19` - else - pid=`$BASENAME $value .t16` - fi - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - -bdf | -BDF) - makebdf=1 - ;; - -de* | -DE*) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - -vf | -VF) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - -u* | -U*) - - user=$value - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - -obj | -OBJ) - objs="$value" - ;; - -q* | -Q*) - qid=$value - ;; - -b* | -B*) - case $value in - y* | Y*) - qid=background - ;; - n* | N*) - qid=foreground - ;; - *) - ;; - esac - ;; - -at | -AT) - att=$value - ;; - -cpu* | -CPU*) - cpu=$value - ;; - -pq | -PQ*) - priority=$value - ;; - -v* | -V*) - verify=$value - ;; - -sa* | -SA*) - prgsav=$value - ;; - -np* | -NP*) - nprocdddm=$value - nprocdddmprint=$value - case $arg in - -nps* | -NPS* | -nprocds* | -NPROCDS*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - case $arg in - -np | -NP | -nprocd | -NPROCD) - icreated=0 - nprocdarg=-nprocd - ;; - esac - ;; - -ns* | -NS*) - nsolver=$value - ;; - -nt* | -NT*) - nthread=$value - ;; - -it* | -IT*) - itree=$value - ;; - -iam | -IAM) - iam=$value - ;; - -au* | -AU*) - nauto=$value - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -me | -ME ) - mesh=$value - ;; - -ml | -ML ) - memlimit=$value - ;; - -mo | -MO ) - ;; - -mpi | -MPI ) - mpioption=true - MARC_MPITYPE=$value - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - fi - fi - ;; - -dir* | -DIR*) - DIRJOB=$value - case $DIRJOB in - \/*) - ;; - *) - DIRJOB=`pwd`/$DIRJOB - ;; - esac - if test -z "$DIRSCRSET" - then - DIRSCR=$DIRJOB - fi - ;; - -sd* | -SD*) - DIRSCR=$value - DIRSCRSET=yes - case $DIRSCR in - \/*) - ;; - *) - DIRSCR=`pwd`/$DIRSCR - ;; - esac - ;; - -ho* | -HO*) - host=$value - ;; - -co* | -CO*) - compatible=$value - ;; - -ci* | -CI*) - cpinput=$value - ;; - -cr* | -CR*) - cpresults=$value - ;; - *) - error="$error -$arg: invalid option" - break - ;; - esac - case $value in - -*) - error="$error -$arg: invalid name $value" - break - ;; - esac - shift - arg=$1 - if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - shift - arg=$1 - fi -done -argc=`expr $# % 2` -if test $argc -eq 1 -then -# -# odd number of arguments -# - error="$error -argument list incomplete" -fi - -if test $nprocdddm -gt 0 -then -nprocd=$nprocdddm -fi - -if test $nsolver -gt 0 -then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi -fi - -if test $nthread -eq -1 -then -nthread=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nthread -lt 0 -then -nthread=0 -fi - -nthreadprint=$nthread -if test $nthreadprint -eq 0 -then -nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi -fi - -nthread=$nthreadprint - - - -if test $nprocd -gt 1; then - if test -f $jid$dotdefhost; then - if test "$host" = ""; then - host=$jid$dotdefhost - fi - fi - if test -f hostfile_qa_$nprocd; then - if test "$host" = ""; then - host=hostfile_qa_$nprocd - fi - fi -fi - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then - dotdat=.inp - fi - - if test "$progdll"; then - /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll - rmdll=yes - pathdll=yes - progdll=${progdll}_$marcdll - else - progdll=$marcdll - fi - - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - pathdll=yes - fi -fi - -############################################################################## -# check parameter validity # -############################################################################## - -while test forever; do - -# -# check for input file existence -# -if test $nprocdddm -gt 1 -a $icreated -eq 0; then - if test ! -f $DIRJID/1$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/1$jid$dotdat not accessible" - fi - fi -else - if test ! -f $DIRJID/$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/$jid$dotdat not accessible" - fi - fi -fi - if test $nprocd -gt 1; then - if test "$host" ; then - if test ! -f $host; then - error="$error -host name file $host not accessible" - fi - fi - fi - -# -# check if the job is already running in the background -# -if test -f $DIRJOB/$jid.pid; then - error="$error -job is already running (the file $jid.pid exists)" -fi - -# -# if the program name is other than marc, then -# assume that this is a program in the users local directory -# - -bd=$MARC_BIN/ - -case $prog in - marc | MARC | $exefile) - program=$exefile - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - if test ! -f $user - then - error="$error -user subroutine file $user not accessible" - fi - fi - if test "$objs" - then - missingobjs= - for o in $objs - do - if test ! -f "$o" - then - if test -z "$missingobjs" - then - missingobjs="$o" - else - missingobjs="$missingobjs $o" - fi - fi - done - if test -n "$missingobjs" - then - error="$error -user object/library file(s) $missingobjs not accessible" - fi - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$vid" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRVID/1$vid.vfs - then - error="$error -view factor file $DIRVID/1$vid.vfs not accessible" - fi - else - if test ! -f $DIRVID/$vid.vfs - then - error="$error -view factor file $DIRVID/$vid.vfs not accessible" - fi - fi - fi - if $mpioption - then - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" - fi - fi - ;; - *) - program=$prog.marc - case $prog in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - error="$error -program option may not be used with user subroutine" - fi - if test "$objs" - then - error="$error -program option may not be used with user objects or libraries" - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$nauto" - then - if test $nauto -gt 2 - then - error="$error -incorrect option for auto restart " - fi - fi - if test "$ndcoup" - then - if test $ndcoup -gt 3 - then - error="$error -incorrect option for contact decoupling " - fi - fi - if test "$ndytran" - then - if test $ndytran -gt 1 - then - error="$error -incorrect option for Marc-Dytran Switch " - fi - fi - if $mpioption - then - if test ! -x $MARC_BIN/$exefile - then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE " - fi - fi - ;; -esac - -############################################################################## -# check argument integrity # -############################################################################## - -if test "$jid" -then - : -else - error="$error -job id required" -fi - -if test $nprocd -gt 1 -then - if test $nauto -gt 0 - then - error="$error -cannot run DDM job with auto restart (-au) option " - fi -fi -case $qid in - S* | s*) - qid=short - ;; - L* | l*) - qid=long - ;; - V* | v*) - qid=verylong - ;; - B* | b*) - qid=background - ;; - F* | f*) - qid=foreground - ;; - A* | a*) - qid=at - ;; - *) - error="$error -bad value for queue_id option" - ;; -esac - -case $prgsav in - N* | n*) - prgsav=no - ;; - Y* | y*) - prgsav=yes - ;; - *) - error="$error -bad value for save option" - ;; -esac - -case $verify in - N* | n*) - verify=no - ;; - Y* | y*) - verify=yes - ;; - *) - error="$error -bad value for verify option" - ;; -esac - -case $nprocdddm in - -* ) - error="$error -bad value for nprocd option" - ;; -esac - -case $nthread in - -* ) - error="$error -bad value for nthread option" - ;; -esac - -case $itree in - -* ) - error="$error -bad value for itree option" - ;; -esac -case $iam in - -* ) - error="$error -bad value for iam option" - ;; -esac -case $compatible in - N* | n*) - compatible=no - ;; - Y* | y*) - compatible=yes - ;; - unknown) - ;; - *) - error="$error -bad value for comp option" - ;; -esac -case $cpinput in - N* | n*) - cpinput=no - ;; - Y* | y*) - cpinput=yes - ;; - *) - error="$error -bad value for copy input option" - ;; -esac -case $cpresults in - N* | n*) - cpresults=no - ;; - Y* | y*) - cpresults=yes - ;; - *) - error="$error -bad value for copy results option" - ;; -esac - -# -# check for external file to run -# -if test -f $MARC_TOOLS/run_marc_check -then - . $MARC_TOOLS/run_marc_check -fi - -# -# pick up version data from bin/VERSION if it exists -# -if test -f $MARC_BIN/VERSION; then - ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` - if test -n "$ppp" ;then - PRODUCT=$ppp - fi - ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` - if test -n "$ppp" ;then - REVISION=", Build $ppp" - fi -fi -############################################################################## -# interact with the user to get the required information to run marc or # -# other marc system program # -############################################################################## - -deletelog=yes -if test $qid = background -a $verify = no -then -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto " > $jid.log -deletelog=no -fi -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto" - - -case $qid in - s* | S* | l* | L* | v* | V* ) - echo \ -"Queue priority : $priority -Queue CPU limit : $cpu -Queue start time : $att" - ;; -# * ) -# echo \ -#" " -# ;; -esac - -if test "$error" -then - if test $verify = yes - then - $ECHO "$error - -Please correct or quit(correct,quit,): $ECHOTXT" - error= - read answer - case $answer in - q* | Q*) - answer=quit - ;; - *) - answer=correct - ;; - esac - else - $ECHO "$error - $ECHOTXT" - echo " " - if test "$deletelog" = no - then - $ECHO "$error - $ECHOTXT" >> $jid.log - echo " " >> $jid.log - fi - answer=quit - fi -else - if test $verify = yes - then - $ECHO " -Are these parameters correct (yes,no,quit,)? $ECHOTXT" - read answer - case $answer in - q* | Q*) - answer=quit - ;; - y* | Y*) - answer=yes - ;; - *) - answer=no - ;; - esac - else - answer=yes - fi -fi - -case $answer in - no | correct) - -############################################################################## -# prompt for each value # -############################################################################## - - $ECHO " -Program name ($prog)? $ECHOTXT" - read value - if test "$value" - then - prog=$value - fi - $ECHO "Job ID ($jid)? $ECHOTXT" - read value - if test "$value" - then - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - fi - $ECHO "User subroutine name ($user)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - user= - ;; - *) - user=$value - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - esac - fi - $ECHO "User objects or libraries ($objs)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - objs= - ;; - *) - objs="$value" - ;; - esac - fi - $ECHO "Restart File Job ID ($rid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - rid= - ;; - *) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - esac - fi - $ECHO "Substructure File ID ($sid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - sid= - ;; - *) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - esac - fi - $ECHO "Post File Job ID ($pid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - pid= - ;; - *) - pid=$value - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - esac - fi - $ECHO "Defaults File ID ($did)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - did= - ;; - *) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - esac - fi - $ECHO "View Factor File ID ($vid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - vid= - ;; - *) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - esac - fi - $ECHO "Save generated module ($prgsav)? $ECHOTXT" - read value - if test "$value" - then - prgsav=$value - fi - $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" - read value - if test "$value" - then - nprocdddm=$value - nprocdddmprint=$value - fi - $ECHO "Run on ($nthread) threads ? $ECHOTXT" - read value - if test "$value" - then - nthread=$value - fi - $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" - read value - if test "$value" - then - nsolver=$value - fi -# - if test $nprocdddm -gt 0 - then - nprocd=$nprocdddm - fi - if test $nsolver -gt 0 - then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi - fi - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - nthreadprint=$nthread - if test $nthreadprint -eq 0 - then - nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi - fi -# - if test $nprocd -gt 1 - then - $ECHO "Message passing type ($itree)? $ECHOTXT" - read value - if test "$value" - then - itree=$value - fi - $ECHO "Host file name ($host)? $ECHOTXT" - read value - if test "$value" - then - host=$value - fi - if test $nprocdddm -gt 1 - then - $ECHO "Single input file? $ECHOTXT" - read value - case $value in - y* | Y*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" - read value - if test "$value" - then - compatible=$value - fi - $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" - read value - if test "$value" - then - cpinput=$value - fi - $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" - read value - if test "$value" - then - cpresults=$value - fi - fi - fi - $ECHO "Run the job in the queue ($qid)? $ECHOTXT" - read value - if test "$value" - then - qid=$value - fi - case $qid in - s* | S* | l* | L* | v* | V* ) - $ECHO "Queue priority ($priority)? $ECHOTXT" - read value - if test "$value" - then - priority=$value - fi - $ECHO "Job starts at ($att)? $ECHOTXT" - read value - if test "$value" - then - att=$value - fi - $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" - read value - if test "$value" - then - cpu=$value - fi - ;; - * ) - ;; - esac - $ECHO "Auto Restart option ($nauto)? $ECHOTXT" - read value - if test "$value" - then - nauto=$value - fi - $ECHO "Run directory ($DIRJOB)? $ECHOTXT" - read value - if test "$value" - then - DIRJOB=$value - DIRSCR=$DIRJOB - fi - $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" - read value - if test "$value" - then - DIRSCR=$value - fi - ;; - quit) - exit 1 - ;; - *) - break - ;; - -esac - - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - -done - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - pathdll=yes - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - fi - - if test "$pathdll"; then -# -# reset share lib path -# - if test $MACHINENAME = "HP" - then - SHLIB_PATH=$DIRJOB:$SHLIB_PATH - export SHLIB_PATH - fi - if test $MACHINENAME = "IBM" - then - LIBPATH=$DIRJOB:$LIBPATH - export LIBPATH - fi -# - LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH - LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH - LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH - export LD_LIBRARY_PATH - export LD_LIBRARY64_PATH - export LD_LIBRARYN32_PATH - fi -fi -# end of dllrun>0 - - -if test $program = $exefile -o $program = $prog.marc -then - -# delete the old .log file unless we run in the background -if test "$deletelog" = yes -then - /bin/rm $jid.log 2>/dev/null -else - echo - echo running the job in the background, see $jid.log - echo -fi - -# -# check if this is an autoforge or rezoning or radiation job -# -if test $nprocd -eq 1 -then - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` - if test "$line" - then - autoforge=1 - fi -fi -# -# check that jobname for restarted run is not the same -# as restart file basename -# -if test "$rid" -then - if test "$jid" = "$rid" - then - echo " " - echo "ERROR: job name of current run is the same as job name" - echo " of the restarted job" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "ERROR: job name of current run is the same as job name" >> $jid.log - echo " of the restarted job" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi -fi - -# -# user objects/libraries used -# - - if test "$objs" - then - program="$DIRJOB/$jid.marc" - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# user subroutine used -# -# add DAMASK options for linking - DAMASK="" - - if test "$user" - then - program=$usernoext.marc - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# Special case for IBM using POE but not an SP machine -# in this case we always need a host file, also for serial jobs. -# -if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP -then - MP_HOSTFILE=${jid}.host - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $nprocd -gt 1 - then - numdom=$nprocd - while test $numdom -gt 0 - do - hostname -s >> $MP_HOSTFILE - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - else - hostname -s > $MP_HOSTFILE - fi -fi -# -# check correctness of host file; fix for user sub -# - if test $nprocd -gt 1 - then - -# construct the path name to the executable (execpath) - execpath=$MARC_BIN/$exefile - usersub=0 - if test $program = $prog.marc - then - execpath=$prog.marc - usersub=1 - fi - if test "$objs" - then - execpath="$DIRJOB/$jid.marc" - usersub=1 - fi - if test "$user" - then - execpath=$usernoext.marc - usersub=1 - fi - export execpath - execname=`$BASENAME $execpath` - - if test "$host" - then - userhost=$host - case $userhost in - \/* | \.\/*) - ;; - *) - userhost=`pwd`/$userhost - ;; - esac - -# check that the number of processes specified in the hostfile is -# equal to nprocd specified by -nprocd. - numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` - if test $nprocd -ne $numproc - then - echo " " - echo "error, the number of processes specified in the host file" - echo "must be equal to the number of processes given by -nprocd/-nsolver" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, the number of processes specified in the host file" >> $jid.log - echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - -# check for Myrinet that the number of processes per host is -# less than number of available user ports, 5 -# .gmpi directory must exist in user's home directory -# and must have write permission from remote hosts - if test $MPITYPE = "myrinet" - then - numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` - if test $numproc -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes specified " - echo "in the hostfile must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes specified " >> $jid.log - echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - if test ! -d ~/.gmpi - then - echo " " - echo "error, for Myrinet a .gmpi directory must exist " - echo "under the user's home directory" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log - echo "under the user's home directory" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - homedir=`echo ~` - for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - echo " " - echo "error, for Myrinet a shared .gmpi directory must exist " - echo "under the user's home directory " - echo "with remote write permission" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log - echo "under the user's home directory " >> $jid.log - echo "with remote write permission" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - /bin/rm tmp.$$ - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - fi - fi - done - fi - fi - -# construct the host file $jid.host which is used by mpirun -# skip lines starting with # and only consider lines with more than -# one word in them. Note that the hostfile given to this script -# has two columns: the host name and the number of shared processes -# to run on this host. mpirun wants the number of _other_ -# processes to run in addition to the one being run on the machine -# on which the job is started. hence the $2-1 for fnr == 1. - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then -# HPMPI or HP hardware MPI - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ - -v mpihpspecial="$MPIHPSPECIAL" \ -'{if ( NF > 0) {\ - fnr++ ; \ - printf("-h %s -np %s",$1,$2); \ - printf(" %s",mpihpspecial); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ - if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ - }\ - }' > $jid.host -# end HPMPI or HP hardware MPI - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then -# IBM using hardware MPI (POE) - MP_HOSTFILE=$jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host -# end IBM using hardware MPI (POE) -# for Intel MPI, need to create a machinefile for DMP - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then -# Intel MPI - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - /bin/cp $host $jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Intel MPI for DMP -# for Solaris HPC 7.1, need to create a machinefile for DMP - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then -# Solaris HPC 7.1 - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Solaris HPC 7.1 for DMP -# for Myrinet, construct a configuration file in ~/.gmpi -# this must be readable by each process -# format is (hostname) (port number) for each process - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - grep -v '^#' $host | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ -{if ( NF > 0 ) \ - for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ -}' >> ~/.gmpi/$jid.host - else -# this is for mpich-1.2.5 and later, using the -pg option -# format: host nproc executable user arguments -# the arguments are added later - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s %s\n",path,user);\ - if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ - }\ - }' > $jid.host - fi -# end Myrinet - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then -# Compaq MPI via Memory Channel - grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host -# end Compaq MPI - else -# MPICH - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ - }\ - }' > $jid.host - fi -# define the variable host and host_filt -# host_filt is used for loops over hosts -# for Myrinet we need to use a filtered variant of userhost -# for others we can use $host - if test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - host=~/.gmpi/$jid.host - host_filt=$jid.host_tMp - grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt - else - host=$jid.host - host_filt=$host - fi - else - host=$jid.host - host_filt=$host - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - host_filt=$jid.mfile - fi - fi -# figure out if the machines in the hostfile are nfs mounted -# or distributed and set the variable "dirstatus" accordingly. -# only perform the check if user subroutine is used -# or a user subroutine executable is used - - numfield=1 - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - numfield=2 - fi - DIR1=$DIRJOB - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - counter=0 - echo " " - echo "checking if local or shared directories for host" - if test "$deletelog" = no - then - echo "checking if local or shared directories for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - dirstatus[$counter]="shared" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - dirstatus[$counter]="local" - /bin/rm tmp.$$ - else - if test ! -f $jid.$$ - then - dirstatus[$counter]="local" - $RSH $i /bin/rm $DIR1/$jid.$$ - else - /bin/rm $jid.$$ - fi - fi - if test -f tmp.$$ - then - /bin/rm tmp.$$ - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - echo " ${dirstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${dirstatus[$counter]}" >> $jid.log - fi - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - fi - -# figure out if this is a compatible set of machines -# unless explicitly specified with flag -comp -# only perform the check if user subroutine is used -# or a user subroutine executable is used -# Myrinet does not support heterogeneous - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - if test $compatible = "unknown" - then - thisname=$ARCH - compatible=yes - counter=0 - echo "checking if machines are compatible for host" - if test "$deletelog" = no - then - echo "checking if machines are compatible for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]="yes" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - othername=`$RSH $i uname -a | cut -f 1 -d " "` - if test $thisname != $othername - then - compatible=no - compstatus[$counter]="no" - fi - fi - echo " ${compstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${compstatus[$counter]}" >> $jid.log - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - else - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]=$compatible - fi - done - if test $compatible = "no" - then - echo "all machines assumed incompatible" - if test "$deletelog" = no - then - echo "all machines assumed incompatible" >> $jid.log - fi - else - echo "all machines compatible" - if test "$deletelog" = no - then - echo "all machines compatible" >> $jid.log - fi - fi - fi -# error out if user objects or libraries are used on incompatible machines - if test "$compatible" = "no" -a -n "$objs" - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" - if test "$deletelog" = no - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log - fi - exit 1 - fi -# modify new host file if NFS mounted heterogeneous machine - doit= - if test $program = $prog.marc - then - doit=yes - fi - if test "$user" - then - doit=yes - fi - if test "$doit" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - $AWK -v hst=$i '{fnr++ ; \ -if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ -printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} - /bin/mv $jid.host{$$} $jid.host - host=$jid.host - fi - fi - done - fi - fi # if test $program = $prog.marc -o $user -o $obj - - else # if test $host - # assume shared memory machine if no hostfile given and - # MPITYPE is set to mpich or Myrinet - # check for Myrinet that the total number of processes is - # less than number of available user ports, 5 - if test $MPITYPE = "mpich" -o $MPITYPE = "scali" - then - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - host=$jid.host - elif test $MPITYPE = "myrinet" - then - if test $nprocd -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes " - echo "must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes " >> $jid.log - echo "must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - echo `hostname` $nprocd | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ - {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ -' >> ~/.gmpi/$jid.host - host=~/.gmpi/$jid.host - else - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - - fi - fi # if test myrinet - - fi # if test $host - - fi # if test $nprocd -gt 1 - -fi # if test $program = $exefile -o $program = $prog.marc - -############################################################################## -# construct run stream (Marc only) # -############################################################################## - -# set maximum message length for ddm to a large number -# for vendor provided mpi -if test $itree -eq 0 -a $MPITYPE = hardware -then - itree=100000000 - if test $MACHINENAME = SGI - then - itree=100000001 - fi -fi -if test $itree -eq 0 -a $MPITYPE = hpmpi -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = myrinet -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = nec -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = scali -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = intelmpi -then - itree=100000000 -fi -if test $nprocdddm -lt 2 -then - nprocdarg= -else - nprocdarg="$nprocdarg $nprocdddm" -fi -if test $nsolver -eq 0 -then - nsolverarg= -else - nsolverarg="$nsolverarg $nsolver" -fi -if test $nprocdddm -lt 2 -a $nsolver -eq 0 -then -nprocd=0 -fi -if test $nprocd -gt 0 -then - if test "$host" - then - if test -z "$RUN_JOB2" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then - RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - else - RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" - RUN_JOB=" -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - fi - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - numhost=`uniq $jid.mfile | wc -l` - if test "$INTELMPI_VERSION" = "HYDRA" - then - RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n $numhost -r $RSH -f $jid.mfile - RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" - fi - -# intelmpi uses configfile. format: -# -host host1 -n n1 executable marcargs -# one such line per host -# collect the marcargs in RUN_JOB and construct the config file later -# collect the run stream in RUN_JOB_TMP - RUN_JOB="-jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - - - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then - RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - fi - if test "$userhost" - then - RUN_JOB="$RUN_JOB -mhost $userhost" - fi - if test $MPITYPE = "scali" - then -# set default working directory to /tmp to allow -# different directory names - SCAMPI_WORKING_DIRECTORY=/tmp - export SCAMPI_WORKING_DIRECTORY - fi - else - if test -z "$RUN_JOB1" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - RUNNPROCD=$nprocd - if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" - then - RUNNPROCD= - MP_PROCS=$nprocd - export MP_PROCS - fi - if test $MPITYPE = "myrinet" - then - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread -dirjob $DIRJOB " - fi - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - touch $jid.hosts - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n 1 -f $jid.hosts - fi -# /bin/rm $jid.hosts 2> /dev/null - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread -dirjob $DIRJOB " - fi - fi -else - if test $nauto -gt 0 -o $ndcoup -gt 0 - then - RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ - -nthread $nthread -dirjob $DIRJOB " - else -# this is for a serial job without auto restart: - RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ --nthread $nthread -dirjob $DIRJOB " - fi -fi -if test "$rid" -then - RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" -fi -if test "$pid" -then - RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" -fi -if test "$sid" -then - RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" -fi -if test "$did" -then - RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" -fi -if test "$vid" -then - RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" -fi -if test $nauto -gt 0 -then - RUN_JOB="$RUN_JOB -autorst $nauto " -fi -if test $ndcoup -gt 0 -then - RUN_JOB="$RUN_JOB -dcoup $ndcoup " -fi -if test $ndytran -gt 0 -then - RUN_JOB="$RUN_JOB -dytran $ndytran " -fi -if test $mesh -gt 0 -then - RUN_JOB="$RUN_JOB -me $mesh " -fi -if test $noutcore -gt 0 -then - RUN_JOB="$RUN_JOB -outcore $noutcore " -fi -if test "$dllrun" -gt 0 -then - RUN_JOB="$RUN_JOB -dll $dllrun " -fi -if test "$trkrun" -gt 0 -then - RUN_JOB="$RUN_JOB -trk $trkrun " -fi -if test "$iam" -then - RUN_JOB="$RUN_JOB -iam $iam " -fi -if test "$justlist" -then - RUN_JOB="$RUN_JOB -list 1 " -fi -if test "$feature" -then - RUN_JOB="$RUN_JOB -feature $feature " -fi -if test "$memlimit" -ne 0 -then - RUN_JOB="$RUN_JOB -ml $memlimit " -fi -if test "$cpinput" -then - RUN_JOB="$RUN_JOB -ci $cpinput " -fi -if test "$cpresults" -then - RUN_JOB="$RUN_JOB -cr $cpresults " -fi -if test "$DIRSCR" != "$DIRJOB" -then - RUN_JOB="$RUN_JOB -dirscr $DIRSCR" -else - DIRSCR=$DIRJOB -fi -if test "$makebdf" -then - RUN_JOB="$RUN_JOB -bdf $makebdf " -fi -if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" -then - # append $RUN_JOB to all lines of the host file - # and set RUN_JOB - $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ - /bin/mv $host.$$ $host - RUN_JOB=$RUN_JOB_TMP -fi -if test $MPITYPE = "intelmpi" -a "$host" -then - # construct config file, append $RUN_JOB to all lines of the config file - # and set RUN_JOB - if test "$INTELMPI_VERSION" = "HYDRA" - then - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - else - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-host %s -n %s",$1,$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - fi - RUN_JOB=$RUN_JOB_TMP -fi -echo " " -echo "Final run stream value" -echo " RUNJOB="$RUN_JOB -if test "$deletelog" = no -then -echo " " >> $jid.log -echo "Final run stream value" >> $jid.log -echo " RUNJOB="$RUN_JOB >> $jid.log -fi - - -############################################################################## -# run marc using valgrind # -############################################################################## -#RUN_JOB="valgrind $RUN_JOB" -#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" -############################################################################## - - -############################################################################## -# run the requested program in a queue # -############################################################################## - -if test "$deletelog" = yes -then - echo - date -else - echo >> $jid.log - date >> $jid.log -fi -if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] -then - -/bin/rm -f $jid.runmarcscript - - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - userobj=$usernoext.o - fi - cat > $jid.runmarcscript << END4 - if test "$user" - then - if test $MACHINENAME = "CRAY" - then - $DFORTLOW $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTLOW $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } -END4 -else - prgsav=yes -fi -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# - -cat >> $jid.runmarcscript << END5 - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -# first remove all .out files and incremental restart files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null - /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null -fi - -if test $nprocdddm -gt 1 -then - $RUN_JOB 2>>$jid.log -else - $RUN_JOB 2>>$jid.log -fi - -if test $dllrun -eq 0; then - if test $prgsav = no - then - /bin/rm -f $bd$program 2>/dev/null - fi -else - if test $cpdll = yes; then - filename=`basename $usersubname .f` - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes - then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -END5 - - -# Submit to marc batch queue -# -if [ $qid = at ] -then -QUENAME=at -SUBMCMD= -else -# -# Submit to qsub queue -# -QUENAME=qsub -SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" -if test "$priority" -then - SUBMCMD=$SUBMCMD" -p $priority" -fi -if test "$att" -then - SUBMCMD=$SUBMCMD" -a $att" -fi -if test "$cpu" -then - SUBMCMD=$SUBMCMD" -lt $cpu" -fi - -fi -echo $QUENAME $SUBMCMD -#cat $jid.runmarcscript -$QUENAME $SUBMCMD < $jid.runmarcscript - -/bin/rm -f $jid.runmarcscript - -############################################################################## -# run the requested program in the background # -############################################################################## - -else -if test $qid = background -then - -# -# first remove all old .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi -# -# compile user subroutine if present -# -( -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_l $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - echo " $PRODUCT Exit number 3" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTLOW $user || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTLOW $user -o $userobj || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - echo " $PRODUCT Exit number 3" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc - -# - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -$RUN_JOB & - -marcpid=$! -echo $marcpid > $DIRJOB/$jid.pid -wait $marcpid - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=`basename $usersubname .f` - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -) 1>>$jid.log 2>&1 & - - -############################################################################## -# run the requested program in the foreground # -############################################################################## - -else - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_l $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTLOW $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTLOW $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi -# first remove all .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi - -$RUN_JOB - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - if test "$host" - then - mpdcleanup -a -f $jid.mfile - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.mfile 2> /dev/null - else - mpdcleanup -a -f $jid.hosts - /bin/rm $jid.hosts 2> /dev/null - fi - fi - fi -fi - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=`basename $usersubname .f` - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi - - -fi -fi diff --git a/installation/mods_MarcMentat/2011/Marc_tools/run_damask_lmp b/installation/mods_MarcMentat/2011/Marc_tools/run_damask_lmp deleted file mode 100644 index d9f23dc7b..000000000 --- a/installation/mods_MarcMentat/2011/Marc_tools/run_damask_lmp +++ /dev/null @@ -1,3624 +0,0 @@ -#!/bin/ksh -############################################################################## -# # -# run_marc - run a marc job # -# ------------------------- # -# # -# usage: run_marc -j jid { options } # -# # -# where standard options are: required: defaults: # -# -------------------------- # -# # -# -j* jid job id number. ** YES ** . # -# -pr* prog program name. . marc # -# -v* y|n do or do not verify inputs. . yes # -# -q* s|l|v|b|f batch queue name or background, . short # -# foreground. # -# -b* as alternative to option -q* # -# # -# ( batch queues only : # -# -pq* intra queue priority. . . # -# -at DATE/TIME delay start of job. . . # -# format : January,1,1990,12:31 # -# or : today,5pm # -# -cpu* secs job CPU limit . . ) # -# # -# -r* rid restart file job id. . . # -# -si* sid substructure file id. . . # -# -pi* post post file job id. . . # -# -de* did defaults file . no # -# -vf vid viewfactor . no # -# # -# -u* user user subroutine. . . # -# -obj obj user objects or libraries. . . # -# -sa* y|n do or do not save load module. . no # -# -autorst auto restart flag for auto forge . no # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo selects i4 or i8 version # -# default: i4 or via defaults file run_marc_defaults # -# the -mo option will override # -# -mpi selects MPI version # -# each platform has a default MPI version and some # -# have an alternative version. see the include file # -# for the respective platform # -# MPI_DEFAULT defines the default MPI version # -# MPI_OTHER defines versions one can switch to # -# -dcoup for contact decoupling # -# currently not supported # -# -dir directory where the job i/o should take place. # -# defaults to current directory. # -# -sdir directory where scratch files are created # -# defaults to current directory. # -# # -# -alloc only perform memory allocation test, no analysis # -# -list y only list options in the input file, no analysis # -# -fe num set feature number "num" for the run. only one allowed # -# -dytran flag to switch from Dytran to Marc # -# dytran = 0, program will run w/o Marc-Dytran Switch # -# = 1, program will restart Marc after Dytran run # -# >= 2, Not supported yet. # -# currently not supported # -# -ou force analysis to use out-of-core control # -# =0, not used # -# =1, element storage out-of-core # -# -dll run marc using shared library libmarc.so and exe_marc # -# =1, used # -# =2, do not free streaming input memory # -# =3, run with marc input deck # -# -trk run marc for post-tracking # -# # -# where parallel options are: # -# -------------------------- # -# # -# itree, host, and comp options are available for the domain # -# decomposition only. # -# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # -# # -# # -# -nprocd number of domains. # -# defaults to single domain solution. # -# -nprocds number of domains if single input file. # -# defaults to single domain solution. # -# -nps same as -nprocds. # -# -nsolver number of solver tasks for solver types 12 and 13 # -# these are distributed tasks operating via MPI # -# -nthread number of solver threads for solver types 6, 8, and 11 # -# also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. if both specified, nthread option# -# will be used. # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by 6, 8, and 11 # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor nthread specified. # -# -itree message passing tree type for domain decomposition. # -# for debugging purposes; should not normally be used. # -# -host hostfile name for distributed execution on network. # -# defaults to no hostfile, unless jobid.defhost exists. # -# if jobid.defhost exists, only -np(s) necessary # -# -comp* y|n to be used with user routines on a network of # -# incompatible machines. # -# if set to no, a separate executable will be created # -# for each machine on the network. # -# if set to yes, the executable located on the machine # -# from which marc is started will be used on all machines.# -# defaults to no if O/S versions different on machines. # -# # -# -ci y|n copy input files to remote hosts (default: yes) # -# if "yes", input files are automatically copied to # -# remote hosts for a network run if necessary. # -# -cr y|n copy post files from remote hosts (default: yes) # -# if "yes", post files are automatically copied back from # -# remote hosts for a network run if necessary. # -############################################################################## -# set DIR to the directory in which this script is -REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" -DIR=`dirname $REALCOM` -# make sure DIR has an absolute path -case $DIR in - \/*) - ;; - *) - DIR=`pwd`/$DIR - ;; -esac -DIRSCRIPT=$DIR -AWK=awk -ARCH=`uname -a | cut -f 1 -d " "` -# Sun has a bad awk, use nawk instead -if test $ARCH = "SunOS" -then - AWK=nawk -fi -BASENAME=basename -# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists -if test $ARCH = "SunOS" -then - if test -x /usr/ucb/basename - then - BASENAME=/usr/ucb/basename - fi -fi - -# echo command line in the case of ECHO_COMMAND is true -if test "$ECHO_COMMAND" = true ; then - echo command "$0" "$@" -fi - -# -# "mode" selects version, i4 or i8 -# default is i4 -# this can be changed by a file run_marc_defaults -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MODE i8 -# it can also be set by the environmental variable MARC_INTEGER_SIZE -# and by the command line option "-mo" -# -mode= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -f $HOME/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -n "$MARC_INTEGER_SIZE" ; then - mode=$MARC_INTEGER_SIZE -fi -if test -z "$mode" ; then - mode=i4 -fi -case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "error, version mode must be i4 or i8" - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i4 or i8" - echo " " - echo " use -mo i4 or -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - setmode=true - fi - if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - fi - if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -done - -# set to i4 version for 32 bit Linux -if test "`uname -s`" = "Linux"; then - if test "`uname -m`" = "i686"; then - mode=i4 - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -fi - - -. "$DIR/getarch" - -# Change_me -. $MARC_INCLUDE -# - -# -# Dynamically determine the echo syntax -# - -case "`echo '\c'`" in - '\c') - ECHO='echo -n' - ECHOTXT=' ' - ;; - *) - ECHO='echo' - ECHOTXT=' \c' - ;; -esac - -# -# Variables for the MARC environment -# - -PRODUCT="Marc" -EXITMSG=$MARC_TOOLS/MESSAGES -export EXITMSG -FLEXDIR=$DIR/../flexlm/licenses -export FLEXDIR -TIMCHK=3600 -export TIMCHK -BINDIR=$MARC_BIN -export BINDIR -AFMATDAT=$MARC_RUNTIME/AF_flowmat/ -export AFMATDAT -# -# define directory path to global unified material database -# -MATFILE= -export MATFILE - -# -# define memory limit -# first set to MEMLIMIT from include -# -ml option overrules if specified -memlimit=$MEMLIMIT -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -# -if test $MACHINENAME = "HP" -then - SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH - export SHLIB_PATH -fi -# the one for IBM is defined futher down - -LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH -LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH -export LD_LIBRARY_PATH -export LD_LIBRARY64_PATH -export LD_LIBRARYN32_PATH - -atexit() { -kill -15 $$ -# -if test $MPITYPE = "myrinet" -then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi -fi -} - -trap "atexit" 2 - -# -# defaults -# - -prog=marc -exefile=marc -jid= -rid= -pid= -sid= -did= -vid= -user= -usernoext= -objs= -qid=background -cpu= -priority= -att= -trk= -verify=yes -prgsav=no -rmdll=no -cpdll=no -progdll= -pathdll= -error= -nprocd=0 -nprocdddm=1 -nprocdddmprint= -icreated=0 -nprocdarg= -nsolver=0 -nsolverarg=-nsolver -if test $nprocds -then - if test $nprocds -gt 1 - then - nprocdddm=$nprocds - nprocdddmprint=$nprocds - icreated=1 - nprocdarg=-nprocds - fi -fi -nthread=-1 -nauto=0 -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -nthreadprint=0 -itree=0 -iam= -link= -trkrun=0 -DIRJOB=`pwd` -DIRSCR=$DIRJOB -DIRSCRSET= -autoforge=0 -dotdat=.dat -dotdefhost=.defhost -host= -numhost= -mfile= -userhost= -makebdf= -cpinput=yes -cpresults=yes -marcdll=libmarc.$EXT_DLL -# define hostname and strip off extensions (alpha.aaa.com) -thishost=`hostname` -thishost=${thishost%%.*} -compatible=unknown -numfield=1 -justlist= -feature= -mpioption=false -MDSRCLIB=$MARC_LIB/mdsrc.a -# -# check run_marc_defaults file for default MPI setting -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MPI -# -value= -file= -if test -f $DIRSCRIPT/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$DIRSCRIPT/run_marc_defaults - fi -fi -if test -f $HOME/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$HOME/run_marc_defaults - fi -fi -if test -n "$value"; then - MARC_MPITYPE=$value - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - echo " " - echo " error, incorrect option for MARC_MPI" - echo " defined in $file: $MARC_MPITYPE" - echo " valid options: $MPI_DEFAULT $MPI_OTHER" - echo " " - exit - fi - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - fi -fi -# -# -# allow scratch directory to be specified with environmental variable -# MARCSCRATCH -if test $MARCSCRATCH -then - if test -d $MARCSCRATCH - then - DIRSCR=$MARCSCRATCH - else - echo "error, scratch directory '$MARCSCRATCH'" - echo " specified via environmental variable MARCSCRATCH does not exist" - exit - fi -fi -# -############################################################################## -# parse input - arguments always come in pairs # -############################################################################## - -arg=$1 -if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - shift - arg=$1 -fi -while [ -n "$arg" ] -do - shift - value=$1 - case $arg in - -al* | -AL*) - $MARC_BIN/marc -alloc 1 - exit - ;; - -li* | -LI*) - justlist=yes - ;; - -fe* | -FE*) - feature=$value - ;; - -pr* | -PR*) - if test `dirname $value` = '.' - then - prog=`$BASENAME $value .marc` - progdll=`$BASENAME $value` - else - prog=`dirname $value`/`$BASENAME $value .marc` - progdll=`dirname $value`/`$BASENAME $value` - fi - prdir=`dirname $value` - case $prdir in - \/*) - ;; - *) - prog=`pwd`/$prdir/$prog - ;; - esac - ;; - -j* | -J*) - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - ;; - -r* | -R*) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - -si* | -SI*) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - -pi* | -PI*) - if test -f $value.t19 - then - pid=`$BASENAME $value .t19` - else - pid=`$BASENAME $value .t16` - fi - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - -bdf | -BDF) - makebdf=1 - ;; - -de* | -DE*) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - -vf | -VF) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - -u* | -U*) - - user=$value - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - -obj | -OBJ) - objs="$value" - ;; - -q* | -Q*) - qid=$value - ;; - -b* | -B*) - case $value in - y* | Y*) - qid=background - ;; - n* | N*) - qid=foreground - ;; - *) - ;; - esac - ;; - -at | -AT) - att=$value - ;; - -cpu* | -CPU*) - cpu=$value - ;; - -pq | -PQ*) - priority=$value - ;; - -v* | -V*) - verify=$value - ;; - -sa* | -SA*) - prgsav=$value - ;; - -np* | -NP*) - nprocdddm=$value - nprocdddmprint=$value - case $arg in - -nps* | -NPS* | -nprocds* | -NPROCDS*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - case $arg in - -np | -NP | -nprocd | -NPROCD) - icreated=0 - nprocdarg=-nprocd - ;; - esac - ;; - -ns* | -NS*) - nsolver=$value - ;; - -nt* | -NT*) - nthread=$value - ;; - -it* | -IT*) - itree=$value - ;; - -iam | -IAM) - iam=$value - ;; - -au* | -AU*) - nauto=$value - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -me | -ME ) - mesh=$value - ;; - -ml | -ML ) - memlimit=$value - ;; - -mo | -MO ) - ;; - -mpi | -MPI ) - mpioption=true - MARC_MPITYPE=$value - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - fi - fi - ;; - -dir* | -DIR*) - DIRJOB=$value - case $DIRJOB in - \/*) - ;; - *) - DIRJOB=`pwd`/$DIRJOB - ;; - esac - if test -z "$DIRSCRSET" - then - DIRSCR=$DIRJOB - fi - ;; - -sd* | -SD*) - DIRSCR=$value - DIRSCRSET=yes - case $DIRSCR in - \/*) - ;; - *) - DIRSCR=`pwd`/$DIRSCR - ;; - esac - ;; - -ho* | -HO*) - host=$value - ;; - -co* | -CO*) - compatible=$value - ;; - -ci* | -CI*) - cpinput=$value - ;; - -cr* | -CR*) - cpresults=$value - ;; - *) - error="$error -$arg: invalid option" - break - ;; - esac - case $value in - -*) - error="$error -$arg: invalid name $value" - break - ;; - esac - shift - arg=$1 - if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - shift - arg=$1 - fi -done -argc=`expr $# % 2` -if test $argc -eq 1 -then -# -# odd number of arguments -# - error="$error -argument list incomplete" -fi - -if test $nprocdddm -gt 0 -then -nprocd=$nprocdddm -fi - -if test $nsolver -gt 0 -then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi -fi - -if test $nthread -eq -1 -then -nthread=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nthread -lt 0 -then -nthread=0 -fi - -nthreadprint=$nthread -if test $nthreadprint -eq 0 -then -nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi -fi - -nthread=$nthreadprint - - - -if test $nprocd -gt 1; then - if test -f $jid$dotdefhost; then - if test "$host" = ""; then - host=$jid$dotdefhost - fi - fi - if test -f hostfile_qa_$nprocd; then - if test "$host" = ""; then - host=hostfile_qa_$nprocd - fi - fi -fi - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then - dotdat=.inp - fi - - if test "$progdll"; then - /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll - rmdll=yes - pathdll=yes - progdll=${progdll}_$marcdll - else - progdll=$marcdll - fi - - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - pathdll=yes - fi -fi - -############################################################################## -# check parameter validity # -############################################################################## - -while test forever; do - -# -# check for input file existence -# -if test $nprocdddm -gt 1 -a $icreated -eq 0; then - if test ! -f $DIRJID/1$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/1$jid$dotdat not accessible" - fi - fi -else - if test ! -f $DIRJID/$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/$jid$dotdat not accessible" - fi - fi -fi - if test $nprocd -gt 1; then - if test "$host" ; then - if test ! -f $host; then - error="$error -host name file $host not accessible" - fi - fi - fi - -# -# check if the job is already running in the background -# -if test -f $DIRJOB/$jid.pid; then - error="$error -job is already running (the file $jid.pid exists)" -fi - -# -# if the program name is other than marc, then -# assume that this is a program in the users local directory -# - -bd=$MARC_BIN/ - -case $prog in - marc | MARC | $exefile) - program=$exefile - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - if test ! -f $user - then - error="$error -user subroutine file $user not accessible" - fi - fi - if test "$objs" - then - missingobjs= - for o in $objs - do - if test ! -f "$o" - then - if test -z "$missingobjs" - then - missingobjs="$o" - else - missingobjs="$missingobjs $o" - fi - fi - done - if test -n "$missingobjs" - then - error="$error -user object/library file(s) $missingobjs not accessible" - fi - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$vid" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRVID/1$vid.vfs - then - error="$error -view factor file $DIRVID/1$vid.vfs not accessible" - fi - else - if test ! -f $DIRVID/$vid.vfs - then - error="$error -view factor file $DIRVID/$vid.vfs not accessible" - fi - fi - fi - if $mpioption - then - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" - fi - fi - ;; - *) - program=$prog.marc - case $prog in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - error="$error -program option may not be used with user subroutine" - fi - if test "$objs" - then - error="$error -program option may not be used with user objects or libraries" - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$nauto" - then - if test $nauto -gt 2 - then - error="$error -incorrect option for auto restart " - fi - fi - if test "$ndcoup" - then - if test $ndcoup -gt 3 - then - error="$error -incorrect option for contact decoupling " - fi - fi - if test "$ndytran" - then - if test $ndytran -gt 1 - then - error="$error -incorrect option for Marc-Dytran Switch " - fi - fi - if $mpioption - then - if test ! -x $MARC_BIN/$exefile - then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE " - fi - fi - ;; -esac - -############################################################################## -# check argument integrity # -############################################################################## - -if test "$jid" -then - : -else - error="$error -job id required" -fi - -if test $nprocd -gt 1 -then - if test $nauto -gt 0 - then - error="$error -cannot run DDM job with auto restart (-au) option " - fi -fi -case $qid in - S* | s*) - qid=short - ;; - L* | l*) - qid=long - ;; - V* | v*) - qid=verylong - ;; - B* | b*) - qid=background - ;; - F* | f*) - qid=foreground - ;; - A* | a*) - qid=at - ;; - *) - error="$error -bad value for queue_id option" - ;; -esac - -case $prgsav in - N* | n*) - prgsav=no - ;; - Y* | y*) - prgsav=yes - ;; - *) - error="$error -bad value for save option" - ;; -esac - -case $verify in - N* | n*) - verify=no - ;; - Y* | y*) - verify=yes - ;; - *) - error="$error -bad value for verify option" - ;; -esac - -case $nprocdddm in - -* ) - error="$error -bad value for nprocd option" - ;; -esac - -case $nthread in - -* ) - error="$error -bad value for nthread option" - ;; -esac - -case $itree in - -* ) - error="$error -bad value for itree option" - ;; -esac -case $iam in - -* ) - error="$error -bad value for iam option" - ;; -esac -case $compatible in - N* | n*) - compatible=no - ;; - Y* | y*) - compatible=yes - ;; - unknown) - ;; - *) - error="$error -bad value for comp option" - ;; -esac -case $cpinput in - N* | n*) - cpinput=no - ;; - Y* | y*) - cpinput=yes - ;; - *) - error="$error -bad value for copy input option" - ;; -esac -case $cpresults in - N* | n*) - cpresults=no - ;; - Y* | y*) - cpresults=yes - ;; - *) - error="$error -bad value for copy results option" - ;; -esac - -# -# check for external file to run -# -if test -f $MARC_TOOLS/run_marc_check -then - . $MARC_TOOLS/run_marc_check -fi - -# -# pick up version data from bin/VERSION if it exists -# -if test -f $MARC_BIN/VERSION; then - ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` - if test -n "$ppp" ;then - PRODUCT=$ppp - fi - ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` - if test -n "$ppp" ;then - REVISION=", Build $ppp" - fi -fi -############################################################################## -# interact with the user to get the required information to run marc or # -# other marc system program # -############################################################################## - -deletelog=yes -if test $qid = background -a $verify = no -then -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto " > $jid.log -deletelog=no -fi -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto" - - -case $qid in - s* | S* | l* | L* | v* | V* ) - echo \ -"Queue priority : $priority -Queue CPU limit : $cpu -Queue start time : $att" - ;; -# * ) -# echo \ -#" " -# ;; -esac - -if test "$error" -then - if test $verify = yes - then - $ECHO "$error - -Please correct or quit(correct,quit,): $ECHOTXT" - error= - read answer - case $answer in - q* | Q*) - answer=quit - ;; - *) - answer=correct - ;; - esac - else - $ECHO "$error - $ECHOTXT" - echo " " - if test "$deletelog" = no - then - $ECHO "$error - $ECHOTXT" >> $jid.log - echo " " >> $jid.log - fi - answer=quit - fi -else - if test $verify = yes - then - $ECHO " -Are these parameters correct (yes,no,quit,)? $ECHOTXT" - read answer - case $answer in - q* | Q*) - answer=quit - ;; - y* | Y*) - answer=yes - ;; - *) - answer=no - ;; - esac - else - answer=yes - fi -fi - -case $answer in - no | correct) - -############################################################################## -# prompt for each value # -############################################################################## - - $ECHO " -Program name ($prog)? $ECHOTXT" - read value - if test "$value" - then - prog=$value - fi - $ECHO "Job ID ($jid)? $ECHOTXT" - read value - if test "$value" - then - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - fi - $ECHO "User subroutine name ($user)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - user= - ;; - *) - user=$value - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - esac - fi - $ECHO "User objects or libraries ($objs)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - objs= - ;; - *) - objs="$value" - ;; - esac - fi - $ECHO "Restart File Job ID ($rid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - rid= - ;; - *) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - esac - fi - $ECHO "Substructure File ID ($sid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - sid= - ;; - *) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - esac - fi - $ECHO "Post File Job ID ($pid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - pid= - ;; - *) - pid=$value - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - esac - fi - $ECHO "Defaults File ID ($did)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - did= - ;; - *) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - esac - fi - $ECHO "View Factor File ID ($vid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - vid= - ;; - *) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - esac - fi - $ECHO "Save generated module ($prgsav)? $ECHOTXT" - read value - if test "$value" - then - prgsav=$value - fi - $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" - read value - if test "$value" - then - nprocdddm=$value - nprocdddmprint=$value - fi - $ECHO "Run on ($nthread) threads ? $ECHOTXT" - read value - if test "$value" - then - nthread=$value - fi - $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" - read value - if test "$value" - then - nsolver=$value - fi -# - if test $nprocdddm -gt 0 - then - nprocd=$nprocdddm - fi - if test $nsolver -gt 0 - then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi - fi - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - nthreadprint=$nthread - if test $nthreadprint -eq 0 - then - nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi - fi -# - if test $nprocd -gt 1 - then - $ECHO "Message passing type ($itree)? $ECHOTXT" - read value - if test "$value" - then - itree=$value - fi - $ECHO "Host file name ($host)? $ECHOTXT" - read value - if test "$value" - then - host=$value - fi - if test $nprocdddm -gt 1 - then - $ECHO "Single input file? $ECHOTXT" - read value - case $value in - y* | Y*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" - read value - if test "$value" - then - compatible=$value - fi - $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" - read value - if test "$value" - then - cpinput=$value - fi - $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" - read value - if test "$value" - then - cpresults=$value - fi - fi - fi - $ECHO "Run the job in the queue ($qid)? $ECHOTXT" - read value - if test "$value" - then - qid=$value - fi - case $qid in - s* | S* | l* | L* | v* | V* ) - $ECHO "Queue priority ($priority)? $ECHOTXT" - read value - if test "$value" - then - priority=$value - fi - $ECHO "Job starts at ($att)? $ECHOTXT" - read value - if test "$value" - then - att=$value - fi - $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" - read value - if test "$value" - then - cpu=$value - fi - ;; - * ) - ;; - esac - $ECHO "Auto Restart option ($nauto)? $ECHOTXT" - read value - if test "$value" - then - nauto=$value - fi - $ECHO "Run directory ($DIRJOB)? $ECHOTXT" - read value - if test "$value" - then - DIRJOB=$value - DIRSCR=$DIRJOB - fi - $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" - read value - if test "$value" - then - DIRSCR=$value - fi - ;; - quit) - exit 1 - ;; - *) - break - ;; - -esac - - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - -done - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - pathdll=yes - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - fi - - if test "$pathdll"; then -# -# reset share lib path -# - if test $MACHINENAME = "HP" - then - SHLIB_PATH=$DIRJOB:$SHLIB_PATH - export SHLIB_PATH - fi - if test $MACHINENAME = "IBM" - then - LIBPATH=$DIRJOB:$LIBPATH - export LIBPATH - fi -# - LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH - LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH - LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH - export LD_LIBRARY_PATH - export LD_LIBRARY64_PATH - export LD_LIBRARYN32_PATH - fi -fi -# end of dllrun>0 - - -if test $program = $exefile -o $program = $prog.marc -then - -# delete the old .log file unless we run in the background -if test "$deletelog" = yes -then - /bin/rm $jid.log 2>/dev/null -else - echo - echo running the job in the background, see $jid.log - echo -fi - -# -# check if this is an autoforge or rezoning or radiation job -# -if test $nprocd -eq 1 -then - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` - if test "$line" - then - autoforge=1 - fi -fi -# -# check that jobname for restarted run is not the same -# as restart file basename -# -if test "$rid" -then - if test "$jid" = "$rid" - then - echo " " - echo "ERROR: job name of current run is the same as job name" - echo " of the restarted job" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "ERROR: job name of current run is the same as job name" >> $jid.log - echo " of the restarted job" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi -fi - -# -# user objects/libraries used -# - - if test "$objs" - then - program="$DIRJOB/$jid.marc" - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# user subroutine used -# -# add DAMASK options for linking - DAMASK="" - - if test "$user" - then - program=$usernoext.marc - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# Special case for IBM using POE but not an SP machine -# in this case we always need a host file, also for serial jobs. -# -if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP -then - MP_HOSTFILE=${jid}.host - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $nprocd -gt 1 - then - numdom=$nprocd - while test $numdom -gt 0 - do - hostname -s >> $MP_HOSTFILE - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - else - hostname -s > $MP_HOSTFILE - fi -fi -# -# check correctness of host file; fix for user sub -# - if test $nprocd -gt 1 - then - -# construct the path name to the executable (execpath) - execpath=$MARC_BIN/$exefile - usersub=0 - if test $program = $prog.marc - then - execpath=$prog.marc - usersub=1 - fi - if test "$objs" - then - execpath="$DIRJOB/$jid.marc" - usersub=1 - fi - if test "$user" - then - execpath=$usernoext.marc - usersub=1 - fi - export execpath - execname=`$BASENAME $execpath` - - if test "$host" - then - userhost=$host - case $userhost in - \/* | \.\/*) - ;; - *) - userhost=`pwd`/$userhost - ;; - esac - -# check that the number of processes specified in the hostfile is -# equal to nprocd specified by -nprocd. - numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` - if test $nprocd -ne $numproc - then - echo " " - echo "error, the number of processes specified in the host file" - echo "must be equal to the number of processes given by -nprocd/-nsolver" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, the number of processes specified in the host file" >> $jid.log - echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - -# check for Myrinet that the number of processes per host is -# less than number of available user ports, 5 -# .gmpi directory must exist in user's home directory -# and must have write permission from remote hosts - if test $MPITYPE = "myrinet" - then - numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` - if test $numproc -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes specified " - echo "in the hostfile must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes specified " >> $jid.log - echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - if test ! -d ~/.gmpi - then - echo " " - echo "error, for Myrinet a .gmpi directory must exist " - echo "under the user's home directory" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log - echo "under the user's home directory" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - homedir=`echo ~` - for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - echo " " - echo "error, for Myrinet a shared .gmpi directory must exist " - echo "under the user's home directory " - echo "with remote write permission" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log - echo "under the user's home directory " >> $jid.log - echo "with remote write permission" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - /bin/rm tmp.$$ - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - fi - fi - done - fi - fi - -# construct the host file $jid.host which is used by mpirun -# skip lines starting with # and only consider lines with more than -# one word in them. Note that the hostfile given to this script -# has two columns: the host name and the number of shared processes -# to run on this host. mpirun wants the number of _other_ -# processes to run in addition to the one being run on the machine -# on which the job is started. hence the $2-1 for fnr == 1. - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then -# HPMPI or HP hardware MPI - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ - -v mpihpspecial="$MPIHPSPECIAL" \ -'{if ( NF > 0) {\ - fnr++ ; \ - printf("-h %s -np %s",$1,$2); \ - printf(" %s",mpihpspecial); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ - if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ - }\ - }' > $jid.host -# end HPMPI or HP hardware MPI - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then -# IBM using hardware MPI (POE) - MP_HOSTFILE=$jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host -# end IBM using hardware MPI (POE) -# for Intel MPI, need to create a machinefile for DMP - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then -# Intel MPI - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - /bin/cp $host $jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Intel MPI for DMP -# for Solaris HPC 7.1, need to create a machinefile for DMP - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then -# Solaris HPC 7.1 - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Solaris HPC 7.1 for DMP -# for Myrinet, construct a configuration file in ~/.gmpi -# this must be readable by each process -# format is (hostname) (port number) for each process - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - grep -v '^#' $host | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ -{if ( NF > 0 ) \ - for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ -}' >> ~/.gmpi/$jid.host - else -# this is for mpich-1.2.5 and later, using the -pg option -# format: host nproc executable user arguments -# the arguments are added later - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s %s\n",path,user);\ - if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ - }\ - }' > $jid.host - fi -# end Myrinet - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then -# Compaq MPI via Memory Channel - grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host -# end Compaq MPI - else -# MPICH - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ - }\ - }' > $jid.host - fi -# define the variable host and host_filt -# host_filt is used for loops over hosts -# for Myrinet we need to use a filtered variant of userhost -# for others we can use $host - if test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - host=~/.gmpi/$jid.host - host_filt=$jid.host_tMp - grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt - else - host=$jid.host - host_filt=$host - fi - else - host=$jid.host - host_filt=$host - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - host_filt=$jid.mfile - fi - fi -# figure out if the machines in the hostfile are nfs mounted -# or distributed and set the variable "dirstatus" accordingly. -# only perform the check if user subroutine is used -# or a user subroutine executable is used - - numfield=1 - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - numfield=2 - fi - DIR1=$DIRJOB - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - counter=0 - echo " " - echo "checking if local or shared directories for host" - if test "$deletelog" = no - then - echo "checking if local or shared directories for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - dirstatus[$counter]="shared" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - dirstatus[$counter]="local" - /bin/rm tmp.$$ - else - if test ! -f $jid.$$ - then - dirstatus[$counter]="local" - $RSH $i /bin/rm $DIR1/$jid.$$ - else - /bin/rm $jid.$$ - fi - fi - if test -f tmp.$$ - then - /bin/rm tmp.$$ - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - echo " ${dirstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${dirstatus[$counter]}" >> $jid.log - fi - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - fi - -# figure out if this is a compatible set of machines -# unless explicitly specified with flag -comp -# only perform the check if user subroutine is used -# or a user subroutine executable is used -# Myrinet does not support heterogeneous - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - if test $compatible = "unknown" - then - thisname=$ARCH - compatible=yes - counter=0 - echo "checking if machines are compatible for host" - if test "$deletelog" = no - then - echo "checking if machines are compatible for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]="yes" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - othername=`$RSH $i uname -a | cut -f 1 -d " "` - if test $thisname != $othername - then - compatible=no - compstatus[$counter]="no" - fi - fi - echo " ${compstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${compstatus[$counter]}" >> $jid.log - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - else - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]=$compatible - fi - done - if test $compatible = "no" - then - echo "all machines assumed incompatible" - if test "$deletelog" = no - then - echo "all machines assumed incompatible" >> $jid.log - fi - else - echo "all machines compatible" - if test "$deletelog" = no - then - echo "all machines compatible" >> $jid.log - fi - fi - fi -# error out if user objects or libraries are used on incompatible machines - if test "$compatible" = "no" -a -n "$objs" - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" - if test "$deletelog" = no - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log - fi - exit 1 - fi -# modify new host file if NFS mounted heterogeneous machine - doit= - if test $program = $prog.marc - then - doit=yes - fi - if test "$user" - then - doit=yes - fi - if test "$doit" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - $AWK -v hst=$i '{fnr++ ; \ -if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ -printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} - /bin/mv $jid.host{$$} $jid.host - host=$jid.host - fi - fi - done - fi - fi # if test $program = $prog.marc -o $user -o $obj - - else # if test $host - # assume shared memory machine if no hostfile given and - # MPITYPE is set to mpich or Myrinet - # check for Myrinet that the total number of processes is - # less than number of available user ports, 5 - if test $MPITYPE = "mpich" -o $MPITYPE = "scali" - then - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - host=$jid.host - elif test $MPITYPE = "myrinet" - then - if test $nprocd -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes " - echo "must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes " >> $jid.log - echo "must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - echo `hostname` $nprocd | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ - {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ -' >> ~/.gmpi/$jid.host - host=~/.gmpi/$jid.host - else - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - - fi - fi # if test myrinet - - fi # if test $host - - fi # if test $nprocd -gt 1 - -fi # if test $program = $exefile -o $program = $prog.marc - -############################################################################## -# construct run stream (Marc only) # -############################################################################## - -# set maximum message length for ddm to a large number -# for vendor provided mpi -if test $itree -eq 0 -a $MPITYPE = hardware -then - itree=100000000 - if test $MACHINENAME = SGI - then - itree=100000001 - fi -fi -if test $itree -eq 0 -a $MPITYPE = hpmpi -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = myrinet -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = nec -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = scali -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = intelmpi -then - itree=100000000 -fi -if test $nprocdddm -lt 2 -then - nprocdarg= -else - nprocdarg="$nprocdarg $nprocdddm" -fi -if test $nsolver -eq 0 -then - nsolverarg= -else - nsolverarg="$nsolverarg $nsolver" -fi -if test $nprocdddm -lt 2 -a $nsolver -eq 0 -then -nprocd=0 -fi -if test $nprocd -gt 0 -then - if test "$host" - then - if test -z "$RUN_JOB2" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then - RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - else - RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" - RUN_JOB=" -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - fi - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - numhost=`uniq $jid.mfile | wc -l` - if test "$INTELMPI_VERSION" = "HYDRA" - then - RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n $numhost -r $RSH -f $jid.mfile - RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" - fi - -# intelmpi uses configfile. format: -# -host host1 -n n1 executable marcargs -# one such line per host -# collect the marcargs in RUN_JOB and construct the config file later -# collect the run stream in RUN_JOB_TMP - RUN_JOB="-jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - - - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then - RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - fi - if test "$userhost" - then - RUN_JOB="$RUN_JOB -mhost $userhost" - fi - if test $MPITYPE = "scali" - then -# set default working directory to /tmp to allow -# different directory names - SCAMPI_WORKING_DIRECTORY=/tmp - export SCAMPI_WORKING_DIRECTORY - fi - else - if test -z "$RUN_JOB1" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - RUNNPROCD=$nprocd - if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" - then - RUNNPROCD= - MP_PROCS=$nprocd - export MP_PROCS - fi - if test $MPITYPE = "myrinet" - then - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread -dirjob $DIRJOB " - fi - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - touch $jid.hosts - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n 1 -f $jid.hosts - fi -# /bin/rm $jid.hosts 2> /dev/null - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread -dirjob $DIRJOB " - fi - fi -else - if test $nauto -gt 0 -o $ndcoup -gt 0 - then - RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ - -nthread $nthread -dirjob $DIRJOB " - else -# this is for a serial job without auto restart: - RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ --nthread $nthread -dirjob $DIRJOB " - fi -fi -if test "$rid" -then - RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" -fi -if test "$pid" -then - RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" -fi -if test "$sid" -then - RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" -fi -if test "$did" -then - RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" -fi -if test "$vid" -then - RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" -fi -if test $nauto -gt 0 -then - RUN_JOB="$RUN_JOB -autorst $nauto " -fi -if test $ndcoup -gt 0 -then - RUN_JOB="$RUN_JOB -dcoup $ndcoup " -fi -if test $ndytran -gt 0 -then - RUN_JOB="$RUN_JOB -dytran $ndytran " -fi -if test $mesh -gt 0 -then - RUN_JOB="$RUN_JOB -me $mesh " -fi -if test $noutcore -gt 0 -then - RUN_JOB="$RUN_JOB -outcore $noutcore " -fi -if test "$dllrun" -gt 0 -then - RUN_JOB="$RUN_JOB -dll $dllrun " -fi -if test "$trkrun" -gt 0 -then - RUN_JOB="$RUN_JOB -trk $trkrun " -fi -if test "$iam" -then - RUN_JOB="$RUN_JOB -iam $iam " -fi -if test "$justlist" -then - RUN_JOB="$RUN_JOB -list 1 " -fi -if test "$feature" -then - RUN_JOB="$RUN_JOB -feature $feature " -fi -if test "$memlimit" -ne 0 -then - RUN_JOB="$RUN_JOB -ml $memlimit " -fi -if test "$cpinput" -then - RUN_JOB="$RUN_JOB -ci $cpinput " -fi -if test "$cpresults" -then - RUN_JOB="$RUN_JOB -cr $cpresults " -fi -if test "$DIRSCR" != "$DIRJOB" -then - RUN_JOB="$RUN_JOB -dirscr $DIRSCR" -else - DIRSCR=$DIRJOB -fi -if test "$makebdf" -then - RUN_JOB="$RUN_JOB -bdf $makebdf " -fi -if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" -then - # append $RUN_JOB to all lines of the host file - # and set RUN_JOB - $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ - /bin/mv $host.$$ $host - RUN_JOB=$RUN_JOB_TMP -fi -if test $MPITYPE = "intelmpi" -a "$host" -then - # construct config file, append $RUN_JOB to all lines of the config file - # and set RUN_JOB - if test "$INTELMPI_VERSION" = "HYDRA" - then - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - else - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-host %s -n %s",$1,$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - fi - RUN_JOB=$RUN_JOB_TMP -fi -echo " " -echo "Final run stream value" -echo " RUNJOB="$RUN_JOB -if test "$deletelog" = no -then -echo " " >> $jid.log -echo "Final run stream value" >> $jid.log -echo " RUNJOB="$RUN_JOB >> $jid.log -fi - - -############################################################################## -# run marc using valgrind # -############################################################################## -#RUN_JOB="valgrind $RUN_JOB" -#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" -############################################################################## - - -############################################################################## -# run the requested program in a queue # -############################################################################## - -if test "$deletelog" = yes -then - echo - date -else - echo >> $jid.log - date >> $jid.log -fi -if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] -then - -/bin/rm -f $jid.runmarcscript - - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - userobj=$usernoext.o - fi - cat > $jid.runmarcscript << END4 - if test "$user" - then - if test $MACHINENAME = "CRAY" - then - $DFORTLOWMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTLOWMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } -END4 -else - prgsav=yes -fi -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# - -cat >> $jid.runmarcscript << END5 - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -# first remove all .out files and incremental restart files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null - /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null -fi - -if test $nprocdddm -gt 1 -then - $RUN_JOB 2>>$jid.log -else - $RUN_JOB 2>>$jid.log -fi - -if test $dllrun -eq 0; then - if test $prgsav = no - then - /bin/rm -f $bd$program 2>/dev/null - fi -else - if test $cpdll = yes; then - filename=`basename $usersubname .f` - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes - then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -END5 - - -# Submit to marc batch queue -# -if [ $qid = at ] -then -QUENAME=at -SUBMCMD= -else -# -# Submit to qsub queue -# -QUENAME=qsub -SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" -if test "$priority" -then - SUBMCMD=$SUBMCMD" -p $priority" -fi -if test "$att" -then - SUBMCMD=$SUBMCMD" -a $att" -fi -if test "$cpu" -then - SUBMCMD=$SUBMCMD" -lt $cpu" -fi - -fi -echo $QUENAME $SUBMCMD -#cat $jid.runmarcscript -$QUENAME $SUBMCMD < $jid.runmarcscript - -/bin/rm -f $jid.runmarcscript - -############################################################################## -# run the requested program in the background # -############################################################################## - -else -if test $qid = background -then - -# -# first remove all old .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi -# -# compile user subroutine if present -# -( -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_lmp $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - echo " $PRODUCT Exit number 3" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTLOWMP $user || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTLOWMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - echo " $PRODUCT Exit number 3" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc - -# - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -$RUN_JOB & - -marcpid=$! -echo $marcpid > $DIRJOB/$jid.pid -wait $marcpid - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=`basename $usersubname .f` - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -) 1>>$jid.log 2>&1 & - - -############################################################################## -# run the requested program in the foreground # -############################################################################## - -else - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_lmp $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTLOWMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTLOWMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi -# first remove all .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi - -$RUN_JOB - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - if test "$host" - then - mpdcleanup -a -f $jid.mfile - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.mfile 2> /dev/null - else - mpdcleanup -a -f $jid.hosts - /bin/rm $jid.hosts 2> /dev/null - fi - fi - fi -fi - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=`basename $usersubname .f` - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi - - -fi -fi diff --git a/installation/mods_MarcMentat/2011/Marc_tools/run_damask_mp b/installation/mods_MarcMentat/2011/Marc_tools/run_damask_mp deleted file mode 100644 index 8a0ed187e..000000000 --- a/installation/mods_MarcMentat/2011/Marc_tools/run_damask_mp +++ /dev/null @@ -1,3625 +0,0 @@ -#!/bin/ksh -############################################################################## -# # -# run_marc - run a marc job # -# ------------------------- # -# # -# usage: run_marc -j jid { options } # -# # -# where standard options are: required: defaults: # -# -------------------------- # -# # -# -j* jid job id number. ** YES ** . # -# -pr* prog program name. . marc # -# -v* y|n do or do not verify inputs. . yes # -# -q* s|l|v|b|f batch queue name or background, . short # -# foreground. # -# -b* as alternative to option -q* # -# # -# ( batch queues only : # -# -pq* intra queue priority. . . # -# -at DATE/TIME delay start of job. . . # -# format : January,1,1990,12:31 # -# or : today,5pm # -# -cpu* secs job CPU limit . . ) # -# # -# -r* rid restart file job id. . . # -# -si* sid substructure file id. . . # -# -pi* post post file job id. . . # -# -de* did defaults file . no # -# -vf vid viewfactor . no # -# # -# -u* user user subroutine. . . # -# -obj obj user objects or libraries. . . # -# -sa* y|n do or do not save load module. . no # -# -autorst auto restart flag for auto forge . no # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo selects i4 or i8 version # -# default: i4 or via defaults file run_marc_defaults # -# the -mo option will override # -# -mpi selects MPI version # -# each platform has a default MPI version and some # -# have an alternative version. see the include file # -# for the respective platform # -# MPI_DEFAULT defines the default MPI version # -# MPI_OTHER defines versions one can switch to # -# -dcoup for contact decoupling # -# currently not supported # -# -dir directory where the job i/o should take place. # -# defaults to current directory. # -# -sdir directory where scratch files are created # -# defaults to current directory. # -# # -# -alloc only perform memory allocation test, no analysis # -# -list y only list options in the input file, no analysis # -# -fe num set feature number "num" for the run. only one allowed # -# -dytran flag to switch from Dytran to Marc # -# dytran = 0, program will run w/o Marc-Dytran Switch # -# = 1, program will restart Marc after Dytran run # -# >= 2, Not supported yet. # -# currently not supported # -# -ou force analysis to use out-of-core control # -# =0, not used # -# =1, element storage out-of-core # -# -dll run marc using shared library libmarc.so and exe_marc # -# =1, used # -# =2, do not free streaming input memory # -# =3, run with marc input deck # -# -trk run marc for post-tracking # -# # -# where parallel options are: # -# -------------------------- # -# # -# itree, host, and comp options are available for the domain # -# decomposition only. # -# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # -# # -# # -# -nprocd number of domains. # -# defaults to single domain solution. # -# -nprocds number of domains if single input file. # -# defaults to single domain solution. # -# -nps same as -nprocds. # -# -nsolver number of solver tasks for solver types 12 and 13 # -# these are distributed tasks operating via MPI # -# -nthread number of solver threads for solver types 6, 8, and 11 # -# also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. if both specified, nthread option# -# will be used. # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by 6, 8, and 11 # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor nthread specified. # -# -itree message passing tree type for domain decomposition. # -# for debugging purposes; should not normally be used. # -# -host hostfile name for distributed execution on network. # -# defaults to no hostfile, unless jobid.defhost exists. # -# if jobid.defhost exists, only -np(s) necessary # -# -comp* y|n to be used with user routines on a network of # -# incompatible machines. # -# if set to no, a separate executable will be created # -# for each machine on the network. # -# if set to yes, the executable located on the machine # -# from which marc is started will be used on all machines.# -# defaults to no if O/S versions different on machines. # -# # -# -ci y|n copy input files to remote hosts (default: yes) # -# if "yes", input files are automatically copied to # -# remote hosts for a network run if necessary. # -# -cr y|n copy post files from remote hosts (default: yes) # -# if "yes", post files are automatically copied back from # -# remote hosts for a network run if necessary. # -############################################################################## -# set DIR to the directory in which this script is -REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" -DIR=`dirname $REALCOM` -# make sure DIR has an absolute path -case $DIR in - \/*) - ;; - *) - DIR=`pwd`/$DIR - ;; -esac -DIRSCRIPT=$DIR -AWK=awk -ARCH=`uname -a | cut -f 1 -d " "` -# Sun has a bad awk, use nawk instead -if test $ARCH = "SunOS" -then - AWK=nawk -fi -BASENAME=basename -# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists -if test $ARCH = "SunOS" -then - if test -x /usr/ucb/basename - then - BASENAME=/usr/ucb/basename - fi -fi - -# echo command line in the case of ECHO_COMMAND is true -if test "$ECHO_COMMAND" = true ; then - echo command "$0" "$@" -fi - -# -# "mode" selects version, i4 or i8 -# default is i4 -# this can be changed by a file run_marc_defaults -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MODE i8 -# it can also be set by the environmental variable MARC_INTEGER_SIZE -# and by the command line option "-mo" -# -mode= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -f $HOME/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -n "$MARC_INTEGER_SIZE" ; then - mode=$MARC_INTEGER_SIZE -fi -if test -z "$mode" ; then - mode=i4 -fi -case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "error, version mode must be i4 or i8" - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i4 or i8" - echo " " - echo " use -mo i4 or -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - setmode=true - fi - if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - fi - if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -done - -# set to i4 version for 32 bit Linux -if test "`uname -s`" = "Linux"; then - if test "`uname -m`" = "i686"; then - mode=i4 - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -fi - - -. "$DIR/getarch" - -# Change_me -. $MARC_INCLUDE -# - -# -# Dynamically determine the echo syntax -# - -case "`echo '\c'`" in - '\c') - ECHO='echo -n' - ECHOTXT=' ' - ;; - *) - ECHO='echo' - ECHOTXT=' \c' - ;; -esac - -# -# Variables for the MARC environment -# - -PRODUCT="Marc" -EXITMSG=$MARC_TOOLS/MESSAGES -export EXITMSG -FLEXDIR=$DIR/../flexlm/licenses -export FLEXDIR -TIMCHK=3600 -export TIMCHK -BINDIR=$MARC_BIN -export BINDIR -AFMATDAT=$MARC_RUNTIME/AF_flowmat/ -export AFMATDAT -# -# define directory path to global unified material database -# -MATFILE= -export MATFILE - -# -# define memory limit -# first set to MEMLIMIT from include -# -ml option overrules if specified -memlimit=$MEMLIMIT -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -# -if test $MACHINENAME = "HP" -then - SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH - export SHLIB_PATH -fi -# the one for IBM is defined futher down - -LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH -LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH -export LD_LIBRARY_PATH -export LD_LIBRARY64_PATH -export LD_LIBRARYN32_PATH - -atexit() { -kill -15 $$ -# -if test $MPITYPE = "myrinet" -then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi -fi -} - -trap "atexit" 2 - -# -# defaults -# - -prog=marc -exefile=marc -jid= -rid= -pid= -sid= -did= -vid= -user= -usernoext= -objs= -qid=background -cpu= -priority= -att= -trk= -verify=yes -prgsav=no -rmdll=no -cpdll=no -progdll= -pathdll= -error= -nprocd=0 -nprocdddm=1 -nprocdddmprint= -icreated=0 -nprocdarg= -nsolver=0 -nsolverarg=-nsolver -if test $nprocds -then - if test $nprocds -gt 1 - then - nprocdddm=$nprocds - nprocdddmprint=$nprocds - icreated=1 - nprocdarg=-nprocds - fi -fi -nthread=-1 -nauto=0 -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -nthreadprint=0 -itree=0 -iam= -link= -trkrun=0 -DIRJOB=`pwd` -DIRSCR=$DIRJOB -DIRSCRSET= -autoforge=0 -dotdat=.dat -dotdefhost=.defhost -host= -numhost= -mfile= -userhost= -makebdf= -cpinput=yes -cpresults=yes -marcdll=libmarc.$EXT_DLL -# define hostname and strip off extensions (alpha.aaa.com) -thishost=`hostname` -thishost=${thishost%%.*} -compatible=unknown -numfield=1 -justlist= -feature= -mpioption=false -MDSRCLIB=$MARC_LIB/mdsrc.a -# -# check run_marc_defaults file for default MPI setting -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MPI -# -value= -file= -if test -f $DIRSCRIPT/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$DIRSCRIPT/run_marc_defaults - fi -fi -if test -f $HOME/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$HOME/run_marc_defaults - fi -fi -if test -n "$value"; then - MARC_MPITYPE=$value - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - echo " " - echo " error, incorrect option for MARC_MPI" - echo " defined in $file: $MARC_MPITYPE" - echo " valid options: $MPI_DEFAULT $MPI_OTHER" - echo " " - exit - fi - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - fi -fi -# -# -# allow scratch directory to be specified with environmental variable -# MARCSCRATCH -if test $MARCSCRATCH -then - if test -d $MARCSCRATCH - then - DIRSCR=$MARCSCRATCH - else - echo "error, scratch directory '$MARCSCRATCH'" - echo " specified via environmental variable MARCSCRATCH does not exist" - exit - fi -fi -# -############################################################################## -# parse input - arguments always come in pairs # -############################################################################## - -arg=$1 -if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - shift - arg=$1 -fi -while [ -n "$arg" ] -do - shift - value=$1 - case $arg in - -al* | -AL*) - $MARC_BIN/marc -alloc 1 - exit - ;; - -li* | -LI*) - justlist=yes - ;; - -fe* | -FE*) - feature=$value - ;; - -pr* | -PR*) - if test `dirname $value` = '.' - then - prog=`$BASENAME $value .marc` - progdll=`$BASENAME $value` - else - prog=`dirname $value`/`$BASENAME $value .marc` - progdll=`dirname $value`/`$BASENAME $value` - fi - prdir=`dirname $value` - case $prdir in - \/*) - ;; - *) - prog=`pwd`/$prdir/$prog - ;; - esac - ;; - -j* | -J*) - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - ;; - -r* | -R*) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - -si* | -SI*) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - -pi* | -PI*) - if test -f $value.t19 - then - pid=`$BASENAME $value .t19` - else - pid=`$BASENAME $value .t16` - fi - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - -bdf | -BDF) - makebdf=1 - ;; - -de* | -DE*) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - -vf | -VF) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - -u* | -U*) - - user=$value - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - -obj | -OBJ) - objs="$value" - ;; - -q* | -Q*) - qid=$value - ;; - -b* | -B*) - case $value in - y* | Y*) - qid=background - ;; - n* | N*) - qid=foreground - ;; - *) - ;; - esac - ;; - -at | -AT) - att=$value - ;; - -cpu* | -CPU*) - cpu=$value - ;; - -pq | -PQ*) - priority=$value - ;; - -v* | -V*) - verify=$value - ;; - -sa* | -SA*) - prgsav=$value - ;; - -np* | -NP*) - nprocdddm=$value - nprocdddmprint=$value - case $arg in - -nps* | -NPS* | -nprocds* | -NPROCDS*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - case $arg in - -np | -NP | -nprocd | -NPROCD) - icreated=0 - nprocdarg=-nprocd - ;; - esac - ;; - -ns* | -NS*) - nsolver=$value - ;; - -nt* | -NT*) - nthread=$value - ;; - -it* | -IT*) - itree=$value - ;; - -iam | -IAM) - iam=$value - ;; - -au* | -AU*) - nauto=$value - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -me | -ME ) - mesh=$value - ;; - -ml | -ML ) - memlimit=$value - ;; - -mo | -MO ) - ;; - -mpi | -MPI ) - mpioption=true - MARC_MPITYPE=$value - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - fi - fi - ;; - -dir* | -DIR*) - DIRJOB=$value - case $DIRJOB in - \/*) - ;; - *) - DIRJOB=`pwd`/$DIRJOB - ;; - esac - if test -z "$DIRSCRSET" - then - DIRSCR=$DIRJOB - fi - ;; - -sd* | -SD*) - DIRSCR=$value - DIRSCRSET=yes - case $DIRSCR in - \/*) - ;; - *) - DIRSCR=`pwd`/$DIRSCR - ;; - esac - ;; - -ho* | -HO*) - host=$value - ;; - -co* | -CO*) - compatible=$value - ;; - -ci* | -CI*) - cpinput=$value - ;; - -cr* | -CR*) - cpresults=$value - ;; - *) - error="$error -$arg: invalid option" - break - ;; - esac - case $value in - -*) - error="$error -$arg: invalid name $value" - break - ;; - esac - shift - arg=$1 - if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - shift - arg=$1 - fi -done -argc=`expr $# % 2` -if test $argc -eq 1 -then -# -# odd number of arguments -# - error="$error -argument list incomplete" -fi - -if test $nprocdddm -gt 0 -then -nprocd=$nprocdddm -fi - -if test $nsolver -gt 0 -then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi -fi - -if test $nthread -eq -1 -then -nthread=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nthread -lt 0 -then -nthread=0 -fi - -nthreadprint=$nthread -if test $nthreadprint -eq 0 -then -nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi -fi - -nthread=$nthreadprint - - - -if test $nprocd -gt 1; then - if test -f $jid$dotdefhost; then - if test "$host" = ""; then - host=$jid$dotdefhost - fi - fi - if test -f hostfile_qa_$nprocd; then - if test "$host" = ""; then - host=hostfile_qa_$nprocd - fi - fi -fi - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then - dotdat=.inp - fi - - if test "$progdll"; then - /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll - rmdll=yes - pathdll=yes - progdll=${progdll}_$marcdll - else - progdll=$marcdll - fi - - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - pathdll=yes - fi -fi - -############################################################################## -# check parameter validity # -############################################################################## - -while test forever; do - -# -# check for input file existence -# -if test $nprocdddm -gt 1 -a $icreated -eq 0; then - if test ! -f $DIRJID/1$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/1$jid$dotdat not accessible" - fi - fi -else - if test ! -f $DIRJID/$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/$jid$dotdat not accessible" - fi - fi -fi - if test $nprocd -gt 1; then - if test "$host" ; then - if test ! -f $host; then - error="$error -host name file $host not accessible" - fi - fi - fi - -# -# check if the job is already running in the background -# -if test -f $DIRJOB/$jid.pid; then - error="$error -job is already running (the file $jid.pid exists)" -fi - -# -# if the program name is other than marc, then -# assume that this is a program in the users local directory -# - -bd=$MARC_BIN/ - -case $prog in - marc | MARC | $exefile) - program=$exefile - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - if test ! -f $user - then - error="$error -user subroutine file $user not accessible" - fi - fi - if test "$objs" - then - missingobjs= - for o in $objs - do - if test ! -f "$o" - then - if test -z "$missingobjs" - then - missingobjs="$o" - else - missingobjs="$missingobjs $o" - fi - fi - done - if test -n "$missingobjs" - then - error="$error -user object/library file(s) $missingobjs not accessible" - fi - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$vid" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRVID/1$vid.vfs - then - error="$error -view factor file $DIRVID/1$vid.vfs not accessible" - fi - else - if test ! -f $DIRVID/$vid.vfs - then - error="$error -view factor file $DIRVID/$vid.vfs not accessible" - fi - fi - fi - if $mpioption - then - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" - fi - fi - ;; - *) - program=$prog.marc - case $prog in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - error="$error -program option may not be used with user subroutine" - fi - if test "$objs" - then - error="$error -program option may not be used with user objects or libraries" - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$nauto" - then - if test $nauto -gt 2 - then - error="$error -incorrect option for auto restart " - fi - fi - if test "$ndcoup" - then - if test $ndcoup -gt 3 - then - error="$error -incorrect option for contact decoupling " - fi - fi - if test "$ndytran" - then - if test $ndytran -gt 1 - then - error="$error -incorrect option for Marc-Dytran Switch " - fi - fi - if $mpioption - then - if test ! -x $MARC_BIN/$exefile - then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE " - fi - fi - ;; -esac - -############################################################################## -# check argument integrity # -############################################################################## - -if test "$jid" -then - : -else - error="$error -job id required" -fi - -if test $nprocd -gt 1 -then - if test $nauto -gt 0 - then - error="$error -cannot run DDM job with auto restart (-au) option " - fi -fi -case $qid in - S* | s*) - qid=short - ;; - L* | l*) - qid=long - ;; - V* | v*) - qid=verylong - ;; - B* | b*) - qid=background - ;; - F* | f*) - qid=foreground - ;; - A* | a*) - qid=at - ;; - *) - error="$error -bad value for queue_id option" - ;; -esac - -case $prgsav in - N* | n*) - prgsav=no - ;; - Y* | y*) - prgsav=yes - ;; - *) - error="$error -bad value for save option" - ;; -esac - -case $verify in - N* | n*) - verify=no - ;; - Y* | y*) - verify=yes - ;; - *) - error="$error -bad value for verify option" - ;; -esac - -case $nprocdddm in - -* ) - error="$error -bad value for nprocd option" - ;; -esac - -case $nthread in - -* ) - error="$error -bad value for nthread option" - ;; -esac - -case $itree in - -* ) - error="$error -bad value for itree option" - ;; -esac -case $iam in - -* ) - error="$error -bad value for iam option" - ;; -esac -case $compatible in - N* | n*) - compatible=no - ;; - Y* | y*) - compatible=yes - ;; - unknown) - ;; - *) - error="$error -bad value for comp option" - ;; -esac -case $cpinput in - N* | n*) - cpinput=no - ;; - Y* | y*) - cpinput=yes - ;; - *) - error="$error -bad value for copy input option" - ;; -esac -case $cpresults in - N* | n*) - cpresults=no - ;; - Y* | y*) - cpresults=yes - ;; - *) - error="$error -bad value for copy results option" - ;; -esac - -# -# check for external file to run -# -if test -f $MARC_TOOLS/run_marc_check -then - . $MARC_TOOLS/run_marc_check -fi - -# -# pick up version data from bin/VERSION if it exists -# -if test -f $MARC_BIN/VERSION; then - ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` - if test -n "$ppp" ;then - PRODUCT=$ppp - fi - ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` - if test -n "$ppp" ;then - REVISION=", Build $ppp" - fi -fi -############################################################################## -# interact with the user to get the required information to run marc or # -# other marc system program # -############################################################################## - -deletelog=yes -if test $qid = background -a $verify = no -then -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto " > $jid.log -deletelog=no -fi -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto" - - -case $qid in - s* | S* | l* | L* | v* | V* ) - echo \ -"Queue priority : $priority -Queue CPU limit : $cpu -Queue start time : $att" - ;; -# * ) -# echo \ -#" " -# ;; -esac - -if test "$error" -then - if test $verify = yes - then - $ECHO "$error - -Please correct or quit(correct,quit,): $ECHOTXT" - error= - read answer - case $answer in - q* | Q*) - answer=quit - ;; - *) - answer=correct - ;; - esac - else - $ECHO "$error - $ECHOTXT" - echo " " - if test "$deletelog" = no - then - $ECHO "$error - $ECHOTXT" >> $jid.log - echo " " >> $jid.log - fi - answer=quit - fi -else - if test $verify = yes - then - $ECHO " -Are these parameters correct (yes,no,quit,)? $ECHOTXT" - read answer - case $answer in - q* | Q*) - answer=quit - ;; - y* | Y*) - answer=yes - ;; - *) - answer=no - ;; - esac - else - answer=yes - fi -fi - -case $answer in - no | correct) - -############################################################################## -# prompt for each value # -############################################################################## - - $ECHO " -Program name ($prog)? $ECHOTXT" - read value - if test "$value" - then - prog=$value - fi - $ECHO "Job ID ($jid)? $ECHOTXT" - read value - if test "$value" - then - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - fi - $ECHO "User subroutine name ($user)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - user= - ;; - *) - user=$value - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - esac - fi - $ECHO "User objects or libraries ($objs)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - objs= - ;; - *) - objs="$value" - ;; - esac - fi - $ECHO "Restart File Job ID ($rid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - rid= - ;; - *) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - esac - fi - $ECHO "Substructure File ID ($sid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - sid= - ;; - *) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - esac - fi - $ECHO "Post File Job ID ($pid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - pid= - ;; - *) - pid=$value - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - esac - fi - $ECHO "Defaults File ID ($did)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - did= - ;; - *) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - esac - fi - $ECHO "View Factor File ID ($vid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - vid= - ;; - *) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - esac - fi - $ECHO "Save generated module ($prgsav)? $ECHOTXT" - read value - if test "$value" - then - prgsav=$value - fi - $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" - read value - if test "$value" - then - nprocdddm=$value - nprocdddmprint=$value - fi - $ECHO "Run on ($nthread) threads ? $ECHOTXT" - read value - if test "$value" - then - nthread=$value - fi - $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" - read value - if test "$value" - then - nsolver=$value - fi -# - if test $nprocdddm -gt 0 - then - nprocd=$nprocdddm - fi - if test $nsolver -gt 0 - then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi - fi - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - nthreadprint=$nthread - if test $nthreadprint -eq 0 - then - nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi - fi -# - if test $nprocd -gt 1 - then - $ECHO "Message passing type ($itree)? $ECHOTXT" - read value - if test "$value" - then - itree=$value - fi - $ECHO "Host file name ($host)? $ECHOTXT" - read value - if test "$value" - then - host=$value - fi - if test $nprocdddm -gt 1 - then - $ECHO "Single input file? $ECHOTXT" - read value - case $value in - y* | Y*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" - read value - if test "$value" - then - compatible=$value - fi - $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" - read value - if test "$value" - then - cpinput=$value - fi - $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" - read value - if test "$value" - then - cpresults=$value - fi - fi - fi - $ECHO "Run the job in the queue ($qid)? $ECHOTXT" - read value - if test "$value" - then - qid=$value - fi - case $qid in - s* | S* | l* | L* | v* | V* ) - $ECHO "Queue priority ($priority)? $ECHOTXT" - read value - if test "$value" - then - priority=$value - fi - $ECHO "Job starts at ($att)? $ECHOTXT" - read value - if test "$value" - then - att=$value - fi - $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" - read value - if test "$value" - then - cpu=$value - fi - ;; - * ) - ;; - esac - $ECHO "Auto Restart option ($nauto)? $ECHOTXT" - read value - if test "$value" - then - nauto=$value - fi - $ECHO "Run directory ($DIRJOB)? $ECHOTXT" - read value - if test "$value" - then - DIRJOB=$value - DIRSCR=$DIRJOB - fi - $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" - read value - if test "$value" - then - DIRSCR=$value - fi - ;; - quit) - exit 1 - ;; - *) - break - ;; - -esac - - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - -done - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - pathdll=yes - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - fi - - if test "$pathdll"; then -# -# reset share lib path -# - if test $MACHINENAME = "HP" - then - SHLIB_PATH=$DIRJOB:$SHLIB_PATH - export SHLIB_PATH - fi - if test $MACHINENAME = "IBM" - then - LIBPATH=$DIRJOB:$LIBPATH - export LIBPATH - fi -# - LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH - LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH - LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH - export LD_LIBRARY_PATH - export LD_LIBRARY64_PATH - export LD_LIBRARYN32_PATH - fi -fi -# end of dllrun>0 - - -if test $program = $exefile -o $program = $prog.marc -then - -# delete the old .log file unless we run in the background -if test "$deletelog" = yes -then - /bin/rm $jid.log 2>/dev/null -else - echo - echo running the job in the background, see $jid.log - echo -fi - -# -# check if this is an autoforge or rezoning or radiation job -# -if test $nprocd -eq 1 -then - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` - if test "$line" - then - autoforge=1 - fi -fi -# -# check that jobname for restarted run is not the same -# as restart file basename -# -if test "$rid" -then - if test "$jid" = "$rid" - then - echo " " - echo "ERROR: job name of current run is the same as job name" - echo " of the restarted job" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "ERROR: job name of current run is the same as job name" >> $jid.log - echo " of the restarted job" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi -fi - -# -# user objects/libraries used -# - - if test "$objs" - then - program="$DIRJOB/$jid.marc" - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# user subroutine used -# -# add DAMASK options for linking - DAMASK="" - - - if test "$user" - then - program=$usernoext.marc - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# Special case for IBM using POE but not an SP machine -# in this case we always need a host file, also for serial jobs. -# -if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP -then - MP_HOSTFILE=${jid}.host - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $nprocd -gt 1 - then - numdom=$nprocd - while test $numdom -gt 0 - do - hostname -s >> $MP_HOSTFILE - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - else - hostname -s > $MP_HOSTFILE - fi -fi -# -# check correctness of host file; fix for user sub -# - if test $nprocd -gt 1 - then - -# construct the path name to the executable (execpath) - execpath=$MARC_BIN/$exefile - usersub=0 - if test $program = $prog.marc - then - execpath=$prog.marc - usersub=1 - fi - if test "$objs" - then - execpath="$DIRJOB/$jid.marc" - usersub=1 - fi - if test "$user" - then - execpath=$usernoext.marc - usersub=1 - fi - export execpath - execname=`$BASENAME $execpath` - - if test "$host" - then - userhost=$host - case $userhost in - \/* | \.\/*) - ;; - *) - userhost=`pwd`/$userhost - ;; - esac - -# check that the number of processes specified in the hostfile is -# equal to nprocd specified by -nprocd. - numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` - if test $nprocd -ne $numproc - then - echo " " - echo "error, the number of processes specified in the host file" - echo "must be equal to the number of processes given by -nprocd/-nsolver" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, the number of processes specified in the host file" >> $jid.log - echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - -# check for Myrinet that the number of processes per host is -# less than number of available user ports, 5 -# .gmpi directory must exist in user's home directory -# and must have write permission from remote hosts - if test $MPITYPE = "myrinet" - then - numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` - if test $numproc -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes specified " - echo "in the hostfile must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes specified " >> $jid.log - echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - if test ! -d ~/.gmpi - then - echo " " - echo "error, for Myrinet a .gmpi directory must exist " - echo "under the user's home directory" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log - echo "under the user's home directory" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - homedir=`echo ~` - for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - echo " " - echo "error, for Myrinet a shared .gmpi directory must exist " - echo "under the user's home directory " - echo "with remote write permission" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log - echo "under the user's home directory " >> $jid.log - echo "with remote write permission" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - /bin/rm tmp.$$ - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - fi - fi - done - fi - fi - -# construct the host file $jid.host which is used by mpirun -# skip lines starting with # and only consider lines with more than -# one word in them. Note that the hostfile given to this script -# has two columns: the host name and the number of shared processes -# to run on this host. mpirun wants the number of _other_ -# processes to run in addition to the one being run on the machine -# on which the job is started. hence the $2-1 for fnr == 1. - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then -# HPMPI or HP hardware MPI - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ - -v mpihpspecial="$MPIHPSPECIAL" \ -'{if ( NF > 0) {\ - fnr++ ; \ - printf("-h %s -np %s",$1,$2); \ - printf(" %s",mpihpspecial); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ - if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ - }\ - }' > $jid.host -# end HPMPI or HP hardware MPI - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then -# IBM using hardware MPI (POE) - MP_HOSTFILE=$jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host -# end IBM using hardware MPI (POE) -# for Intel MPI, need to create a machinefile for DMP - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then -# Intel MPI - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - /bin/cp $host $jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Intel MPI for DMP -# for Solaris HPC 7.1, need to create a machinefile for DMP - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then -# Solaris HPC 7.1 - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Solaris HPC 7.1 for DMP -# for Myrinet, construct a configuration file in ~/.gmpi -# this must be readable by each process -# format is (hostname) (port number) for each process - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - grep -v '^#' $host | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ -{if ( NF > 0 ) \ - for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ -}' >> ~/.gmpi/$jid.host - else -# this is for mpich-1.2.5 and later, using the -pg option -# format: host nproc executable user arguments -# the arguments are added later - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s %s\n",path,user);\ - if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ - }\ - }' > $jid.host - fi -# end Myrinet - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then -# Compaq MPI via Memory Channel - grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host -# end Compaq MPI - else -# MPICH - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ - }\ - }' > $jid.host - fi -# define the variable host and host_filt -# host_filt is used for loops over hosts -# for Myrinet we need to use a filtered variant of userhost -# for others we can use $host - if test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - host=~/.gmpi/$jid.host - host_filt=$jid.host_tMp - grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt - else - host=$jid.host - host_filt=$host - fi - else - host=$jid.host - host_filt=$host - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - host_filt=$jid.mfile - fi - fi -# figure out if the machines in the hostfile are nfs mounted -# or distributed and set the variable "dirstatus" accordingly. -# only perform the check if user subroutine is used -# or a user subroutine executable is used - - numfield=1 - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - numfield=2 - fi - DIR1=$DIRJOB - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - counter=0 - echo " " - echo "checking if local or shared directories for host" - if test "$deletelog" = no - then - echo "checking if local or shared directories for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - dirstatus[$counter]="shared" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - dirstatus[$counter]="local" - /bin/rm tmp.$$ - else - if test ! -f $jid.$$ - then - dirstatus[$counter]="local" - $RSH $i /bin/rm $DIR1/$jid.$$ - else - /bin/rm $jid.$$ - fi - fi - if test -f tmp.$$ - then - /bin/rm tmp.$$ - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - echo " ${dirstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${dirstatus[$counter]}" >> $jid.log - fi - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - fi - -# figure out if this is a compatible set of machines -# unless explicitly specified with flag -comp -# only perform the check if user subroutine is used -# or a user subroutine executable is used -# Myrinet does not support heterogeneous - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - if test $compatible = "unknown" - then - thisname=$ARCH - compatible=yes - counter=0 - echo "checking if machines are compatible for host" - if test "$deletelog" = no - then - echo "checking if machines are compatible for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]="yes" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - othername=`$RSH $i uname -a | cut -f 1 -d " "` - if test $thisname != $othername - then - compatible=no - compstatus[$counter]="no" - fi - fi - echo " ${compstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${compstatus[$counter]}" >> $jid.log - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - else - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]=$compatible - fi - done - if test $compatible = "no" - then - echo "all machines assumed incompatible" - if test "$deletelog" = no - then - echo "all machines assumed incompatible" >> $jid.log - fi - else - echo "all machines compatible" - if test "$deletelog" = no - then - echo "all machines compatible" >> $jid.log - fi - fi - fi -# error out if user objects or libraries are used on incompatible machines - if test "$compatible" = "no" -a -n "$objs" - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" - if test "$deletelog" = no - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log - fi - exit 1 - fi -# modify new host file if NFS mounted heterogeneous machine - doit= - if test $program = $prog.marc - then - doit=yes - fi - if test "$user" - then - doit=yes - fi - if test "$doit" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - $AWK -v hst=$i '{fnr++ ; \ -if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ -printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} - /bin/mv $jid.host{$$} $jid.host - host=$jid.host - fi - fi - done - fi - fi # if test $program = $prog.marc -o $user -o $obj - - else # if test $host - # assume shared memory machine if no hostfile given and - # MPITYPE is set to mpich or Myrinet - # check for Myrinet that the total number of processes is - # less than number of available user ports, 5 - if test $MPITYPE = "mpich" -o $MPITYPE = "scali" - then - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - host=$jid.host - elif test $MPITYPE = "myrinet" - then - if test $nprocd -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes " - echo "must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes " >> $jid.log - echo "must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - echo `hostname` $nprocd | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ - {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ -' >> ~/.gmpi/$jid.host - host=~/.gmpi/$jid.host - else - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - - fi - fi # if test myrinet - - fi # if test $host - - fi # if test $nprocd -gt 1 - -fi # if test $program = $exefile -o $program = $prog.marc - -############################################################################## -# construct run stream (Marc only) # -############################################################################## - -# set maximum message length for ddm to a large number -# for vendor provided mpi -if test $itree -eq 0 -a $MPITYPE = hardware -then - itree=100000000 - if test $MACHINENAME = SGI - then - itree=100000001 - fi -fi -if test $itree -eq 0 -a $MPITYPE = hpmpi -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = myrinet -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = nec -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = scali -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = intelmpi -then - itree=100000000 -fi -if test $nprocdddm -lt 2 -then - nprocdarg= -else - nprocdarg="$nprocdarg $nprocdddm" -fi -if test $nsolver -eq 0 -then - nsolverarg= -else - nsolverarg="$nsolverarg $nsolver" -fi -if test $nprocdddm -lt 2 -a $nsolver -eq 0 -then -nprocd=0 -fi -if test $nprocd -gt 0 -then - if test "$host" - then - if test -z "$RUN_JOB2" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then - RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - else - RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" - RUN_JOB=" -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - fi - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - numhost=`uniq $jid.mfile | wc -l` - if test "$INTELMPI_VERSION" = "HYDRA" - then - RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n $numhost -r $RSH -f $jid.mfile - RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" - fi - -# intelmpi uses configfile. format: -# -host host1 -n n1 executable marcargs -# one such line per host -# collect the marcargs in RUN_JOB and construct the config file later -# collect the run stream in RUN_JOB_TMP - RUN_JOB="-jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - - - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then - RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - fi - if test "$userhost" - then - RUN_JOB="$RUN_JOB -mhost $userhost" - fi - if test $MPITYPE = "scali" - then -# set default working directory to /tmp to allow -# different directory names - SCAMPI_WORKING_DIRECTORY=/tmp - export SCAMPI_WORKING_DIRECTORY - fi - else - if test -z "$RUN_JOB1" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - RUNNPROCD=$nprocd - if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" - then - RUNNPROCD= - MP_PROCS=$nprocd - export MP_PROCS - fi - if test $MPITYPE = "myrinet" - then - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread -dirjob $DIRJOB " - fi - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - touch $jid.hosts - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n 1 -f $jid.hosts - fi -# /bin/rm $jid.hosts 2> /dev/null - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread -dirjob $DIRJOB " - fi - fi -else - if test $nauto -gt 0 -o $ndcoup -gt 0 - then - RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ - -nthread $nthread -dirjob $DIRJOB " - else -# this is for a serial job without auto restart: - RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ --nthread $nthread -dirjob $DIRJOB " - fi -fi -if test "$rid" -then - RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" -fi -if test "$pid" -then - RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" -fi -if test "$sid" -then - RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" -fi -if test "$did" -then - RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" -fi -if test "$vid" -then - RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" -fi -if test $nauto -gt 0 -then - RUN_JOB="$RUN_JOB -autorst $nauto " -fi -if test $ndcoup -gt 0 -then - RUN_JOB="$RUN_JOB -dcoup $ndcoup " -fi -if test $ndytran -gt 0 -then - RUN_JOB="$RUN_JOB -dytran $ndytran " -fi -if test $mesh -gt 0 -then - RUN_JOB="$RUN_JOB -me $mesh " -fi -if test $noutcore -gt 0 -then - RUN_JOB="$RUN_JOB -outcore $noutcore " -fi -if test "$dllrun" -gt 0 -then - RUN_JOB="$RUN_JOB -dll $dllrun " -fi -if test "$trkrun" -gt 0 -then - RUN_JOB="$RUN_JOB -trk $trkrun " -fi -if test "$iam" -then - RUN_JOB="$RUN_JOB -iam $iam " -fi -if test "$justlist" -then - RUN_JOB="$RUN_JOB -list 1 " -fi -if test "$feature" -then - RUN_JOB="$RUN_JOB -feature $feature " -fi -if test "$memlimit" -ne 0 -then - RUN_JOB="$RUN_JOB -ml $memlimit " -fi -if test "$cpinput" -then - RUN_JOB="$RUN_JOB -ci $cpinput " -fi -if test "$cpresults" -then - RUN_JOB="$RUN_JOB -cr $cpresults " -fi -if test "$DIRSCR" != "$DIRJOB" -then - RUN_JOB="$RUN_JOB -dirscr $DIRSCR" -else - DIRSCR=$DIRJOB -fi -if test "$makebdf" -then - RUN_JOB="$RUN_JOB -bdf $makebdf " -fi -if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" -then - # append $RUN_JOB to all lines of the host file - # and set RUN_JOB - $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ - /bin/mv $host.$$ $host - RUN_JOB=$RUN_JOB_TMP -fi -if test $MPITYPE = "intelmpi" -a "$host" -then - # construct config file, append $RUN_JOB to all lines of the config file - # and set RUN_JOB - if test "$INTELMPI_VERSION" = "HYDRA" - then - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - else - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-host %s -n %s",$1,$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - fi - RUN_JOB=$RUN_JOB_TMP -fi -echo " " -echo "Final run stream value" -echo " RUNJOB="$RUN_JOB -if test "$deletelog" = no -then -echo " " >> $jid.log -echo "Final run stream value" >> $jid.log -echo " RUNJOB="$RUN_JOB >> $jid.log -fi - - -############################################################################## -# run marc using valgrind # -############################################################################## -#RUN_JOB="valgrind $RUN_JOB" -#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" -############################################################################## - - -############################################################################## -# run the requested program in a queue # -############################################################################## - -if test "$deletelog" = yes -then - echo - date -else - echo >> $jid.log - date >> $jid.log -fi -if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] -then - -/bin/rm -f $jid.runmarcscript - - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - userobj=$usernoext.o - fi - cat > $jid.runmarcscript << END4 - if test "$user" - then - if test $MACHINENAME = "CRAY" - then - $DFORTRANMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTRANMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } -END4 -else - prgsav=yes -fi -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# - -cat >> $jid.runmarcscript << END5 - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -# first remove all .out files and incremental restart files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null - /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null -fi - -if test $nprocdddm -gt 1 -then - $RUN_JOB 2>>$jid.log -else - $RUN_JOB 2>>$jid.log -fi - -if test $dllrun -eq 0; then - if test $prgsav = no - then - /bin/rm -f $bd$program 2>/dev/null - fi -else - if test $cpdll = yes; then - filename=`basename $usersubname .f` - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes - then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -END5 - - -# Submit to marc batch queue -# -if [ $qid = at ] -then -QUENAME=at -SUBMCMD= -else -# -# Submit to qsub queue -# -QUENAME=qsub -SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" -if test "$priority" -then - SUBMCMD=$SUBMCMD" -p $priority" -fi -if test "$att" -then - SUBMCMD=$SUBMCMD" -a $att" -fi -if test "$cpu" -then - SUBMCMD=$SUBMCMD" -lt $cpu" -fi - -fi -echo $QUENAME $SUBMCMD -#cat $jid.runmarcscript -$QUENAME $SUBMCMD < $jid.runmarcscript - -/bin/rm -f $jid.runmarcscript - -############################################################################## -# run the requested program in the background # -############################################################################## - -else -if test $qid = background -then - -# -# first remove all old .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi -# -# compile user subroutine if present -# -( -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_mp $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - echo " $PRODUCT Exit number 3" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTRANMP $user || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTRANMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - echo " $PRODUCT Exit number 3" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc - -# - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -$RUN_JOB & - -marcpid=$! -echo $marcpid > $DIRJOB/$jid.pid -wait $marcpid - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=`basename $usersubname .f` - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -) 1>>$jid.log 2>&1 & - - -############################################################################## -# run the requested program in the foreground # -############################################################################## - -else - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_mp $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTRANMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTRANMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi -# first remove all .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi - -$RUN_JOB - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - if test "$host" - then - mpdcleanup -a -f $jid.mfile - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.mfile 2> /dev/null - else - mpdcleanup -a -f $jid.hosts - /bin/rm $jid.hosts 2> /dev/null - fi - fi - fi -fi - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=`basename $usersubname .f` - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi - - -fi -fi diff --git a/installation/mods_MarcMentat/2011/Marc_tools/run_marc.original b/installation/mods_MarcMentat/2011/Marc_tools/run_marc.original deleted file mode 100644 index 53ad826f1..000000000 --- a/installation/mods_MarcMentat/2011/Marc_tools/run_marc.original +++ /dev/null @@ -1,3675 +0,0 @@ -#!/bin/ksh -############################################################################## -# # -# run_marc - run a marc job # -# ------------------------- # -# # -# usage: run_marc -j jid { options } # -# # -# where standard options are: required: defaults: # -# -------------------------- # -# # -# -j* jid job id number. ** YES ** . # -# -pr* prog program name. . marc # -# -v* y|n do or do not verify inputs. . yes # -# -q* s|l|v|b|f batch queue name or background, . short # -# foreground. # -# -b* as alternative to option -q* # -# # -# ( batch queues only : # -# -pq* intra queue priority. . . # -# -at DATE/TIME delay start of job. . . # -# format : January,1,1990,12:31 # -# or : today,5pm # -# -cpu* secs job CPU limit . . ) # -# # -# -r* rid restart file job id. . . # -# -si* sid substructure file id. . . # -# -pi* post post file job id. . . # -# -de* did defaults file . no # -# -vf vid viewfactor . no # -# # -# -u* user user subroutine. . . # -# -obj obj user objects or libraries. . . # -# -sa* y|n do or do not save load module. . no # -# -autorst auto restart flag for auto forge . no # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo selects i4 or i8 version # -# default: i4 or via defaults file run_marc_defaults # -# the -mo option will override # -# -mpi selects MPI version # -# each platform has a default MPI version and some # -# have an alternative version. see the include file # -# for the respective platform # -# MPI_DEFAULT defines the default MPI version # -# MPI_OTHER defines versions one can switch to # -# -dcoup for contact decoupling # -# currently not supported # -# -dir directory where the job i/o should take place. # -# defaults to current directory. # -# -sdir directory where scratch files are created # -# defaults to current directory. # -# # -# -alloc only perform memory allocation test, no analysis # -# -list y only list options in the input file, no analysis # -# -fe num set feature number "num" for the run. only one allowed # -# -dytran flag to switch from Dytran to Marc # -# dytran = 0, program will run w/o Marc-Dytran Switch # -# = 1, program will restart Marc after Dytran run # -# >= 2, Not supported yet. # -# currently not supported # -# -ou force analysis to use out-of-core control # -# =0, not used # -# =1, element storage out-of-core # -# -dll run marc using shared library libmarc.so and exe_marc # -# =1, used # -# =2, do not free streaming input memory # -# =3, run with marc input deck # -# -trk run marc for post-tracking # -# # -# where parallel options are: # -# -------------------------- # -# # -# itree, host, and comp options are available for the domain # -# decomposition only. # -# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # -# # -# # -# -nprocd number of domains. # -# defaults to single domain solution. # -# -nprocds number of domains if single input file. # -# defaults to single domain solution. # -# -nps same as -nprocds. # -# -nsolver number of solver tasks for solver types 12 and 13 # -# these are distributed tasks operating via MPI # -# -nthread number of solver threads for solver types 6, 8, and 11 # -# also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. if both specified, nthread option# -# will be used. # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by 6, 8, and 11 # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor nthread specified. # -# -itree message passing tree type for domain decomposition. # -# for debugging purposes; should not normally be used. # -# -host hostfile name for distributed execution on network. # -# defaults to no hostfile, unless jobid.defhost exists. # -# if jobid.defhost exists, only -np(s) necessary # -# -comp* y|n to be used with user routines on a network of # -# incompatible machines. # -# if set to no, a separate executable will be created # -# for each machine on the network. # -# if set to yes, the executable located on the machine # -# from which marc is started will be used on all machines.# -# defaults to no if O/S versions different on machines. # -# # -# -ci y|n copy input files to remote hosts (default: yes) # -# if "yes", input files are automatically copied to # -# remote hosts for a network run if necessary. # -# -cr y|n copy post files from remote hosts (default: yes) # -# if "yes", post files are automatically copied back from # -# remote hosts for a network run if necessary. # -############################################################################## -# set DIR to the directory in which this script is -REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" -DIR=`dirname $REALCOM` -# make sure DIR has an absolute path -case $DIR in - \/*) - ;; - *) - DIR=`pwd`/$DIR - ;; -esac -DIRSCRIPT=$DIR -AWK=awk -ARCH=`uname -a | cut -f 1 -d " "` -# Sun has a bad awk, use nawk instead -if test $ARCH = "SunOS" -then - AWK=nawk -fi -BASENAME=basename -# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists -if test $ARCH = "SunOS" -then - if test -x /usr/ucb/basename - then - BASENAME=/usr/ucb/basename - fi -fi - -# echo command line in the case of ECHO_COMMAND is true -if test "$ECHO_COMMAND" = true ; then - echo command "$0" "$@" -fi - -# -# "mode" selects version, i4 or i8 -# default is i4 -# this can be changed by a file run_marc_defaults -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MODE i8 -# it can also be set by the environmental variable MARC_INTEGER_SIZE -# and by the command line option "-mo" -# -mode= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -f $HOME/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -n "$MARC_INTEGER_SIZE" ; then - mode=$MARC_INTEGER_SIZE -fi -if test -z "$mode" ; then - mode=i4 -fi -case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "error, version mode must be i4 or i8" - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i4 or i8" - echo " " - echo " use -mo i4 or -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - setmode=true - fi - if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - fi - if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -done - -# set to i4 version for 32 bit Linux -if test "`uname -s`" = "Linux"; then - if test "`uname -m`" = "i686"; then - mode=i4 - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -fi - - -. "$DIR/getarch" - -# Change_me -. $MARC_INCLUDE -# - -# -# Dynamically determine the echo syntax -# - -case "`echo '\c'`" in - '\c') - ECHO='echo -n' - ECHOTXT=' ' - ;; - *) - ECHO='echo' - ECHOTXT=' \c' - ;; -esac - -# -# Variables for the MARC environment -# - -PRODUCT="Marc" -EXITMSG=$MARC_TOOLS/MESSAGES -export EXITMSG -FLEXDIR=$DIR/../flexlm/licenses -export FLEXDIR -TIMCHK=3600 -export TIMCHK -BINDIR=$MARC_BIN -export BINDIR -AFMATDAT=$MARC_RUNTIME/AF_flowmat/ -export AFMATDAT -# -# define directory path to global unified material database -# -MATFILE= -export MATFILE - -# -# define memory limit -# first set to MEMLIMIT from include -# -ml option overrules if specified -memlimit=$MEMLIMIT -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -# -if test $MACHINENAME = "HP" -then - SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH - export SHLIB_PATH -fi -# the one for IBM is defined futher down - -LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH -LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH -export LD_LIBRARY_PATH -export LD_LIBRARY64_PATH -export LD_LIBRARYN32_PATH - -atexit() { -kill -15 $$ -# -if test $MPITYPE = "myrinet" -then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi -fi -} - -trap "atexit" 2 - -# -# defaults -# - -prog=marc -exefile=marc -jid= -rid= -pid= -sid= -did= -vid= -user= -usersubname= -objs= -qid=background -cpu= -priority= -att= -trk= -verify=yes -prgsav=no -rmdll=no -cpdll=no -progdll= -pathdll= -error= -nprocd=0 -nprocdddm=1 -nprocdddmprint= -icreated=0 -nprocdarg= -nsolver=0 -nsolverarg=-nsolver -if test $nprocds -then - if test $nprocds -gt 1 - then - nprocdddm=$nprocds - nprocdddmprint=$nprocds - icreated=1 - nprocdarg=-nprocds - fi -fi -nthread=-1 -nauto=0 -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -nthreadprint=0 -itree=0 -iam= -link= -trkrun=0 -DIRJOB=`pwd` -DIRSCR=$DIRJOB -DIRSCRSET= -autoforge=0 -dotdat=.dat -dotdefhost=.defhost -host= -numhost= -mfile= -userhost= -makebdf= -cpinput=yes -cpresults=yes -marcdll=libmarc.$EXT_DLL -# define hostname and strip off extensions (alpha.aaa.com) -thishost=`hostname` -thishost=${thishost%%.*} -compatible=unknown -numfield=1 -justlist= -feature= -mpioption=false -MDSRCLIB=$MARC_LIB/mdsrc.a -# -# check run_marc_defaults file for default MPI setting -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MPI -# -value= -file= -if test -f $DIRSCRIPT/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$DIRSCRIPT/run_marc_defaults - fi -fi -if test -f $HOME/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$HOME/run_marc_defaults - fi -fi -if test -n "$value"; then - MARC_MPITYPE=$value - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - echo " " - echo " error, incorrect option for MARC_MPI" - echo " defined in $file: $MARC_MPITYPE" - echo " valid options: $MPI_DEFAULT $MPI_OTHER" - echo " " - exit - fi - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - fi -fi -# -# -# allow scratch directory to be specified with environmental variable -# MARCSCRATCH -if test $MARCSCRATCH -then - if test -d $MARCSCRATCH - then - DIRSCR=$MARCSCRATCH - else - echo "error, scratch directory '$MARCSCRATCH'" - echo " specified via environmental variable MARCSCRATCH does not exist" - exit - fi -fi -# -############################################################################## -# parse input - arguments always come in pairs # -############################################################################## - -arg=$1 -if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - shift - arg=$1 -fi -while [ -n "$arg" ] -do - shift - value=$1 - case $arg in - -al* | -AL*) - $MARC_BIN/marc -alloc 1 - exit - ;; - -li* | -LI*) - justlist=yes - ;; - -fe* | -FE*) - feature=$value - ;; - -pr* | -PR*) - if test `dirname $value` = '.' - then - prog=`$BASENAME $value .marc` - progdll=`$BASENAME $value` - else - prog=`dirname $value`/`$BASENAME $value .marc` - progdll=`dirname $value`/`$BASENAME $value` - fi - prdir=`dirname $value` - case $prdir in - \/*) - ;; - *) - prog=`pwd`/$prdir/$prog - ;; - esac - ;; - -j* | -J*) - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - ;; - -r* | -R*) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - -si* | -SI*) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - -pi* | -PI*) - if test -f $value.t19 - then - pid=`$BASENAME $value .t19` - else - pid=`$BASENAME $value .t16` - fi - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - -bdf | -BDF) - makebdf=1 - ;; - -de* | -DE*) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - -vf | -VF) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - -u* | -U*) - user=`dirname $value`/`$BASENAME $value .f` - basefile=`$BASENAME $value` - if test ${basefile##*.} = F - then - user=`dirname $value`/`$BASENAME $value .F` - fi - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - if test -f $user.f - then - usersubname=$user.f - elif test -f $user.F - then - usersubname=$user.F - else - usersubname=$user - fi - ;; - -obj | -OBJ) - objs="$value" - ;; - -q* | -Q*) - qid=$value - ;; - -b* | -B*) - case $value in - y* | Y*) - qid=background - ;; - n* | N*) - qid=foreground - ;; - *) - ;; - esac - ;; - -at | -AT) - att=$value - ;; - -cpu* | -CPU*) - cpu=$value - ;; - -pq | -PQ*) - priority=$value - ;; - -v* | -V*) - verify=$value - ;; - -sa* | -SA*) - prgsav=$value - ;; - -np* | -NP*) - nprocdddm=$value - nprocdddmprint=$value - case $arg in - -nps* | -NPS* | -nprocds* | -NPROCDS*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - case $arg in - -np | -NP | -nprocd | -NPROCD) - icreated=0 - nprocdarg=-nprocd - ;; - esac - ;; - -ns* | -NS*) - nsolver=$value - ;; - -nt* | -NT*) - nthread=$value - ;; - -it* | -IT*) - itree=$value - ;; - -iam | -IAM) - iam=$value - ;; - -au* | -AU*) - nauto=$value - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -me | -ME ) - mesh=$value - ;; - -ml | -ML ) - memlimit=$value - ;; - -mo | -MO ) - ;; - -mpi | -MPI ) - mpioption=true - MARC_MPITYPE=$value - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - fi - fi - ;; - -dir* | -DIR*) - DIRJOB=$value - case $DIRJOB in - \/*) - ;; - *) - DIRJOB=`pwd`/$DIRJOB - ;; - esac - if test -z "$DIRSCRSET" - then - DIRSCR=$DIRJOB - fi - ;; - -sd* | -SD*) - DIRSCR=$value - DIRSCRSET=yes - case $DIRSCR in - \/*) - ;; - *) - DIRSCR=`pwd`/$DIRSCR - ;; - esac - ;; - -ho* | -HO*) - host=$value - ;; - -co* | -CO*) - compatible=$value - ;; - -ci* | -CI*) - cpinput=$value - ;; - -cr* | -CR*) - cpresults=$value - ;; - *) - error="$error -$arg: invalid option" - break - ;; - esac - case $value in - -*) - error="$error -$arg: invalid name $value" - break - ;; - esac - shift - arg=$1 - if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - shift - arg=$1 - fi -done -argc=`expr $# % 2` -if test $argc -eq 1 -then -# -# odd number of arguments -# - error="$error -argument list incomplete" -fi - -if test $nprocdddm -gt 0 -then -nprocd=$nprocdddm -fi - -if test $nsolver -gt 0 -then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi -fi - -if test $nthread -eq -1 -then -nthread=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nthread -lt 0 -then -nthread=0 -fi - -nthreadprint=$nthread -if test $nthreadprint -eq 0 -then -nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi -fi - -nthread=$nthreadprint - - - -if test $nprocd -gt 1; then - if test -f $jid$dotdefhost; then - if test "$host" = ""; then - host=$jid$dotdefhost - fi - fi - if test -f hostfile_qa_$nprocd; then - if test "$host" = ""; then - host=hostfile_qa_$nprocd - fi - fi -fi - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then - dotdat=.inp - fi - - if test "$progdll"; then - /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll - rmdll=yes - pathdll=yes - progdll=${progdll}_$marcdll - else - progdll=$marcdll - fi - - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - pathdll=yes - fi -fi - -############################################################################## -# check parameter validity # -############################################################################## - -while test forever; do - -# -# check for input file existence -# -if test $nprocdddm -gt 1 -a $icreated -eq 0; then - if test ! -f $DIRJID/1$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/1$jid$dotdat not accessible" - fi - fi -else - if test ! -f $DIRJID/$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/$jid$dotdat not accessible" - fi - fi -fi - if test $nprocd -gt 1; then - if test "$host" ; then - if test ! -f $host; then - error="$error -host name file $host not accessible" - fi - fi - fi - -# -# check if the job is already running in the background -# -if test -f $DIRJOB/$jid.pid; then - error="$error -job is already running (the file $jid.pid exists)" -fi - -# -# if the program name is other than marc, then -# assume that this is a program in the users local directory -# - -bd=$MARC_BIN/ - -case $prog in - marc | MARC | $exefile) - program=$exefile - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$usersubname" - then - if test ! -f $usersubname - then - error="$error -user subroutine file $usersubname not accessible" - fi - fi - if test "$objs" - then - missingobjs= - for o in $objs - do - if test ! -f "$o" - then - if test -z "$missingobjs" - then - missingobjs="$o" - else - missingobjs="$missingobjs $o" - fi - fi - done - if test -n "$missingobjs" - then - error="$error -user object/library file(s) $missingobjs not accessible" - fi - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$vid" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRVID/1$vid.vfs - then - error="$error -view factor file $DIRVID/1$vid.vfs not accessible" - fi - else - if test ! -f $DIRVID/$vid.vfs - then - error="$error -view factor file $DIRVID/$vid.vfs not accessible" - fi - fi - fi - if $mpioption - then - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" - fi - fi - ;; - *) - program=$prog.marc - case $prog in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - error="$error -program option may not be used with user subroutine" - fi - if test "$objs" - then - error="$error -program option may not be used with user objects or libraries" - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$nauto" - then - if test $nauto -gt 2 - then - error="$error -incorrect option for auto restart " - fi - fi - if test "$ndcoup" - then - if test $ndcoup -gt 3 - then - error="$error -incorrect option for contact decoupling " - fi - fi - if test "$ndytran" - then - if test $ndytran -gt 1 - then - error="$error -incorrect option for Marc-Dytran Switch " - fi - fi - if $mpioption - then - if test ! -x $MARC_BIN/$exefile - then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE " - fi - fi - ;; -esac - -############################################################################## -# check argument integrity # -############################################################################## - -if test "$jid" -then - : -else - error="$error -job id required" -fi - -if test $nprocd -gt 1 -then - if test $nauto -gt 0 - then - error="$error -cannot run DDM job with auto restart (-au) option " - fi -fi -case $qid in - S* | s*) - qid=short - ;; - L* | l*) - qid=long - ;; - V* | v*) - qid=verylong - ;; - B* | b*) - qid=background - ;; - F* | f*) - qid=foreground - ;; - A* | a*) - qid=at - ;; - *) - error="$error -bad value for queue_id option" - ;; -esac - -case $prgsav in - N* | n*) - prgsav=no - ;; - Y* | y*) - prgsav=yes - ;; - *) - error="$error -bad value for save option" - ;; -esac - -case $verify in - N* | n*) - verify=no - ;; - Y* | y*) - verify=yes - ;; - *) - error="$error -bad value for verify option" - ;; -esac - -case $nprocdddm in - -* ) - error="$error -bad value for nprocd option" - ;; -esac - -case $nthread in - -* ) - error="$error -bad value for nthread option" - ;; -esac - -case $itree in - -* ) - error="$error -bad value for itree option" - ;; -esac -case $iam in - -* ) - error="$error -bad value for iam option" - ;; -esac -case $compatible in - N* | n*) - compatible=no - ;; - Y* | y*) - compatible=yes - ;; - unknown) - ;; - *) - error="$error -bad value for comp option" - ;; -esac -case $cpinput in - N* | n*) - cpinput=no - ;; - Y* | y*) - cpinput=yes - ;; - *) - error="$error -bad value for copy input option" - ;; -esac -case $cpresults in - N* | n*) - cpresults=no - ;; - Y* | y*) - cpresults=yes - ;; - *) - error="$error -bad value for copy results option" - ;; -esac - -# -# check for external file to run -# -if test -f $MARC_TOOLS/run_marc_check -then - . $MARC_TOOLS/run_marc_check -fi - -# -# pick up version data from bin/VERSION if it exists -# -if test -f $MARC_BIN/VERSION; then - ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` - if test -n "$ppp" ;then - PRODUCT=$ppp - fi - ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` - if test -n "$ppp" ;then - REVISION=", Build $ppp" - fi -fi -############################################################################## -# interact with the user to get the required information to run marc or # -# other marc system program # -############################################################################## - -deletelog=yes -if test $qid = background -a $verify = no -then -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $usersubname -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto " > $jid.log -deletelog=no -fi -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $usersubname -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto" - - -case $qid in - s* | S* | l* | L* | v* | V* ) - echo \ -"Queue priority : $priority -Queue CPU limit : $cpu -Queue start time : $att" - ;; -# * ) -# echo \ -#" " -# ;; -esac - -if test "$error" -then - if test $verify = yes - then - $ECHO "$error - -Please correct or quit(correct,quit,): $ECHOTXT" - error= - read answer - case $answer in - q* | Q*) - answer=quit - ;; - *) - answer=correct - ;; - esac - else - $ECHO "$error - $ECHOTXT" - echo " " - if test "$deletelog" = no - then - $ECHO "$error - $ECHOTXT" >> $jid.log - echo " " >> $jid.log - fi - answer=quit - fi -else - if test $verify = yes - then - $ECHO " -Are these parameters correct (yes,no,quit,)? $ECHOTXT" - read answer - case $answer in - q* | Q*) - answer=quit - ;; - y* | Y*) - answer=yes - ;; - *) - answer=no - ;; - esac - else - answer=yes - fi -fi - -case $answer in - no | correct) - -############################################################################## -# prompt for each value # -############################################################################## - - $ECHO " -Program name ($prog)? $ECHOTXT" - read value - if test "$value" - then - prog=$value - fi - $ECHO "Job ID ($jid)? $ECHOTXT" - read value - if test "$value" - then - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - fi - $ECHO "User subroutine name ($user)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - user= - ;; - *) - user=`dirname $value`/`$BASENAME $value .f` - basefile=`$BASENAME $value` - if test ${basefile##*.} = F - then - user=`dirname $value`/`$BASENAME $value .F` - fi - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - if test -f $user.f - then - usersubname=$user.f - elif test -f $user.F - then - usersubname=$user.F - else - usersubname=$user - fi - ;; - esac - fi - $ECHO "User objects or libraries ($objs)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - objs= - ;; - *) - objs="$value" - ;; - esac - fi - $ECHO "Restart File Job ID ($rid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - rid= - ;; - *) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - esac - fi - $ECHO "Substructure File ID ($sid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - sid= - ;; - *) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - esac - fi - $ECHO "Post File Job ID ($pid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - pid= - ;; - *) - pid=$value - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - esac - fi - $ECHO "Defaults File ID ($did)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - did= - ;; - *) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - esac - fi - $ECHO "View Factor File ID ($vid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - vid= - ;; - *) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - esac - fi - $ECHO "Save generated module ($prgsav)? $ECHOTXT" - read value - if test "$value" - then - prgsav=$value - fi - $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" - read value - if test "$value" - then - nprocdddm=$value - nprocdddmprint=$value - fi - $ECHO "Run on ($nthread) threads ? $ECHOTXT" - read value - if test "$value" - then - nthread=$value - fi - $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" - read value - if test "$value" - then - nsolver=$value - fi -# - if test $nprocdddm -gt 0 - then - nprocd=$nprocdddm - fi - if test $nsolver -gt 0 - then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi - fi - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - nthreadprint=$nthread - if test $nthreadprint -eq 0 - then - nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi - fi -# - if test $nprocd -gt 1 - then - $ECHO "Message passing type ($itree)? $ECHOTXT" - read value - if test "$value" - then - itree=$value - fi - $ECHO "Host file name ($host)? $ECHOTXT" - read value - if test "$value" - then - host=$value - fi - if test $nprocdddm -gt 1 - then - $ECHO "Single input file? $ECHOTXT" - read value - case $value in - y* | Y*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" - read value - if test "$value" - then - compatible=$value - fi - $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" - read value - if test "$value" - then - cpinput=$value - fi - $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" - read value - if test "$value" - then - cpresults=$value - fi - fi - fi - $ECHO "Run the job in the queue ($qid)? $ECHOTXT" - read value - if test "$value" - then - qid=$value - fi - case $qid in - s* | S* | l* | L* | v* | V* ) - $ECHO "Queue priority ($priority)? $ECHOTXT" - read value - if test "$value" - then - priority=$value - fi - $ECHO "Job starts at ($att)? $ECHOTXT" - read value - if test "$value" - then - att=$value - fi - $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" - read value - if test "$value" - then - cpu=$value - fi - ;; - * ) - ;; - esac - $ECHO "Auto Restart option ($nauto)? $ECHOTXT" - read value - if test "$value" - then - nauto=$value - fi - $ECHO "Run directory ($DIRJOB)? $ECHOTXT" - read value - if test "$value" - then - DIRJOB=$value - DIRSCR=$DIRJOB - fi - $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" - read value - if test "$value" - then - DIRSCR=$value - fi - ;; - quit) - exit 1 - ;; - *) - break - ;; - -esac - - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - -done - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - pathdll=yes - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - fi - - if test "$pathdll"; then -# -# reset share lib path -# - if test $MACHINENAME = "HP" - then - SHLIB_PATH=$DIRJOB:$SHLIB_PATH - export SHLIB_PATH - fi - if test $MACHINENAME = "IBM" - then - LIBPATH=$DIRJOB:$LIBPATH - export LIBPATH - fi -# - LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH - LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH - LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH - export LD_LIBRARY_PATH - export LD_LIBRARY64_PATH - export LD_LIBRARYN32_PATH - fi -fi -# end of dllrun>0 - - -if test $program = $exefile -o $program = $prog.marc -then - -# delete the old .log file unless we run in the background -if test "$deletelog" = yes -then - /bin/rm $jid.log 2>/dev/null -else - echo - echo running the job in the background, see $jid.log - echo -fi - -# -# check if this is an autoforge or rezoning or radiation job -# -if test $nprocd -eq 1 -then - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` - if test "$line" - then - autoforge=1 - fi -fi -# -# check that jobname for restarted run is not the same -# as restart file basename -# -if test "$rid" -then - if test "$jid" = "$rid" - then - echo " " - echo "ERROR: job name of current run is the same as job name" - echo " of the restarted job" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "ERROR: job name of current run is the same as job name" >> $jid.log - echo " of the restarted job" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi -fi - -# -# user objects/libraries used -# - - if test "$objs" - then - program="$DIRJOB/$jid.marc" - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# user subroutine used -# - - if test "$user" - then -# program=$user.marc - program=$DIRJOB/`$BASENAME $user .f`.marc - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# Special case for IBM using POE but not an SP machine -# in this case we always need a host file, also for serial jobs. -# -if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP -then - MP_HOSTFILE=${jid}.host - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $nprocd -gt 1 - then - numdom=$nprocd - while test $numdom -gt 0 - do - hostname -s >> $MP_HOSTFILE - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - else - hostname -s > $MP_HOSTFILE - fi -fi -# -# check correctness of host file; fix for user sub -# - if test $nprocd -gt 1 - then - -# construct the path name to the executable (execpath) - execpath=$MARC_BIN/$exefile - usersub=0 - if test $program = $prog.marc - then - execpath=$prog.marc - usersub=1 - fi - if test "$objs" - then - execpath="$DIRJOB/$jid.marc" - usersub=1 - fi - if test "$user" - then - execpath=$DIRJOB/`$BASENAME $user .f`.marc - usersub=1 - fi - export execpath - execname=`$BASENAME $execpath` - - if test "$host" - then - userhost=$host - case $userhost in - \/* | \.\/*) - ;; - *) - userhost=`pwd`/$userhost - ;; - esac - -# check that the number of processes specified in the hostfile is -# equal to nprocd specified by -nprocd. - numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` - if test $nprocd -ne $numproc - then - echo " " - echo "error, the number of processes specified in the host file" - echo "must be equal to the number of processes given by -nprocd/-nsolver" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, the number of processes specified in the host file" >> $jid.log - echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - -# check for Myrinet that the number of processes per host is -# less than number of available user ports, 5 -# .gmpi directory must exist in user's home directory -# and must have write permission from remote hosts - if test $MPITYPE = "myrinet" - then - numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` - if test $numproc -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes specified " - echo "in the hostfile must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes specified " >> $jid.log - echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - if test ! -d ~/.gmpi - then - echo " " - echo "error, for Myrinet a .gmpi directory must exist " - echo "under the user's home directory" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log - echo "under the user's home directory" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - homedir=`echo ~` - for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - echo " " - echo "error, for Myrinet a shared .gmpi directory must exist " - echo "under the user's home directory " - echo "with remote write permission" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log - echo "under the user's home directory " >> $jid.log - echo "with remote write permission" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - /bin/rm tmp.$$ - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - fi - fi - done - fi - fi - -# construct the host file $jid.host which is used by mpirun -# skip lines starting with # and only consider lines with more than -# one word in them. Note that the hostfile given to this script -# has two columns: the host name and the number of shared processes -# to run on this host. mpirun wants the number of _other_ -# processes to run in addition to the one being run on the machine -# on which the job is started. hence the $2-1 for fnr == 1. - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then -# HPMPI or HP hardware MPI - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ - -v mpihpspecial="$MPIHPSPECIAL" \ -'{if ( NF > 0) {\ - fnr++ ; \ - printf("-h %s -np %s",$1,$2); \ - printf(" %s",mpihpspecial); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ - if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ - }\ - }' > $jid.host -# end HPMPI or HP hardware MPI - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then -# IBM using hardware MPI (POE) - MP_HOSTFILE=$jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host -# end IBM using hardware MPI (POE) -# for Intel MPI, need to create a machinefile for DMP - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then -# Intel MPI - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - /bin/cp $host $jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Intel MPI for DMP -# for Solaris HPC 7.1, need to create a machinefile for DMP - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then -# Solaris HPC 7.1 - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Solaris HPC 7.1 for DMP -# for Myrinet, construct a configuration file in ~/.gmpi -# this must be readable by each process -# format is (hostname) (port number) for each process - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - grep -v '^#' $host | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ -{if ( NF > 0 ) \ - for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ -}' >> ~/.gmpi/$jid.host - else -# this is for mpich-1.2.5 and later, using the -pg option -# format: host nproc executable user arguments -# the arguments are added later - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s %s\n",path,user);\ - if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ - }\ - }' > $jid.host - fi -# end Myrinet - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then -# Compaq MPI via Memory Channel - grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host -# end Compaq MPI - else -# MPICH - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ - }\ - }' > $jid.host - fi -# define the variable host and host_filt -# host_filt is used for loops over hosts -# for Myrinet we need to use a filtered variant of userhost -# for others we can use $host - if test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - host=~/.gmpi/$jid.host - host_filt=$jid.host_tMp - grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt - else - host=$jid.host - host_filt=$host - fi - else - host=$jid.host - host_filt=$host - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - host_filt=$jid.mfile - fi - fi -# figure out if the machines in the hostfile are nfs mounted -# or distributed and set the variable "dirstatus" accordingly. -# only perform the check if user subroutine is used -# or a user subroutine executable is used - - numfield=1 - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - numfield=2 - fi - DIR1=$DIRJOB - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - counter=0 - echo " " - echo "checking if local or shared directories for host" - if test "$deletelog" = no - then - echo "checking if local or shared directories for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - dirstatus[$counter]="shared" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - dirstatus[$counter]="local" - /bin/rm tmp.$$ - else - if test ! -f $jid.$$ - then - dirstatus[$counter]="local" - $RSH $i /bin/rm $DIR1/$jid.$$ - else - /bin/rm $jid.$$ - fi - fi - if test -f tmp.$$ - then - /bin/rm tmp.$$ - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - echo " ${dirstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${dirstatus[$counter]}" >> $jid.log - fi - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - fi - -# figure out if this is a compatible set of machines -# unless explicitly specified with flag -comp -# only perform the check if user subroutine is used -# or a user subroutine executable is used -# Myrinet does not support heterogeneous - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - if test $compatible = "unknown" - then - thisname=$ARCH - compatible=yes - counter=0 - echo "checking if machines are compatible for host" - if test "$deletelog" = no - then - echo "checking if machines are compatible for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]="yes" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - othername=`$RSH $i uname -a | cut -f 1 -d " "` - if test $thisname != $othername - then - compatible=no - compstatus[$counter]="no" - fi - fi - echo " ${compstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${compstatus[$counter]}" >> $jid.log - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - else - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]=$compatible - fi - done - if test $compatible = "no" - then - echo "all machines assumed incompatible" - if test "$deletelog" = no - then - echo "all machines assumed incompatible" >> $jid.log - fi - else - echo "all machines compatible" - if test "$deletelog" = no - then - echo "all machines compatible" >> $jid.log - fi - fi - fi -# error out if user objects or libraries are used on incompatible machines - if test "$compatible" = "no" -a -n "$objs" - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" - if test "$deletelog" = no - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log - fi - exit 1 - fi -# modify new host file if NFS mounted heterogeneous machine - doit= - if test $program = $prog.marc - then - doit=yes - fi - if test "$user" - then - doit=yes - fi - if test "$doit" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - $AWK -v hst=$i '{fnr++ ; \ -if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ -printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} - /bin/mv $jid.host{$$} $jid.host - host=$jid.host - fi - fi - done - fi - fi # if test $program = $prog.marc -o $user -o $obj - - else # if test $host - # assume shared memory machine if no hostfile given and - # MPITYPE is set to mpich or Myrinet - # check for Myrinet that the total number of processes is - # less than number of available user ports, 5 - if test $MPITYPE = "mpich" -o $MPITYPE = "scali" - then - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - host=$jid.host - elif test $MPITYPE = "myrinet" - then - if test $nprocd -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes " - echo "must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes " >> $jid.log - echo "must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - echo `hostname` $nprocd | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ - {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ -' >> ~/.gmpi/$jid.host - host=~/.gmpi/$jid.host - else - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - - fi - fi # if test myrinet - - fi # if test $host - - fi # if test $nprocd -gt 1 - -fi # if test $program = $exefile -o $program = $prog.marc - -############################################################################## -# construct run stream (Marc only) # -############################################################################## - -# set maximum message length for ddm to a large number -# for vendor provided mpi -if test $itree -eq 0 -a $MPITYPE = hardware -then - itree=100000000 - if test $MACHINENAME = SGI - then - itree=100000001 - fi -fi -if test $itree -eq 0 -a $MPITYPE = hpmpi -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = myrinet -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = nec -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = scali -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = intelmpi -then - itree=100000000 -fi -if test $nprocdddm -lt 2 -then - nprocdarg= -else - nprocdarg="$nprocdarg $nprocdddm" -fi -if test $nsolver -eq 0 -then - nsolverarg= -else - nsolverarg="$nsolverarg $nsolver" -fi -if test $nprocdddm -lt 2 -a $nsolver -eq 0 -then -nprocd=0 -fi -if test $nprocd -gt 0 -then - if test "$host" - then - if test -z "$RUN_JOB2" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then - RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - else - RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" - RUN_JOB=" -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - fi - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - numhost=`uniq $jid.mfile | wc -l` - if test "$INTELMPI_VERSION" = "HYDRA" - then - RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n $numhost -r $RSH -f $jid.mfile - RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" - fi - -# intelmpi uses configfile. format: -# -host host1 -n n1 executable marcargs -# one such line per host -# collect the marcargs in RUN_JOB and construct the config file later -# collect the run stream in RUN_JOB_TMP - RUN_JOB="-jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - - - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then - RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread -dirjob $DIRJOB " - fi - if test "$userhost" - then - RUN_JOB="$RUN_JOB -mhost $userhost" - fi - if test $MPITYPE = "scali" - then -# set default working directory to /tmp to allow -# different directory names - SCAMPI_WORKING_DIRECTORY=/tmp - export SCAMPI_WORKING_DIRECTORY - fi - else - if test -z "$RUN_JOB1" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - RUNNPROCD=$nprocd - if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" - then - RUNNPROCD= - MP_PROCS=$nprocd - export MP_PROCS - fi - if test $MPITYPE = "myrinet" - then - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread -dirjob $DIRJOB " - fi - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - touch $jid.hosts - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n 1 -f $jid.hosts - fi -# /bin/rm $jid.hosts 2> /dev/null - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread -dirjob $DIRJOB " - fi - fi -else - if test $nauto -gt 0 -o $ndcoup -gt 0 - then - RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ - -nthread $nthread -dirjob $DIRJOB " - else -# this is for a serial job without auto restart: - RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ --nthread $nthread -dirjob $DIRJOB " - fi -fi -if test "$rid" -then - RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" -fi -if test "$pid" -then - RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" -fi -if test "$sid" -then - RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" -fi -if test "$did" -then - RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" -fi -if test "$vid" -then - RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" -fi -if test $nauto -gt 0 -then - RUN_JOB="$RUN_JOB -autorst $nauto " -fi -if test $ndcoup -gt 0 -then - RUN_JOB="$RUN_JOB -dcoup $ndcoup " -fi -if test $ndytran -gt 0 -then - RUN_JOB="$RUN_JOB -dytran $ndytran " -fi -if test $mesh -gt 0 -then - RUN_JOB="$RUN_JOB -me $mesh " -fi -if test $noutcore -gt 0 -then - RUN_JOB="$RUN_JOB -outcore $noutcore " -fi -if test "$dllrun" -gt 0 -then - RUN_JOB="$RUN_JOB -dll $dllrun " -fi -if test "$trkrun" -gt 0 -then - RUN_JOB="$RUN_JOB -trk $trkrun " -fi -if test "$iam" -then - RUN_JOB="$RUN_JOB -iam $iam " -fi -if test "$justlist" -then - RUN_JOB="$RUN_JOB -list 1 " -fi -if test "$feature" -then - RUN_JOB="$RUN_JOB -feature $feature " -fi -if test "$memlimit" -ne 0 -then - RUN_JOB="$RUN_JOB -ml $memlimit " -fi -if test "$cpinput" -then - RUN_JOB="$RUN_JOB -ci $cpinput " -fi -if test "$cpresults" -then - RUN_JOB="$RUN_JOB -cr $cpresults " -fi -if test "$DIRSCR" != "$DIRJOB" -then - RUN_JOB="$RUN_JOB -dirscr $DIRSCR" -else - DIRSCR=$DIRJOB -fi -if test "$makebdf" -then - RUN_JOB="$RUN_JOB -bdf $makebdf " -fi -if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" -then - # append $RUN_JOB to all lines of the host file - # and set RUN_JOB - $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ - /bin/mv $host.$$ $host - RUN_JOB=$RUN_JOB_TMP -fi -if test $MPITYPE = "intelmpi" -a "$host" -then - # construct config file, append $RUN_JOB to all lines of the config file - # and set RUN_JOB - if test "$INTELMPI_VERSION" = "HYDRA" - then - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - else - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-host %s -n %s",$1,$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - fi - RUN_JOB=$RUN_JOB_TMP -fi -echo " " -echo "Final run stream value" -echo " RUNJOB="$RUN_JOB -if test "$deletelog" = no -then -echo " " >> $jid.log -echo "Final run stream value" >> $jid.log -echo " RUNJOB="$RUN_JOB >> $jid.log -fi - - -############################################################################## -# run marc using valgrind # -############################################################################## -#RUN_JOB="valgrind $RUN_JOB" -#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" -############################################################################## - - -############################################################################## -# run the requested program in a queue # -############################################################################## - -if test "$deletelog" = yes -then - echo - date -else - echo >> $jid.log - date >> $jid.log -fi -if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] -then - -/bin/rm -f $jid.runmarcscript - - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - userobj=$DIRJOB/`$BASENAME $user .f`.o - basefile=`$BASENAME $usersubname` - if test ${basefile##*.} = f - then - usersub=$DIRJOB/`$BASENAME $user .f`.F - ln -sf "$user.f" "$usersub" - else - usersub=$usersubname - fi - - fi - cat > $jid.runmarcscript << END4 - if test "$user" - then - if test ${basefile##*.} = f - then - ln -sf "$user.f" "$usersub" - fi - if test $MACHINENAME = "CRAY" - then - $FORTRAN $usersub || \ - { - echo "$0: compile failed for $user.f" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $FORTRAN $usersub -o $userobj || \ - { - echo "$0: compile failed for $user.f" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - if test ${basefile##*.} = f - then - /bin/rm -f "$usersub" - fi - fi - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } -END4 -else - prgsav=yes -fi -/bin/rm $userobj 2>/dev/null - -# -# run marc -# - -cat >> $jid.runmarcscript << END5 - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -# first remove all .out files and incremental restart files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null - /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null -fi - -if test $nprocdddm -gt 1 -then - $RUN_JOB 2>>$jid.log -else - $RUN_JOB 2>>$jid.log -fi - -if test $dllrun -eq 0; then - if test $prgsav = no - then - /bin/rm -f $bd$program 2>/dev/null - fi -else - if test $cpdll = yes; then - filename=`basename $usersubname .f` - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes - then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -END5 - - -# Submit to marc batch queue -# -if [ $qid = at ] -then -QUENAME=at -SUBMCMD= -else -# -# Submit to qsub queue -# -QUENAME=qsub -SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" -if test "$priority" -then - SUBMCMD=$SUBMCMD" -p $priority" -fi -if test "$att" -then - SUBMCMD=$SUBMCMD" -a $att" -fi -if test "$cpu" -then - SUBMCMD=$SUBMCMD" -lt $cpu" -fi - -fi -echo $QUENAME $SUBMCMD -#cat $jid.runmarcscript -$QUENAME $SUBMCMD < $jid.runmarcscript - -/bin/rm -f $jid.runmarcscript - -############################################################################## -# run the requested program in the background # -############################################################################## - -else -if test $qid = background -then - -# -# first remove all old .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi -# -# compile user subroutine if present -# -( -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user.f $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_user $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user.f on host $i" - echo " $PRODUCT Exit number 3" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser.f 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user.f on host `hostname`" - fi - userobj=$DIRJOB/`$BASENAME $user .f`.o - basefile=`$BASENAME $usersubname` - if test ${basefile##*.} = f - then - usersub=$DIRJOB/`$BASENAME $user .f`.F - ln -sf "$user.f" "$usersub" - else - usersub=$usersubname - fi - if test $MACHINENAME = "CRAY" - then - $FORTRAN $usersub || \ - { - echo "$0: compile failed for $user.f" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $FORTRAN $usersub -o $userobj || \ - { - echo "$0: compile failed for $user.f" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - if test ${basefile##*.} = f - then - /bin/rm -f "$usersub" - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - echo " $PRODUCT Exit number 3" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null - -# -# run marc - -# - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -$RUN_JOB & - -marcpid=$! -echo $marcpid > $DIRJOB/$jid.pid -wait $marcpid - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=`basename $usersubname .f` - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -) 1>>$jid.log 2>&1 & - - -############################################################################## -# run the requested program in the foreground # -############################################################################## - -else - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user.f $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_user $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user.f on host $i" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser.f 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user.f on host `hostname`" - fi - userobj=$DIRJOB/`$BASENAME $user .f`.o - basefile=`$BASENAME $usersubname` - if test ${basefile##*.} = f - then - usersub=$DIRJOB/`$BASENAME $user .f`.F - ln -sf "$user.f" "$usersub" - else - usersub=$usersubname - fi - if test $MACHINENAME = "CRAY" - then - $FORTRAN $usersub || \ - { - echo "$0: compile failed for $user.f" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $FORTRAN $usersub -o $userobj || \ - { - echo "$0: compile failed for $user.f" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - if test ${basefile##*.} = f - then - /bin/rm -f "$usersub" - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null - -# -# run marc -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi -# first remove all .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi - -$RUN_JOB - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - if test "$host" - then - mpdcleanup -a -f $jid.mfile - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.mfile 2> /dev/null - else - mpdcleanup -a -f $jid.hosts - /bin/rm $jid.hosts 2> /dev/null - fi - fi - fi -fi - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=`basename $usersubname .f` - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi - - -fi -fi diff --git a/installation/mods_MarcMentat/2011/Mentat_bin/edit_window b/installation/mods_MarcMentat/2011/Mentat_bin/edit_window deleted file mode 100644 index afc8e2b39..000000000 --- a/installation/mods_MarcMentat/2011/Mentat_bin/edit_window +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# This script opens a window running an editor. The default window is an -# xterm, and the default editor is vi. These may be customized. - -if [ "`uname`" = "SunOS" ]; then - dir=/usr/openwin/bin -else - dir=/usr/bin/X11 -fi - -# $dir/xterm -T "vi $*" -n "vi $*" -e vi $* -%EDITOR% $* \ No newline at end of file diff --git a/installation/mods_MarcMentat/2011/Mentat_bin/edit_window.org b/installation/mods_MarcMentat/2011/Mentat_bin/edit_window.org deleted file mode 100644 index d6138d5c8..000000000 --- a/installation/mods_MarcMentat/2011/Mentat_bin/edit_window.org +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# This script opens a window running an editor. The default window is an -# xterm, and the default editor is vi. These may be customized. - -if [ "`uname`" = "SunOS" ]; then - dir=/usr/openwin/bin -else - dir=/usr/bin/X11 -fi - -$dir/xterm -T "vi $*" -n "vi $*" -e vi $* diff --git a/installation/mods_MarcMentat/2011/Mentat_bin/kill4 b/installation/mods_MarcMentat/2011/Mentat_bin/kill4 deleted file mode 100644 index 6d1ff84bf..000000000 --- a/installation/mods_MarcMentat/2011/Mentat_bin/kill4 +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "usage: $0 job_name" - exit 1 -fi - -echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2011/Mentat_bin/kill5 b/installation/mods_MarcMentat/2011/Mentat_bin/kill5 deleted file mode 100644 index 6d1ff84bf..000000000 --- a/installation/mods_MarcMentat/2011/Mentat_bin/kill5 +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "usage: $0 job_name" - exit 1 -fi - -echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2011/Mentat_bin/kill6 b/installation/mods_MarcMentat/2011/Mentat_bin/kill6 deleted file mode 100644 index 6d1ff84bf..000000000 --- a/installation/mods_MarcMentat/2011/Mentat_bin/kill6 +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "usage: $0 job_name" - exit 1 -fi - -echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2011/Mentat_bin/kill7 b/installation/mods_MarcMentat/2011/Mentat_bin/kill7 deleted file mode 100644 index 6d1ff84bf..000000000 --- a/installation/mods_MarcMentat/2011/Mentat_bin/kill7 +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "usage: $0 job_name" - exit 1 -fi - -echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2011/Mentat_bin/kill8 b/installation/mods_MarcMentat/2011/Mentat_bin/kill8 deleted file mode 100644 index 6d1ff84bf..000000000 --- a/installation/mods_MarcMentat/2011/Mentat_bin/kill8 +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "usage: $0 job_name" - exit 1 -fi - -echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2011/Mentat_bin/kill9 b/installation/mods_MarcMentat/2011/Mentat_bin/kill9 deleted file mode 100644 index 6d1ff84bf..000000000 --- a/installation/mods_MarcMentat/2011/Mentat_bin/kill9 +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "usage: $0 job_name" - exit 1 -fi - -echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2011/Mentat_bin/submit1.org b/installation/mods_MarcMentat/2011/Mentat_bin/submit1.org deleted file mode 100644 index 8a57636be..000000000 --- a/installation/mods_MarcMentat/2011/Mentat_bin/submit1.org +++ /dev/null @@ -1,156 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=/home/f.roters/msc/marc2011 -if test $MARCDIR1 -then - DIR=$MARCDIR1 -fi - -SRCEXT=.f -RSTEXT=.t08 -PSTEXT=.t19 -PSTEXTB=.t16 -VWFCEXT=.vfs - -slv=$1 -version=$2 -ndom_fea_solver=$3 -ndom_preprocessor=$4 -hostfile=$5 -compat=$6 -job=$7 -srcfile=$8 -srcmeth=$9 -shift 9 # cannot use $10, $11, ... -restart=$1 -postfile=$2 -viewfactorsfile=$3 -autorst=$4 -copy_datfile="-ci $5" -copy_postfile="-cr $6" -scr_dir=$7 -dcoup=$8 -nthread=$9 -shift 9 # cannot use $10, $11, ... -nsolver=$1 -mode=$2 - -if [ "$slv" != "" -a "$slv" != "marc" ]; then - slv="-iam sfm" -else - slv="" -fi - -if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then - nprocds="-nprocds $ndom_fea_solver" -else - nprocd="" - if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then - nprocd="-nprocd $ndom_preprocessor" - else - nprocd="" - fi -fi - -if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then - srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` - case "$srcmeth" in - -) - srcfile="-u $srcfile" - ;; - compsave) - srcfile="-u $srcfile -save y" - ;; - runsaved) - srcfile="-prog $srcfile" - ;; - esac -else - srcfile="" -fi - -if [ "$restart" != "" -a "$restart" != "-" ]; then - restart=`echo $restart | sed "s/$RSTEXT$//"` - restart="-r $restart" -else - restart="" -fi - -if [ "$postfile" != "" -a "$postfile" != "-" ]; then - postfile=`echo $postfile | sed "s/$PSTEXT$//"` - postfile=`echo $postfile | sed "s/$PSTEXTB$//"` - postfile="-pid $postfile" -else - postfile="" -fi - -if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then - viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` - viewfactorsfile="-vf $viewfactorsfile" -else - viewfactorsfile="" -fi - -if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then - hostfile="-ho $hostfile" -else - hostfile="" -fi - -if [ "$compat" != "" -a "$compat" != "-" ]; then - compat="-co $compat" -else - compat="" -fi - -if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then - scr_dir="-sd $scr_dir" -else - scr_dir="" -fi - -if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then - dcoup="-dcoup $dcoup" -else - dcoup="" -fi - -if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then - nthread="-nthread $nthread" -else - nthread="" -fi - -if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then - nsolver="-nsolver $nsolver" -else - nsolver="" -fi - -case "$mode" in - 4) mode="-mo i4" ;; - 8) mode="-mo i8" ;; - *) mode= ;; -esac - -rm -f $job.cnt -rm -f $job.sts -rm -f $job.out -rm -f $job.log - -# To prevent a mismatch with the python version used by the solver -# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH -# unset environment variables PYTHONHOME and PYTHONPATH -unset PYTHONHOME -unset PYTHONPATH - -"${DIR}/tools/run_marc" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ - $srcfile $restart $postfile $viewfactorsfile $hostfile \ - $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ - $nthread $nsolver $mode > /dev/null 2>&1 -sleep 1 -exit 0 diff --git a/installation/mods_MarcMentat/2011/Mentat_bin/submit4 b/installation/mods_MarcMentat/2011/Mentat_bin/submit4 deleted file mode 100644 index 1843d75cf..000000000 --- a/installation/mods_MarcMentat/2011/Mentat_bin/submit4 +++ /dev/null @@ -1,157 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=%INSTALLDIR%/marc%VERSION% -if test $MARCDIR1 -then - DIR=$MARCDIR1 -fi - -SRCEXT=.f -RSTEXT=.t08 -PSTEXT=.t19 -PSTEXTB=.t16 -VWFCEXT=.vfs - -slv=$1 -version=$2 -ndom_fea_solver=$3 -ndom_preprocessor=$4 -hostfile=$5 -compat=$6 -job=$7 -srcfile=$8 -srcmeth=$9 -shift 9 # cannot use $10, $11, ... -restart=$1 -postfile=$2 -viewfactorsfile=$3 -autorst=$4 -copy_datfile="-ci $5" -copy_postfile="-cr $6" -scr_dir=$7 -dcoup=$8 -nthread=$9 -shift 9 # cannot use $10, $11, ... -nsolver=$1 -mode=$2 - -if [ "$slv" != "" -a "$slv" != "marc" ]; then - slv="-iam sfm" -else - slv="" -fi - -if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then - nprocds="-nprocds $ndom_fea_solver" -else - nprocd="" - if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then - nprocd="-nprocd $ndom_preprocessor" - else - nprocd="" - fi -fi - -if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then -# srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` - case "$srcmeth" in - -) - srcfile="-u $srcfile" - ;; - compsave) - srcfile="-u $srcfile -save y" - ;; - runsaved) - srcfile=${srcfile%.*}".marc" - srcfile="-prog $srcfile" - ;; - esac -else - srcfile="" -fi - -if [ "$restart" != "" -a "$restart" != "-" ]; then - restart=`echo $restart | sed "s/$RSTEXT$//"` - restart="-r $restart" -else - restart="" -fi - -if [ "$postfile" != "" -a "$postfile" != "-" ]; then - postfile=`echo $postfile | sed "s/$PSTEXT$//"` - postfile=`echo $postfile | sed "s/$PSTEXTB$//"` - postfile="-pid $postfile" -else - postfile="" -fi - -if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then - viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` - viewfactorsfile="-vf $viewfactorsfile" -else - viewfactorsfile="" -fi - -if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then - hostfile="-ho $hostfile" -else - hostfile="" -fi - -if [ "$compat" != "" -a "$compat" != "-" ]; then - compat="-co $compat" -else - compat="" -fi - -if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then - scr_dir="-sd $scr_dir" -else - scr_dir="" -fi - -if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then - dcoup="-dcoup $dcoup" -else - dcoup="" -fi - -if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then - nthread="-nthread $nthread" -else - nthread="" -fi - -if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then - nsolver="-nsolver $nsolver" -else - nsolver="" -fi - -case "$mode" in - 4) mode="-mo i4" ;; - 8) mode="-mo i8" ;; - *) mode= ;; -esac - -rm -f $job.cnt -rm -f $job.sts -rm -f $job.out -rm -f $job.log - -# To prevent a mismatch with the python version used by the solver -# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH -# unset environment variables PYTHONHOME and PYTHONPATH -unset PYTHONHOME -unset PYTHONPATH - -"${DIR}/tools/run_damask_hmp" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ - $srcfile $restart $postfile $viewfactorsfile $hostfile \ - $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ - $nthread $nsolver $mode > /dev/null 2>&1 -sleep 1 -exit 0 diff --git a/installation/mods_MarcMentat/2011/Mentat_bin/submit5 b/installation/mods_MarcMentat/2011/Mentat_bin/submit5 deleted file mode 100644 index 7c83ee735..000000000 --- a/installation/mods_MarcMentat/2011/Mentat_bin/submit5 +++ /dev/null @@ -1,157 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=%INSTALLDIR%/marc%VERSION% -if test $MARCDIR1 -then - DIR=$MARCDIR1 -fi - -SRCEXT=.f -RSTEXT=.t08 -PSTEXT=.t19 -PSTEXTB=.t16 -VWFCEXT=.vfs - -slv=$1 -version=$2 -ndom_fea_solver=$3 -ndom_preprocessor=$4 -hostfile=$5 -compat=$6 -job=$7 -srcfile=$8 -srcmeth=$9 -shift 9 # cannot use $10, $11, ... -restart=$1 -postfile=$2 -viewfactorsfile=$3 -autorst=$4 -copy_datfile="-ci $5" -copy_postfile="-cr $6" -scr_dir=$7 -dcoup=$8 -nthread=$9 -shift 9 # cannot use $10, $11, ... -nsolver=$1 -mode=$2 - -if [ "$slv" != "" -a "$slv" != "marc" ]; then - slv="-iam sfm" -else - slv="" -fi - -if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then - nprocds="-nprocds $ndom_fea_solver" -else - nprocd="" - if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then - nprocd="-nprocd $ndom_preprocessor" - else - nprocd="" - fi -fi - -if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then -# srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` - case "$srcmeth" in - -) - srcfile="-u $srcfile" - ;; - compsave) - srcfile="-u $srcfile -save y" - ;; - runsaved) - srcfile=${srcfile%.*}".marc" - srcfile="-prog $srcfile" - ;; - esac -else - srcfile="" -fi - -if [ "$restart" != "" -a "$restart" != "-" ]; then - restart=`echo $restart | sed "s/$RSTEXT$//"` - restart="-r $restart" -else - restart="" -fi - -if [ "$postfile" != "" -a "$postfile" != "-" ]; then - postfile=`echo $postfile | sed "s/$PSTEXT$//"` - postfile=`echo $postfile | sed "s/$PSTEXTB$//"` - postfile="-pid $postfile" -else - postfile="" -fi - -if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then - viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` - viewfactorsfile="-vf $viewfactorsfile" -else - viewfactorsfile="" -fi - -if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then - hostfile="-ho $hostfile" -else - hostfile="" -fi - -if [ "$compat" != "" -a "$compat" != "-" ]; then - compat="-co $compat" -else - compat="" -fi - -if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then - scr_dir="-sd $scr_dir" -else - scr_dir="" -fi - -if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then - dcoup="-dcoup $dcoup" -else - dcoup="" -fi - -if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then - nthread="-nthread $nthread" -else - nthread="" -fi - -if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then - nsolver="-nsolver $nsolver" -else - nsolver="" -fi - -case "$mode" in - 4) mode="-mo i4" ;; - 8) mode="-mo i8" ;; - *) mode= ;; -esac - -rm -f $job.cnt -rm -f $job.sts -rm -f $job.out -rm -f $job.log - -# To prevent a mismatch with the python version used by the solver -# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH -# unset environment variables PYTHONHOME and PYTHONPATH -unset PYTHONHOME -unset PYTHONPATH - -"${DIR}/tools/run_damask" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ - $srcfile $restart $postfile $viewfactorsfile $hostfile \ - $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ - $nthread $nsolver $mode > /dev/null 2>&1 -sleep 1 -exit 0 diff --git a/installation/mods_MarcMentat/2011/Mentat_bin/submit6 b/installation/mods_MarcMentat/2011/Mentat_bin/submit6 deleted file mode 100644 index c37857b6e..000000000 --- a/installation/mods_MarcMentat/2011/Mentat_bin/submit6 +++ /dev/null @@ -1,157 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=%INSTALLDIR%/marc%VERSION% -if test $MARCDIR1 -then - DIR=$MARCDIR1 -fi - -SRCEXT=.f -RSTEXT=.t08 -PSTEXT=.t19 -PSTEXTB=.t16 -VWFCEXT=.vfs - -slv=$1 -version=$2 -ndom_fea_solver=$3 -ndom_preprocessor=$4 -hostfile=$5 -compat=$6 -job=$7 -srcfile=$8 -srcmeth=$9 -shift 9 # cannot use $10, $11, ... -restart=$1 -postfile=$2 -viewfactorsfile=$3 -autorst=$4 -copy_datfile="-ci $5" -copy_postfile="-cr $6" -scr_dir=$7 -dcoup=$8 -nthread=$9 -shift 9 # cannot use $10, $11, ... -nsolver=$1 -mode=$2 - -if [ "$slv" != "" -a "$slv" != "marc" ]; then - slv="-iam sfm" -else - slv="" -fi - -if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then - nprocds="-nprocds $ndom_fea_solver" -else - nprocd="" - if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then - nprocd="-nprocd $ndom_preprocessor" - else - nprocd="" - fi -fi - -if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then -# srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` - case "$srcmeth" in - -) - srcfile="-u $srcfile" - ;; - compsave) - srcfile="-u $srcfile -save y" - ;; - runsaved) - srcfile=${srcfile%.*}".marc" - srcfile="-prog $srcfile" - ;; - esac -else - srcfile="" -fi - -if [ "$restart" != "" -a "$restart" != "-" ]; then - restart=`echo $restart | sed "s/$RSTEXT$//"` - restart="-r $restart" -else - restart="" -fi - -if [ "$postfile" != "" -a "$postfile" != "-" ]; then - postfile=`echo $postfile | sed "s/$PSTEXT$//"` - postfile=`echo $postfile | sed "s/$PSTEXTB$//"` - postfile="-pid $postfile" -else - postfile="" -fi - -if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then - viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` - viewfactorsfile="-vf $viewfactorsfile" -else - viewfactorsfile="" -fi - -if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then - hostfile="-ho $hostfile" -else - hostfile="" -fi - -if [ "$compat" != "" -a "$compat" != "-" ]; then - compat="-co $compat" -else - compat="" -fi - -if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then - scr_dir="-sd $scr_dir" -else - scr_dir="" -fi - -if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then - dcoup="-dcoup $dcoup" -else - dcoup="" -fi - -if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then - nthread="-nthread $nthread" -else - nthread="" -fi - -if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then - nsolver="-nsolver $nsolver" -else - nsolver="" -fi - -case "$mode" in - 4) mode="-mo i4" ;; - 8) mode="-mo i8" ;; - *) mode= ;; -esac - -rm -f $job.cnt -rm -f $job.sts -rm -f $job.out -rm -f $job.log - -# To prevent a mismatch with the python version used by the solver -# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH -# unset environment variables PYTHONHOME and PYTHONPATH -unset PYTHONHOME -unset PYTHONPATH - -"${DIR}/tools/run_damask_lmp" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ - $srcfile $restart $postfile $viewfactorsfile $hostfile \ - $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ - $nthread $nsolver $mode > /dev/null 2>&1 -sleep 1 -exit 0 diff --git a/installation/mods_MarcMentat/2011/Mentat_bin/submit7 b/installation/mods_MarcMentat/2011/Mentat_bin/submit7 deleted file mode 100644 index e02560352..000000000 --- a/installation/mods_MarcMentat/2011/Mentat_bin/submit7 +++ /dev/null @@ -1,157 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=%INSTALLDIR%/marc%VERSION% -if test $MARCDIR1 -then - DIR=$MARCDIR1 -fi - -SRCEXT=.f -RSTEXT=.t08 -PSTEXT=.t19 -PSTEXTB=.t16 -VWFCEXT=.vfs - -slv=$1 -version=$2 -ndom_fea_solver=$3 -ndom_preprocessor=$4 -hostfile=$5 -compat=$6 -job=$7 -srcfile=$8 -srcmeth=$9 -shift 9 # cannot use $10, $11, ... -restart=$1 -postfile=$2 -viewfactorsfile=$3 -autorst=$4 -copy_datfile="-ci $5" -copy_postfile="-cr $6" -scr_dir=$7 -dcoup=$8 -nthread=$9 -shift 9 # cannot use $10, $11, ... -nsolver=$1 -mode=$2 - -if [ "$slv" != "" -a "$slv" != "marc" ]; then - slv="-iam sfm" -else - slv="" -fi - -if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then - nprocds="-nprocds $ndom_fea_solver" -else - nprocd="" - if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then - nprocd="-nprocd $ndom_preprocessor" - else - nprocd="" - fi -fi - -if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then -# srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` - case "$srcmeth" in - -) - srcfile="-u $srcfile" - ;; - compsave) - srcfile="-u $srcfile -save y" - ;; - runsaved) - srcfile=${srcfile%.*}".marc" - srcfile="-prog $srcfile" - ;; - esac -else - srcfile="" -fi - -if [ "$restart" != "" -a "$restart" != "-" ]; then - restart=`echo $restart | sed "s/$RSTEXT$//"` - restart="-r $restart" -else - restart="" -fi - -if [ "$postfile" != "" -a "$postfile" != "-" ]; then - postfile=`echo $postfile | sed "s/$PSTEXT$//"` - postfile=`echo $postfile | sed "s/$PSTEXTB$//"` - postfile="-pid $postfile" -else - postfile="" -fi - -if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then - viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` - viewfactorsfile="-vf $viewfactorsfile" -else - viewfactorsfile="" -fi - -if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then - hostfile="-ho $hostfile" -else - hostfile="" -fi - -if [ "$compat" != "" -a "$compat" != "-" ]; then - compat="-co $compat" -else - compat="" -fi - -if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then - scr_dir="-sd $scr_dir" -else - scr_dir="" -fi - -if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then - dcoup="-dcoup $dcoup" -else - dcoup="" -fi - -if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then - nthread="-nthread $nthread" -else - nthread="" -fi - -if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then - nsolver="-nsolver $nsolver" -else - nsolver="" -fi - -case "$mode" in - 4) mode="-mo i4" ;; - 8) mode="-mo i8" ;; - *) mode= ;; -esac - -rm -f $job.cnt -rm -f $job.sts -rm -f $job.out -rm -f $job.log - -# To prevent a mismatch with the python version used by the solver -# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH -# unset environment variables PYTHONHOME and PYTHONPATH -unset PYTHONHOME -unset PYTHONPATH - -"${DIR}/tools/run_damask_h" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ - $srcfile $restart $postfile $viewfactorsfile $hostfile \ - $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ - $nthread $nsolver $mode > /dev/null 2>&1 -sleep 1 -exit 0 diff --git a/installation/mods_MarcMentat/2011/Mentat_bin/submit8 b/installation/mods_MarcMentat/2011/Mentat_bin/submit8 deleted file mode 100644 index 7c83ee735..000000000 --- a/installation/mods_MarcMentat/2011/Mentat_bin/submit8 +++ /dev/null @@ -1,157 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=%INSTALLDIR%/marc%VERSION% -if test $MARCDIR1 -then - DIR=$MARCDIR1 -fi - -SRCEXT=.f -RSTEXT=.t08 -PSTEXT=.t19 -PSTEXTB=.t16 -VWFCEXT=.vfs - -slv=$1 -version=$2 -ndom_fea_solver=$3 -ndom_preprocessor=$4 -hostfile=$5 -compat=$6 -job=$7 -srcfile=$8 -srcmeth=$9 -shift 9 # cannot use $10, $11, ... -restart=$1 -postfile=$2 -viewfactorsfile=$3 -autorst=$4 -copy_datfile="-ci $5" -copy_postfile="-cr $6" -scr_dir=$7 -dcoup=$8 -nthread=$9 -shift 9 # cannot use $10, $11, ... -nsolver=$1 -mode=$2 - -if [ "$slv" != "" -a "$slv" != "marc" ]; then - slv="-iam sfm" -else - slv="" -fi - -if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then - nprocds="-nprocds $ndom_fea_solver" -else - nprocd="" - if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then - nprocd="-nprocd $ndom_preprocessor" - else - nprocd="" - fi -fi - -if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then -# srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` - case "$srcmeth" in - -) - srcfile="-u $srcfile" - ;; - compsave) - srcfile="-u $srcfile -save y" - ;; - runsaved) - srcfile=${srcfile%.*}".marc" - srcfile="-prog $srcfile" - ;; - esac -else - srcfile="" -fi - -if [ "$restart" != "" -a "$restart" != "-" ]; then - restart=`echo $restart | sed "s/$RSTEXT$//"` - restart="-r $restart" -else - restart="" -fi - -if [ "$postfile" != "" -a "$postfile" != "-" ]; then - postfile=`echo $postfile | sed "s/$PSTEXT$//"` - postfile=`echo $postfile | sed "s/$PSTEXTB$//"` - postfile="-pid $postfile" -else - postfile="" -fi - -if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then - viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` - viewfactorsfile="-vf $viewfactorsfile" -else - viewfactorsfile="" -fi - -if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then - hostfile="-ho $hostfile" -else - hostfile="" -fi - -if [ "$compat" != "" -a "$compat" != "-" ]; then - compat="-co $compat" -else - compat="" -fi - -if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then - scr_dir="-sd $scr_dir" -else - scr_dir="" -fi - -if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then - dcoup="-dcoup $dcoup" -else - dcoup="" -fi - -if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then - nthread="-nthread $nthread" -else - nthread="" -fi - -if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then - nsolver="-nsolver $nsolver" -else - nsolver="" -fi - -case "$mode" in - 4) mode="-mo i4" ;; - 8) mode="-mo i8" ;; - *) mode= ;; -esac - -rm -f $job.cnt -rm -f $job.sts -rm -f $job.out -rm -f $job.log - -# To prevent a mismatch with the python version used by the solver -# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH -# unset environment variables PYTHONHOME and PYTHONPATH -unset PYTHONHOME -unset PYTHONPATH - -"${DIR}/tools/run_damask" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ - $srcfile $restart $postfile $viewfactorsfile $hostfile \ - $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ - $nthread $nsolver $mode > /dev/null 2>&1 -sleep 1 -exit 0 diff --git a/installation/mods_MarcMentat/2011/Mentat_bin/submit9 b/installation/mods_MarcMentat/2011/Mentat_bin/submit9 deleted file mode 100644 index 924f725b1..000000000 --- a/installation/mods_MarcMentat/2011/Mentat_bin/submit9 +++ /dev/null @@ -1,157 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=%INSTALLDIR%/marc%VERSION% -if test $MARCDIR1 -then - DIR=$MARCDIR1 -fi - -SRCEXT=.f -RSTEXT=.t08 -PSTEXT=.t19 -PSTEXTB=.t16 -VWFCEXT=.vfs - -slv=$1 -version=$2 -ndom_fea_solver=$3 -ndom_preprocessor=$4 -hostfile=$5 -compat=$6 -job=$7 -srcfile=$8 -srcmeth=$9 -shift 9 # cannot use $10, $11, ... -restart=$1 -postfile=$2 -viewfactorsfile=$3 -autorst=$4 -copy_datfile="-ci $5" -copy_postfile="-cr $6" -scr_dir=$7 -dcoup=$8 -nthread=$9 -shift 9 # cannot use $10, $11, ... -nsolver=$1 -mode=$2 - -if [ "$slv" != "" -a "$slv" != "marc" ]; then - slv="-iam sfm" -else - slv="" -fi - -if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then - nprocds="-nprocds $ndom_fea_solver" -else - nprocd="" - if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then - nprocd="-nprocd $ndom_preprocessor" - else - nprocd="" - fi -fi - -if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then -# srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` - case "$srcmeth" in - -) - srcfile="-u $srcfile" - ;; - compsave) - srcfile="-u $srcfile -save y" - ;; - runsaved) - srcfile=${srcfile%.*}".marc" - srcfile="-prog $srcfile" - ;; - esac -else - srcfile="" -fi - -if [ "$restart" != "" -a "$restart" != "-" ]; then - restart=`echo $restart | sed "s/$RSTEXT$//"` - restart="-r $restart" -else - restart="" -fi - -if [ "$postfile" != "" -a "$postfile" != "-" ]; then - postfile=`echo $postfile | sed "s/$PSTEXT$//"` - postfile=`echo $postfile | sed "s/$PSTEXTB$//"` - postfile="-pid $postfile" -else - postfile="" -fi - -if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then - viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` - viewfactorsfile="-vf $viewfactorsfile" -else - viewfactorsfile="" -fi - -if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then - hostfile="-ho $hostfile" -else - hostfile="" -fi - -if [ "$compat" != "" -a "$compat" != "-" ]; then - compat="-co $compat" -else - compat="" -fi - -if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then - scr_dir="-sd $scr_dir" -else - scr_dir="" -fi - -if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then - dcoup="-dcoup $dcoup" -else - dcoup="" -fi - -if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then - nthread="-nthread $nthread" -else - nthread="" -fi - -if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then - nsolver="-nsolver $nsolver" -else - nsolver="" -fi - -case "$mode" in - 4) mode="-mo i4" ;; - 8) mode="-mo i8" ;; - *) mode= ;; -esac - -rm -f $job.cnt -rm -f $job.sts -rm -f $job.out -rm -f $job.log - -# To prevent a mismatch with the python version used by the solver -# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH -# unset environment variables PYTHONHOME and PYTHONPATH -unset PYTHONHOME -unset PYTHONPATH - -"${DIR}/tools/run_damask_l" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ - $srcfile $restart $postfile $viewfactorsfile $hostfile \ - $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ - $nthread $nsolver $mode > /dev/null 2>&1 -sleep 1 -exit 0 diff --git a/installation/mods_MarcMentat/2011/Mentat_menus/job_run.ms b/installation/mods_MarcMentat/2011/Mentat_menus/job_run.ms deleted file mode 100644 index adb27171f..000000000 --- a/installation/mods_MarcMentat/2011/Mentat_menus/job_run.ms +++ /dev/null @@ -1,2867 +0,0 @@ -#ifndef AUTOFORGE -popmenu job_title_pm file jobs.ms -popdown job_title_ok file jobs.ms -#ifndef QT_MENTAT -popmenu marc_input_style_pm file job_common.ms -popmenu marc_input_style_run_adv_pm file job_common.ms -popmenu marc_version_run_pm file job_common.ms -#endif -group job_solver_gr file job_common.ms -group user_domains_gr file domain_decomposition.ms -group user_domains_generate_gr file domain_decomposition.ms -group user_domains_tail_gr file domain_decomposition.ms -group job_solver_opts_gr file job_common.ms -popmenu ddm_options file job_common.ms -#ifdef QT_MENTAT -browser edit_browser file file.ms -browser directory_browser file file.ms -screen domains file domain_decomposition.ms -#else -popmenu edit_browser_popmenu file file.ms -popmenu directory_browser_popmenu file file.ms -#endif - -#ifndef QT_MENTAT -popmenu usersub_file_browser_pm { - - group { -#endif - - browser usersub_file_browser { - position 0 0 - size 82 72 - text "$usersub_file_browser_label" ($usersub_file_browser_label) - filter "*.f *.f90" - nvisible 10 - select_files true - cancel_action popdown - ok_action popdown - command "$usersub_file_browser_command" ($usersub_file_browser_command) - } -#ifndef QT_MENTAT - } - - window { - title " Select MARC User Subroutine File" - origin 30 30 - size 82 72 - } - - mode dialog - disable_right_mouse_button -} -#endif - -#ifndef QT_MENTAT -popmenu host_file_browser_pm { - - group { -#endif - - browser host_file_browser { - position 0 0 - size 82 72 - text "$host_file_browser_label" ($host_file_browser_label) - filter "*" - nvisible 10 - select_files true - cancel_action popdown - ok_action popdown - command "$host_file_browser_command" ($host_file_browser_command) - } -#ifndef QT_MENTAT - } - - window { - title " Select MARC Host File" - origin 30 30 - size 82 72 - } - - mode dialog - disable_right_mouse_button -} -#endif - -popmenu job_run_popmenu { - -#ifdef QT_MENTAT - text "RUN JOB" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 50 4 - text "RUN JOB" - } -#endif - -#ifdef QT_MENTAT - label { - position 0 0 - size 6 4 - text "NAME" - } - - display { - position +6 = - size 26 4 - display "job_name" - } - - label { - position 0 +4 - size 6 4 - text "TYPE" - } - - display { - position +6 = - size 26 4 - display job_class_label - } -#endif - - button { -#ifdef QT_MENTAT - position 1 9 -#else - position 1 5 -#endif - size 24 4 - text "USER SUBROUTINE FILE" -#ifdef QT_MENTAT - browser usersub_file_browser -#else - popmenu usersub_file_browser_pm -#endif - settext $usersub_file_browser_label "SELECT USER SUBROUTINE FILE" - set $usersub_file_browser_command "*job_usersub_file" - help job_usersub_file - } - - toggle { - position +26 = - size 22 4 - text "SELECTED USER SUBS" - toggle job_usersubs - help job_run_seluser - visible job_usersubs - popmenu job_usersub_pm - } - - display { - position 1 +4 - size 48 4 - display job_usersub_file - } - - button { - position 1 +4 - size 12 4 - text "EDIT" - command "*job_edit_usersub_file" - visible job_usersub_file - } - - button { - position +12 = - size 12 4 - text "CLEAR" - command "*job_clear_usersub_file" - visible job_usersub_file - } - - roller { - position +12 = - size 24 4 - nvalues 3 - texts "COMPILE / NO SAVE" - "COMPILE AND SAVE" - "RUN SAVED EXECUTABLE" - help job_run_compile - roller "job_option user_source" - visible job_usersub_file -#ifdef QT_MENTAT - commands "*job_option user_source:compile_nosave" - "*job_option user_source:compile_save" - "*job_option user_source:run_saved" -#else - popmenu job_user_source_pm -#endif - } - - frame { - position 1 +6 - size 48 10 - border_width 1 - border_color black - - group { - - toggle { - position 1 1 - size 23 4 - text "PARALLELIZATION" - help job_run_parallel - toggle "or(*job_option parallel:on, \ - solver_multi_procs, \ - solver_multi_threads)" - popmenu job_run_parallelization_pm - set $popname2 "job_run_parallelization_pm" - } - - frame { - position +23 = - size 23 8 - border_width 1 - border_color black - - group { - - display { - position 0 0 - size 23 4 - display job_ddm_domains - } - - display { - position = +4 - size 23 4 - display job_solver_procs - visible solver_allows_multi_procs - } - - display { - position = = - size 23 4 - display job_solver_threads - visible "and(solver_allows_multi_threads,\ - not(and(job_solver_mfront_sparse,\ - *job_option parallel:on)))" - } - } - } - } - } - - button { - position 1 +12 - size 8 4 - text "TITLE" - popmenu job_title_pm - command "*job_title" - } - -# see also job_common.ms -# see also the ADVANCED JOB SUBMISSION popmenu in this file - - label { - position +10 = - size 7 4 - text "STYLE" - border_width 1 - border_color black - } - - roller { - position +7 = - size 16 4 - nvalues 3 - texts "TABLE-DRIVEN" - "MULTI-PHYSICS" - "OLD" - rollers "job_input_style_table_driven" - "job_input_style_multi_physics" - "job_input_style_old" -#ifdef QT_MENTAT - commands "*job_option input_style:new *job_option input_physics_style:old" - "*job_option input_physics_style:new *job_option input_style:new" - "*job_option input_style:old *job_option input_physics_style:old" - visibles "job_allows_input_style_table_driven" - "job_allows_input_style_multi_physics" - "job_allows_input_style_old" -#else - popmenu marc_input_style_pm -#endif - help job_option_input_style - } - - button { - position +18 = - size 13 4 - text "SAVE MODEL" - command "*save_model" - } - - button { - position 1 +6 - size 16 6 - text "SUBMIT (1)" - command "*submit_job 1 *monitor_job" - } - - button { - position +16 = - size 16 6 - text "ADV. JOB SUBM." - popmenu job_submit_adv_pm - } - - button { - position +16 = - size 16 6 - text "DAMASK" - popmenu damask - } - - button { - position 1 +6 - size 16 6 - text "UPDATE" - command "*update_job" - } - - button { - position +16 = - size 16 6 - text "MONITOR" - command "*monitor_job" - } - - button { - position +16 = - size 16 6 - text "KILL" - command "*kill_job *monitor_job" - } - - label { - position 1 +7 - size 32 4 - text "STATUS" - border_width 1 - border_color black - } - - display { - position +32 = - size 16 4 - display "job_status" - } - - label { - position -32 +4 - size 32 4 - text "CURRENT INCREMENT (CYCLE)" - border_width 1 - border_color black - } - - display { - position +32 = - size 16 4 - display "job_increment" - } - - label { - position -32 +4 - size 32 4 - text "SINGULARITY RATIO" - border_width 1 - border_color black - } - - float { - position +32 = - size 16 4 - display "job_singularity_ratio" - } - - label { - position -32 +4 - size 32 4 - text "CONVERGENCE RATIO" - border_width 1 - border_color black - } - - float { - position +32 = - size 16 4 - display "job_convergence_ratio" - } - - - label { - position 1 +4 - size 32 4 - text "ANALYSIS TIME" - border_width 1 - border_color black - } - - float { - position +32 = - size 16 4 - display "job_analysis_time" - } - - label { - position -32 +4 - size 32 4 - text "WALL TIME" - border_width 1 - border_color black - } - - float { - position +32 = - size 16 4 - display "job_time" - } - - frame { - position 1 +4 - size 48 8 - - group { - - frame { - position 0 0 - size 48 8 - text "TOTAL" - border_width 1 - border_color black - group { - - label { - position +6 = - size 12 4 - text "CYCLES" - border_width 1 - border_color black - } - - integer { - position +12 = - size 10 4 - display "acc_job_cycles" - border_width 1 - border_color black - } - - label { - position -12 +4 - size 12 4 - text "SEPARATIONS" - border_width 1 - border_color black - } - - integer { - position +12 = - size 10 4 - display "acc_job_separations" - border_width 1 - border_color black - } - - label { - position +10 -4 - size 10 4 - text "CUT BACKS" - border_width 1 - border_color black - } - - integer { - position +10 = - size 10 4 - display "acc_job_cut_backs" - border_width 1 - border_color black - } - - label { - position -10 +4 - size 10 4 - text "REMESHES" - border_width 1 - border_color black - } - - integer { - position +10 = - size 10 4 - display "acc_job_remeshes" - border_width 1 - border_color black - } - } - } - } - } - - label { - position 1 +8 - size 18 4 - text "EXIT NUMBER" - border_width 1 - border_color black - } - - integer { - position +18 = - size 10 4 - display "job_exit" - } - - button { - position +10 = - size 20 4 - text "EXIT MESSAGE" - popmenu job_exit_msg_pm - help exit_message - } - - label { - position 1 +6 - size 5 4 - text "EDIT" - border_width 1 - border_color black - } - - button { - position +5 = - size 12 4 - text "OUTPUT FILE" - command "*job_edit_output" - } - - button { - position +12 = - size 9 4 - text "LOG FILE" - command "*job_edit_log_file" - } - - button { - position +9 = - size 12 4 - text "STATUS FILE" - command "*job_edit_status_file" - } - - button { - position +12 = - size 10 4 - text "ANY FILE" - settext $edit_browser_label "EDIT FILE" - set $edit_browser_command "*edit_file" -#ifdef QT_MENTAT - browser edit_browser -#else - popmenu edit_browser_popmenu -#endif - help edit_file - } - - popdown { - position 1 +6 - size 32 4 - text "OPEN POST FILE (RESULTS MENU)" - screen results - command "*post_open_default" - } - - button { - position 1 +6 - size 12 8 - text "RESET" - command "*job_submit_reset" - } - - popdown { - position +36 = - size 12 8 - text "OK" - } - } - - window job_run_wi { - parent mentat - origin 35 4 - size 50 109 - background_color body - border_width 1 - border_color border - buffering single - } - -#ifdef QT_MENTAT - mode permanent -#else - mode dialog -#endif -} - -popmenu job_usersub_pm { - -#ifdef QT_MENTAT - text "CURRENTLY SELECTED USER SUBROUTINES" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 66 4 - text "CURRENTLY SELECTED USER SUBROUTINES" - } -#endif - - display { - position 1 +5 - size 64 86 - display "job_usersubs" - } - - popdown { - position 27 +88 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 38 8 - size 66 102 - background_color body - border_width 1 - border_color border - buffering single - } - mode dialog -} - -popmenu job_submit_adv_pm { - -#ifdef QT_MENTAT - text "ADVANCED JOB SUBMISSION" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 50 4 - text "ADVANCED JOB SUBMISSION" - } -#endif - - label { - position 1 5 - size 19 4 - text "INITIAL ALLOCATION" - border_width 1 - border_color black - } -#ifdef QT_MENTAT - label { - position +19 = - size 15 4 - text "GENERAL MEMORY" - } -#else - button { - position +19 = - size 15 4 - text "GENERAL MEMORY" - help job_param_general_init_allocation - command "*job_param general_init_allocation" - } -#endif - text { - position +15 = - size 10 4 - display "job_param_value_general_init_allocation" - command "*job_param general_init_allocation" - help job_param_general_init_allocation - } - - label { - position +10 = - size 4 4 - text "MB" - border_width 1 - border_color black - } - - toggle { - position 1 +5 - size 32 4 - text "OUT-OF-CORE ELEMENT STORAGE" - help job_param_elsto - toggle "*job_option elsto:on" - true_command "*job_option elsto:on" - false_command "*job_option elsto:off" - } - - toggle { - position 1 +4 - size 32 4 - text "OUT-OF-CORE INCREMENTAL BACKUP" - help job_param_inc_backup_storage - toggle "*job_option inc_backup_storage:out_of_core" - true_command "*job_option inc_backup_storage:out_of_core" - false_command "*job_option inc_backup_storage:in_core" - } - - toggle { - position +34 = - size 14 4 - text "CHECK SIZES" - help job_run_check - toggle "*job_option check:on" - true_command "*job_option check:on" - false_command "*job_option check:off" - } - - label { - position 1 +6 - size 16 4 - text "INTEGER SIZE" - border_width 1 - border_color black - } - - roller { - position +16 = - size 32 4 - nvalues 3 - texts "DEFAULT" - "4-BYTE INTEGERS" - "8-BYTE INTEGERS" -#ifdef QT_MENTAT - commands "*job_option marc_integer_size:default" - "*job_option marc_integer_size:i4" - "*job_option marc_integer_size:i8" -#else - popmenu marc_integer_size_pm -#endif - help job_run_intsize - roller "job_option marc_integer_size" - } - - frame { - position 1 +6 - size 48 12 - text "MARC INPUT FILE" - border_width 1 - border_color black - - group { - - label { - position 0 4 - size 9 4 - text "VERSION" - border_width 1 - border_color black - } - - roller { - position +9 = - size 14 4 - nvalues 14 - nvisible 14 - texts "DEFAULT" -#if 0 - "2011" -#endif - "2010.2" - "2010" - "2008" - "2007" - "2005R3" - "2005" - "2003" - "2001" - "2000" -#if 0 - "8" -#endif - "K7" - "K6.2" - "K5" - "K4" - help job_param_version - rollers "job_input_version_default" -#if 0 - "job_input_version_2011" -#endif - "job_input_version_2010.2" - "job_input_version_2010" - "job_input_version_2008" - "job_input_version_2007" - "job_input_version_2005r3" - "job_input_version_2005" - "job_input_version_2003" - "job_input_version_2001" - "job_input_version_2000" -#if 0 - "job_input_version_8" -#endif - "job_input_version_k7" - "job_input_version_k6" - "job_input_version_k5" - "job_input_version_k4" -#ifdef QT_MENTAT - commands "*job_option version:default" -#if 0 - "*job_option version:2011" -#endif - "*job_option version:2010.2" - "*job_option version:2010" - "*job_option version:2008" - "*job_option version:2007" - "*job_option version:2005r3" - "*job_option version:2005" - "*job_option version:2003" - "*job_option version:2001" - "*job_option version:2000" -#if 0 - "*job_option version:8" -#endif - "*job_option version:k7" - "*job_option version:k6" - "*job_option version:k5" - "*job_option version:k4" - visibles "job_allows_input_version_default" -#if 0 - "job_allows_input_version_2011" -#endif - "job_allows_input_version_2010.2" - "job_allows_input_version_2010" - "job_allows_input_version_2008" - "job_allows_input_version_2007" - "job_allows_input_version_2005r3" - "job_allows_input_version_2005" - "job_allows_input_version_2003" - "job_allows_input_version_2001" - "job_allows_input_version_2000" -#if 0 - "job_allows_input_version_8" -#endif - "job_allows_input_version_k7" - "job_allows_input_version_k6" - "job_allows_input_version_k5" - "job_allows_input_version_k4" -#else - popmenu marc_version_run_pm -#endif - } - -# see also job_common.ms -# see also the RUN JOB popmenu in this file - - label { - position +14 = - size 7 4 - text "STYLE" - border_width 1 - border_color black - } - - roller { - position +7 = - size 18 4 - nvalues 3 - texts "TABLE-DRIVEN" - "MULTI-PHYSICS" - "OLD" - rollers "job_input_style_table_driven" - "job_input_style_multi_physics" - "job_input_style_old" -#ifdef QT_MENTAT - commands "*job_option input_style:new *job_option input_physics_style:old" - "*job_option input_physics_style:new *job_option input_style:new" - "*job_option input_style:old *job_option input_physics_style:old" - visibles "job_allows_input_style_table_driven" - "job_allows_input_style_multi_physics" - "job_allows_input_style_old" -#else - popmenu marc_input_style_run_adv_pm -#endif - help job_option_input_style - } - - toggle { - position 0 +4 - size 48 4 - text "EXTENDED PRECISION" - help job_run_precision - toggle "*job_option inp_file_prec:extended" - true_command "*job_option inp_file_prec:extended" - false_command "*job_option inp_file_prec:normal" - } - } - } - - button { - position 1 +14 - size 24 4 - text "SCRATCH DIRECTORY" - settext $directory_browser_label "JOB SCRATCH DIRECTORY" - set $directory_browser_command "*job_scratch_directory" -#ifdef QT_MENTAT - browser directory_browser -#else - popmenu directory_browser_popmenu -#endif - help job_scratch_directory - } - - button { - position +24 = - size 24 4 - text "CLEAR" - command "*job_clear_scratch_directory" - visible job_scratch_directory - } - - text { - position 1 +4 - size 48 4 - display job_scratch_dir - command "*job_scratch_directory" - } - -#ifdef DCOM - toggle { - position 1 +6 - size 8 4 - text "DCOM" - toggle "*job_option dcom:on" - help job_run_dcom - true_command "*job_option dcom:on" - false_command "*job_option dcom:off" - visible win32_available - } - - button { - position +8 = - size 12 4 - text "HOSTNAME" - command "*job_dcom_hostname" - visible "and(win32_available, *job_option dcom:on)" - } - - text job_dcom_hostname { - position +12 = - size 28 4 - display "job_dcom_hostname" - command "*job_dcom_hostname" - visible "and(win32_available, *job_option dcom:on)" - } -#endif - - button { - position 1 +6 - size 24 4 - text "TITLE" - popmenu job_title_pm - command "*job_title" - } - - button { - position +24 = - size 24 4 - text "SAVE MODEL" - command "*save_model" - } - - button { - position +4 +6 - size 20 4 - text "WRITE INPUT FILE" - command "*job_write_input" - } - - button { - position = +4 - size 20 4 - text "EDIT INPUT FILE" - command "*job_edit_input" - } - - popdown { - position 1 +5 - size 20 6 - text "SUBMIT 1" - command "*submit_job 1 *monitor_job" - } - - popdown { - position +28 = - size 20 6 - text "EXECUTE 1" - command "*execute_job 1 *monitor_job" - } - - popdown { - position -28 +6 - size 20 6 - text "SUBMIT 2" - command "*submit_job 2 *monitor_job" - } - - popdown { - position +28 = - size 20 6 - text "EXECUTE 2" - command "*execute_job 2 *monitor_job" - } - - popdown { - position -28 +6 - size 20 6 - text "SUBMIT 3" - command "*submit_job 3 *monitor_job" - } - - popdown { - position +28 = - size 20 6 - text "EXECUTE 3" - command "*execute_job 3 *monitor_job" - } - - popdown { - position 19 +8 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 38 8 -#ifdef DCOM - size 50 100 -#else - size 50 94 -#endif - background_color body - border_width 1 - border_color border - buffering single - } - mode dialog -} - -popmenu damask { - -#ifdef QT_MENTAT - text "DAMASK.MPIE.DE" -#endif - - group { -#ifndef QT_MENTAT - label { - position 0 0 - size 50 4 - text "DAMASK.MPIE.DE" - } -#endif - - label { - position 1 6 - size 13 6 - text "Optimzation" - border_width 1 - border_color black - } - - label { - position +13 = - size 20 6 - text "write Input" - border_width 1 - border_color black - } - - label { - position +18 = - size 30 6 - text "do not write Inp." - border_width 1 - border_color black - } - - label { - position -32 +6 - size 12 6 - text "O2 / OpenMP" - border_width 1 - border_color black - } - - popdown { - position +12 = - size 20 6 - text "Submit" - command "*submit_job 4 *monitor_job" - } - - popdown { - position +20 = - size 20 6 - text "Execute" - command "*execute_job 4 *monitor_job" - } - - label { - position -32 +6 - size 12 6 - text "O1 / OpenMP" - border_width 1 - border_color black - } - - popdown { - position +12 = - size 20 6 - text "Submit" - command "*submit_job 5 *monitor_job" - } - - popdown { - position +20 = - size 20 6 - text "Execute" - command "*execute_job 5 *monitor_job" - } - - label { - position -32 +6 - size 12 6 - text "O0 / OpenMP" - border_width 1 - border_color black - } - - popdown { - position +12 = - size 20 6 - text "Submit" - command "*submit_job 6 *monitor_job" - } - - popdown { - position +20 = - size 20 6 - text "Execute" - command "*execute_job 6 *monitor_job" - } - - label { - position -29 +8 - size 9 6 - text "O2" - border_width 1 - border_color black - } - - popdown { - position +9 = - size 20 6 - text "Submit" - command "*submit_job 7 *monitor_job" - } - - popdown { - position +20 = - size 20 6 - text "Execute" - command "*execute_job 7 *monitor_job" - } - - label { - position -29 +6 - size 9 6 - text "O1" - border_width 1 - border_color black - } - - popdown { - position +9 = - size 20 6 - text "Submit" - command "*submit_job 8 *monitor_job" - } - - popdown { - position +20 = - size 20 6 - text "Execute" - command "*execute_job 8 *monitor_job" - } - - label { - position -29 +6 - size 9 6 - text "O0" - border_width 1 - border_color black - } - - popdown { - position +9 = - size 20 6 - text "Submit" - command "*submit_job 9 *monitor_job" - } - - popdown { - position +20 = - size 20 6 - text "Execute" - command "*execute_job 9 *monitor_job" - } - - popdown { - position 19 +8 - size 12 8 - text "CANCEL" - } -} - - - - window { - parent mentat - origin 38 8 -#ifdef DCOM - size 50 100 -#else - size 50 94 -#endif - background_color body - border_width 1 - border_color border - buffering single - } - mode dialog -} - -popmenu job_exit_msg_pm { - -#ifdef QT_MENTAT - text "EXIT MESSAGE" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 86 4 - text "EXIT MESSAGE" - } -#endif - - display { - position 1 5 - size 84 74 - display "job_exit_msg" - } - - popdown { - position 37 +76 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 38 8 - size 86 90 - background_color body - border_width 1 - border_color border - buffering single - } - mode dialog -} - -#ifndef QT_MENTAT -popmenu job_user_source_pm { - window { - parent job_run_wi - origin 25 17 - size 24 17 - border_width 1 - border_color border - background_color body - } - mode dialog - - group job_user_source_gr -} - - -group job_user_source_gr { - popdown { - position 0 0 - size 24 4 - text "COMPILE / NO SAVE" - command "*job_option user_source:compile_nosave" - } - - popdown { - position = +4 - size 24 4 - text "COMPILE AND SAVE" - command "*job_option user_source:compile_save" - } - - popdown { - position = +4 - size 24 4 - text "RUN SAVED EXECUTABLE" - command "*job_option user_source:run_saved" - } - - popdown { - position = +5 - size 24 4 - text "CANCEL" - } -} -#endif - -popmenu job_run_parallelization_pm { - -#ifdef QT_MENTAT - text "PARALLELIZATION" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 50 4 - text "PARALLELIZATION" - } -#endif - -#ifdef QT_MENTAT - label { - position 0 0 - size 6 4 - text "NAME" - } - - display { - position +6 = - size 26 4 - display "job_name" - } - - label { - position 0 +4 - size 6 4 - text "TYPE" - } - - display { - position +6 = - size 26 4 - display job_class_label - } -#endif - - frame { -#ifdef QT_MENTAT - position 1 9 -#else - position 1 5 -#endif - size 48 28 - group job_ddm_gr - text "DOMAIN DECOMPOSITION" - border_width 1 - border_color black - } - - frame { - position 1 +29 - size 48 26 - group job_parallel_matrix_solver_gr - text "MATRIX SOLVER" - border_width 1 - border_color black - } - - frame { - position 1 +27 - size 48 28 - group job_parallel_env_gr - text "PARALLELIZATION ENVIRONMENT" - border_width 1 - border_color black - visible "or(*job_option parallel:on, \ - solver_multi_procs)" - } - - popdown { - position 19 +30 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 38 8 - size 50 100 - background_color body - border_width 1 - border_color border - buffering single - } -#ifdef QT_MENTAT - mode permanent -#else - mode dialog -#endif -} - -group job_ddm_gr { - - toggle { - position 1 4 - size 30 4 - text "USE \{DDM}" - toggle "*job_option parallel:on" - help job_run_ddm_use - true_command "*job_option parallel:on" - false_command "*job_option parallel:off" - } - - frame { - position +2 +5 - size 44 18 - group job_ddm_use_gr - visible "*job_option parallel:on" - } -} - -group job_ddm_use_gr { - roller { - position 0 0 - size 30 4 - nvalues 2 - texts "DECOMPOSITION IN MARC" - "DECOMPOSITION IN MENTAT" - roller "job_option ddm_generator" -#ifdef QT_MENTAT - commands "*job_option ddm_generator:fea_solver" - "*job_option ddm_generator:preprocessor" -#else - popmenu job_ddm_generator_pm -#endif - help job_run_ddm_generator - } - - frame { - position 0 +5 - size 44 8 - group job_ddm_fea_solver_gr - visible "*job_option ddm_generator:fea_solver" - } - - frame { - position = = - size 44 8 - group job_ddm_preprocessor_gr - visible "*job_option ddm_generator:preprocessor" - } - - text { - position 0 +9 - size 22 4 - text "SINGLE INPUT FILE" - readonly - visible "*job_option ddm_generator:fea_solver" - } - - roller { - position = = - size 22 4 - nvalues 2 - texts "MULTIPLE INPUT FILES" - "SINGLE INPUT FILE" - roller "job_option ddm_single_input" - commands "*job_option ddm_single_input:off" - "*job_option ddm_single_input:on" - visible "*job_option ddm_generator:preprocessor" - help job_run_ddm_single_input - } - - roller { - position +23 = - size 21 4 - nvalues 2 - texts "MULTIPLE POST FILES" - "SINGLE POST FILE" - roller "job_option ddm_single_post" - commands "*job_option ddm_single_post:off" - "*job_option ddm_single_post:on" - help job_run_ddm_single_post - } -} - -#ifndef QT_MENTAT -popmenu job_ddm_generator_pm { - - window { - parent mentat - origin 42 26 - size 30 13 - border_width 1 - border_color border - background_color body - } - - mode dialog - - group job_ddm_generator_gr -} - -group job_ddm_generator_gr { - popdown { - position 0 0 - size 30 4 - text "DECOMPOSITION IN MARC" - command "*job_option ddm_generator:fea_solver" - help job_run_ddm_generator - } - - popdown { - position = +4 - size 30 4 - text "DECOMPOSITION IN MENTAT" - command "*job_option ddm_generator:preprocessor" - help job_run_ddm_generator - } - - popdown { - position = +5 - size 30 4 - text "CANCEL" - help job_run_ddm_generator - } -} -#endif - -group job_ddm_fea_solver_gr { -#ifdef QT_MENTAT - label { - position 0 0 - size 10 4 - text "# DOMAINS" - } -#else - button { - position 0 0 - size 10 4 - text "# DOMAINS" - command "*job_param ndomains" - } -#endif - text { - position +10 = - size 4 4 - display "job_param_value_ndomains" - command "*job_param ndomains" - } - - label { - position +4 = - size 7 4 - text "METHOD" - border_width 1 - border_color black - } - - roller { - position +7 = - size 23 4 - nvalues 7 - texts "METIS BEST" - "METIS ELEMENT" - "METIS NODE" - "REC. COORD. BISECTION" - "VECTOR" - "RADIAL" - "ANGULAR" - help set_job_decomp_type - rollers "*job_option ddm_method:metis_best" - "*job_option ddm_method:metis_element_based" - "*job_option ddm_method:metis_node_based" - "*job_option ddm_method:recur_coord_bisect" - "*job_option ddm_method:vector" - "*job_option ddm_method:radial" - "*job_option ddm_method:angular" -#ifdef QT_MENTAT - commands "*job_option ddm_method:metis_best" - "*job_option ddm_method:metis_element_based" - "*job_option ddm_method:metis_node_based" - "*job_option ddm_method:recur_coord_bisect" - "*job_option ddm_method:vector" - "*job_option ddm_method:radial" - "*job_option ddm_method:angular" -#else - popmenu job_ddm_method_pm -#endif - } - - button { - position +4 +4 - size 19 4 - text "ADVANCED SETTINGS" -#ifdef QT_MENTAT - popmenu job_ddm_fea_solver_pm -#else - screen job_ddm_fea_solver_sc - command "@popdown($popname2) @popdown($popname1)" ($popname2, $popname1) -#endif - } -} - -#ifndef QT_MENTAT -popmenu job_ddm_method_pm { - - window { - parent mentat - origin 56 31 - size 30 33 - border_width 1 - border_color border - background_color body - } - - mode dialog - - group job_ddm_method_gr -} - -group job_ddm_method_gr { - - popdown { - position 0 0 - size 30 4 - text "METIS BEST" - command "*job_option ddm_method:metis_best" - } - - popdown { - position = +4 - size 30 4 - text "METIS ELEMENT BASED" - command "*job_option ddm_method:metis_element_based" - } - - popdown { - position = +4 - size 30 4 - text "METIS NODE BASED" - command "*job_option ddm_method:metis_node_based" - } - - popdown { - position = +4 - size 30 4 - text "RECURSIVE COORDINATE BISECTION" - command "*job_option ddm_method:recur_coord_bisect" - } - - popdown { - position = +4 - size 30 4 - text "VECTOR" - command "*job_option ddm_method:vector" - } - - popdown { - position = +4 - size 30 4 - text "RADIAL" - command "*job_option ddm_method:radial" - } - - popdown { - position = +4 - size 30 4 - text "ANGULAR" - command "*job_option ddm_method:angular" - } - - popdown { - position = +5 - size 30 4 - text "CANCEL" - } -} -#endif - -#ifdef QT_MENTAT -popmenu job_ddm_fea_solver_pm { - - text "JOB PARALLELIZATION" -#else -screen job_ddm_fea_solver_sc { - - menu { -#endif - - group { - units 32 120 - -#ifndef QT_MENTAT - label { - position 0 0 - size 32 4 - text "JOB PARALLELIZATION" - } -#endif - - label { - position 0 5 - size 6 4 - text "NAME" - } - - display { - position +6 = - size 26 4 - display "job_name" - } - -#ifdef QT_MENTAT - label { - position 0 +4 - size 6 4 - text "TYPE" - } - - display { - position +6 = - size 26 4 - display job_class_label - } -#endif - - frame { -#ifdef QT_MENTAT - position 0 +9 -#else - position 0 +5 -#endif - size 32 56 - text "ADVANCED DECOMPOSITION IN MARC" - border_width 1 - border_color black - - group { -#ifdef QT_MENTAT - label { - position 1 4 - size 16 4 - text "# DOMAINS" - } -#else - button { - position 1 4 - size 16 4 - text "# DOMAINS" - command "*job_param ndomains" - } -#endif - text { - position +16 = - size 14 4 - display "job_param_value_ndomains" - command "*job_param ndomains" - } - - label { - position 1 +4 - size 7 4 - text "METHOD" - border_width 1 - border_color black - } - - roller { - position +7 = - size 23 4 - nvalues 7 - texts "METIS BEST" - "METIS ELEMENT" - "METIS NODE" - "REC. COORD. BISECTION" - "VECTOR" - "RADIAL" - "ANGULAR" - help set_job_decomp_type - rollers "*job_option ddm_method:metis_best" - "*job_option ddm_method:metis_element_based" - "*job_option ddm_method:metis_node_based" - "*job_option ddm_method:recur_coord_bisect" - "*job_option ddm_method:vector" - "*job_option ddm_method:radial" - "*job_option ddm_method:angular" -#ifdef QT_MENTAT - commands "*job_option ddm_method:metis_best" - "*job_option ddm_method:metis_element_based" - "*job_option ddm_method:metis_node_based" - "*job_option ddm_method:recur_coord_bisect" - "*job_option ddm_method:vector" - "*job_option ddm_method:radial" - "*job_option ddm_method:angular" -#else - popmenu job_ddm_method2_pm -#endif - } - - frame { - position 1 +5 - size 30 20 - group job_ddm_direction_gr - visible "or(*job_option ddm_method:vector, \ - *job_option ddm_method:radial, \ - *job_option ddm_method:angular)" - } - - toggle { - position 1 +21 - size 30 4 - text "DOMAIN ISLAND REMOVAL" - toggle "*job_option ddm_island_removal:on" - true_command "*job_option ddm_island_removal:on" - false_command "*job_option ddm_island_removal:off" - } - - toggle { - position = +4 - size 30 4 - text "COARSE GRAPH" - toggle "*job_option ddm_graph:coarse" - true_command "*job_option ddm_graph:coarse" - false_command "*job_option ddm_graph:fine" - visible "or(*job_option ddm_method:metis_best, \ - *job_option ddm_method:metis_element_based, \ - *job_option ddm_method:metis_node_based)" - } - - toggle { - position = +4 - size 30 4 - text "DETECT CONTACT" - toggle "*job_option ddm_detect_contact:on" - true_command "*job_option ddm_detect_contact:on" - false_command "*job_option ddm_detect_contact:off" - visible "or(*job_option ddm_method:metis_best, \ - *job_option ddm_method:metis_element_based, \ - *job_option ddm_method:metis_node_based)" - } -#ifdef QT_MENTAT - label { - position 1 +5 - size 30 4 - text "ELEMENT WEIGHT COEFFICIENT" - } -#else - button { - position 1 +5 - size 30 4 - text "ELEMENT WEIGHT COEFFICIENT" - command "*job_param ddm_elem_weight_coeff" - } -#endif - text { - position = +4 - size 30 4 - display "job_param_value_ddm_elem_weight_coeff" - command "*job_param ddm_elem_weight_coeff" - } - } - } - -#ifdef QT_MENTAT - popdown { - position 0 +57 - size 32 8 - text "OK" - } -#else - frame { - position 0 +57 - size 32 8 - group ok2_gr - } - - frame select_frame - frame inactive_return -#endif - } -#ifndef QT_MENTAT - window main_window - disable_right_mouse_button - } - - menu transform -} # job_ddm_fea_solver_sc -#else - mode permanent -} # job_ddm_fea_solver_pm -#endif - -#ifndef QT_MENTAT -popmenu job_ddm_method2_pm { - - window { - parent mentat - origin 1 22 - size 30 33 - border_width 1 - border_color border - background_color body - } - - mode dialog - - group job_ddm_method_gr -} -#endif - -group job_ddm_direction_gr { - button { - position 0 0 - size 15 4 - text "DIRECTION" - command "*job_vector ddm_sort_direction_x" - visible "*job_option ddm_method:vector" - } - - button { - position = = - size 15 4 - text "DIRECTION" - command "*job_vector ddm_sort_direction_x" - visible "not(*job_option ddm_method:vector)" - } - - button { - position +15 = - size 15 4 - text "FROM / TO" - command "*job_vector_from_to ddm_sort_direction_x" - } - - text { - position -15 +4 - size 10 4 - command "*job_param ddm_sort_direction_x" - display "job_param_value_ddm_sort_direction_x" - help ddm_job_decomp_user_direction_x - } - - text { - position +10 = - size 10 4 - command "*job_param ddm_sort_direction_y" - display "job_param_value_ddm_sort_direction_y" - } - - text { - position +10 = - size 10 4 - command "*job_param ddm_sort_direction_z" - display "job_param_value_ddm_sort_direction_z" - } - - frame { - position 0 +4 - size 30 8 - group job_ddm_sort_point_gr - visible "not(*job_option ddm_method:vector)" - } -} - -group job_ddm_sort_point_gr { - label { - position 0 0 - size 14 4 - border_width 1 - border_color black - text "POINT ON AXIS" - } - - roller { - position +14 = - size 10 4 - nvalues 2 - texts "DEFAULT" - "USER" - roller "job_option ddm_sort_point" -#ifdef QT_MENTAT - commands "*job_option ddm_sort_point:default" - "*job_option ddm_sort_point:user" -#else - popmenu job_ddm_sort_point_meth_pm -#endif - } - - button { - position +10 = - size 6 4 - text "SET" - command "*job_position ddm_sort_point_x" - visible "*job_option ddm_sort_point:user" - } - - text { - position 0 +4 - size 10 4 - command "*job_param ddm_sort_point_x" - display "job_param_value_ddm_sort_point_x" - visible "*job_option ddm_sort_point:user" - } - - text { - position +10 = - size 10 4 - command "*job_param ddm_sort_point_y" - display "job_param_value_ddm_sort_point_y" - visible "*job_option ddm_sort_point:user" - } - - text { - position +10 = - size 10 4 - command "*job_param ddm_sort_point_z" - display "job_param_value_ddm_sort_point_z" - visible "*job_option ddm_sort_point:user" - } -} - -#ifndef QT_MENTAT -popmenu job_ddm_sort_point_meth_pm { - - window { - parent mentat - origin 15 35 - size 14 13 - border_width 1 - border_color border - background_color body - } - - mode dialog - - group job_ddm_sort_point_meth_gr -} - -group job_ddm_sort_point_meth_gr { - popdown { - position 0 0 - size 14 4 - text "DEFAULT" - command "*job_option ddm_sort_point:default" - } - - popdown { - position = +4 - size 14 4 - text "USER DEFINED" - command "*job_option ddm_sort_point:user" - } - - popdown { - position = +5 - size 14 4 - text "CANCEL" - } -} -#endif - -group job_ddm_preprocessor_gr { - label { - position 0 0 - size 10 4 - text "# DOMAINS" - border_width 1 - border_color black - } - - integer { - position +10 = - size 4 4 - display valid_domains - } - - button { - position +4 = - size 30 4 - text "USER DOMAINS" -#ifdef QT_MENTAT - screen domains -#else - screen job_ddm_user_domains_sc - command "@popdown($popname2) @popdown($popname1)" ($popname2, $popname1) -#endif - help job_run_ddm_user_domains - } -} - -#ifndef QT_MENTAT -screen job_ddm_user_domains_sc { - - menu { - - group { - units 32 120 - - label { - position 0 0 - size 32 4 - text "USER DOMAINS" - } - - frame { - position 0 5 - size 32 28 - group user_domains_gr - } - - frame { - position 0 +29 - size 32 49 - group user_domains_generate_gr - } - - frame { - position 0 +50 - size 32 8 - group user_domains_tail_gr - } - - frame { - position 0 92 - size 32 8 - group ok2_gr - } - - frame select_frame - frame inactive_return - } - window main_window - disable_right_mouse_button - - } - - menu transform - -} # job_ddm_user_domains_sc -#endif - -group job_parallel_matrix_solver_gr { - - label { - position 3 4 - size 12 4 - text "SOLUTION" - border_width 1 - border_color black - } - - roller { - position +12 = - size 18 4 - nvalues 2 - texts "SYMMETRIC" - "NONSYMMETRIC" - rollers job_nonsym_off - job_nonsym_on - commands "*job_option solver_nonsym:off" - "*job_option solver_nonsym:on" - help job_param_solver_method - } - - label { - position -12 +4 - size 6 4 - text "TYPE" - border_width 1 - border_color black - } - - roller { - position +6 = - size 24 4 - nvalues 9 - help job_param_solver_method - texts "MULTIFRONTAL SPARSE" - "MIXED DIRECT-ITERATIVE" - "CASI ITERATIVE" - "PARDISO DIRECT SPARSE" - "MUMPS PARALLEL DIRECT" - "HARDWARE SPARSE" - "ITERATIVE SPARSE" - "DIRECT PROFILE" - "DIRECT SPARSE" - rollers job_solver_mfront_sparse - job_solver_mixed_direct_iterative - job_solver_it_ext - job_solver_pardiso - job_solver_mumps - job_solver_sparse - job_solver_it_sparse - job_solver_dir_profile - job_solver_dir_sparse -#ifdef QT_MENTAT - commands "*job_option solver:mfront_sparse" - "*job_option solver:mixed_direct_iterative" - "*job_option solver:it_ext" - "*job_option solver:pardiso" - "*job_option solver:mumps" - "*job_option solver:sparse" - "*job_option solver:it_sparse" - "*job_option solver:dir_profile" - "*job_option solver:dir_sparse" - visibles job_allows_solver_mfront_sparse - job_allows_solver_mixed_direct_iterative - job_allows_solver_it_ext - job_allows_solver_pardiso - job_allows_solver_mumps - job_allows_solver_sparse - job_allows_solver_it_sparse - job_allows_solver_dir_profile - job_allows_solver_dir_sparse - help job_param_solver_method -#else - popmenu job_set_parallel_matrix_solver_pm -#endif - } - - button { - position +24 = - size 14 4 - text "OPTIONS" - popmenu job_parallel_matrix_solver_opt_pm - } - - frame { - position = +4 - size 14 4 - group job_run_solver_ddm_opts_gr - visible "*job_option parallel:on" - } - - frame { - position 1 +5 - size 46 8 - group job_solver_multi_procs_gr - visible solver_allows_multi_procs - } - - frame { - position = = - size 46 8 - group job_solver_multi_threads_gr - visible solver_allows_multi_threads - } -} - -#ifndef QT_MENTAT -popmenu job_set_parallel_matrix_solver_pm { - window { - parent mentat - origin 48 54 - size 24 42 - border_width 1 - border_color border - background_color body - } - mode dialog - - group job_solver_gr -} -#endif - -popmenu job_parallel_matrix_solver_opt_pm { - -#ifdef QT_MENTAT - text "MATRIX SOLVER OPTIONS" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 38 4 - text "MATRIX SOLVER OPTIONS" - } -#endif - - frame { - position 1 5 - size 36 23 - group job_solver_opts_gr - } - - popdown { - position 13 +25 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 41 12 - size 38 39 - border_width 1 - border_color border - background_color body - } - mode dialog -} - -group job_run_solver_ddm_opts_gr { - button { - position 0 0 - size 14 4 - text "\{DDM} OPTIONS" - popmenu ddm_options -# see also job_common.ms! - visible "not(or(job_solver_it_sparse, \ - job_solver_it_ext, \ - job_solver_mixed_direct_iterative, \ - job_solver_pardiso, \ - job_solver_mumps))" - } -} - -group job_solver_multi_procs_gr { - frame { - position 0 0 - size 46 8 - group job_solver_multi_procs_parallel_off_gr - visible "*job_option parallel:off" - } - - frame { - position = = - size 46 8 - group job_solver_multi_procs_parallel_on_gr - visible "*job_option parallel:on" - } -} - -group job_solver_multi_procs_parallel_off_gr { - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - true_command "*job_option nsolver_procs_serial:on" - false_command "*job_option nsolver_procs_serial:off" - toggle "*job_option nsolver_procs_serial:on" - help job_run_multithreading - } -#ifdef QT_MENTAT - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - visible "*job_option nsolver_procs_serial:on" - } -#else - button { - position +2 +4 - size 14 4 - text "# PROCESSES" - command "*job_param nsolver_procs" - visible "*job_option nsolver_procs_serial:on" - } -#endif - text { - position +14 = - size 14 4 - display "job_param_value_nsolver_procs" - command "*job_param nsolver_procs" - visible "*job_option nsolver_procs_serial:on" - } -} - -group job_solver_multi_procs_parallel_on_gr { - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - help job_run_multithreading - toggle true -#ifdef QT_MENTAT - set $dummy dummy -#endif - } - - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - border_width 1 - border_color black - } - - roller { - position +14 = - size 14 4 - nvalues 2 - texts "AUTOMATIC" - "USER" - commands "*job_option nsolver_procs_ddm:automatic" - "*job_option nsolver_procs_ddm:user" - help job_run_multithreading - rollers "*job_option nsolver_procs_ddm:automatic" - "*job_option nsolver_procs_ddm:user" - } - - frame { - position +14 = - size 16 4 - group job_nsolver_procs_ddm_automatic_gr - visible "*job_option nsolver_procs_ddm:automatic" - } - - frame { - position = = - size 16 4 - group job_nsolver_procs_ddm_user_gr - visible "*job_option nsolver_procs_ddm:user" - } -} - -group job_nsolver_procs_ddm_automatic_gr { - label { - position 0 0 - size 8 4 - text "VALUE" - border_width 1 - border_color black - } - - integer { - position +8 = - size 8 4 - display valid_domains - visible "*job_option ddm_generator:preprocessor" - } - - integer { - position = = - size 8 4 - display "job_param_ndomains" - visible "*job_option ddm_generator:fea_solver" - } -} - -group job_nsolver_procs_ddm_user_gr { -#ifdef QT_MENTAT - label { - position 0 0 - size 8 4 - text "VALUE" - } -#else - button { - position 0 0 - size 8 4 - text "VALUE" - command "*job_param nsolver_procs" - } -#endif - text { - position +8 = - size 8 4 - display "job_param_value_nsolver_procs" - command "*job_param nsolver_procs" - } -} - -group job_solver_multi_threads_gr { - frame { - position 0 0 - size 30 8 - group job_solver_multi_threads_mfront_sparse_gr - visible "and(job_solver_mfront_sparse,*job_option parallel:off)" - } - - frame { - position = = - size 46 8 - group job_solver_multi_threads_pardiso_parallel_off_gr - visible "and(job_solver_pardiso,*job_option parallel:off)" - } - - frame { - position = = - size 46 8 - group job_solver_multi_threads_pardiso_parallel_on_gr - visible "and(job_solver_pardiso,*job_option parallel:on)" - } -} - -group job_solver_multi_threads_mfront_sparse_gr { - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - toggle "*job_option mfront_sparse_multi_threading:on" - true_command "*job_option mfront_sparse_multi_threading:on" - false_command "*job_option mfront_sparse_multi_threading:off" - help job_run_multithreading - } -#ifdef QT_MENTAT - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - visible "*job_option mfront_sparse_multi_threading:on" - } -#else - button { - position +2 +4 - size 14 4 - text "# PROCESSES" - command "*job_param nthreads" - visible "*job_option mfront_sparse_multi_threading:on" - } -#endif - text { - position +14 = - size 14 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - visible "*job_option mfront_sparse_multi_threading:on" - } -} - -group job_solver_multi_threads_pardiso_parallel_off_gr { - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - toggle "*job_option pardiso_multi_threading:on" - true_command "*job_option pardiso_multi_threading:on" - false_command "*job_option pardiso_multi_threading:off" - help job_run_multithreading - } -#ifdef QT_MENTAT - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - visible "*job_option pardiso_multi_threading:on" - } -#else - button { - position +2 +4 - size 14 4 - text "# PROCESSES" - command "*job_param nthreads" - visible "*job_option pardiso_multi_threading:on" - } -#endif - text { - position +14 = - size 14 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - visible "*job_option pardiso_multi_threading:on" - } -} - -group job_solver_multi_threads_pardiso_parallel_on_gr { - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - help job_run_multithreading - toggle true -#ifdef QT_MENTAT - set $dummy dummy -#endif - } - - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - border_color black - border_width 1 - } - - roller { - position +14 = - size 14 4 - nvalues 2 - texts "AUTOMATIC" - "USER" - commands "*job_option pardiso_multi_threading_ddm:automatic" - "*job_option pardiso_multi_threading_ddm:user" - help job_run_multithreading - rollers "*job_option pardiso_multi_threading_ddm:automatic" - "*job_option pardiso_multi_threading_ddm:user" - } - - frame { - position +14 = - size 16 4 - group job_pardiso_multi_threads_ddm_automatic_gr - visible "*job_option pardiso_multi_threading_ddm:automatic" - } - - frame { - position = = - size 16 4 - group job_pardiso_multi_threads_ddm_user_gr - visible "*job_option pardiso_multi_threading_ddm:user" - } -} - -group job_pardiso_multi_threads_ddm_automatic_gr { - label { - position 0 0 - size 8 4 - text "VALUE" - border_width 1 - border_color black - } - - integer { - position +8 = - size 8 4 - display valid_domains - visible "*job_option ddm_generator:preprocessor" - } - - integer { - position = = - size 8 4 - display "job_param_ndomains" - visible "*job_option ddm_generator:fea_solver" - } -} - -group job_pardiso_multi_threads_ddm_user_gr { -#ifdef QT_MENTAT - label { - position 0 0 - size 8 4 - text "VALUE" - } -#else - button { - position 0 0 - size 8 4 - text "VALUE" - command "*job_param nthreads" - } -#endif - text { - position +8 = - size 8 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - } -} - -group job_parallel_env_gr { - - roller { - position 1 4 - size 30 4 - nvalues 2 - texts "SINGLE MACHINE" - "NETWORK" - help job_run_ddm_setup - roller "job_option parallel_setup" - commands "*job_option parallel_setup:single" - "*job_option parallel_setup:network" - } - - frame { - position +2 +5 - size 44 18 - group job_parallel_env_network_gr - visible "*job_option parallel_setup:network" - } -} - -group job_parallel_env_network_gr { - button { - position 0 0 - size 28 4 - text "HOST FILE" -#ifdef QT_MENTAT - browser host_file_browser -#else - popmenu host_file_browser_pm -#endif - settext $host_file_browser_label "SELECT HOST FILE" - set $host_file_browser_command "*job_host_file" - help job_host_file - } - - button { - position +28 = - size 8 4 - text "EDIT" - command "*job_edit_host_file" - help job_edit_host_file - visible job_host_file - } - - button { - position +8 = - size 8 4 - text "CLEAR" - command "*job_clear_host_file" - help job_clear_host_file - visible job_host_file - } - - display { - position 0 +4 - size 44 4 - display job_host_file - } - - frame { - position 0 +5 - size 44 9 - group job_parallel_env_network_ddm_gr - visible "*job_option parallel:on" - } -} - -group job_parallel_env_network_ddm_gr { - toggle { - position 0 0 - size 22 4 - text "COPY INPUT FILE" - toggle "*job_option copy_input_file:on" - true_command "*job_option copy_input_file:on" - false_command "*job_option copy_input_file:off" - help job_host_copy_inputfile - } - - toggle { - position +23 = - size 21 4 - text "COPY POST FILE" - toggle "*job_option copy_post_file:on" - true_command "*job_option copy_post_file:on" - false_command "*job_option copy_post_file:off" - help job_host_copy_inputfile - } - - label { - position 0 +5 - size 10 4 - text "HOSTS" - border_width 1 - border_color black - visible job_usersub_file - } - - roller { - position +10 = - size 18 4 - nvalues 2 - texts "COMPATIBLE" - "INCOMPATIBLE" - roller "job_option network_hosts" - commands "*job_option network_hosts:compatible" - "*job_option network_hosts:incompatible" - help job_host_comp - visible job_usersub_file - } -} - -#ifndef QT_MENTAT -popmenu marc_integer_size_pm { - window { - parent mentat - origin 55 32 - size 32 17 - border_width 1 - border_color border - background_color body - } - mode dialog - - group marc_integer_size_gr -} - -group marc_integer_size_gr { - popdown { - position 0 0 - size 32 4 - text "DEFAULT" - command "*job_option marc_integer_size:default" - help job_run_intsize - } - - popdown { - position = +4 - size 32 4 - text "4-BYTE INTEGERS" - command "*job_option marc_integer_size:i4" - help job_run_intsize - } - - popdown { - position = +4 - size 32 4 - text "8-BYTE INTEGERS" - command "*job_option marc_integer_size:i8" - help job_run_intsize - } - - popdown { - position = +5 - size 32 4 - text "CANCEL" - help job_run_intsize - } -} -#endif -#endif diff --git a/installation/mods_MarcMentat/2011/Mentat_menus/job_run.ms.org b/installation/mods_MarcMentat/2011/Mentat_menus/job_run.ms.org deleted file mode 100644 index 1f4ec6ecd..000000000 --- a/installation/mods_MarcMentat/2011/Mentat_menus/job_run.ms.org +++ /dev/null @@ -1,2664 +0,0 @@ -#ifndef AUTOFORGE -popmenu job_title_pm file jobs.ms -popdown job_title_ok file jobs.ms -#ifndef QT_MENTAT -popmenu marc_input_style_pm file job_common.ms -popmenu marc_input_style_run_adv_pm file job_common.ms -popmenu marc_version_run_pm file job_common.ms -#endif -group job_solver_gr file job_common.ms -group user_domains_gr file domain_decomposition.ms -group user_domains_generate_gr file domain_decomposition.ms -group user_domains_tail_gr file domain_decomposition.ms -group job_solver_opts_gr file job_common.ms -popmenu ddm_options file job_common.ms -#ifdef QT_MENTAT -browser edit_browser file file.ms -browser directory_browser file file.ms -screen domains file domain_decomposition.ms -#else -popmenu edit_browser_popmenu file file.ms -popmenu directory_browser_popmenu file file.ms -#endif - -#ifndef QT_MENTAT -popmenu usersub_file_browser_pm { - - group { -#endif - - browser usersub_file_browser { - position 0 0 - size 82 72 - text "$usersub_file_browser_label" ($usersub_file_browser_label) - filter "*.f *.F" - nvisible 10 - select_files true - cancel_action popdown - ok_action popdown - command "$usersub_file_browser_command" ($usersub_file_browser_command) - } -#ifndef QT_MENTAT - } - - window { - title " Select MARC User Subroutine File" - origin 30 30 - size 82 72 - } - - mode dialog - disable_right_mouse_button -} -#endif - -#ifndef QT_MENTAT -popmenu host_file_browser_pm { - - group { -#endif - - browser host_file_browser { - position 0 0 - size 82 72 - text "$host_file_browser_label" ($host_file_browser_label) - filter "*" - nvisible 10 - select_files true - cancel_action popdown - ok_action popdown - command "$host_file_browser_command" ($host_file_browser_command) - } -#ifndef QT_MENTAT - } - - window { - title " Select MARC Host File" - origin 30 30 - size 82 72 - } - - mode dialog - disable_right_mouse_button -} -#endif - -popmenu job_run_popmenu { - -#ifdef QT_MENTAT - text "RUN JOB" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 50 4 - text "RUN JOB" - } -#endif - -#ifdef QT_MENTAT - label { - position 0 0 - size 6 4 - text "NAME" - } - - display { - position +6 = - size 26 4 - display "job_name" - } - - label { - position 0 +4 - size 6 4 - text "TYPE" - } - - display { - position +6 = - size 26 4 - display job_class_label - } -#endif - - button { -#ifdef QT_MENTAT - position 1 9 -#else - position 1 5 -#endif - size 24 4 - text "USER SUBROUTINE FILE" -#ifdef QT_MENTAT - browser usersub_file_browser -#else - popmenu usersub_file_browser_pm -#endif - settext $usersub_file_browser_label "SELECT USER SUBROUTINE FILE" - set $usersub_file_browser_command "*job_usersub_file" - help job_usersub_file - } - - toggle { - position +26 = - size 22 4 - text "SELECTED USER SUBS" - toggle job_usersubs - help job_run_seluser - visible job_usersubs - popmenu job_usersub_pm - } - - display { - position 1 +4 - size 48 4 - display job_usersub_file - } - - button { - position 1 +4 - size 12 4 - text "EDIT" - command "*job_edit_usersub_file" - visible job_usersub_file - } - - button { - position +12 = - size 12 4 - text "CLEAR" - command "*job_clear_usersub_file" - visible job_usersub_file - } - - roller { - position +12 = - size 24 4 - nvalues 3 - texts "COMPILE / NO SAVE" - "COMPILE AND SAVE" - "RUN SAVED EXECUTABLE" - help job_run_compile - roller "job_option user_source" - visible job_usersub_file -#ifdef QT_MENTAT - commands "*job_option user_source:compile_nosave" - "*job_option user_source:compile_save" - "*job_option user_source:run_saved" -#else - popmenu job_user_source_pm -#endif - } - - frame { - position 1 +6 - size 48 10 - border_width 1 - border_color black - - group { - - toggle { - position 1 1 - size 23 4 - text "PARALLELIZATION" - help job_run_parallel - toggle "or(*job_option parallel:on, \ - solver_multi_procs, \ - solver_multi_threads)" - popmenu job_run_parallelization_pm - set $popname2 "job_run_parallelization_pm" - } - - frame { - position +23 = - size 23 8 - border_width 1 - border_color black - - group { - - display { - position 0 0 - size 23 4 - display job_ddm_domains - } - - display { - position = +4 - size 23 4 - display job_solver_procs - visible solver_allows_multi_procs - } - - display { - position = = - size 23 4 - display job_solver_threads - visible "and(solver_allows_multi_threads,\ - not(and(job_solver_mfront_sparse,\ - *job_option parallel:on)))" - } - } - } - } - } - - button { - position 1 +12 - size 8 4 - text "TITLE" - popmenu job_title_pm - command "*job_title" - } - -# see also job_common.ms -# see also the ADVANCED JOB SUBMISSION popmenu in this file - - label { - position +10 = - size 7 4 - text "STYLE" - border_width 1 - border_color black - } - - roller { - position +7 = - size 16 4 - nvalues 3 - texts "TABLE-DRIVEN" - "MULTI-PHYSICS" - "OLD" - rollers "job_input_style_table_driven" - "job_input_style_multi_physics" - "job_input_style_old" -#ifdef QT_MENTAT - commands "*job_option input_style:new *job_option input_physics_style:old" - "*job_option input_physics_style:new *job_option input_style:new" - "*job_option input_style:old *job_option input_physics_style:old" - visibles "job_allows_input_style_table_driven" - "job_allows_input_style_multi_physics" - "job_allows_input_style_old" -#else - popmenu marc_input_style_pm -#endif - help job_option_input_style - } - - button { - position +18 = - size 13 4 - text "SAVE MODEL" - command "*save_model" - } - - button { - position 1 +6 - size 16 6 - text "SUBMIT (1)" - command "*submit_job 1 *monitor_job" - } - - button { - position +16 = - size 32 6 - text "ADVANCED JOB SUBMISSION" - popmenu job_submit_adv_pm - } - - button { - position 1 +6 - size 16 6 - text "UPDATE" - command "*update_job" - } - - button { - position +16 = - size 16 6 - text "MONITOR" - command "*monitor_job" - } - - button { - position +16 = - size 16 6 - text "KILL" - command "*kill_job *monitor_job" - } - - label { - position 1 +7 - size 32 4 - text "STATUS" - border_width 1 - border_color black - } - - display { - position +32 = - size 16 4 - display "job_status" - } - - label { - position -32 +4 - size 32 4 - text "CURRENT INCREMENT (CYCLE)" - border_width 1 - border_color black - } - - display { - position +32 = - size 16 4 - display "job_increment" - } - - label { - position -32 +4 - size 32 4 - text "SINGULARITY RATIO" - border_width 1 - border_color black - } - - float { - position +32 = - size 16 4 - display "job_singularity_ratio" - } - - label { - position -32 +4 - size 32 4 - text "CONVERGENCE RATIO" - border_width 1 - border_color black - } - - float { - position +32 = - size 16 4 - display "job_convergence_ratio" - } - - - label { - position 1 +4 - size 32 4 - text "ANALYSIS TIME" - border_width 1 - border_color black - } - - float { - position +32 = - size 16 4 - display "job_analysis_time" - } - - label { - position -32 +4 - size 32 4 - text "WALL TIME" - border_width 1 - border_color black - } - - float { - position +32 = - size 16 4 - display "job_time" - } - - frame { - position 1 +4 - size 48 8 - - group { - - frame { - position 0 0 - size 48 8 - text "TOTAL" - border_width 1 - border_color black - group { - - label { - position +6 = - size 12 4 - text "CYCLES" - border_width 1 - border_color black - } - - integer { - position +12 = - size 10 4 - display "acc_job_cycles" - border_width 1 - border_color black - } - - label { - position -12 +4 - size 12 4 - text "SEPARATIONS" - border_width 1 - border_color black - } - - integer { - position +12 = - size 10 4 - display "acc_job_separations" - border_width 1 - border_color black - } - - label { - position +10 -4 - size 10 4 - text "CUT BACKS" - border_width 1 - border_color black - } - - integer { - position +10 = - size 10 4 - display "acc_job_cut_backs" - border_width 1 - border_color black - } - - label { - position -10 +4 - size 10 4 - text "REMESHES" - border_width 1 - border_color black - } - - integer { - position +10 = - size 10 4 - display "acc_job_remeshes" - border_width 1 - border_color black - } - } - } - } - } - - label { - position 1 +8 - size 18 4 - text "EXIT NUMBER" - border_width 1 - border_color black - } - - integer { - position +18 = - size 10 4 - display "job_exit" - } - - button { - position +10 = - size 20 4 - text "EXIT MESSAGE" - popmenu job_exit_msg_pm - help exit_message - } - - label { - position 1 +6 - size 5 4 - text "EDIT" - border_width 1 - border_color black - } - - button { - position +5 = - size 12 4 - text "OUTPUT FILE" - command "*job_edit_output" - } - - button { - position +12 = - size 9 4 - text "LOG FILE" - command "*job_edit_log_file" - } - - button { - position +9 = - size 12 4 - text "STATUS FILE" - command "*job_edit_status_file" - } - - button { - position +12 = - size 10 4 - text "ANY FILE" - settext $edit_browser_label "EDIT FILE" - set $edit_browser_command "*edit_file" -#ifdef QT_MENTAT - browser edit_browser -#else - popmenu edit_browser_popmenu -#endif - help edit_file - } - - popdown { - position 1 +6 - size 32 4 - text "OPEN POST FILE (RESULTS MENU)" - screen results - command "*post_open_default" - } - - button { - position 1 +6 - size 12 8 - text "RESET" - command "*job_submit_reset" - } - - popdown { - position +36 = - size 12 8 - text "OK" - } - } - - window job_run_wi { - parent mentat - origin 35 4 - size 50 109 - background_color body - border_width 1 - border_color border - buffering single - } - -#ifdef QT_MENTAT - mode permanent -#else - mode dialog -#endif -} - -popmenu job_usersub_pm { - -#ifdef QT_MENTAT - text "CURRENTLY SELECTED USER SUBROUTINES" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 66 4 - text "CURRENTLY SELECTED USER SUBROUTINES" - } -#endif - - display { - position 1 +5 - size 64 86 - display "job_usersubs" - } - - popdown { - position 27 +88 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 38 8 - size 66 102 - background_color body - border_width 1 - border_color border - buffering single - } - mode dialog -} - -popmenu job_submit_adv_pm { - -#ifdef QT_MENTAT - text "ADVANCED JOB SUBMISSION" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 50 4 - text "ADVANCED JOB SUBMISSION" - } -#endif - - label { - position 1 5 - size 19 4 - text "INITIAL ALLOCATION" - border_width 1 - border_color black - } -#ifdef QT_MENTAT - label { - position +19 = - size 15 4 - text "GENERAL MEMORY" - } -#else - button { - position +19 = - size 15 4 - text "GENERAL MEMORY" - help job_param_general_init_allocation - command "*job_param general_init_allocation" - } -#endif - text { - position +15 = - size 10 4 - display "job_param_value_general_init_allocation" - command "*job_param general_init_allocation" - help job_param_general_init_allocation - } - - label { - position +10 = - size 4 4 - text "MB" - border_width 1 - border_color black - } - - toggle { - position 1 +5 - size 32 4 - text "OUT-OF-CORE ELEMENT STORAGE" - help job_param_elsto - toggle "*job_option elsto:on" - true_command "*job_option elsto:on" - false_command "*job_option elsto:off" - } - - toggle { - position 1 +4 - size 32 4 - text "OUT-OF-CORE INCREMENTAL BACKUP" - help job_param_inc_backup_storage - toggle "*job_option inc_backup_storage:out_of_core" - true_command "*job_option inc_backup_storage:out_of_core" - false_command "*job_option inc_backup_storage:in_core" - } - - toggle { - position +34 = - size 14 4 - text "CHECK SIZES" - help job_run_check - toggle "*job_option check:on" - true_command "*job_option check:on" - false_command "*job_option check:off" - } - - label { - position 1 +6 - size 16 4 - text "INTEGER SIZE" - border_width 1 - border_color black - } - - roller { - position +16 = - size 32 4 - nvalues 3 - texts "DEFAULT" - "4-BYTE INTEGERS" - "8-BYTE INTEGERS" -#ifdef QT_MENTAT - commands "*job_option marc_integer_size:default" - "*job_option marc_integer_size:i4" - "*job_option marc_integer_size:i8" -#else - popmenu marc_integer_size_pm -#endif - help job_run_intsize - roller "job_option marc_integer_size" - } - - frame { - position 1 +6 - size 48 12 - text "MARC INPUT FILE" - border_width 1 - border_color black - - group { - - label { - position 0 4 - size 9 4 - text "VERSION" - border_width 1 - border_color black - } - - roller { - position +9 = - size 14 4 - nvalues 14 - nvisible 14 - texts "DEFAULT" -#if 0 - "2011" -#endif - "2010.2" - "2010" - "2008" - "2007" - "2005R3" - "2005" - "2003" - "2001" - "2000" -#if 0 - "8" -#endif - "K7" - "K6.2" - "K5" - "K4" - help job_param_version - rollers "job_input_version_default" -#if 0 - "job_input_version_2011" -#endif - "job_input_version_2010.2" - "job_input_version_2010" - "job_input_version_2008" - "job_input_version_2007" - "job_input_version_2005r3" - "job_input_version_2005" - "job_input_version_2003" - "job_input_version_2001" - "job_input_version_2000" -#if 0 - "job_input_version_8" -#endif - "job_input_version_k7" - "job_input_version_k6" - "job_input_version_k5" - "job_input_version_k4" -#ifdef QT_MENTAT - commands "*job_option version:default" -#if 0 - "*job_option version:2011" -#endif - "*job_option version:2010.2" - "*job_option version:2010" - "*job_option version:2008" - "*job_option version:2007" - "*job_option version:2005r3" - "*job_option version:2005" - "*job_option version:2003" - "*job_option version:2001" - "*job_option version:2000" -#if 0 - "*job_option version:8" -#endif - "*job_option version:k7" - "*job_option version:k6" - "*job_option version:k5" - "*job_option version:k4" - visibles "job_allows_input_version_default" -#if 0 - "job_allows_input_version_2011" -#endif - "job_allows_input_version_2010.2" - "job_allows_input_version_2010" - "job_allows_input_version_2008" - "job_allows_input_version_2007" - "job_allows_input_version_2005r3" - "job_allows_input_version_2005" - "job_allows_input_version_2003" - "job_allows_input_version_2001" - "job_allows_input_version_2000" -#if 0 - "job_allows_input_version_8" -#endif - "job_allows_input_version_k7" - "job_allows_input_version_k6" - "job_allows_input_version_k5" - "job_allows_input_version_k4" -#else - popmenu marc_version_run_pm -#endif - } - -# see also job_common.ms -# see also the RUN JOB popmenu in this file - - label { - position +14 = - size 7 4 - text "STYLE" - border_width 1 - border_color black - } - - roller { - position +7 = - size 18 4 - nvalues 3 - texts "TABLE-DRIVEN" - "MULTI-PHYSICS" - "OLD" - rollers "job_input_style_table_driven" - "job_input_style_multi_physics" - "job_input_style_old" -#ifdef QT_MENTAT - commands "*job_option input_style:new *job_option input_physics_style:old" - "*job_option input_physics_style:new *job_option input_style:new" - "*job_option input_style:old *job_option input_physics_style:old" - visibles "job_allows_input_style_table_driven" - "job_allows_input_style_multi_physics" - "job_allows_input_style_old" -#else - popmenu marc_input_style_run_adv_pm -#endif - help job_option_input_style - } - - toggle { - position 0 +4 - size 48 4 - text "EXTENDED PRECISION" - help job_run_precision - toggle "*job_option inp_file_prec:extended" - true_command "*job_option inp_file_prec:extended" - false_command "*job_option inp_file_prec:normal" - } - } - } - - button { - position 1 +14 - size 24 4 - text "SCRATCH DIRECTORY" - settext $directory_browser_label "JOB SCRATCH DIRECTORY" - set $directory_browser_command "*job_scratch_directory" -#ifdef QT_MENTAT - browser directory_browser -#else - popmenu directory_browser_popmenu -#endif - help job_scratch_directory - } - - button { - position +24 = - size 24 4 - text "CLEAR" - command "*job_clear_scratch_directory" - visible job_scratch_directory - } - - text { - position 1 +4 - size 48 4 - display job_scratch_dir - command "*job_scratch_directory" - } - -#ifdef DCOM - toggle { - position 1 +6 - size 8 4 - text "DCOM" - toggle "*job_option dcom:on" - help job_run_dcom - true_command "*job_option dcom:on" - false_command "*job_option dcom:off" - visible win32_available - } - - button { - position +8 = - size 12 4 - text "HOSTNAME" - command "*job_dcom_hostname" - visible "and(win32_available, *job_option dcom:on)" - } - - text job_dcom_hostname { - position +12 = - size 28 4 - display "job_dcom_hostname" - command "*job_dcom_hostname" - visible "and(win32_available, *job_option dcom:on)" - } -#endif - - button { - position 1 +6 - size 24 4 - text "TITLE" - popmenu job_title_pm - command "*job_title" - } - - button { - position +24 = - size 24 4 - text "SAVE MODEL" - command "*save_model" - } - - button { - position +4 +6 - size 20 4 - text "WRITE INPUT FILE" - command "*job_write_input" - } - - button { - position = +4 - size 20 4 - text "EDIT INPUT FILE" - command "*job_edit_input" - } - - popdown { - position 1 +5 - size 20 6 - text "SUBMIT 1" - command "*submit_job 1 *monitor_job" - } - - popdown { - position +28 = - size 20 6 - text "EXECUTE 1" - command "*execute_job 1 *monitor_job" - } - - popdown { - position -28 +6 - size 20 6 - text "SUBMIT 2" - command "*submit_job 2 *monitor_job" - } - - popdown { - position +28 = - size 20 6 - text "EXECUTE 2" - command "*execute_job 2 *monitor_job" - } - - popdown { - position -28 +6 - size 20 6 - text "SUBMIT 3" - command "*submit_job 3 *monitor_job" - } - - popdown { - position +28 = - size 20 6 - text "EXECUTE 3" - command "*execute_job 3 *monitor_job" - } - - popdown { - position 19 +8 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 38 8 -#ifdef DCOM - size 50 100 -#else - size 50 94 -#endif - background_color body - border_width 1 - border_color border - buffering single - } - mode dialog -} - -popmenu job_exit_msg_pm { - -#ifdef QT_MENTAT - text "EXIT MESSAGE" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 86 4 - text "EXIT MESSAGE" - } -#endif - - display { - position 1 5 - size 84 74 - display "job_exit_msg" - } - - popdown { - position 37 +76 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 38 8 - size 86 90 - background_color body - border_width 1 - border_color border - buffering single - } - mode dialog -} - -#ifndef QT_MENTAT -popmenu job_user_source_pm { - window { - parent job_run_wi - origin 25 17 - size 24 17 - border_width 1 - border_color border - background_color body - } - mode dialog - - group job_user_source_gr -} - - -group job_user_source_gr { - popdown { - position 0 0 - size 24 4 - text "COMPILE / NO SAVE" - command "*job_option user_source:compile_nosave" - } - - popdown { - position = +4 - size 24 4 - text "COMPILE AND SAVE" - command "*job_option user_source:compile_save" - } - - popdown { - position = +4 - size 24 4 - text "RUN SAVED EXECUTABLE" - command "*job_option user_source:run_saved" - } - - popdown { - position = +5 - size 24 4 - text "CANCEL" - } -} -#endif - -popmenu job_run_parallelization_pm { - -#ifdef QT_MENTAT - text "PARALLELIZATION" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 50 4 - text "PARALLELIZATION" - } -#endif - -#ifdef QT_MENTAT - label { - position 0 0 - size 6 4 - text "NAME" - } - - display { - position +6 = - size 26 4 - display "job_name" - } - - label { - position 0 +4 - size 6 4 - text "TYPE" - } - - display { - position +6 = - size 26 4 - display job_class_label - } -#endif - - frame { -#ifdef QT_MENTAT - position 1 9 -#else - position 1 5 -#endif - size 48 28 - group job_ddm_gr - text "DOMAIN DECOMPOSITION" - border_width 1 - border_color black - } - - frame { - position 1 +29 - size 48 26 - group job_parallel_matrix_solver_gr - text "MATRIX SOLVER" - border_width 1 - border_color black - } - - frame { - position 1 +27 - size 48 28 - group job_parallel_env_gr - text "PARALLELIZATION ENVIRONMENT" - border_width 1 - border_color black - visible "or(*job_option parallel:on, \ - solver_multi_procs)" - } - - popdown { - position 19 +30 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 38 8 - size 50 100 - background_color body - border_width 1 - border_color border - buffering single - } -#ifdef QT_MENTAT - mode permanent -#else - mode dialog -#endif -} - -group job_ddm_gr { - - toggle { - position 1 4 - size 30 4 - text "USE \{DDM}" - toggle "*job_option parallel:on" - help job_run_ddm_use - true_command "*job_option parallel:on" - false_command "*job_option parallel:off" - } - - frame { - position +2 +5 - size 44 18 - group job_ddm_use_gr - visible "*job_option parallel:on" - } -} - -group job_ddm_use_gr { - roller { - position 0 0 - size 30 4 - nvalues 2 - texts "DECOMPOSITION IN MARC" - "DECOMPOSITION IN MENTAT" - roller "job_option ddm_generator" -#ifdef QT_MENTAT - commands "*job_option ddm_generator:fea_solver" - "*job_option ddm_generator:preprocessor" -#else - popmenu job_ddm_generator_pm -#endif - help job_run_ddm_generator - } - - frame { - position 0 +5 - size 44 8 - group job_ddm_fea_solver_gr - visible "*job_option ddm_generator:fea_solver" - } - - frame { - position = = - size 44 8 - group job_ddm_preprocessor_gr - visible "*job_option ddm_generator:preprocessor" - } - - text { - position 0 +9 - size 22 4 - text "SINGLE INPUT FILE" - readonly - visible "*job_option ddm_generator:fea_solver" - } - - roller { - position = = - size 22 4 - nvalues 2 - texts "MULTIPLE INPUT FILES" - "SINGLE INPUT FILE" - roller "job_option ddm_single_input" - commands "*job_option ddm_single_input:off" - "*job_option ddm_single_input:on" - visible "*job_option ddm_generator:preprocessor" - help job_run_ddm_single_input - } - - roller { - position +23 = - size 21 4 - nvalues 2 - texts "MULTIPLE POST FILES" - "SINGLE POST FILE" - roller "job_option ddm_single_post" - commands "*job_option ddm_single_post:off" - "*job_option ddm_single_post:on" - help job_run_ddm_single_post - } -} - -#ifndef QT_MENTAT -popmenu job_ddm_generator_pm { - - window { - parent mentat - origin 42 26 - size 30 13 - border_width 1 - border_color border - background_color body - } - - mode dialog - - group job_ddm_generator_gr -} - -group job_ddm_generator_gr { - popdown { - position 0 0 - size 30 4 - text "DECOMPOSITION IN MARC" - command "*job_option ddm_generator:fea_solver" - help job_run_ddm_generator - } - - popdown { - position = +4 - size 30 4 - text "DECOMPOSITION IN MENTAT" - command "*job_option ddm_generator:preprocessor" - help job_run_ddm_generator - } - - popdown { - position = +5 - size 30 4 - text "CANCEL" - help job_run_ddm_generator - } -} -#endif - -group job_ddm_fea_solver_gr { -#ifdef QT_MENTAT - label { - position 0 0 - size 10 4 - text "# DOMAINS" - } -#else - button { - position 0 0 - size 10 4 - text "# DOMAINS" - command "*job_param ndomains" - } -#endif - text { - position +10 = - size 4 4 - display "job_param_value_ndomains" - command "*job_param ndomains" - } - - label { - position +4 = - size 7 4 - text "METHOD" - border_width 1 - border_color black - } - - roller { - position +7 = - size 23 4 - nvalues 7 - texts "METIS BEST" - "METIS ELEMENT" - "METIS NODE" - "REC. COORD. BISECTION" - "VECTOR" - "RADIAL" - "ANGULAR" - help set_job_decomp_type - rollers "*job_option ddm_method:metis_best" - "*job_option ddm_method:metis_element_based" - "*job_option ddm_method:metis_node_based" - "*job_option ddm_method:recur_coord_bisect" - "*job_option ddm_method:vector" - "*job_option ddm_method:radial" - "*job_option ddm_method:angular" -#ifdef QT_MENTAT - commands "*job_option ddm_method:metis_best" - "*job_option ddm_method:metis_element_based" - "*job_option ddm_method:metis_node_based" - "*job_option ddm_method:recur_coord_bisect" - "*job_option ddm_method:vector" - "*job_option ddm_method:radial" - "*job_option ddm_method:angular" -#else - popmenu job_ddm_method_pm -#endif - } - - button { - position +4 +4 - size 19 4 - text "ADVANCED SETTINGS" -#ifdef QT_MENTAT - popmenu job_ddm_fea_solver_pm -#else - screen job_ddm_fea_solver_sc - command "@popdown($popname2) @popdown($popname1)" ($popname2, $popname1) -#endif - } -} - -#ifndef QT_MENTAT -popmenu job_ddm_method_pm { - - window { - parent mentat - origin 56 31 - size 30 33 - border_width 1 - border_color border - background_color body - } - - mode dialog - - group job_ddm_method_gr -} - -group job_ddm_method_gr { - - popdown { - position 0 0 - size 30 4 - text "METIS BEST" - command "*job_option ddm_method:metis_best" - } - - popdown { - position = +4 - size 30 4 - text "METIS ELEMENT BASED" - command "*job_option ddm_method:metis_element_based" - } - - popdown { - position = +4 - size 30 4 - text "METIS NODE BASED" - command "*job_option ddm_method:metis_node_based" - } - - popdown { - position = +4 - size 30 4 - text "RECURSIVE COORDINATE BISECTION" - command "*job_option ddm_method:recur_coord_bisect" - } - - popdown { - position = +4 - size 30 4 - text "VECTOR" - command "*job_option ddm_method:vector" - } - - popdown { - position = +4 - size 30 4 - text "RADIAL" - command "*job_option ddm_method:radial" - } - - popdown { - position = +4 - size 30 4 - text "ANGULAR" - command "*job_option ddm_method:angular" - } - - popdown { - position = +5 - size 30 4 - text "CANCEL" - } -} -#endif - -#ifdef QT_MENTAT -popmenu job_ddm_fea_solver_pm { - - text "JOB PARALLELIZATION" -#else -screen job_ddm_fea_solver_sc { - - menu { -#endif - - group { - units 32 120 - -#ifndef QT_MENTAT - label { - position 0 0 - size 32 4 - text "JOB PARALLELIZATION" - } -#endif - - label { - position 0 5 - size 6 4 - text "NAME" - } - - display { - position +6 = - size 26 4 - display "job_name" - } - -#ifdef QT_MENTAT - label { - position 0 +4 - size 6 4 - text "TYPE" - } - - display { - position +6 = - size 26 4 - display job_class_label - } -#endif - - frame { -#ifdef QT_MENTAT - position 0 +9 -#else - position 0 +5 -#endif - size 32 56 - text "ADVANCED DECOMPOSITION IN MARC" - border_width 1 - border_color black - - group { -#ifdef QT_MENTAT - label { - position 1 4 - size 16 4 - text "# DOMAINS" - } -#else - button { - position 1 4 - size 16 4 - text "# DOMAINS" - command "*job_param ndomains" - } -#endif - text { - position +16 = - size 14 4 - display "job_param_value_ndomains" - command "*job_param ndomains" - } - - label { - position 1 +4 - size 7 4 - text "METHOD" - border_width 1 - border_color black - } - - roller { - position +7 = - size 23 4 - nvalues 7 - texts "METIS BEST" - "METIS ELEMENT" - "METIS NODE" - "REC. COORD. BISECTION" - "VECTOR" - "RADIAL" - "ANGULAR" - help set_job_decomp_type - rollers "*job_option ddm_method:metis_best" - "*job_option ddm_method:metis_element_based" - "*job_option ddm_method:metis_node_based" - "*job_option ddm_method:recur_coord_bisect" - "*job_option ddm_method:vector" - "*job_option ddm_method:radial" - "*job_option ddm_method:angular" -#ifdef QT_MENTAT - commands "*job_option ddm_method:metis_best" - "*job_option ddm_method:metis_element_based" - "*job_option ddm_method:metis_node_based" - "*job_option ddm_method:recur_coord_bisect" - "*job_option ddm_method:vector" - "*job_option ddm_method:radial" - "*job_option ddm_method:angular" -#else - popmenu job_ddm_method2_pm -#endif - } - - frame { - position 1 +5 - size 30 20 - group job_ddm_direction_gr - visible "or(*job_option ddm_method:vector, \ - *job_option ddm_method:radial, \ - *job_option ddm_method:angular)" - } - - toggle { - position 1 +21 - size 30 4 - text "DOMAIN ISLAND REMOVAL" - toggle "*job_option ddm_island_removal:on" - true_command "*job_option ddm_island_removal:on" - false_command "*job_option ddm_island_removal:off" - } - - toggle { - position = +4 - size 30 4 - text "COARSE GRAPH" - toggle "*job_option ddm_graph:coarse" - true_command "*job_option ddm_graph:coarse" - false_command "*job_option ddm_graph:fine" - visible "or(*job_option ddm_method:metis_best, \ - *job_option ddm_method:metis_element_based, \ - *job_option ddm_method:metis_node_based)" - } - - toggle { - position = +4 - size 30 4 - text "DETECT CONTACT" - toggle "*job_option ddm_detect_contact:on" - true_command "*job_option ddm_detect_contact:on" - false_command "*job_option ddm_detect_contact:off" - visible "or(*job_option ddm_method:metis_best, \ - *job_option ddm_method:metis_element_based, \ - *job_option ddm_method:metis_node_based)" - } -#ifdef QT_MENTAT - label { - position 1 +5 - size 30 4 - text "ELEMENT WEIGHT COEFFICIENT" - } -#else - button { - position 1 +5 - size 30 4 - text "ELEMENT WEIGHT COEFFICIENT" - command "*job_param ddm_elem_weight_coeff" - } -#endif - text { - position = +4 - size 30 4 - display "job_param_value_ddm_elem_weight_coeff" - command "*job_param ddm_elem_weight_coeff" - } - } - } - -#ifdef QT_MENTAT - popdown { - position 0 +57 - size 32 8 - text "OK" - } -#else - frame { - position 0 +57 - size 32 8 - group ok2_gr - } - - frame select_frame - frame inactive_return -#endif - } -#ifndef QT_MENTAT - window main_window - disable_right_mouse_button - } - - menu transform -} # job_ddm_fea_solver_sc -#else - mode permanent -} # job_ddm_fea_solver_pm -#endif - -#ifndef QT_MENTAT -popmenu job_ddm_method2_pm { - - window { - parent mentat - origin 1 22 - size 30 33 - border_width 1 - border_color border - background_color body - } - - mode dialog - - group job_ddm_method_gr -} -#endif - -group job_ddm_direction_gr { - button { - position 0 0 - size 15 4 - text "DIRECTION" - command "*job_vector ddm_sort_direction_x" - visible "*job_option ddm_method:vector" - } - - button { - position = = - size 15 4 - text "DIRECTION" - command "*job_vector ddm_sort_direction_x" - visible "not(*job_option ddm_method:vector)" - } - - button { - position +15 = - size 15 4 - text "FROM / TO" - command "*job_vector_from_to ddm_sort_direction_x" - } - - text { - position -15 +4 - size 10 4 - command "*job_param ddm_sort_direction_x" - display "job_param_value_ddm_sort_direction_x" - help ddm_job_decomp_user_direction_x - } - - text { - position +10 = - size 10 4 - command "*job_param ddm_sort_direction_y" - display "job_param_value_ddm_sort_direction_y" - } - - text { - position +10 = - size 10 4 - command "*job_param ddm_sort_direction_z" - display "job_param_value_ddm_sort_direction_z" - } - - frame { - position 0 +4 - size 30 8 - group job_ddm_sort_point_gr - visible "not(*job_option ddm_method:vector)" - } -} - -group job_ddm_sort_point_gr { - label { - position 0 0 - size 14 4 - border_width 1 - border_color black - text "POINT ON AXIS" - } - - roller { - position +14 = - size 10 4 - nvalues 2 - texts "DEFAULT" - "USER" - roller "job_option ddm_sort_point" -#ifdef QT_MENTAT - commands "*job_option ddm_sort_point:default" - "*job_option ddm_sort_point:user" -#else - popmenu job_ddm_sort_point_meth_pm -#endif - } - - button { - position +10 = - size 6 4 - text "SET" - command "*job_position ddm_sort_point_x" - visible "*job_option ddm_sort_point:user" - } - - text { - position 0 +4 - size 10 4 - command "*job_param ddm_sort_point_x" - display "job_param_value_ddm_sort_point_x" - visible "*job_option ddm_sort_point:user" - } - - text { - position +10 = - size 10 4 - command "*job_param ddm_sort_point_y" - display "job_param_value_ddm_sort_point_y" - visible "*job_option ddm_sort_point:user" - } - - text { - position +10 = - size 10 4 - command "*job_param ddm_sort_point_z" - display "job_param_value_ddm_sort_point_z" - visible "*job_option ddm_sort_point:user" - } -} - -#ifndef QT_MENTAT -popmenu job_ddm_sort_point_meth_pm { - - window { - parent mentat - origin 15 35 - size 14 13 - border_width 1 - border_color border - background_color body - } - - mode dialog - - group job_ddm_sort_point_meth_gr -} - -group job_ddm_sort_point_meth_gr { - popdown { - position 0 0 - size 14 4 - text "DEFAULT" - command "*job_option ddm_sort_point:default" - } - - popdown { - position = +4 - size 14 4 - text "USER DEFINED" - command "*job_option ddm_sort_point:user" - } - - popdown { - position = +5 - size 14 4 - text "CANCEL" - } -} -#endif - -group job_ddm_preprocessor_gr { - label { - position 0 0 - size 10 4 - text "# DOMAINS" - border_width 1 - border_color black - } - - integer { - position +10 = - size 4 4 - display valid_domains - } - - button { - position +4 = - size 30 4 - text "USER DOMAINS" -#ifdef QT_MENTAT - screen domains -#else - screen job_ddm_user_domains_sc - command "@popdown($popname2) @popdown($popname1)" ($popname2, $popname1) -#endif - help job_run_ddm_user_domains - } -} - -#ifndef QT_MENTAT -screen job_ddm_user_domains_sc { - - menu { - - group { - units 32 120 - - label { - position 0 0 - size 32 4 - text "USER DOMAINS" - } - - frame { - position 0 5 - size 32 28 - group user_domains_gr - } - - frame { - position 0 +29 - size 32 49 - group user_domains_generate_gr - } - - frame { - position 0 +50 - size 32 8 - group user_domains_tail_gr - } - - frame { - position 0 92 - size 32 8 - group ok2_gr - } - - frame select_frame - frame inactive_return - } - window main_window - disable_right_mouse_button - - } - - menu transform - -} # job_ddm_user_domains_sc -#endif - -group job_parallel_matrix_solver_gr { - - label { - position 3 4 - size 12 4 - text "SOLUTION" - border_width 1 - border_color black - } - - roller { - position +12 = - size 18 4 - nvalues 2 - texts "SYMMETRIC" - "NONSYMMETRIC" - rollers job_nonsym_off - job_nonsym_on - commands "*job_option solver_nonsym:off" - "*job_option solver_nonsym:on" - help job_param_solver_method - } - - label { - position -12 +4 - size 6 4 - text "TYPE" - border_width 1 - border_color black - } - - roller { - position +6 = - size 24 4 - nvalues 9 - help job_param_solver_method - texts "MULTIFRONTAL SPARSE" - "MIXED DIRECT-ITERATIVE" - "CASI ITERATIVE" - "PARDISO DIRECT SPARSE" - "MUMPS PARALLEL DIRECT" - "HARDWARE SPARSE" - "ITERATIVE SPARSE" - "DIRECT PROFILE" - "DIRECT SPARSE" - rollers job_solver_mfront_sparse - job_solver_mixed_direct_iterative - job_solver_it_ext - job_solver_pardiso - job_solver_mumps - job_solver_sparse - job_solver_it_sparse - job_solver_dir_profile - job_solver_dir_sparse -#ifdef QT_MENTAT - commands "*job_option solver:mfront_sparse" - "*job_option solver:mixed_direct_iterative" - "*job_option solver:it_ext" - "*job_option solver:pardiso" - "*job_option solver:mumps" - "*job_option solver:sparse" - "*job_option solver:it_sparse" - "*job_option solver:dir_profile" - "*job_option solver:dir_sparse" - visibles job_allows_solver_mfront_sparse - job_allows_solver_mixed_direct_iterative - job_allows_solver_it_ext - job_allows_solver_pardiso - job_allows_solver_mumps - job_allows_solver_sparse - job_allows_solver_it_sparse - job_allows_solver_dir_profile - job_allows_solver_dir_sparse - help job_param_solver_method -#else - popmenu job_set_parallel_matrix_solver_pm -#endif - } - - button { - position +24 = - size 14 4 - text "OPTIONS" - popmenu job_parallel_matrix_solver_opt_pm - } - - frame { - position = +4 - size 14 4 - group job_run_solver_ddm_opts_gr - visible "*job_option parallel:on" - } - - frame { - position 1 +5 - size 46 8 - group job_solver_multi_procs_gr - visible solver_allows_multi_procs - } - - frame { - position = = - size 46 8 - group job_solver_multi_threads_gr - visible solver_allows_multi_threads - } -} - -#ifndef QT_MENTAT -popmenu job_set_parallel_matrix_solver_pm { - window { - parent mentat - origin 48 54 - size 24 42 - border_width 1 - border_color border - background_color body - } - mode dialog - - group job_solver_gr -} -#endif - -popmenu job_parallel_matrix_solver_opt_pm { - -#ifdef QT_MENTAT - text "MATRIX SOLVER OPTIONS" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 38 4 - text "MATRIX SOLVER OPTIONS" - } -#endif - - frame { - position 1 5 - size 36 23 - group job_solver_opts_gr - } - - popdown { - position 13 +25 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 41 12 - size 38 39 - border_width 1 - border_color border - background_color body - } - mode dialog -} - -group job_run_solver_ddm_opts_gr { - button { - position 0 0 - size 14 4 - text "\{DDM} OPTIONS" - popmenu ddm_options -# see also job_common.ms! - visible "not(or(job_solver_it_sparse, \ - job_solver_it_ext, \ - job_solver_mixed_direct_iterative, \ - job_solver_pardiso, \ - job_solver_mumps))" - } -} - -group job_solver_multi_procs_gr { - frame { - position 0 0 - size 46 8 - group job_solver_multi_procs_parallel_off_gr - visible "*job_option parallel:off" - } - - frame { - position = = - size 46 8 - group job_solver_multi_procs_parallel_on_gr - visible "*job_option parallel:on" - } -} - -group job_solver_multi_procs_parallel_off_gr { - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - true_command "*job_option nsolver_procs_serial:on" - false_command "*job_option nsolver_procs_serial:off" - toggle "*job_option nsolver_procs_serial:on" - help job_run_multithreading - } -#ifdef QT_MENTAT - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - visible "*job_option nsolver_procs_serial:on" - } -#else - button { - position +2 +4 - size 14 4 - text "# PROCESSES" - command "*job_param nsolver_procs" - visible "*job_option nsolver_procs_serial:on" - } -#endif - text { - position +14 = - size 14 4 - display "job_param_value_nsolver_procs" - command "*job_param nsolver_procs" - visible "*job_option nsolver_procs_serial:on" - } -} - -group job_solver_multi_procs_parallel_on_gr { - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - help job_run_multithreading - toggle true -#ifdef QT_MENTAT - set $dummy dummy -#endif - } - - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - border_width 1 - border_color black - } - - roller { - position +14 = - size 14 4 - nvalues 2 - texts "AUTOMATIC" - "USER" - commands "*job_option nsolver_procs_ddm:automatic" - "*job_option nsolver_procs_ddm:user" - help job_run_multithreading - rollers "*job_option nsolver_procs_ddm:automatic" - "*job_option nsolver_procs_ddm:user" - } - - frame { - position +14 = - size 16 4 - group job_nsolver_procs_ddm_automatic_gr - visible "*job_option nsolver_procs_ddm:automatic" - } - - frame { - position = = - size 16 4 - group job_nsolver_procs_ddm_user_gr - visible "*job_option nsolver_procs_ddm:user" - } -} - -group job_nsolver_procs_ddm_automatic_gr { - label { - position 0 0 - size 8 4 - text "VALUE" - border_width 1 - border_color black - } - - integer { - position +8 = - size 8 4 - display valid_domains - visible "*job_option ddm_generator:preprocessor" - } - - integer { - position = = - size 8 4 - display "job_param_ndomains" - visible "*job_option ddm_generator:fea_solver" - } -} - -group job_nsolver_procs_ddm_user_gr { -#ifdef QT_MENTAT - label { - position 0 0 - size 8 4 - text "VALUE" - } -#else - button { - position 0 0 - size 8 4 - text "VALUE" - command "*job_param nsolver_procs" - } -#endif - text { - position +8 = - size 8 4 - display "job_param_value_nsolver_procs" - command "*job_param nsolver_procs" - } -} - -group job_solver_multi_threads_gr { - frame { - position 0 0 - size 30 8 - group job_solver_multi_threads_mfront_sparse_gr - visible "and(job_solver_mfront_sparse,*job_option parallel:off)" - } - - frame { - position = = - size 46 8 - group job_solver_multi_threads_pardiso_parallel_off_gr - visible "and(job_solver_pardiso,*job_option parallel:off)" - } - - frame { - position = = - size 46 8 - group job_solver_multi_threads_pardiso_parallel_on_gr - visible "and(job_solver_pardiso,*job_option parallel:on)" - } -} - -group job_solver_multi_threads_mfront_sparse_gr { - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - toggle "*job_option mfront_sparse_multi_threading:on" - true_command "*job_option mfront_sparse_multi_threading:on" - false_command "*job_option mfront_sparse_multi_threading:off" - help job_run_multithreading - } -#ifdef QT_MENTAT - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - visible "*job_option mfront_sparse_multi_threading:on" - } -#else - button { - position +2 +4 - size 14 4 - text "# PROCESSES" - command "*job_param nthreads" - visible "*job_option mfront_sparse_multi_threading:on" - } -#endif - text { - position +14 = - size 14 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - visible "*job_option mfront_sparse_multi_threading:on" - } -} - -group job_solver_multi_threads_pardiso_parallel_off_gr { - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - toggle "*job_option pardiso_multi_threading:on" - true_command "*job_option pardiso_multi_threading:on" - false_command "*job_option pardiso_multi_threading:off" - help job_run_multithreading - } -#ifdef QT_MENTAT - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - visible "*job_option pardiso_multi_threading:on" - } -#else - button { - position +2 +4 - size 14 4 - text "# PROCESSES" - command "*job_param nthreads" - visible "*job_option pardiso_multi_threading:on" - } -#endif - text { - position +14 = - size 14 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - visible "*job_option pardiso_multi_threading:on" - } -} - -group job_solver_multi_threads_pardiso_parallel_on_gr { - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - help job_run_multithreading - toggle true -#ifdef QT_MENTAT - set $dummy dummy -#endif - } - - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - border_color black - border_width 1 - } - - roller { - position +14 = - size 14 4 - nvalues 2 - texts "AUTOMATIC" - "USER" - commands "*job_option pardiso_multi_threading_ddm:automatic" - "*job_option pardiso_multi_threading_ddm:user" - help job_run_multithreading - rollers "*job_option pardiso_multi_threading_ddm:automatic" - "*job_option pardiso_multi_threading_ddm:user" - } - - frame { - position +14 = - size 16 4 - group job_pardiso_multi_threads_ddm_automatic_gr - visible "*job_option pardiso_multi_threading_ddm:automatic" - } - - frame { - position = = - size 16 4 - group job_pardiso_multi_threads_ddm_user_gr - visible "*job_option pardiso_multi_threading_ddm:user" - } -} - -group job_pardiso_multi_threads_ddm_automatic_gr { - label { - position 0 0 - size 8 4 - text "VALUE" - border_width 1 - border_color black - } - - integer { - position +8 = - size 8 4 - display valid_domains - visible "*job_option ddm_generator:preprocessor" - } - - integer { - position = = - size 8 4 - display "job_param_ndomains" - visible "*job_option ddm_generator:fea_solver" - } -} - -group job_pardiso_multi_threads_ddm_user_gr { -#ifdef QT_MENTAT - label { - position 0 0 - size 8 4 - text "VALUE" - } -#else - button { - position 0 0 - size 8 4 - text "VALUE" - command "*job_param nthreads" - } -#endif - text { - position +8 = - size 8 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - } -} - -group job_parallel_env_gr { - - roller { - position 1 4 - size 30 4 - nvalues 2 - texts "SINGLE MACHINE" - "NETWORK" - help job_run_ddm_setup - roller "job_option parallel_setup" - commands "*job_option parallel_setup:single" - "*job_option parallel_setup:network" - } - - frame { - position +2 +5 - size 44 18 - group job_parallel_env_network_gr - visible "*job_option parallel_setup:network" - } -} - -group job_parallel_env_network_gr { - button { - position 0 0 - size 28 4 - text "HOST FILE" -#ifdef QT_MENTAT - browser host_file_browser -#else - popmenu host_file_browser_pm -#endif - settext $host_file_browser_label "SELECT HOST FILE" - set $host_file_browser_command "*job_host_file" - help job_host_file - } - - button { - position +28 = - size 8 4 - text "EDIT" - command "*job_edit_host_file" - help job_edit_host_file - visible job_host_file - } - - button { - position +8 = - size 8 4 - text "CLEAR" - command "*job_clear_host_file" - help job_clear_host_file - visible job_host_file - } - - display { - position 0 +4 - size 44 4 - display job_host_file - } - - frame { - position 0 +5 - size 44 9 - group job_parallel_env_network_ddm_gr - visible "*job_option parallel:on" - } -} - -group job_parallel_env_network_ddm_gr { - toggle { - position 0 0 - size 22 4 - text "COPY INPUT FILE" - toggle "*job_option copy_input_file:on" - true_command "*job_option copy_input_file:on" - false_command "*job_option copy_input_file:off" - help job_host_copy_inputfile - } - - toggle { - position +23 = - size 21 4 - text "COPY POST FILE" - toggle "*job_option copy_post_file:on" - true_command "*job_option copy_post_file:on" - false_command "*job_option copy_post_file:off" - help job_host_copy_inputfile - } - - label { - position 0 +5 - size 10 4 - text "HOSTS" - border_width 1 - border_color black - visible job_usersub_file - } - - roller { - position +10 = - size 18 4 - nvalues 2 - texts "COMPATIBLE" - "INCOMPATIBLE" - roller "job_option network_hosts" - commands "*job_option network_hosts:compatible" - "*job_option network_hosts:incompatible" - help job_host_comp - visible job_usersub_file - } -} - -#ifndef QT_MENTAT -popmenu marc_integer_size_pm { - window { - parent mentat - origin 55 32 - size 32 17 - border_width 1 - border_color border - background_color body - } - mode dialog - - group marc_integer_size_gr -} - -group marc_integer_size_gr { - popdown { - position 0 0 - size 32 4 - text "DEFAULT" - command "*job_option marc_integer_size:default" - help job_run_intsize - } - - popdown { - position = +4 - size 32 4 - text "4-BYTE INTEGERS" - command "*job_option marc_integer_size:i4" - help job_run_intsize - } - - popdown { - position = +4 - size 32 4 - text "8-BYTE INTEGERS" - command "*job_option marc_integer_size:i8" - help job_run_intsize - } - - popdown { - position = +5 - size 32 4 - text "CANCEL" - help job_run_intsize - } -} -#endif -#endif diff --git a/installation/mods_MarcMentat/2012/Marc_tools/comp_damask b/installation/mods_MarcMentat/2012/Marc_tools/comp_damask deleted file mode 100644 index 2d144b8a4..000000000 --- a/installation/mods_MarcMentat/2012/Marc_tools/comp_damask +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/ksh -# 1st arg: $DIR -# 2nd arg: $DIRJOB -# 3rd arg: $user -# 4th arg: $program -DIR=$1 -user=$3 -program=$4 -usernoext=$user -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - -# add BLAS options for linking - BLAS="%BLAS%" - -. $DIR/tools/include -DIRJOB=$2 -cd $DIRJOB -echo "Compiling and linking user subroutine $user on host `hostname`" -echo "program: $program" - $DFORTRAN $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - userobj=$usernoext.o - - - $LOAD ${program} $DIR/lib/main.o\ - $DIR/lib/blkdta.o $DIR/lib/comm?.o \ - ${userobj-} \ - $DIR/lib/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ../lib/mdsrc.a \ - ../lib/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $BLAS \ - $SYSLIBS || \ - { - echo "$0: link failed for $usernoext.o on host `hostname`" - exit 1 - } - /bin/rm $userobj - /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2012/Marc_tools/comp_damask_h b/installation/mods_MarcMentat/2012/Marc_tools/comp_damask_h deleted file mode 100644 index 01464f095..000000000 --- a/installation/mods_MarcMentat/2012/Marc_tools/comp_damask_h +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/ksh -# 1st arg: $DIR -# 2nd arg: $DIRJOB -# 3rd arg: $user -# 4th arg: $program -DIR=$1 -user=$3 -program=$4 -usernoext=$user -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - -# add BLAS options for linking - BLAS="%BLAS%" - -. $DIR/tools/include -DIRJOB=$2 -cd $DIRJOB -echo "Compiling and linking user subroutine $user on host `hostname`" -echo "program: $program" - $DFORTHIGH $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - userobj=$usernoext.o - - - $LOAD ${program} $DIR/lib/main.o\ - $DIR/lib/blkdta.o $DIR/lib/comm?.o \ - ${userobj-} \ - $DIR/lib/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ../lib/mdsrc.a \ - ../lib/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $BLAS \ - $SYSLIBS || \ - { - echo "$0: link failed for $usernoext.o on host `hostname`" - exit 1 - } - /bin/rm $userobj - /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2012/Marc_tools/comp_damask_hmp b/installation/mods_MarcMentat/2012/Marc_tools/comp_damask_hmp deleted file mode 100644 index 36ced6543..000000000 --- a/installation/mods_MarcMentat/2012/Marc_tools/comp_damask_hmp +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/ksh -# 1st arg: $DIR -# 2nd arg: $DIRJOB -# 3rd arg: $user -# 4th arg: $program -DIR=$1 -user=$3 -program=$4 -usernoext=$user -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - -# add BLAS options for linking - BLAS="%BLAS%" - -. $DIR/tools/include -DIRJOB=$2 -cd $DIRJOB -echo "Compiling and linking user subroutine $user on host `hostname`" -echo "program: $program" - $DFORTHIGHMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - userobj=$usernoext.o - - - $LOAD ${program} $DIR/lib/main.o\ - $DIR/lib/blkdta.o $DIR/lib/comm?.o \ - ${userobj-} \ - $DIR/lib/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ../lib/mdsrc.a \ - ../lib/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $BLAS \ - $SYSLIBS || \ - { - echo "$0: link failed for $usernoext.o on host `hostname`" - exit 1 - } - /bin/rm $userobj - /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2012/Marc_tools/comp_damask_l b/installation/mods_MarcMentat/2012/Marc_tools/comp_damask_l deleted file mode 100644 index 31b5cd175..000000000 --- a/installation/mods_MarcMentat/2012/Marc_tools/comp_damask_l +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/ksh -# 1st arg: $DIR -# 2nd arg: $DIRJOB -# 3rd arg: $user -# 4th arg: $program -DIR=$1 -user=$3 -program=$4 -usernoext=$user -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - -# add BLAS options for linking - BLAS="%BLAS%" - -. $DIR/tools/include -DIRJOB=$2 -cd $DIRJOB -echo "Compiling and linking user subroutine $user on host `hostname`" -echo "program: $program" - $DFORTLOW $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - userobj=$usernoext.o - - - $LOAD ${program} $DIR/lib/main.o\ - $DIR/lib/blkdta.o $DIR/lib/comm?.o \ - ${userobj-} \ - $DIR/lib/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ../lib/mdsrc.a \ - ../lib/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $BLAS \ - $SYSLIBS || \ - { - echo "$0: link failed for $usernoext.o on host `hostname`" - exit 1 - } - /bin/rm $userobj - /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2012/Marc_tools/comp_damask_lmp b/installation/mods_MarcMentat/2012/Marc_tools/comp_damask_lmp deleted file mode 100644 index 8a0c1255d..000000000 --- a/installation/mods_MarcMentat/2012/Marc_tools/comp_damask_lmp +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/ksh -# 1st arg: $DIR -# 2nd arg: $DIRJOB -# 3rd arg: $user -# 4th arg: $program -DIR=$1 -user=$3 -program=$4 -usernoext=$user -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - -# add BLAS options for linking - BLAS="%BLAS%" - -. $DIR/tools/include -DIRJOB=$2 -cd $DIRJOB -echo "Compiling and linking user subroutine $user on host `hostname`" -echo "program: $program" - $DFORTRANLOWMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - userobj=$usernoext.o - - - $LOAD ${program} $DIR/lib/main.o\ - $DIR/lib/blkdta.o $DIR/lib/comm?.o \ - ${userobj-} \ - $DIR/lib/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ../lib/mdsrc.a \ - ../lib/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $BLAS \ - $SYSLIBS || \ - { - echo "$0: link failed for $usernoext.o on host `hostname`" - exit 1 - } - /bin/rm $userobj - /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2012/Marc_tools/comp_damask_mp b/installation/mods_MarcMentat/2012/Marc_tools/comp_damask_mp deleted file mode 100644 index 986d9ae04..000000000 --- a/installation/mods_MarcMentat/2012/Marc_tools/comp_damask_mp +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/ksh -# 1st arg: $DIR -# 2nd arg: $DIRJOB -# 3rd arg: $user -# 4th arg: $program -DIR=$1 -user=$3 -program=$4 -usernoext=$user -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - -# add BLAS options for linking - BLAS="%BLAS%" - -. $DIR/tools/include -DIRJOB=$2 -cd $DIRJOB -echo "Compiling and linking user subroutine $user on host `hostname`" -echo "program: $program" - $DFORTRANMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - userobj=$usernoext.o - - - $LOAD ${program} $DIR/lib/main.o\ - $DIR/lib/blkdta.o $DIR/lib/comm?.o \ - ${userobj-} \ - $DIR/lib/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ../lib/mdsrc.a \ - ../lib/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $BLAS \ - $SYSLIBS || \ - { - echo "$0: link failed for $usernoext.o on host `hostname`" - exit 1 - } - /bin/rm $userobj - /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2012/Marc_tools/comp_user.original b/installation/mods_MarcMentat/2012/Marc_tools/comp_user.original deleted file mode 100644 index 8679bb041..000000000 --- a/installation/mods_MarcMentat/2012/Marc_tools/comp_user.original +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/ksh -# 1st arg: $DIR -# 2nd arg: $DIRJOB -# 3rd arg: $user -# 4th arg: $program -DIR=$1 -user=$3 -program=$4 -. $DIR/tools/include -DIRJOB=$2 -cd $DIRJOB -echo "Compiling and linking user subroutine $user.f on host `hostname`" -echo "program: $program" - $FORTRAN $user.f || \ - { - echo "$0: compile failed for $user.f" - exit 1 - } - /bin/rm $program 2>/dev/null - userobj=$user.o - - - $LOAD ${program} $DIR/lib/main.o\ - $DIR/lib/blkdta.o $DIR/lib/comm?.o \ - ${userobj-} \ - $DIR/lib/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ../lib/mdsrc.a \ - ../lib/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $SYSLIBS || \ - { - echo "$0: link failed for $user.o on host `hostname`" - exit 1 - } - /bin/rm $userobj diff --git a/installation/mods_MarcMentat/2012/Marc_tools/include_linux64 b/installation/mods_MarcMentat/2012/Marc_tools/include_linux64 deleted file mode 100644 index 0292ffae7..000000000 --- a/installation/mods_MarcMentat/2012/Marc_tools/include_linux64 +++ /dev/null @@ -1,703 +0,0 @@ -# -# General definitions for the Marc 2011 version -# -# EM64T -# ( LP64 - i4 version) -# (ILP64 - i8 version) -# -# Linux RedHat 5.4 -# -# 64 bit MPI version -# -# Intel(R) Fortran Compiler -# Version 12.0.4 -# -# Intel(R) C Compiler -# Version 12.0.4 -# -# DATE -# -# To check the O/S level, type: -# uname -a -# -# Distributed parallel MPI libraries: -# 1) HP MPI 2.3 -# To check the mpi version, type: -# mpirun -version -# 2) Intel MPI 4.0.1.007 -# To check the mpi version, type: -# mpirun -version -# -# MKL Libraries: -# Intel(R) MKL 10.3.0.084 -# -# To check the Compiler level, type using the compiler -# installation path: -# ifort -V -# icc -V -# -# REMARKS : This file contains the definitions of variables used during -# compilation loading and use of the MARC programmes . The -# current machine type is identified by means of the variable -# MACHINE , defined below. -# -# -# MPI_ROOT: root directory in which mpi shared libraries, etc. are located -# DIRJOB : directory in which spawned jobs should look for Marc input -# MPI_ARCH: system architecture -# MPI_EPATH: path where executable resides -# - -REVISION="VERSION, BUILD" -HOSTNAME=`hostname` - -# find available memory in Mbyte on the machine -# can be set explicitly -MEMLIMIT=`free -m | awk '/Mem:/ {print $2}'` - -# set _OEM_NASTRAN to 1 for MD Nastran build -# override _OEM_NASTRAN setting with MARC_MD_NASTRAN environment variable -_OEM_NASTRAN="${MARC_MD_NASTRAN:-0}" - -# uncomment the following line for an autoforge build -#AUTOFORGE=1 -AUTOFORGE=0 -export AUTOFORGE - -# integer size -if test "$MARC_INTEGER_SIZE" = "" ; then - INTEGER_PATH= -else - INTEGER_PATH=/$MARC_INTEGER_SIZE -fi - -FCOMP=ifort - -# -# settings for Metis -# -METIS="-I$METIS_SOURCE" -METISLIBS="$MARC_LIB/metis.a " - -# -# settings for MPI -# -# RCP and RSH are used for parallel network runs -# replace with similar commands like rsh if needed -RCP=/usr/bin/scp -RSH=/usr/bin/ssh -# - - -MPI_DEFAULT=intelmpi -MPI_OTHER=hpmpi - -MPITYPE=$MPI_DEFAULT - -if test $AUTOFORGE -then - if test $AUTOFORGE = 1 - then - MPITYPE=none - fi -fi - - -# overrule MPITYPE setting with environmental variable MARC_MPITYPE -if test $MARC_MPITYPE -then - MPITYPE=$MARC_MPITYPE -fi - -# always set MPITYPE to none for MD Nastran -if test "$_OEM_NASTRAN" -ne 0 -then - MPITYPE=none -fi - -# Edit following lines to build with GPGPU version of BCS Solver for -# NVIDIA platforms -#BCSGPUSOLVER=NONE -BCSGPUSOLVER=BCSGPU - -SOLVERFLAGS= -if test "$BCSGPUSOLVER" = BCSGPU -then - SOLVERFLAGS="$SOLVERFLAGS -DBCSGPU -DCUDA" - BCS_DIR=bcsgpusolver - export PATH=$MARC_CUDA/bin:$MARC_CUDA/nvvm:$PATH - export LD_LIBRARY_PATH=$MARC_CUDA/lib64:$LD_LIBRARY_PATH -else - BCS_DIR=bcssolver -fi -# -# settings for MPI -# -DDM= -if test $MPITYPE != none -then - if test $MPITYPE = hpmpi - then - FCOMPMPI=mpif90 - export MPI_ROOT=$MARC_HPMPI - export MPI_REMSH=$RSH - export MPI_F77=$FCOMP - ARCHITECTURE=linux_amd64 - DDM="-I$MPI_ROOT/include/64 -DDDM -DHPMPI" - MPI_CLEAN= - export MPI_EPATH=$MARC_BIN - export LD_LIBRARY_PATH=$MPI_ROOT/lib/$ARCHITECTURE:$MARC_LIB:$MARC_LIB_SHARED:$LD_LIBRARY_PATH - export MPIHPSPECIAL="-e MPI_FLAGS=E,T,y1" -# Below line is moved in run_marc file -# export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - export MPIHPSPECIAL="$MPIHPSPECIAL -e BINDIR=$MARC_BIN" - if test -n "$MSC_LICENSE_FILE" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e MSC_LICENSE_FILE=$MSC_LICENSE_FILE" - fi - if test -n "$LM_LICENSE_FILE" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LM_LICENSE_FILE=$LM_LICENSE_FILE" - fi - export MPIHPSPECIAL="$MPIHPSPECIAL -e MPI_LIC_CHECKER=$MPI_ROOT/bin/licensing/amd64_s8/lichk.x" - RUN_JOB2="$MPI_ROOT/bin/mpirun ${MPIRUNOPTIONS} -prot -f " - RUN_JOB1="$MPI_ROOT/bin/mpirun ${MPIRUNOPTIONS} -prot -w $MPIHPSPECIAL -np " - RUN_JOB0= - fi - if test $MPITYPE = intelmpi - then - INTELMPI_VERSION=HYDRA - FCOMPMPI=mpiifort - MPI_ROOT=$MARC_INTELMPI - DDM="-I${MPI_ROOT}/include64 -DDDM" - PATH=$MPI_ROOT/bin64:$PATH - export PATH - LD_LIBRARY_PATH=$MPI_ROOT/lib64:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - if test $INTELMPI_VERSION = HYDRA - then - RUN_JOB1="${MPI_ROOT}/bin64/mpiexec.hydra -genvall -n " - RUN_JOB2="${MPI_ROOT}/bin64/mpiexec.hydra -genvall" - else - RUN_JOB1="${MPI_ROOT}/bin64/mpiexec -n " - RUN_JOB2="${MPI_ROOT}/bin64/mpiexec -configfile " - fi - RUN_JOB0= - MPI_CLEAN= - MPI_EPATH=$MARC_BIN - MPIR_HOME=$MPI_ROOT - MPICH_F77=$FCOMP - MPICH_F77LINKER=$FCOMP - export MPI_ROOT MPI_EPATH MPIR_HOME MPICH_F77 MPICH_F77LINKER - I_MPI_PIN_DOMAIN=node - export I_MPI_PIN_DOMAIN - fi -else - MPI_ROOT=$MARC_DUMMYMPI - export MPI_ROOT=$MARC_DUMMYMPI - DDM="-I$MPI_ROOT/include" -fi - -# -# variables for the "maintain" script -# - -MACHINENAME=LINUX -MACHINE64BIT=yes -MACHINE=Linux_EM64T -DEV=/dev/tape -GETLOG="whoami" -CLEAR="clear" -MY_UNAME=`uname -a` - -# Edit following 2 lines to build with VKI Solver -#VKISOLVER=VKI -VKISOLVER=NONE - -# Edit following 2 lines to build with CASI Solver -CASISOLVER=CASI -#CASISOLVER=NONE - -# Edit following 2 lines to build with MF2 Solver -MF2SOLVER=NONE -#MF2SOLVER=SERIAL -#MF2SOLVER=MF2PARALLEL - -# Edit following lines to build with Intel(c) Multithreaded solver (PARDISO) -#INTELSOLVER=NONE -INTELSOLVER=PARDISO - -# Edit following lines to build with MUMPS -if test "$MARC_INTEGER_SIZE" = "i4" ; then - #MUMPSSOLVER=NONE - MUMPSSOLVER=MUMPS -else - #MUMPSSOLVER=NONE - MUMPSSOLVER=MUMPS -fi - -# Edit following 2 lines to build MARC dynamic shared library -MARC_DLL=MARC_DLL -#MARC_DLL=NONE - -# always set VKISOLVER, CASISOLVER, BCSGPUSOLVER, and MARC_DLL to NONE for MD Nastran -if test "$_OEM_NASTRAN" -ne 0 -then - VKISOLVER=NONE - CASISOLVER=NONE - MF2SOLVER=NONE - INTELSOLVER=NONE - MUMPSSOLVER=NONE - BCSGPUSOLVER=NONE - MARC_DLL=NONE -fi - -# -# define Fortran and C compile syntax -# -if test "$VKISOLVER" = VKI -then - SOLVERFLAGS="$SOLVERFLAGS -DVKI" -fi - -if test "$CASISOLVER" = CASI -then - SOLVERFLAGS="$SOLVERFLAGS -DCASI" -fi - -if test "$MF2SOLVER" = MF2PARALLEL -then - SOLVERFLAGS="$SOLVERFLAGS -DMF2PARALLEL" -fi -if test "$MF2SOLVER" = MF2SERIAL -then - SOLVERFLAGS="$SOLVERFLAGS -DMF2SERIAL" -fi - -if test "$INTELSOLVER" = PARDISO -then - SOLVERFLAGS="$SOLVERFLAGS -DPARDISO" -fi - -if test "$MUMPSSOLVER" = MUMPS -then - SOLVERFLAGS="$SOLVERFLAGS -DMUMPS" -fi - - -if test "$MARC_DLL" = MARC_DLL -then - SOLVERFLAGS="$SOLVERFLAGS -DMARC_DLL" -fi - -LINK_OPT= -DEBUG_OPT= -C_DEBUG_OPT= - -#Uncomment following line to build Marc in debuggable mode -MARCDEBUG= -#MARCDEBUG="ON" - -if test "$MARCDEBUG" = "ON" -then - LINK_OPT="-debug -traceback" - DEBUG_OPT="-debug -traceback" - C_DEBUG_OPT="-debug -traceback" -fi - - -MARCCHECK= -#MARCCHECK="ON" -if test "$MARCCHECK" = "ON" -then - DEBUG_OPT="$DEBUG_OPT -fpe0 -fp-stack-check -check all -ftrapuv " - C_DEBUG_OPT="$C_DEBUG_OPT -fp-stack-check -check-uninit -Wformat -ftrapuv " -fi - -if test "$MARC_INTEGER_SIZE" = "i4" ; then - I8FFLAGS="-real-size 64 -integer-size 32" - I8DEFINES="-DFLOAT=8 -DINT=4" - I8CDEFINES= - I8CASIDEFS= -else - I8FFLAGS="-i8 -real-size 64 -integer-size 64" - I8DEFINES="-DI64 -DFLOAT=8 -DINT=8" - I8CDEFINES="-U_DOUBLE -D_SINGLE" - I8CASIDEFS="-DCASI_64BIT_INT=1" -fi - - -CDEFINES= -FDEFINES= - -if test "$_OEM_NASTRAN" -ne 0 -then - CDEFINES="$CDEFINES -D_OEM_NASTRAN" - FDEFINES="$FDEFINES -D_OEM_NASTRAN" -fi - -FDEFINES="$FDEFINES -D_IMPLICITNONE" - -if test "$_OEM_NASTRAN" -eq 0 -then - FDEFINES="$FDEFINES -DOPENMP -DMKL" -fi - -# -D_MSCMARC -FDEFINES="$FDEFINES -D_MSCMARC $DEBUG_OPT" -CDEFINES="$CDEFINES -D_MSCMARC $C_DEBUG_OPT $I8CDEFINES" - -CINCL="-I$MARC_SOURCE/mdsrc -I$MARC_SOURCE/csource" -if test "$_OEM_NASTRAN" -ne 0 -then - CINCL="$CINCL -I../../include" -fi - -CC="icc -c -O1 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS" -CCLOW="icc -c -O0 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS" -CCHIGH="icc -c -O3 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS" - -if test "$MARCDEBUG" = "ON" -then - CC="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS" - CCLOW="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS" - CCHIGH="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS" -fi - -LOAD_CC="icc -O1 -DLinux -DLINUX -DLinux_intel" -CCT="$CC" -CCTLOW="$CCLOW" -CCTHIGH="$CCHIGH" - -CC_CASI="$CC -c99 $I8CASIDEFS" -CCLOW_CASI="$CCLOW -c99 $I8CASIDEFS" -CCHIGH_CASI="$CCHIGH -c99 $I8CASIDEFS" - -CCT_CASI="$CCT -c99 $I8CASIDEFS" -CCTLOW_CASI="$CCLOW -c99 $I8CASIDEFS" -CCTHIGH_CASI="$CCHIGH -c99 $I8CASIDEFS" - -#PROFILE="-Mprof=func" -#PROFILE="-Mprof=lines" -#PROFILE="-Mprof=func,mpi" -PROFILE= - -FORTLOW="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -O0 $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -FORTRAN="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -O1 $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -FORTHIGH="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -FORTNA="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr -save -zero -mp1 -WB -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" - -# determine DAMASK version -HIT=0 -for arg in "$@" -do - if [ $HIT = 1 ] - then - DAMASKPATH=`dirname $arg` - break - elif [ ${arg:0:2} = -u -o ${arg:0:2} = -U ] - then - HIT=1 - fi -done -read DAMASKVERSION < $DAMASKPATH/../VERSION -DAMASKVERSION="'"$DAMASKVERSION"'" - -# DAMASK compiler calls: additional flags are in line 2 OpenMP flags in line 3; removed -save for calls with openMP -DFORTLOW="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -O0 $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2012 -DDAMASKVERSION=$DAMASKVERSION \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -DFORTLOWMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB -O0 $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2012 -DDAMASKVERSION=$DAMASKVERSION \ - -openmp -openmp_report2 \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -DFORTRAN="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -O1 $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2012 -DDAMASKVERSION=$DAMASKVERSION \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -DFORTRANMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB -O1 $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2012 -DDAMASKVERSION=$DAMASKVERSION \ - -openmp -openmp_report2 \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -DFORTHIGH="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2012 -DDAMASKVERSION=$DAMASKVERSION \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -DFORTHIGHMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2012 -DDAMASKVERSION=$DAMASKVERSION \ - -openmp -openmp_report2 \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - -if test "$MARCDEBUG" = "ON" -then - FORTLOW="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - FORTRAN="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - FORTHIGH="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - FORTNA="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr -save -zero -mp1 -WB -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" - -# DAMASK compiler calls: additional flags are in line 2 OpenMP flags in line 3; removed -save for calls with openMP - DFORTLOW="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2012 -DDAMASKVERSION=$DAMASKVERSION \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - DFORTLOWMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2012 -DDAMASKVERSION=$DAMASKVERSION \ - -openmp -openmp_report2 \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - DFORTRAN="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2012 -DDAMASKVERSION=$DAMASKVERSION \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - DFORTRANMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2012 -DDAMASKVERSION=$DAMASKVERSION \ - -openmp -openmp_report2 \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - DFORTHIGH="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2012 -DDAMASKVERSION=$DAMASKVERSION \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - DFORTHIGHMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2012 -DDAMASKVERSION=$DAMASKVERSION \ - -openmp -openmp_report2 \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -fi - -FORTLOWT="$FORTLOW" -FORTRANT="$FORTRAN" -FORTHIGHT="$FORTHIGH" - -FORTRANMNF="$FCOMP -c $FDEFINES " -CCMNF="icc -c -O1 -DLinux -DLINUX -DLinux_intel -Dport2egcs -I$MARC_SOURCE/marctoadams/mnf/include -D_LARGEFILE64_SOURCE" - - -FORTRANMUMPS="$FCOMP -c -fpp -D_IMPLICITNONE $I8FFLAGS $I8DEFINES $DDM -I$MARC_SOURCE/mumpssolver/include -Dintel_ -DALLOW_NON_INIT -Dmetis -nofor_main" -CCMUMPS="icc -c -DAdd_ -Dmetis -I$MARC_SOURCE/mumpssolver/include" - - -BCSCC="icc -c -O3 -DLOWERCASE_ -I${MARC_SOURCE}/${BCS_DIR}/bcslib_csrc $CDEFINES $CINCL" -NVCC="nvcc -c -O3 -arch sm_20 -DLOWERCASE_ -I${MARC_SOURCE}/${BCS_DIR}/bcslib_cuda/include -I${MARC_CUDA}/include -I$MARC_SOURCE/mdsrc $I8DEFINES -Xcompiler -fvisibility=hidden -Xcompiler -fPIC $I8DEFINES " -NVCCLIB="ar rvl" -NVCCLD=gcc -BCSFORTLOW="$FORTLOW -I${MARC_SOURCE}/${BCS_DIR}/common" -BCSFORTRAN="$FORTRAN -I${MARC_SOURCE}/${BCS_DIR}/common" -BCSFORTHIGH="$FORTHIGH -I${MARC_SOURCE}/${BCS_DIR}/common" -BCSFORT90HIGH="$BCSFORTHIGH" -if test "$MARCDEBUG" = "ON" -then - BCSFORTRAN=$BCSFORTLOW - BCSFORTHIGH=$BCSFORTLOW - BCSFORT90HIGH=$BCSFORTLOW -fi - -if test $MPITYPE != none -then - if test $MPITYPE = hpmpi - then - LOAD="$MPI_ROOT/bin/$FCOMPMPI ${LOADOPTIONS} -L$MPI_ROOT/lib/$ARCHITECTURE $PROFILE $LINK_OPT -o " - LOADT="$MPI_ROOT/bin/$FCOMPMPI ${LOADOPTIONS} -L$MPI_ROOT/lib/$ARCHITECTURE $PROFILE $LINK_OPT -o " - fi -# Uncomment the following lines to turn on the tracer and commnet out the next 5 lines -# if test $MPITYPE = intelmpi -# then -# INCLUDEMPI="-I$MPI_ROOT/include64 -I$VT_ROOT/include" -# LOAD="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " -# LOADT="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " -# fi - if test $MPITYPE = intelmpi - then - LOAD="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $LINK_OPT -o " - LOADT="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $LINK_OPT -o " - fi -else - LOAD="$FCOMP $LINK_OPT -o " - LOADT="$FCOMP $LINK_OPT -o " -fi - -if test "$MARC_DLL" = MARC_DLL -then - FORTLOW="$FORTLOW -fpp -fPIC" - FORTRAN="$FORTRAN -fpp -fPIC" - FORTHIGH="$FORTHIGH -fpp -fPIC" - FORTRANMNF="$FORTRANMNF -fpp -fPIC" - CC="$CC -fPIC" - CCMNF="$CCMNF -fPIC" - CC_CASI="$CC_CASI -fPIC" - CCLOW_CASI="$CCLOW_CASI -fPIC" - CCHIGH_CASI="$CCHIGH_CASI -fPIC" - LINK_EXE_MARC="-L$MARC_LIB -lmarc -L$MARC_LIB_SHARED -lguide -lpthread" - LINK_MARC_DLL="-shared -fPIC" - LOAD_DLL=$LOAD - LOADT_DLL=$LOADT - EXT_DLL="so" -fi - - -XLIBS="-L/usr/X11/lib -lX11 " - -# -# define archive and ranlib syntax -# - -ARC="ar rvl" -ARD="ar dvl" -ARX="ar xl" -RAN="" - -# -# choose which libraries you want to use ( e.g. blas ) -# - -if test "$VKISOLVER" = VKI -then - VKISOLVERLIBS="$MARC_LIB/vkisolver.a" -else - VKISOLVERLIBS= -fi - -if test "$CASISOLVER" = CASI -then - CASISOLVERLIBS="$MARC_LIB/casilib.a" -else - CASISOLVERLIBS= -fi - -MF2SOLVERLIBS= -if test "$MF2SOLVER" = MF2PARALLEL -then - MF2SOLVERLIBS="$MARC_LIB/mf2parallel/libseq.a \ - $MARC_LIB/mf2parallel/libsym.a \ - $MARC_LIB/mf2parallel/libmet.a \ - $MARC_LIB/mf2parallel/libmf2.a \ - $MARC_LIB/mf2parallel/libgauss.a \ - $MARC_LIB/mf2parallel/libmf2.a \ - $MARC_LIB/mf2parallel/libgauss.a \ - $MARC_LIB/mf2parallel/libnum.a \ - $MARC_LIB/mf2parallel/libutl.a \ - $MARC_LIB/mf2parallel/libr8.a \ - $MARC_LIB/mf2parallel/libz.a " -fi - -if test "$INTELSOLVER" = PARDISO -then - if test "$MARC_INTEGER_SIZE" = "i4" ; then - INTELSOLVERLIBS="$MARC_MKL/libmkl_solver_lp64.a" - else - INTELSOLVERLIBS="$MARC_MKL/libmkl_solver_ilp64.a" - fi -else - INTELSOLVERLIBS= -fi - -if test "$MUMPSSOLVER" = MUMPS -then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - if test $MPITYPE = none - then - MUMPSSOLVERLIBS2= - echo hello > /dev/null - fi - if test $MPITYPE = intelmpi - then - if test "$MARC_INTEGER_SIZE" = "i4" ; then - MUMPSSOLVERLIBS2="$MARC_MKL/libmkl_scalapack_lp64.a $MARC_MKL/libmkl_blacs_intelmpi_lp64.a" - else - MUMPSSOLVERLIBS2="$MARC_MKL/libmkl_scalapack_ilp64.a $MARC_MKL/libmkl_blacs_intelmpi_ilp64.a" - fi - fi - if test $MPITYPE = hpmpi - then - if test "$MARC_INTEGER_SIZE" = "i4" ; then - MUMPSSOLVERLIBS2="$MARC_MKL/libmkl_scalapack_lp64.a $MARC_MKL/libmkl_blacs_lp64.a" - else - MUMPSSOLVERLIBS2="$MARC_MKL/libmkl_scalapack_ilp64.a $MARC_MKL/libmkl_blacs_ilp64.a" - fi - fi -else - MUMPSSOLVERLIBS= - MUMPSSOLVERLIBS2= -fi - -if test "$BCSGPUSOLVER" = BCSGPU -then - BCSSOLVERLIBS="${MARC_LIB}/bcsgpulib.a " - MARCCUDALIBS1="-L${MARC_LIB}/cuda_dummy -lmarccuda " - MARCCUDALIBS2="-L${MARC_LIB}/cuda -lmarccuda " - MARCCUDALIBS=$MARCCUDALIBS1 - CUDALIBS="-L$MARC_CUDA/lib64 -lcudart -lcublas -L/usr/lib64 -lcuda " -else - BCSSOLVERLIBS="${MARC_LIB}/bcslib.a " -fi - -if test "$MARC_INTEGER_SIZE" = "i4" ; then - MKLLIB=$MARC_MKL/libmkl_intel_lp64.a -else - MKLLIB=$MARC_MKL/libmkl_intel_ilp64.a -fi - -SECLIBS="-L$MARC_LIB -llapi" - -SOLVERLIBS="${BCSSOLVERLIBS} \ - ${INTELSOLVERLIBS} ${MUMPSSOLVERLIBS2} ${MF2SOLVERLIBS} \ - -Wl,--start-group $MKLLIB $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_core.a -Wl,--end-group \ - $MARC_MKL/libguide.a \ - $MARC_LIB/blas_src.a ${VKISOLVERLIBS} ${CASISOLVERLIBS} " -SOLVERLIBS_DLL=${SOLVERLIBS} - -MRCLIBS="$MARC_LIB/clib.a ${CASISOLVERLIBS}" -MRCLIBSPAR="$MARC_LIB/clib.a" -STUBS="$MARC_LIB/stubs.a " -MNFLIBS="$MARC_LIB/libmnf.a" -MDUSER="$MARC_LIB/md_user.a" - - -OPENMP="-openmp" - -SYSLIBS=" $OPENMP -lpthread " - -# Uncomment the following lines to turn on the trace and comment out the next 4 lines -# if test $MPITYPE = intelmpi -# then -# SYSLIBS="-L${VT_ROOT}/lib -lVT -ldwarf -lelf -lm -lpthread \ -# -L${MPI_ROOT}/lib64 -lmpi -lmpiif -lmpigi -lrt" -# fi -if test $MPITYPE = intelmpi -then - SYSLIBS="-L${MPI_ROOT}/lib64 -lmpi -lmpiif -lmpigi -lrt $OPENMP -lpthread" -fi - -SYSLIBSPAR=" " - -MARC_DLL_CODES="runmarc.f" - - -BLAS_SRC="dzero.f icopy.f izero.f" -if test "$_OEM_NASTRAN" -ne 0 -then - if test "$MARC_INTEGER_SIZE" = "i4" ; then - BLAS_SRC="$BLAS_SRC dsctr.f zsctr.f dzasum.f daxpyi.f zaxpyi.f dgthr.f zgthr.f" - else - BLAS_SRC="ALL" - fi -fi - -LOW_OPT_CODES="are163.f contro.f ndext.f omarc.f omarca.f omarcb.f omarcc.f \ - omars.f fixbc.f triang.f bet049.f norst3.f eldata.f \ - elec*.f elct*.f fmeig.f oada00.f ogeig.f updtrbe2.f cycrota.f \ - cordef.f ogpk.f ogtan.f eldam.f formrbe3.f \ - inertie.f em_sso072.f cn_fol3d_qpatch6.f" -if test "$MARC_INTEGER_SIZE" = "i8" ; then - LOW_OPT_CODES="$LOW_OPT_CODES bbcseg.f" -fi -LOW_OPT_CODES_CASI="" - -HIGH_OPT_CODES="dpsmsa1.f dpsmsa2.f dpsmsa3.f dpsmsa4.f dpsmsa5.f dpsmsa6.f \ - dpsmsa7.f dpsmsa8.f dpsmsa9.f dpsmsa10.f dpsmsa11.f dpsmsa12.f \ - dpsmsa13.f dpsmsa14.f dpsmsa15.f dpsmsa16.f " - - -HIGH_OPT_CODES_CASI="arithkernels.c blockedroutines.c blockedroutines_fd.c elemmatgenkernels.c longvecroutines.c sfmultutils.c solvewithbd.c" - -MAXNUM=1000000 diff --git a/installation/mods_MarcMentat/2012/Marc_tools/include_linux64.original b/installation/mods_MarcMentat/2012/Marc_tools/include_linux64.original deleted file mode 100644 index 2e7c07e24..000000000 --- a/installation/mods_MarcMentat/2012/Marc_tools/include_linux64.original +++ /dev/null @@ -1,641 +0,0 @@ -# -# General definitions for the Marc 2011 version -# -# EM64T -# ( LP64 - i4 version) -# (ILP64 - i8 version) -# -# Linux RedHat 5.4 -# -# 64 bit MPI version -# -# Intel(R) Fortran Compiler -# Version 12.0.4 -# -# Intel(R) C Compiler -# Version 12.0.4 -# -# DATE -# -# To check the O/S level, type: -# uname -a -# -# Distributed parallel MPI libraries: -# 1) HP MPI 2.3 -# To check the mpi version, type: -# mpirun -version -# 2) Intel MPI 4.0.1.007 -# To check the mpi version, type: -# mpirun -version -# -# MKL Libraries: -# Intel(R) MKL 10.3.0.084 -# -# To check the Compiler level, type using the compiler -# installation path: -# ifort -V -# icc -V -# -# REMARKS : This file contains the definitions of variables used during -# compilation loading and use of the MARC programmes . The -# current machine type is identified by means of the variable -# MACHINE , defined below. -# -# -# MPI_ROOT: root directory in which mpi shared libraries, etc. are located -# DIRJOB : directory in which spawned jobs should look for Marc input -# MPI_ARCH: system architecture -# MPI_EPATH: path where executable resides -# - -REVISION="VERSION, BUILD" -HOSTNAME=`hostname` - -# find available memory in Mbyte on the machine -# can be set explicitly -MEMLIMIT=`free -m | awk '/Mem:/ {print $2}'` - -# set _OEM_NASTRAN to 1 for MD Nastran build -# override _OEM_NASTRAN setting with MARC_MD_NASTRAN environment variable -_OEM_NASTRAN="${MARC_MD_NASTRAN:-0}" - -# uncomment the following line for an autoforge build -#AUTOFORGE=1 -AUTOFORGE=0 -export AUTOFORGE - -# integer size -if test "$MARC_INTEGER_SIZE" = "" ; then - INTEGER_PATH= -else - INTEGER_PATH=/$MARC_INTEGER_SIZE -fi - -FCOMP=ifort - -# -# settings for Metis -# -METIS="-I$METIS_SOURCE" -METISLIBS="$MARC_LIB/metis.a " - -# -# settings for MPI -# -# RCP and RSH are used for parallel network runs -# replace with similar commands like rsh if needed -RCP=/usr/bin/scp -RSH=/usr/bin/ssh -# - - -MPI_DEFAULT=intelmpi -MPI_OTHER=hpmpi - -MPITYPE=$MPI_DEFAULT - -if test $AUTOFORGE -then - if test $AUTOFORGE = 1 - then - MPITYPE=none - fi -fi - - -# overrule MPITYPE setting with environmental variable MARC_MPITYPE -if test $MARC_MPITYPE -then - MPITYPE=$MARC_MPITYPE -fi - -# always set MPITYPE to none for MD Nastran -if test "$_OEM_NASTRAN" -ne 0 -then - MPITYPE=none -fi - -# Edit following lines to build with GPGPU version of BCS Solver for -# NVIDIA platforms -#BCSGPUSOLVER=NONE -BCSGPUSOLVER=BCSGPU - -SOLVERFLAGS= -if test "$BCSGPUSOLVER" = BCSGPU -then - SOLVERFLAGS="$SOLVERFLAGS -DBCSGPU -DCUDA" - BCS_DIR=bcsgpusolver - export PATH=$MARC_CUDA/bin:$MARC_CUDA/nvvm:$PATH - export LD_LIBRARY_PATH=$MARC_CUDA/lib64:$LD_LIBRARY_PATH -else - BCS_DIR=bcssolver -fi -# -# settings for MPI -# -DDM= -if test $MPITYPE != none -then - if test $MPITYPE = hpmpi - then - FCOMPMPI=mpif90 - export MPI_ROOT=$MARC_HPMPI - export MPI_REMSH=$RSH - export MPI_F77=$FCOMP - ARCHITECTURE=linux_amd64 - DDM="-I$MPI_ROOT/include/64 -DDDM -DHPMPI" - MPI_CLEAN= - export MPI_EPATH=$MARC_BIN - export LD_LIBRARY_PATH=$MPI_ROOT/lib/$ARCHITECTURE:$MARC_LIB:$MARC_LIB_SHARED:$LD_LIBRARY_PATH - export MPIHPSPECIAL="-e MPI_FLAGS=E,T,y1" -# Below line is moved in run_marc file -# export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - export MPIHPSPECIAL="$MPIHPSPECIAL -e BINDIR=$MARC_BIN" - if test -n "$MSC_LICENSE_FILE" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e MSC_LICENSE_FILE=$MSC_LICENSE_FILE" - fi - if test -n "$LM_LICENSE_FILE" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LM_LICENSE_FILE=$LM_LICENSE_FILE" - fi - export MPIHPSPECIAL="$MPIHPSPECIAL -e MPI_LIC_CHECKER=$MPI_ROOT/bin/licensing/amd64_s8/lichk.x" - RUN_JOB2="$MPI_ROOT/bin/mpirun ${MPIRUNOPTIONS} -prot -f " - RUN_JOB1="$MPI_ROOT/bin/mpirun ${MPIRUNOPTIONS} -prot -w $MPIHPSPECIAL -np " - RUN_JOB0= - fi - if test $MPITYPE = intelmpi - then - INTELMPI_VERSION=HYDRA - FCOMPMPI=mpiifort - MPI_ROOT=$MARC_INTELMPI - DDM="-I${MPI_ROOT}/include64 -DDDM" - PATH=$MPI_ROOT/bin64:$PATH - export PATH - LD_LIBRARY_PATH=$MPI_ROOT/lib64:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - if test $INTELMPI_VERSION = HYDRA - then - RUN_JOB1="${MPI_ROOT}/bin64/mpiexec.hydra -genvall -n " - RUN_JOB2="${MPI_ROOT}/bin64/mpiexec.hydra -genvall" - else - RUN_JOB1="${MPI_ROOT}/bin64/mpiexec -n " - RUN_JOB2="${MPI_ROOT}/bin64/mpiexec -configfile " - fi - RUN_JOB0= - MPI_CLEAN= - MPI_EPATH=$MARC_BIN - MPIR_HOME=$MPI_ROOT - MPICH_F77=$FCOMP - MPICH_F77LINKER=$FCOMP - export MPI_ROOT MPI_EPATH MPIR_HOME MPICH_F77 MPICH_F77LINKER - I_MPI_PIN_DOMAIN=node - export I_MPI_PIN_DOMAIN - fi -else - MPI_ROOT=$MARC_DUMMYMPI - export MPI_ROOT=$MARC_DUMMYMPI - DDM="-I$MPI_ROOT/include" -fi - -# -# variables for the "maintain" script -# - -MACHINENAME=LINUX -MACHINE64BIT=yes -MACHINE=Linux_EM64T -DEV=/dev/tape -GETLOG="whoami" -CLEAR="clear" -MY_UNAME=`uname -a` - -# Edit following 2 lines to build with VKI Solver -#VKISOLVER=VKI -VKISOLVER=NONE - -# Edit following 2 lines to build with CASI Solver -CASISOLVER=CASI -#CASISOLVER=NONE - -# Edit following 2 lines to build with MF2 Solver -MF2SOLVER=NONE -#MF2SOLVER=SERIAL -#MF2SOLVER=MF2PARALLEL - -# Edit following lines to build with Intel(c) Multithreaded solver (PARDISO) -#INTELSOLVER=NONE -INTELSOLVER=PARDISO - -# Edit following lines to build with MUMPS -if test "$MARC_INTEGER_SIZE" = "i4" ; then - #MUMPSSOLVER=NONE - MUMPSSOLVER=MUMPS -else - #MUMPSSOLVER=NONE - MUMPSSOLVER=MUMPS -fi - -# Edit following 2 lines to build MARC dynamic shared library -MARC_DLL=MARC_DLL -#MARC_DLL=NONE - -# always set VKISOLVER, CASISOLVER, BCSGPUSOLVER, and MARC_DLL to NONE for MD Nastran -if test "$_OEM_NASTRAN" -ne 0 -then - VKISOLVER=NONE - CASISOLVER=NONE - MF2SOLVER=NONE - INTELSOLVER=NONE - MUMPSSOLVER=NONE - BCSGPUSOLVER=NONE - MARC_DLL=NONE -fi - -# -# define Fortran and C compile syntax -# -if test "$VKISOLVER" = VKI -then - SOLVERFLAGS="$SOLVERFLAGS -DVKI" -fi - -if test "$CASISOLVER" = CASI -then - SOLVERFLAGS="$SOLVERFLAGS -DCASI" -fi - -if test "$MF2SOLVER" = MF2PARALLEL -then - SOLVERFLAGS="$SOLVERFLAGS -DMF2PARALLEL" -fi -if test "$MF2SOLVER" = MF2SERIAL -then - SOLVERFLAGS="$SOLVERFLAGS -DMF2SERIAL" -fi - -if test "$INTELSOLVER" = PARDISO -then - SOLVERFLAGS="$SOLVERFLAGS -DPARDISO" -fi - -if test "$MUMPSSOLVER" = MUMPS -then - SOLVERFLAGS="$SOLVERFLAGS -DMUMPS" -fi - - -if test "$MARC_DLL" = MARC_DLL -then - SOLVERFLAGS="$SOLVERFLAGS -DMARC_DLL" -fi - -LINK_OPT= -DEBUG_OPT= -C_DEBUG_OPT= - -#Uncomment following line to build Marc in debuggable mode -MARCDEBUG= -#MARCDEBUG="ON" - -if test "$MARCDEBUG" = "ON" -then - LINK_OPT="-debug -traceback" - DEBUG_OPT="-debug -traceback" - C_DEBUG_OPT="-debug -traceback" -fi - - -MARCCHECK= -#MARCCHECK="ON" -if test "$MARCCHECK" = "ON" -then - DEBUG_OPT="$DEBUG_OPT -fpe0 -fp-stack-check -check all -ftrapuv " - C_DEBUG_OPT="$C_DEBUG_OPT -fp-stack-check -check-uninit -Wformat -ftrapuv " -fi - -if test "$MARC_INTEGER_SIZE" = "i4" ; then - I8FFLAGS= - I8DEFINES= - I8CDEFINES= - I8CASIDEFS= -else - I8FFLAGS="-i8" - I8DEFINES="-DI64" - I8CDEFINES="-U_DOUBLE -D_SINGLE" - I8CASIDEFS="-DCASI_64BIT_INT=1" -fi - - -CDEFINES= -FDEFINES= - -if test "$_OEM_NASTRAN" -ne 0 -then - CDEFINES="$CDEFINES -D_OEM_NASTRAN" - FDEFINES="$FDEFINES -D_OEM_NASTRAN" -fi - -FDEFINES="$FDEFINES -D_IMPLICITNONE" - -if test "$_OEM_NASTRAN" -eq 0 -then - FDEFINES="$FDEFINES -DOPENMP -DMKL" -fi - -# -D_MSCMARC -FDEFINES="$FDEFINES -D_MSCMARC $DEBUG_OPT" -CDEFINES="$CDEFINES -D_MSCMARC $C_DEBUG_OPT $I8CDEFINES" - -CINCL="-I$MARC_SOURCE/mdsrc -I$MARC_SOURCE/csource" -if test "$_OEM_NASTRAN" -ne 0 -then - CINCL="$CINCL -I../../include" -fi - -CC="icc -c -O1 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS" -CCLOW="icc -c -O0 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS" -CCHIGH="icc -c -O3 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS" - -if test "$MARCDEBUG" = "ON" -then - CC="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS" - CCLOW="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS" - CCHIGH="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS" -fi - -LOAD_CC="icc -O1 -DLinux -DLINUX -DLinux_intel" -CCT="$CC" -CCTLOW="$CCLOW" -CCTHIGH="$CCHIGH" - -CC_CASI="$CC -c99 $I8CASIDEFS" -CCLOW_CASI="$CCLOW -c99 $I8CASIDEFS" -CCHIGH_CASI="$CCHIGH -c99 $I8CASIDEFS" - -CCT_CASI="$CCT -c99 $I8CASIDEFS" -CCTLOW_CASI="$CCLOW -c99 $I8CASIDEFS" -CCTHIGH_CASI="$CCHIGH -c99 $I8CASIDEFS" - -#PROFILE="-Mprof=func" -#PROFILE="-Mprof=lines" -#PROFILE="-Mprof=func,mpi" -PROFILE= - -FORTLOW="$FCOMP -c -assume byterecl -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -O0 $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -FORTRAN="$FCOMP -c -assume byterecl -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -O1 $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -FORTHIGH="$FCOMP -c -assume byterecl -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -FORTNA="$FCOMP -c -assume byterecl -safe_cray_ptr -save -zero -mp1 -WB -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" - -if test "$MARCDEBUG" = "ON" -then - FORTLOW="$FCOMP -c -assume byterecl -safe_cray_ptr $PROFILE -save -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - FORTRAN="$FCOMP -c -assume byterecl -safe_cray_ptr $PROFILE -save -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - FORTHIGH="$FCOMP -c -assume byterecl -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - FORTNA="$FCOMP -c -assume byterecl -safe_cray_ptr -save -zero -mp1 -WB -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" -fi - -FORTLOWT="$FORTLOW" -FORTRANT="$FORTRAN" -FORTHIGHT="$FORTHIGH" - -FORTRANMNF="$FCOMP -c $FDEFINES " -CCMNF="icc -c -O1 -DLinux -DLINUX -DLinux_intel -Dport2egcs -I$MARC_SOURCE/marctoadams/mnf/include -D_LARGEFILE64_SOURCE" - - -FORTRANMUMPS="$FCOMP -c -fpp -D_IMPLICITNONE $I8FFLAGS $I8DEFINES $DDM -I$MARC_SOURCE/mumpssolver/include -Dintel_ -DALLOW_NON_INIT -Dmetis -nofor_main" -CCMUMPS="icc -c -DAdd_ -Dmetis -I$MARC_SOURCE/mumpssolver/include" - - -BCSCC="icc -c -O3 -DLOWERCASE_ -I${MARC_SOURCE}/${BCS_DIR}/bcslib_csrc $CDEFINES $CINCL" -NVCC="nvcc -c -O3 -arch sm_20 -DLOWERCASE_ -I${MARC_SOURCE}/${BCS_DIR}/bcslib_cuda/include -I${MARC_CUDA}/include -I$MARC_SOURCE/mdsrc $I8DEFINES -Xcompiler -fvisibility=hidden -Xcompiler -fPIC $I8DEFINES " -NVCCLIB="ar rvl" -NVCCLD=gcc -BCSFORTLOW="$FORTLOW -I${MARC_SOURCE}/${BCS_DIR}/common" -BCSFORTRAN="$FORTRAN -I${MARC_SOURCE}/${BCS_DIR}/common" -BCSFORTHIGH="$FORTHIGH -I${MARC_SOURCE}/${BCS_DIR}/common" -BCSFORT90HIGH="$BCSFORTHIGH" -if test "$MARCDEBUG" = "ON" -then - BCSFORTRAN=$BCSFORTLOW - BCSFORTHIGH=$BCSFORTLOW - BCSFORT90HIGH=$BCSFORTLOW -fi - -if test $MPITYPE != none -then - if test $MPITYPE = hpmpi - then - LOAD="$MPI_ROOT/bin/$FCOMPMPI ${LOADOPTIONS} -L$MPI_ROOT/lib/$ARCHITECTURE $PROFILE $LINK_OPT -o " - LOADT="$MPI_ROOT/bin/$FCOMPMPI ${LOADOPTIONS} -L$MPI_ROOT/lib/$ARCHITECTURE $PROFILE $LINK_OPT -o " - fi -# Uncomment the following lines to turn on the tracer and commnet out the next 5 lines -# if test $MPITYPE = intelmpi -# then -# INCLUDEMPI="-I$MPI_ROOT/include64 -I$VT_ROOT/include" -# LOAD="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " -# LOADT="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " -# fi - if test $MPITYPE = intelmpi - then - LOAD="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $LINK_OPT -o " - LOADT="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $LINK_OPT -o " - fi -else - LOAD="$FCOMP $LINK_OPT -o " - LOADT="$FCOMP $LINK_OPT -o " -fi - -if test "$MARC_DLL" = MARC_DLL -then - FORTLOW="$FORTLOW -fpp -fPIC" - FORTRAN="$FORTRAN -fpp -fPIC" - FORTHIGH="$FORTHIGH -fpp -fPIC" - FORTRANMNF="$FORTRANMNF -fpp -fPIC" - CC="$CC -fPIC" - CCMNF="$CCMNF -fPIC" - CC_CASI="$CC_CASI -fPIC" - CCLOW_CASI="$CCLOW_CASI -fPIC" - CCHIGH_CASI="$CCHIGH_CASI -fPIC" - LINK_EXE_MARC="-L$MARC_LIB -lmarc -L$MARC_LIB_SHARED -lguide -lpthread" - LINK_MARC_DLL="-shared -fPIC" - LOAD_DLL=$LOAD - LOADT_DLL=$LOADT - EXT_DLL="so" -fi - - -XLIBS="-L/usr/X11/lib -lX11 " - -# -# define archive and ranlib syntax -# - -ARC="ar rvl" -ARD="ar dvl" -ARX="ar xl" -RAN="" - -# -# choose which libraries you want to use ( e.g. blas ) -# - -if test "$VKISOLVER" = VKI -then - VKISOLVERLIBS="$MARC_LIB/vkisolver.a" -else - VKISOLVERLIBS= -fi - -if test "$CASISOLVER" = CASI -then - CASISOLVERLIBS="$MARC_LIB/casilib.a" -else - CASISOLVERLIBS= -fi - -MF2SOLVERLIBS= -if test "$MF2SOLVER" = MF2PARALLEL -then - MF2SOLVERLIBS="$MARC_LIB/mf2parallel/libseq.a \ - $MARC_LIB/mf2parallel/libsym.a \ - $MARC_LIB/mf2parallel/libmet.a \ - $MARC_LIB/mf2parallel/libmf2.a \ - $MARC_LIB/mf2parallel/libgauss.a \ - $MARC_LIB/mf2parallel/libmf2.a \ - $MARC_LIB/mf2parallel/libgauss.a \ - $MARC_LIB/mf2parallel/libnum.a \ - $MARC_LIB/mf2parallel/libutl.a \ - $MARC_LIB/mf2parallel/libr8.a \ - $MARC_LIB/mf2parallel/libz.a " -fi - -if test "$INTELSOLVER" = PARDISO -then - if test "$MARC_INTEGER_SIZE" = "i4" ; then - INTELSOLVERLIBS="$MARC_MKL/libmkl_solver_lp64.a" - else - INTELSOLVERLIBS="$MARC_MKL/libmkl_solver_ilp64.a" - fi -else - INTELSOLVERLIBS= -fi - -if test "$MUMPSSOLVER" = MUMPS -then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - if test $MPITYPE = none - then - MUMPSSOLVERLIBS2= - echo hello > /dev/null - fi - if test $MPITYPE = intelmpi - then - if test "$MARC_INTEGER_SIZE" = "i4" ; then - MUMPSSOLVERLIBS2="$MARC_MKL/libmkl_scalapack_lp64.a $MARC_MKL/libmkl_blacs_intelmpi_lp64.a" - else - MUMPSSOLVERLIBS2="$MARC_MKL/libmkl_scalapack_ilp64.a $MARC_MKL/libmkl_blacs_intelmpi_ilp64.a" - fi - fi - if test $MPITYPE = hpmpi - then - if test "$MARC_INTEGER_SIZE" = "i4" ; then - MUMPSSOLVERLIBS2="$MARC_MKL/libmkl_scalapack_lp64.a $MARC_MKL/libmkl_blacs_lp64.a" - else - MUMPSSOLVERLIBS2="$MARC_MKL/libmkl_scalapack_ilp64.a $MARC_MKL/libmkl_blacs_ilp64.a" - fi - fi -else - MUMPSSOLVERLIBS= - MUMPSSOLVERLIBS2= -fi - -if test "$BCSGPUSOLVER" = BCSGPU -then - BCSSOLVERLIBS="${MARC_LIB}/bcsgpulib.a " - MARCCUDALIBS1="-L${MARC_LIB}/cuda_dummy -lmarccuda " - MARCCUDALIBS2="-L${MARC_LIB}/cuda -lmarccuda " - MARCCUDALIBS=$MARCCUDALIBS1 - CUDALIBS="-L$MARC_CUDA/lib64 -lcudart -lcublas -L/usr/lib64 -lcuda " -else - BCSSOLVERLIBS="${MARC_LIB}/bcslib.a " -fi - -if test "$MARC_INTEGER_SIZE" = "i4" ; then - MKLLIB=$MARC_MKL/libmkl_intel_lp64.a -else - MKLLIB=$MARC_MKL/libmkl_intel_ilp64.a -fi - -SECLIBS="-L$MARC_LIB -llapi" - -SOLVERLIBS="${BCSSOLVERLIBS} \ - ${INTELSOLVERLIBS} ${MUMPSSOLVERLIBS2} ${MF2SOLVERLIBS} \ - -Wl,--start-group $MKLLIB $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_core.a -Wl,--end-group \ - $MARC_MKL/libguide.a \ - $MARC_LIB/blas_src.a ${VKISOLVERLIBS} ${CASISOLVERLIBS} " -SOLVERLIBS_DLL=${SOLVERLIBS} - -MRCLIBS="$MARC_LIB/clib.a ${CASISOLVERLIBS}" -MRCLIBSPAR="$MARC_LIB/clib.a" -STUBS="$MARC_LIB/stubs.a " -MNFLIBS="$MARC_LIB/libmnf.a" -MDUSER="$MARC_LIB/md_user.a" - - -OPENMP="-openmp" - -SYSLIBS=" $OPENMP -lpthread " - -# Uncomment the following lines to turn on the trace and comment out the next 4 lines -# if test $MPITYPE = intelmpi -# then -# SYSLIBS="-L${VT_ROOT}/lib -lVT -ldwarf -lelf -lm -lpthread \ -# -L${MPI_ROOT}/lib64 -lmpi -lmpiif -lmpigi -lrt" -# fi -if test $MPITYPE = intelmpi -then - SYSLIBS="-L${MPI_ROOT}/lib64 -lmpi -lmpiif -lmpigi -lrt $OPENMP -lpthread" -fi - -SYSLIBSPAR=" " - -MARC_DLL_CODES="runmarc.f" - - -BLAS_SRC="dzero.f icopy.f izero.f" -if test "$_OEM_NASTRAN" -ne 0 -then - if test "$MARC_INTEGER_SIZE" = "i4" ; then - BLAS_SRC="$BLAS_SRC dsctr.f zsctr.f dzasum.f daxpyi.f zaxpyi.f dgthr.f zgthr.f" - else - BLAS_SRC="ALL" - fi -fi - -LOW_OPT_CODES="are163.f contro.f ndext.f omarc.f omarca.f omarcb.f omarcc.f \ - omars.f fixbc.f triang.f bet049.f norst3.f eldata.f \ - elec*.f elct*.f fmeig.f oada00.f ogeig.f updtrbe2.f cycrota.f \ - cordef.f ogpk.f ogtan.f eldam.f formrbe3.f \ - inertie.f em_sso072.f cn_fol3d_qpatch6.f" -if test "$MARC_INTEGER_SIZE" = "i8" ; then - LOW_OPT_CODES="$LOW_OPT_CODES bbcseg.f" -fi -LOW_OPT_CODES_CASI="" - -HIGH_OPT_CODES="dpsmsa1.f dpsmsa2.f dpsmsa3.f dpsmsa4.f dpsmsa5.f dpsmsa6.f \ - dpsmsa7.f dpsmsa8.f dpsmsa9.f dpsmsa10.f dpsmsa11.f dpsmsa12.f \ - dpsmsa13.f dpsmsa14.f dpsmsa15.f dpsmsa16.f " - - -HIGH_OPT_CODES_CASI="arithkernels.c blockedroutines.c blockedroutines_fd.c elemmatgenkernels.c longvecroutines.c sfmultutils.c solvewithbd.c" - -MAXNUM=1000000 diff --git a/installation/mods_MarcMentat/2012/Marc_tools/run_damask b/installation/mods_MarcMentat/2012/Marc_tools/run_damask deleted file mode 100644 index 789ce4215..000000000 --- a/installation/mods_MarcMentat/2012/Marc_tools/run_damask +++ /dev/null @@ -1,3690 +0,0 @@ -#!/bin/ksh -############################################################################## -# # -# run_marc - run a marc job # -# ------------------------- # -# # -# usage: run_marc -j jid { options } # -# # -# where standard options are: required: defaults: # -# -------------------------- # -# # -# -j* jid job id number. ** YES ** . # -# -pr* prog program name. . marc # -# -v* y|n do or do not verify inputs. . yes # -# -q* s|l|v|b|f batch queue name or background, . short # -# foreground. # -# -b* as alternative to option -q* # -# # -# ( batch queues only : # -# -pq* intra queue priority. . . # -# -at DATE/TIME delay start of job. . . # -# format : January,1,1990,12:31 # -# or : today,5pm # -# -cpu* secs job CPU limit . . ) # -# # -# -r* rid restart file job id. . . # -# -si* sid substructure file id. . . # -# -pi* post post file job id. . . # -# -de* did defaults file . no # -# -vf vid viewfactor . no # -# # -# -u* user user subroutine. . . # -# -obj obj user objects or libraries. . . # -# -sa* y|n do or do not save load module. . no # -# -autorst auto restart flag for auto forge . no # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo selects i4 or i8 version # -# default: i4 or via defaults file run_marc_defaults # -# the -mo option will override # -# -mpi selects MPI version # -# each platform has a default MPI version and some # -# have an alternative version. see the include file # -# for the respective platform # -# MPI_DEFAULT defines the default MPI version # -# MPI_OTHER defines versions one can switch to # -# -dcoup for contact decoupling # -# currently not supported # -# -dir directory where the job i/o should take place. # -# defaults to current directory. # -# -sdir directory where scratch files are created # -# defaults to current directory. # -# # -# -alloc only perform memory allocation test, no analysis # -# -list y only list options in the input file, no analysis # -# -fe num set feature number "num" for the run. only one allowed # -# -dytran flag to switch from Dytran to Marc # -# dytran = 0, program will run w/o Marc-Dytran Switch # -# = 1, program will restart Marc after Dytran run # -# >= 2, Not supported yet. # -# currently not supported # -# -ou force analysis to use out-of-core control # -# =0, not used # -# =1, element storage out-of-core # -# -dll run marc using shared library libmarc.so and exe_marc # -# =1, used # -# =2, do not free streaming input memory # -# =3, run with marc input deck # -# -trk run marc for post-tracking # -# -gpuid run marc using GPGPU capability # -# specify gpuid on to be used in the analysis. Multiple # -# IDs may be assigned for DDM runs. # -# Separate a list of IDs with a colon. Each DMP # -# process will be assigned a GPU ID in round robin fastion# -# = 0 # -# = 0:1 etc... # -# # -# where parallel options are: # -# -------------------------- # -# # -# itree, host, and comp options are available for the domain # -# decomposition only. # -# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # -# # -# # -# -nprocd number of domains. # -# defaults to single domain solution. # -# -nprocds number of domains if single input file. # -# defaults to single domain solution. # -# -nps same as -nprocds. # -# -nsolver number of solver tasks for solver types 12 and 13 # -# these are distributed tasks operating via MPI # -# -nthread number of solver threads for solver types 6, 8, and 11 # -# also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. if both specified, nthread option# -# will be used. # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by 6, 8, and 11 # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor nthread specified. # -# -itree message passing tree type for domain decomposition. # -# for debugging purposes; should not normally be used. # -# -host hostfile name for distributed execution on network. # -# defaults to no hostfile, unless jobid.defhost exists. # -# if jobid.defhost exists, only -np(s) necessary # -# -comp* y|n to be used with user routines on a network of # -# incompatible machines. # -# if set to no, a separate executable will be created # -# for each machine on the network. # -# if set to yes, the executable located on the machine # -# from which marc is started will be used on all machines.# -# defaults to no if O/S versions different on machines. # -# # -# -ci y|n copy input files to remote hosts (default: yes) # -# if "yes", input files are automatically copied to # -# remote hosts for a network run if necessary. # -# -cr y|n copy post files from remote hosts (default: yes) # -# if "yes", post files are automatically copied back from # -# remote hosts for a network run if necessary. # -############################################################################## -# set DIR to the directory in which this script is -REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" -DIR=`dirname $REALCOM` -# make sure DIR has an absolute path -case $DIR in - \/*) - ;; - *) - DIR=`pwd`/$DIR - ;; -esac -DIRSCRIPT=$DIR -AWK=awk -ARCH=`uname -a | cut -f 1 -d " "` -# Sun has a bad awk, use nawk instead -if test $ARCH = "SunOS" -then - AWK=nawk -fi -BASENAME=basename -# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists -if test $ARCH = "SunOS" -then - if test -x /usr/ucb/basename - then - BASENAME=/usr/ucb/basename - fi -fi - -# echo command line in the case of ECHO_COMMAND is true -if test "$ECHO_COMMAND" = true ; then - echo command "$0" "$@" -fi - -# -# "mode" selects version, i4 or i8 -# default is i4 -# this can be changed by a file run_marc_defaults -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MODE i8 -# it can also be set by the environmental variable MARC_INTEGER_SIZE -# and by the command line option "-mo" -# -mode= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -f $HOME/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -n "$MARC_INTEGER_SIZE" ; then - mode=$MARC_INTEGER_SIZE -fi -if test -z "$mode" ; then - mode=i4 -fi -case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "error, version mode must be i4 or i8" - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i4 or i8" - echo " " - echo " use -mo i4 or -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - setmode=true - fi - if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - fi - if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -done - -# set to i4 version for 32 bit Linux -if test "`uname -s`" = "Linux"; then - if test "`uname -m`" = "i686"; then - mode=i4 - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -fi - - -. "$DIR/getarch" - -# Change_me -. $MARC_INCLUDE -# - -# -# Dynamically determine the echo syntax -# - -case "`echo '\c'`" in - '\c') - ECHO='echo -n' - ECHOTXT=' ' - ;; - *) - ECHO='echo' - ECHOTXT=' \c' - ;; -esac - -# -# Variables for the MARC environment -# - -PRODUCT="Marc" -EXITMSG=$MARC_TOOLS/MESSAGES -export EXITMSG -FLEXDIR=$DIR/../flexlm/licenses -export FLEXDIR -TIMCHK=3600 -export TIMCHK -BINDIR=$MARC_BIN -export BINDIR -AFMATDAT=$MARC_RUNTIME/AF_flowmat/ -export AFMATDAT -# -# define directory path to global unified material database -# -MATFILE= -export MATFILE - -# -# define memory limit -# first set to MEMLIMIT from include -# -ml option overrules if specified -memlimit=$MEMLIMIT -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -# -if test $MACHINENAME = "HP" -then - SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH - export SHLIB_PATH -fi -# the one for IBM is defined futher down - -LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH -LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH -export LD_LIBRARY_PATH -export LD_LIBRARY64_PATH -export LD_LIBRARYN32_PATH - -atexit() { -kill -15 $$ -# -if test $MPITYPE = "myrinet" -then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi -fi -} - -trap "atexit" 2 - -# -# defaults -# - -prog=marc -exefile=marc -jid= -rid= -pid= -sid= -did= -vid= -user= -usersnoext= -objs= -qid=background -cpu= -priority= -att= -trk= -verify=yes -prgsav=no -rmdll=no -cpdll=no -progdll= -pathdll= -error= -nprocd=0 -nprocdddm=1 -nprocdddmprint= -icreated=0 -nprocdarg= -nsolver=0 -nsolverarg=-ns -if test $nprocds -then - if test $nprocds -gt 1 - then - nprocdddm=$nprocds - nprocdddmprint=$nprocds - icreated=1 - nprocdarg=-nprocds - fi -fi -nthread=-1 -gpuids= -nauto=0 -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -nthreadprint=0 -itree=0 -iam= -link= -trkrun=0 -DIRJOB=`pwd` -DIRSCR=$DIRJOB -DIRSCRSET= -autoforge=0 -dotdat=.dat -dotdefhost=.defhost -host= -numhost= -mfile= -userhost= -makebdf= -cpinput=yes -cpresults=yes -marcdll=libmarc.$EXT_DLL -# define hostname and strip off extensions (alpha.aaa.com) -thishost=`hostname` -thishost=${thishost%%.*} -compatible=unknown -numfield=1 -justlist= -feature= -mpioption=false -MDSRCLIB=$MARC_LIB/mdsrc.a -# -# check run_marc_defaults file for default MPI setting -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MPI -# -value= -file= -if test -f $DIRSCRIPT/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$DIRSCRIPT/run_marc_defaults - fi -fi -if test -f $HOME/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$HOME/run_marc_defaults - fi -fi -if test -n "$value"; then - MARC_MPITYPE=$value - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - echo " " - echo " error, incorrect option for MARC_MPI" - echo " defined in $file: $MARC_MPITYPE" - echo " valid options: $MPI_DEFAULT $MPI_OTHER" - echo " " - exit - fi - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - fi -fi -# -# -# allow scratch directory to be specified with environmental variable -# MARCSCRATCH -if test $MARCSCRATCH -then - if test -d $MARCSCRATCH - then - DIRSCR=$MARCSCRATCH - else - echo "error, scratch directory '$MARCSCRATCH'" - echo " specified via environmental variable MARCSCRATCH does not exist" - exit - fi -fi -# -############################################################################## -# parse input - arguments always come in pairs # -############################################################################## - -arg=$1 -if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - shift - arg=$1 -fi -while [ -n "$arg" ] -do - shift - value=$1 - case $arg in - -al* | -AL*) - LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - $MARC_BIN/marc -alloc 1 - exit - ;; - -li* | -LI*) - justlist=yes - ;; - -fe* | -FE*) - feature=$value - ;; - -pr* | -PR*) - if test `dirname $value` = '.' - then - prog=`$BASENAME $value .marc` - progdll=`$BASENAME $value` - else - prog=`dirname $value`/`$BASENAME $value .marc` - progdll=`dirname $value`/`$BASENAME $value` - fi - prdir=`dirname $value` - case $prdir in - \/*) - ;; - *) - prog=`pwd`/$prdir/$prog - ;; - esac - ;; - -j* | -J*) - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - ;; - -r* | -R*) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - -si* | -SI*) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - -pi* | -PI*) - if test -f $value.t19 - then - pid=`$BASENAME $value .t19` - else - pid=`$BASENAME $value .t16` - fi - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - -bdf | -BDF) - makebdf=1 - ;; - -de* | -DE*) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - -vf | -VF) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - -u* | -U*) - - user=$value - - - - - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - -obj | -OBJ) - objs="$value" - ;; - -q* | -Q*) - qid=$value - ;; - -b* | -B*) - case $value in - y* | Y*) - qid=background - ;; - n* | N*) - qid=foreground - ;; - *) - ;; - esac - ;; - -at | -AT) - att=$value - ;; - -cpu* | -CPU*) - cpu=$value - ;; - -pq | -PQ*) - priority=$value - ;; - -v* | -V*) - verify=$value - ;; - -sa* | -SA*) - prgsav=$value - ;; - -np* | -NP*) - nprocdddm=$value - nprocdddmprint=$value - case $arg in - -nps* | -NPS* | -nprocds* | -NPROCDS*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - case $arg in - -np | -NP | -nprocd | -NPROCD) - icreated=0 - nprocdarg=-nprocd - ;; - esac - ;; - -ns* | -NS*) - nsolver=$value - ;; - -nt* | -NT*) - nthread=$value - ;; - -gp* | -GP*) - gpuids=$value - ;; - -it* | -IT*) - itree=$value - ;; - -iam | -IAM) - iam=$value - ;; - -au* | -AU*) - nauto=$value - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -me | -ME ) - mesh=$value - ;; - -ml | -ML ) - memlimit=$value - ;; - -mo | -MO ) - ;; - -mpi | -MPI ) - mpioption=true - MARC_MPITYPE=$value - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - fi - fi - ;; - -dir* | -DIR*) - DIRJOB=$value - case $DIRJOB in - \/*) - ;; - *) - DIRJOB=`pwd`/$DIRJOB - ;; - esac - if test -z "$DIRSCRSET" - then - DIRSCR=$DIRJOB - fi - ;; - -sd* | -SD*) - DIRSCR=$value - DIRSCRSET=yes - case $DIRSCR in - \/*) - ;; - *) - DIRSCR=`pwd`/$DIRSCR - ;; - esac - ;; - -ho* | -HO*) - host=$value - ;; - -co* | -CO*) - compatible=$value - ;; - -ci* | -CI*) - cpinput=$value - ;; - -cr* | -CR*) - cpresults=$value - ;; - *) - error="$error -$arg: invalid option" - break - ;; - esac - case $value in - -*) - error="$error -$arg: invalid name $value" - break - ;; - esac - shift - arg=$1 - if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - shift - arg=$1 - fi -done -argc=`expr $# % 2` -if test $argc -eq 1 -then -# -# odd number of arguments -# - error="$error -argument list incomplete" -fi - -if test $nprocdddm -gt 0 -then -nprocd=$nprocdddm -fi - -if test $nsolver -gt 0 -then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi -fi - -if test $nthread -eq -1 -then -nthread=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nthread -lt 0 -then -nthread=0 -fi - -nthreadprint=$nthread -if test $nthreadprint -eq 0 -then -nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi -fi - -nthread=$nthreadprint - -gpuoption= -if test "$gpuids" = "" ; then - gpuoption= -else - gpuoption="-gp $gpuids" -fi - -if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH -else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH -# Linux 64 + HPMPI, Below code is taken from include_linux64 - if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - fi -fi - -if test $nprocd -gt 1; then - if test -f $jid$dotdefhost; then - if test "$host" = ""; then - host=$jid$dotdefhost - fi - fi - if test -f hostfile_qa_$nprocd; then - if test "$host" = ""; then - host=hostfile_qa_$nprocd - fi - fi -fi - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then - dotdat=.inp - fi - - if test "$progdll"; then - /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll - rmdll=yes - pathdll=yes - progdll=${progdll}_$marcdll - else - progdll=$marcdll - fi - - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - pathdll=yes - fi -fi - -############################################################################## -# check parameter validity # -############################################################################## - -while test forever; do - -# -# check for input file existence -# -if test $nprocdddm -gt 1 -a $icreated -eq 0; then - if test ! -f $DIRJID/1$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/1$jid$dotdat not accessible" - fi - fi -else - if test ! -f $DIRJID/$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/$jid$dotdat not accessible" - fi - fi -fi - if test $nprocd -gt 1; then - if test "$host" ; then - if test ! -f $host; then - error="$error -host name file $host not accessible" - fi - fi - fi - -# -# check if the job is already running in the background -# -if test -f $DIRJOB/$jid.pid; then - error="$error -job is already running (the file $jid.pid exists)" -fi - -# -# if the program name is other than marc, then -# assume that this is a program in the users local directory -# - -bd=$MARC_BIN/ - -case $prog in - marc | MARC | $exefile) - program=$exefile - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - if test ! -f $user - then - error="$error -user subroutine file $user not accessible" - fi - fi - if test "$objs" - then - missingobjs= - for o in $objs - do - if test ! -f "$o" - then - if test -z "$missingobjs" - then - missingobjs="$o" - else - missingobjs="$missingobjs $o" - fi - fi - done - if test -n "$missingobjs" - then - error="$error -user object/library file(s) $missingobjs not accessible" - fi - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$vid" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRVID/1$vid.vfs - then - error="$error -view factor file $DIRVID/1$vid.vfs not accessible" - fi - else - if test ! -f $DIRVID/$vid.vfs - then - error="$error -view factor file $DIRVID/$vid.vfs not accessible" - fi - fi - fi - if $mpioption - then - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" - fi - fi - ;; - *) - program=$prog.marc - case $prog in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - error="$error -program option may not be used with user subroutine" - fi - if test "$objs" - then - error="$error -program option may not be used with user objects or libraries" - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$nauto" - then - if test $nauto -gt 2 - then - error="$error -incorrect option for auto restart " - fi - fi - if test "$ndcoup" - then - if test $ndcoup -gt 3 - then - error="$error -incorrect option for contact decoupling " - fi - fi - if test "$ndytran" - then - if test $ndytran -gt 1 - then - error="$error -incorrect option for Marc-Dytran Switch " - fi - fi - if $mpioption - then - if test ! -x $MARC_BIN/$exefile - then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE " - fi - fi - ;; -esac - -############################################################################## -# check argument integrity # -############################################################################## - -if test "$jid" -then - : -else - error="$error -job id required" -fi - -if test $nprocd -gt 1 -then - if test $nauto -gt 0 - then - error="$error -cannot run DDM job with auto restart (-au) option " - fi -fi -case $qid in - S* | s*) - qid=short - ;; - L* | l*) - qid=long - ;; - V* | v*) - qid=verylong - ;; - B* | b*) - qid=background - ;; - F* | f*) - qid=foreground - ;; - A* | a*) - qid=at - ;; - *) - error="$error -bad value for queue_id option" - ;; -esac - -case $prgsav in - N* | n*) - prgsav=no - ;; - Y* | y*) - prgsav=yes - ;; - *) - error="$error -bad value for save option" - ;; -esac - -case $verify in - N* | n*) - verify=no - ;; - Y* | y*) - verify=yes - ;; - *) - error="$error -bad value for verify option" - ;; -esac - -case $nprocdddm in - -* ) - error="$error -bad value for nprocd option" - ;; -esac - -case $nthread in - -* ) - error="$error -bad value for nthread option" - ;; -esac - -case $itree in - -* ) - error="$error -bad value for itree option" - ;; -esac -case $iam in - -* ) - error="$error -bad value for iam option" - ;; -esac -case $compatible in - N* | n*) - compatible=no - ;; - Y* | y*) - compatible=yes - ;; - unknown) - ;; - *) - error="$error -bad value for comp option" - ;; -esac -case $cpinput in - N* | n*) - cpinput=no - ;; - Y* | y*) - cpinput=yes - ;; - *) - error="$error -bad value for copy input option" - ;; -esac -case $cpresults in - N* | n*) - cpresults=no - ;; - Y* | y*) - cpresults=yes - ;; - *) - error="$error -bad value for copy results option" - ;; -esac - -# -# check for external file to run -# -if test -f $MARC_TOOLS/run_marc_check -then - . $MARC_TOOLS/run_marc_check -fi - -# -# pick up version data from bin/VERSION if it exists -# -if test -f $MARC_BIN/VERSION; then - ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` - if test -n "$ppp" ;then - PRODUCT=$ppp - fi - ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` - if test -n "$ppp" ;then - REVISION=", Build $ppp" - fi -fi -############################################################################## -# interact with the user to get the required information to run marc or # -# other marc system program # -############################################################################## - -deletelog=yes -if test $qid = background -a $verify = no -then -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto " > $jid.log -deletelog=no -fi -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto" - - -case $qid in - s* | S* | l* | L* | v* | V* ) - echo \ -"Queue priority : $priority -Queue CPU limit : $cpu -Queue start time : $att" - ;; -# * ) -# echo \ -#" " -# ;; -esac - -if test "$error" -then - if test $verify = yes - then - $ECHO "$error - -Please correct or quit(correct,quit,): $ECHOTXT" - error= - read answer - case $answer in - q* | Q*) - answer=quit - ;; - *) - answer=correct - ;; - esac - else - $ECHO "$error - $ECHOTXT" - echo " " - if test "$deletelog" = no - then - $ECHO "$error - $ECHOTXT" >> $jid.log - echo " " >> $jid.log - fi - answer=quit - fi -else - if test $verify = yes - then - $ECHO " -Are these parameters correct (yes,no,quit,)? $ECHOTXT" - read answer - case $answer in - q* | Q*) - answer=quit - ;; - y* | Y*) - answer=yes - ;; - *) - answer=no - ;; - esac - else - answer=yes - fi -fi - -case $answer in - no | correct) - -############################################################################## -# prompt for each value # -############################################################################## - - $ECHO " -Program name ($prog)? $ECHOTXT" - read value - if test "$value" - then - prog=$value - fi - $ECHO "Job ID ($jid)? $ECHOTXT" - read value - if test "$value" - then - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - fi - $ECHO "User subroutine name ($user)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - user= - ;; - *) - user=$value - - - - - - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - esac - fi - $ECHO "User objects or libraries ($objs)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - objs= - ;; - *) - objs="$value" - ;; - esac - fi - $ECHO "Restart File Job ID ($rid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - rid= - ;; - *) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - esac - fi - $ECHO "Substructure File ID ($sid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - sid= - ;; - *) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - esac - fi - $ECHO "Post File Job ID ($pid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - pid= - ;; - *) - pid=$value - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - esac - fi - $ECHO "Defaults File ID ($did)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - did= - ;; - *) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - esac - fi - $ECHO "View Factor File ID ($vid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - vid= - ;; - *) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - esac - fi - $ECHO "Save generated module ($prgsav)? $ECHOTXT" - read value - if test "$value" - then - prgsav=$value - fi - $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" - read value - if test "$value" - then - nprocdddm=$value - nprocdddmprint=$value - fi - $ECHO "Run on ($nthread) threads ? $ECHOTXT" - read value - if test "$value" - then - nthread=$value - fi - $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" - read value - if test "$value" - then - nsolver=$value - fi -# - if test $nprocdddm -gt 0 - then - nprocd=$nprocdddm - fi - if test $nsolver -gt 0 - then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi - fi - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - nthreadprint=$nthread - if test $nthreadprint -eq 0 - then - nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi - fi -# - $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" - read value - if test "$value" - then - gpuids=$value - fi - if test "$gpuids" = "" ; then - gpuoption= - else - gpuoption="-gp $gpuids" - fi - if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH - if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - fi - fi -# - if test $nprocd -gt 1 - then - $ECHO "Message passing type ($itree)? $ECHOTXT" - read value - if test "$value" - then - itree=$value - fi - $ECHO "Host file name ($host)? $ECHOTXT" - read value - if test "$value" - then - host=$value - fi - if test $nprocdddm -gt 1 - then - $ECHO "Single input file? $ECHOTXT" - read value - case $value in - y* | Y*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" - read value - if test "$value" - then - compatible=$value - fi - $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" - read value - if test "$value" - then - cpinput=$value - fi - $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" - read value - if test "$value" - then - cpresults=$value - fi - fi - fi - $ECHO "Run the job in the queue ($qid)? $ECHOTXT" - read value - if test "$value" - then - qid=$value - fi - case $qid in - s* | S* | l* | L* | v* | V* ) - $ECHO "Queue priority ($priority)? $ECHOTXT" - read value - if test "$value" - then - priority=$value - fi - $ECHO "Job starts at ($att)? $ECHOTXT" - read value - if test "$value" - then - att=$value - fi - $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" - read value - if test "$value" - then - cpu=$value - fi - ;; - * ) - ;; - esac - $ECHO "Auto Restart option ($nauto)? $ECHOTXT" - read value - if test "$value" - then - nauto=$value - fi - $ECHO "Run directory ($DIRJOB)? $ECHOTXT" - read value - if test "$value" - then - DIRJOB=$value - DIRSCR=$DIRJOB - fi - $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" - read value - if test "$value" - then - DIRSCR=$value - fi - ;; - quit) - exit 1 - ;; - *) - break - ;; - -esac - - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - -done - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - pathdll=yes - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - fi - - if test "$pathdll"; then -# -# reset share lib path -# - if test $MACHINENAME = "HP" - then - SHLIB_PATH=$DIRJOB:$SHLIB_PATH - export SHLIB_PATH - fi - if test $MACHINENAME = "IBM" - then - LIBPATH=$DIRJOB:$LIBPATH - export LIBPATH - fi -# - LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH - LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH - LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH - export LD_LIBRARY_PATH - export LD_LIBRARY64_PATH - export LD_LIBRARYN32_PATH - fi -fi -# end of dllrun>0 - - -if test $program = $exefile -o $program = $prog.marc -then - -# delete the old .log file unless we run in the background -if test "$deletelog" = yes -then - /bin/rm $jid.log 2>/dev/null -else - echo - echo running the job in the background, see $jid.log - echo -fi - -# -# check if this is an autoforge or rezoning or radiation job -# -if test $nprocd -eq 1 -then - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` - if test "$line" - then - autoforge=1 - fi -fi -# -# check that jobname for restarted run is not the same -# as restart file basename -# -if test "$rid" -then - if test "$jid" = "$rid" - then - echo " " - echo "ERROR: job name of current run is the same as job name" - echo " of the restarted job" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "ERROR: job name of current run is the same as job name" >> $jid.log - echo " of the restarted job" >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi -fi - -# -# user objects/libraries used -# - - if test "$objs" - then - program="$DIRJOB/$jid.marc" - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# user subroutine used -# -# add DAMASK options for linking - DAMASK="" - - if test "$user" - then - program=$usernoext.marc - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# Special case for IBM using POE but not an SP machine -# in this case we always need a host file, also for serial jobs. -# -if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP -then - MP_HOSTFILE=${jid}.host - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $nprocd -gt 1 - then - numdom=$nprocd - while test $numdom -gt 0 - do - hostname -s >> $MP_HOSTFILE - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - else - hostname -s > $MP_HOSTFILE - fi -fi -# -# check correctness of host file; fix for user sub -# - if test $nprocd -gt 1 - then - -# construct the path name to the executable (execpath) - execpath=$MARC_BIN/$exefile - usersub=0 - if test $program = $prog.marc - then - execpath=$prog.marc - usersub=1 - fi - if test "$objs" - then - execpath="$DIRJOB/$jid.marc" - usersub=1 - fi - if test "$user" - then - execpath=$usernoext.marc - usersub=1 - fi - export execpath - execname=`$BASENAME $execpath` - - if test "$host" - then - userhost=$host - case $userhost in - \/* | \.\/*) - ;; - *) - userhost=`pwd`/$userhost - ;; - esac - -# check that the number of processes specified in the hostfile is -# equal to nprocd specified by -nprocd. - numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` - if test $nprocd -ne $numproc - then - echo " " - echo "error, the number of processes specified in the host file" - echo "must be equal to the number of processes given by -nprocd/-nsolver" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, the number of processes specified in the host file" >> $jid.log - echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - -# check for Myrinet that the number of processes per host is -# less than number of available user ports, 5 -# .gmpi directory must exist in user's home directory -# and must have write permission from remote hosts - if test $MPITYPE = "myrinet" - then - numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` - if test $numproc -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes specified " - echo "in the hostfile must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes specified " >> $jid.log - echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - if test ! -d ~/.gmpi - then - echo " " - echo "error, for Myrinet a .gmpi directory must exist " - echo "under the user's home directory" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log - echo "under the user's home directory" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - homedir=`echo ~` - for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - echo " " - echo "error, for Myrinet a shared .gmpi directory must exist " - echo "under the user's home directory " - echo "with remote write permission" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log - echo "under the user's home directory " >> $jid.log - echo "with remote write permission" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - /bin/rm tmp.$$ - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - fi - fi - done - fi - fi - -# construct the host file $jid.host which is used by mpirun -# skip lines starting with # and only consider lines with more than -# one word in them. Note that the hostfile given to this script -# has two columns: the host name and the number of shared processes -# to run on this host. mpirun wants the number of _other_ -# processes to run in addition to the one being run on the machine -# on which the job is started. hence the $2-1 for fnr == 1. - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then -# HPMPI or HP hardware MPI - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ - -v mpihpspecial="$MPIHPSPECIAL" \ -'{if ( NF > 0) {\ - fnr++ ; \ - printf("-h %s -np %s",$1,$2); \ - printf(" %s",mpihpspecial); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ - if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ - }\ - }' > $jid.host -# end HPMPI or HP hardware MPI - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then -# IBM using hardware MPI (POE) - MP_HOSTFILE=$jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host -# end IBM using hardware MPI (POE) -# for Intel MPI, need to create a machinefile for DMP - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then -# Intel MPI - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - /bin/cp $host $jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Intel MPI for DMP -# for Solaris HPC 7.1, need to create a machinefile for DMP - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then -# Solaris HPC 7.1 - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Solaris HPC 7.1 for DMP -# for Myrinet, construct a configuration file in ~/.gmpi -# this must be readable by each process -# format is (hostname) (port number) for each process - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - grep -v '^#' $host | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ -{if ( NF > 0 ) \ - for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ -}' >> ~/.gmpi/$jid.host - else -# this is for mpich-1.2.5 and later, using the -pg option -# format: host nproc executable user arguments -# the arguments are added later - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s %s\n",path,user);\ - if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ - }\ - }' > $jid.host - fi -# end Myrinet - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then -# Compaq MPI via Memory Channel - grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host -# end Compaq MPI - else -# MPICH - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ - }\ - }' > $jid.host - fi -# define the variable host and host_filt -# host_filt is used for loops over hosts -# for Myrinet we need to use a filtered variant of userhost -# for others we can use $host - if test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - host=~/.gmpi/$jid.host - host_filt=$jid.host_tMp - grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt - else - host=$jid.host - host_filt=$host - fi - else - host=$jid.host - host_filt=$host - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - host_filt=$jid.mfile - fi - fi -# figure out if the machines in the hostfile are nfs mounted -# or distributed and set the variable "dirstatus" accordingly. -# only perform the check if user subroutine is used -# or a user subroutine executable is used - - numfield=1 - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - numfield=2 - fi - DIR1=$DIRJOB - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - counter=0 - echo " " - echo "checking if local or shared directories for host" - if test "$deletelog" = no - then - echo "checking if local or shared directories for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - dirstatus[$counter]="shared" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - dirstatus[$counter]="local" - /bin/rm tmp.$$ - else - if test ! -f $jid.$$ - then - dirstatus[$counter]="local" - $RSH $i /bin/rm $DIR1/$jid.$$ - else - /bin/rm $jid.$$ - fi - fi - if test -f tmp.$$ - then - /bin/rm tmp.$$ - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - echo " ${dirstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${dirstatus[$counter]}" >> $jid.log - fi - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - fi - -# figure out if this is a compatible set of machines -# unless explicitly specified with flag -comp -# only perform the check if user subroutine is used -# or a user subroutine executable is used -# Myrinet does not support heterogeneous - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - if test $compatible = "unknown" - then - thisname=$ARCH - compatible=yes - counter=0 - echo "checking if machines are compatible for host" - if test "$deletelog" = no - then - echo "checking if machines are compatible for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]="yes" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - othername=`$RSH $i uname -a | cut -f 1 -d " "` - if test $thisname != $othername - then - compatible=no - compstatus[$counter]="no" - fi - fi - echo " ${compstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${compstatus[$counter]}" >> $jid.log - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - else - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]=$compatible - fi - done - if test $compatible = "no" - then - echo "all machines assumed incompatible" - if test "$deletelog" = no - then - echo "all machines assumed incompatible" >> $jid.log - fi - else - echo "all machines compatible" - if test "$deletelog" = no - then - echo "all machines compatible" >> $jid.log - fi - fi - fi -# error out if user objects or libraries are used on incompatible machines - if test "$compatible" = "no" -a -n "$objs" - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" - if test "$deletelog" = no - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log - fi - exit 1 - fi -# modify new host file if NFS mounted heterogeneous machine - doit= - if test $program = $prog.marc - then - doit=yes - fi - if test "$user" - then - doit=yes - fi - if test "$doit" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - $AWK -v hst=$i '{fnr++ ; \ -if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ -printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} - /bin/mv $jid.host{$$} $jid.host - host=$jid.host - fi - fi - done - fi - fi # if test $program = $prog.marc -o $user -o $obj - - else # if test $host - # assume shared memory machine if no hostfile given and - # MPITYPE is set to mpich or Myrinet - # check for Myrinet that the total number of processes is - # less than number of available user ports, 5 - if test $MPITYPE = "mpich" -o $MPITYPE = "scali" - then - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - host=$jid.host - elif test $MPITYPE = "myrinet" - then - if test $nprocd -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes " - echo "must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes " >> $jid.log - echo "must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - echo `hostname` $nprocd | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ - {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ -' >> ~/.gmpi/$jid.host - host=~/.gmpi/$jid.host - else - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - - fi - fi # if test myrinet - - fi # if test $host - - fi # if test $nprocd -gt 1 - -fi # if test $program = $exefile -o $program = $prog.marc - -############################################################################## -# construct run stream (Marc only) # -############################################################################## - -# set maximum message length for ddm to a large number -# for vendor provided mpi -if test $itree -eq 0 -a $MPITYPE = hardware -then - itree=100000000 - if test $MACHINENAME = SGI - then - itree=100000001 - fi -fi -if test $itree -eq 0 -a $MPITYPE = hpmpi -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = myrinet -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = nec -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = scali -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = intelmpi -then - itree=100000000 -fi -if test $nprocdddm -lt 2 -then - nprocdarg= -else - nprocdarg="$nprocdarg $nprocdddm" -fi -if test $nsolver -eq 0 -then - nsolverarg= -else - nsolverarg="$nsolverarg $nsolver" -fi -if test $nprocdddm -lt 2 -a $nsolver -eq 0 -then -nprocd=0 -fi -if test $nprocd -gt 0 -then - if test "$host" - then - if test -z "$RUN_JOB2" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then - RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" - RUN_JOB=" -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - numhost=`uniq $jid.mfile | wc -l` - if test "$INTELMPI_VERSION" = "HYDRA" - then - RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n $numhost -r $RSH -f $jid.mfile - RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" - fi - -# intelmpi uses configfile. format: -# -host host1 -n n1 executable marcargs -# one such line per host -# collect the marcargs in RUN_JOB and construct the config file later -# collect the run stream in RUN_JOB_TMP - RUN_JOB="-jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - - - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then - RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - if test "$userhost" - then - RUN_JOB="$RUN_JOB -mhost $userhost" - fi - if test $MPITYPE = "scali" - then -# set default working directory to /tmp to allow -# different directory names - SCAMPI_WORKING_DIRECTORY=/tmp - export SCAMPI_WORKING_DIRECTORY - fi - else - if test -z "$RUN_JOB1" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - RUNNPROCD=$nprocd - if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" - then - RUNNPROCD= - MP_PROCS=$nprocd - export MP_PROCS - fi - if test $MPITYPE = "myrinet" - then - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n 1 -f $jid.hosts - fi - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - fi -else - if test $nauto -gt 0 -o $ndcoup -gt 0 - then - RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - else -# this is for a serial job without auto restart: - RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi -fi -if test "$rid" -then - RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" -fi -if test "$pid" -then - RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" -fi -if test "$sid" -then - RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" -fi -if test "$did" -then - RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" -fi -if test "$vid" -then - RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" -fi -if test $nauto -gt 0 -then - RUN_JOB="$RUN_JOB -autorst $nauto " -fi -if test $ndcoup -gt 0 -then - RUN_JOB="$RUN_JOB -dcoup $ndcoup " -fi -if test $ndytran -gt 0 -then - RUN_JOB="$RUN_JOB -dytran $ndytran " -fi -if test $mesh -gt 0 -then - RUN_JOB="$RUN_JOB -me $mesh " -fi -if test $noutcore -gt 0 -then - RUN_JOB="$RUN_JOB -outcore $noutcore " -fi -if test "$dllrun" -gt 0 -then - RUN_JOB="$RUN_JOB -dll $dllrun " -fi -if test "$trkrun" -gt 0 -then - RUN_JOB="$RUN_JOB -trk $trkrun " -fi -if test "$iam" -then - RUN_JOB="$RUN_JOB -iam $iam " -fi -if test "$justlist" -then - RUN_JOB="$RUN_JOB -list 1 " -fi -if test "$feature" -then - RUN_JOB="$RUN_JOB -feature $feature " -fi -if test "$memlimit" -ne 0 -then - RUN_JOB="$RUN_JOB -ml $memlimit " -fi -if test "$cpinput" -then - RUN_JOB="$RUN_JOB -ci $cpinput " -fi -if test "$cpresults" -then - RUN_JOB="$RUN_JOB -cr $cpresults " -fi -if test "$DIRSCR" != "$DIRJOB" -then - RUN_JOB="$RUN_JOB -dirscr $DIRSCR" -else - DIRSCR=$DIRJOB -fi -if test "$makebdf" -then - RUN_JOB="$RUN_JOB -bdf $makebdf " -fi -if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" -then - # append $RUN_JOB to all lines of the host file - # and set RUN_JOB - $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ - /bin/mv $host.$$ $host - RUN_JOB=$RUN_JOB_TMP -fi -if test $MPITYPE = "intelmpi" -a "$host" -then - # construct config file, append $RUN_JOB to all lines of the config file - # and set RUN_JOB - if test "$INTELMPI_VERSION" = "HYDRA" - then - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - else - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-host %s -n %s",$1,$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - fi - RUN_JOB=$RUN_JOB_TMP -fi -echo " " -echo "Final run stream value" -echo " RUNJOB="$RUN_JOB -if test "$deletelog" = no -then -echo " " >> $jid.log -echo "Final run stream value" >> $jid.log -echo " RUNJOB="$RUN_JOB >> $jid.log -fi - - -############################################################################## -# run marc using valgrind # -############################################################################## -#RUN_JOB="valgrind $RUN_JOB" -#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" -############################################################################## - - -############################################################################## -# run the requested program in a queue # -############################################################################## - -if test "$deletelog" = yes -then - echo - date -else - echo >> $jid.log - date >> $jid.log -fi -if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] -then - -/bin/rm -f $jid.runmarcscript - - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - userobj=$usernoext.o - fi - cat > $jid.runmarcscript << END4 - if test "$user" - then - if test $MACHINENAME = "CRAY" - then - $DFORTRAN $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTRAN $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $MARCCUDALIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } -END4 -else - prgsav=yes -fi -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# - -cat >> $jid.runmarcscript << END5 - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -# first remove all .out files and incremental restart files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null - /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null -fi - -if test $nprocdddm -gt 1 -then - $RUN_JOB 2>>$jid.log -else - $RUN_JOB 2>>$jid.log -fi - -if test $dllrun -eq 0; then - if test $prgsav = no - then - /bin/rm -f $bd$program 2>/dev/null - fi -else - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes - then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -END5 - - -# Submit to marc batch queue -# -if [ $qid = at ] -then -QUENAME=at -SUBMCMD= -else -# -# Submit to qsub queue -# -QUENAME=qsub -SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" -if test "$priority" -then - SUBMCMD=$SUBMCMD" -p $priority" -fi -if test "$att" -then - SUBMCMD=$SUBMCMD" -a $att" -fi -if test "$cpu" -then - SUBMCMD=$SUBMCMD" -lt $cpu" -fi - -fi -echo $QUENAME $SUBMCMD -#cat $jid.runmarcscript -$QUENAME $SUBMCMD < $jid.runmarcscript - -/bin/rm -f $jid.runmarcscript - -############################################################################## -# run the requested program in the background # -############################################################################## - -else -if test $qid = background -then - -# -# first remove all old .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi -# -# compile user subroutine if present -# -( -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - echo " $PRODUCT Exit number 3" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTRAN $user || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTRAN $user -o $userobj || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - echo " $PRODUCT Exit number 3" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc - -# - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -$RUN_JOB & - -marcpid=$! -echo $marcpid > $DIRJOB/$jid.pid -wait $marcpid - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -) 1>>$jid.log 2>&1 & - - -############################################################################## -# run the requested program in the foreground # -############################################################################## - -else - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTRAN $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTRAN $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi -# first remove all .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi - -$RUN_JOB - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - if test "$host" - then - mpdcleanup -a -f $jid.mfile - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.mfile 2> /dev/null - else - mpdcleanup -a -f $jid.hosts - /bin/rm $jid.hosts 2> /dev/null - fi - fi - fi -fi - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi - - -fi -fi diff --git a/installation/mods_MarcMentat/2012/Marc_tools/run_damask_h b/installation/mods_MarcMentat/2012/Marc_tools/run_damask_h deleted file mode 100644 index d7f3e4ead..000000000 --- a/installation/mods_MarcMentat/2012/Marc_tools/run_damask_h +++ /dev/null @@ -1,3690 +0,0 @@ -#!/bin/ksh -############################################################################## -# # -# run_marc - run a marc job # -# ------------------------- # -# # -# usage: run_marc -j jid { options } # -# # -# where standard options are: required: defaults: # -# -------------------------- # -# # -# -j* jid job id number. ** YES ** . # -# -pr* prog program name. . marc # -# -v* y|n do or do not verify inputs. . yes # -# -q* s|l|v|b|f batch queue name or background, . short # -# foreground. # -# -b* as alternative to option -q* # -# # -# ( batch queues only : # -# -pq* intra queue priority. . . # -# -at DATE/TIME delay start of job. . . # -# format : January,1,1990,12:31 # -# or : today,5pm # -# -cpu* secs job CPU limit . . ) # -# # -# -r* rid restart file job id. . . # -# -si* sid substructure file id. . . # -# -pi* post post file job id. . . # -# -de* did defaults file . no # -# -vf vid viewfactor . no # -# # -# -u* user user subroutine. . . # -# -obj obj user objects or libraries. . . # -# -sa* y|n do or do not save load module. . no # -# -autorst auto restart flag for auto forge . no # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo selects i4 or i8 version # -# default: i4 or via defaults file run_marc_defaults # -# the -mo option will override # -# -mpi selects MPI version # -# each platform has a default MPI version and some # -# have an alternative version. see the include file # -# for the respective platform # -# MPI_DEFAULT defines the default MPI version # -# MPI_OTHER defines versions one can switch to # -# -dcoup for contact decoupling # -# currently not supported # -# -dir directory where the job i/o should take place. # -# defaults to current directory. # -# -sdir directory where scratch files are created # -# defaults to current directory. # -# # -# -alloc only perform memory allocation test, no analysis # -# -list y only list options in the input file, no analysis # -# -fe num set feature number "num" for the run. only one allowed # -# -dytran flag to switch from Dytran to Marc # -# dytran = 0, program will run w/o Marc-Dytran Switch # -# = 1, program will restart Marc after Dytran run # -# >= 2, Not supported yet. # -# currently not supported # -# -ou force analysis to use out-of-core control # -# =0, not used # -# =1, element storage out-of-core # -# -dll run marc using shared library libmarc.so and exe_marc # -# =1, used # -# =2, do not free streaming input memory # -# =3, run with marc input deck # -# -trk run marc for post-tracking # -# -gpuid run marc using GPGPU capability # -# specify gpuid on to be used in the analysis. Multiple # -# IDs may be assigned for DDM runs. # -# Separate a list of IDs with a colon. Each DMP # -# process will be assigned a GPU ID in round robin fastion# -# = 0 # -# = 0:1 etc... # -# # -# where parallel options are: # -# -------------------------- # -# # -# itree, host, and comp options are available for the domain # -# decomposition only. # -# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # -# # -# # -# -nprocd number of domains. # -# defaults to single domain solution. # -# -nprocds number of domains if single input file. # -# defaults to single domain solution. # -# -nps same as -nprocds. # -# -nsolver number of solver tasks for solver types 12 and 13 # -# these are distributed tasks operating via MPI # -# -nthread number of solver threads for solver types 6, 8, and 11 # -# also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. if both specified, nthread option# -# will be used. # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by 6, 8, and 11 # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor nthread specified. # -# -itree message passing tree type for domain decomposition. # -# for debugging purposes; should not normally be used. # -# -host hostfile name for distributed execution on network. # -# defaults to no hostfile, unless jobid.defhost exists. # -# if jobid.defhost exists, only -np(s) necessary # -# -comp* y|n to be used with user routines on a network of # -# incompatible machines. # -# if set to no, a separate executable will be created # -# for each machine on the network. # -# if set to yes, the executable located on the machine # -# from which marc is started will be used on all machines.# -# defaults to no if O/S versions different on machines. # -# # -# -ci y|n copy input files to remote hosts (default: yes) # -# if "yes", input files are automatically copied to # -# remote hosts for a network run if necessary. # -# -cr y|n copy post files from remote hosts (default: yes) # -# if "yes", post files are automatically copied back from # -# remote hosts for a network run if necessary. # -############################################################################## -# set DIR to the directory in which this script is -REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" -DIR=`dirname $REALCOM` -# make sure DIR has an absolute path -case $DIR in - \/*) - ;; - *) - DIR=`pwd`/$DIR - ;; -esac -DIRSCRIPT=$DIR -AWK=awk -ARCH=`uname -a | cut -f 1 -d " "` -# Sun has a bad awk, use nawk instead -if test $ARCH = "SunOS" -then - AWK=nawk -fi -BASENAME=basename -# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists -if test $ARCH = "SunOS" -then - if test -x /usr/ucb/basename - then - BASENAME=/usr/ucb/basename - fi -fi - -# echo command line in the case of ECHO_COMMAND is true -if test "$ECHO_COMMAND" = true ; then - echo command "$0" "$@" -fi - -# -# "mode" selects version, i4 or i8 -# default is i4 -# this can be changed by a file run_marc_defaults -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MODE i8 -# it can also be set by the environmental variable MARC_INTEGER_SIZE -# and by the command line option "-mo" -# -mode= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -f $HOME/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -n "$MARC_INTEGER_SIZE" ; then - mode=$MARC_INTEGER_SIZE -fi -if test -z "$mode" ; then - mode=i4 -fi -case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "error, version mode must be i4 or i8" - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i4 or i8" - echo " " - echo " use -mo i4 or -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - setmode=true - fi - if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - fi - if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -done - -# set to i4 version for 32 bit Linux -if test "`uname -s`" = "Linux"; then - if test "`uname -m`" = "i686"; then - mode=i4 - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -fi - - -. "$DIR/getarch" - -# Change_me -. $MARC_INCLUDE -# - -# -# Dynamically determine the echo syntax -# - -case "`echo '\c'`" in - '\c') - ECHO='echo -n' - ECHOTXT=' ' - ;; - *) - ECHO='echo' - ECHOTXT=' \c' - ;; -esac - -# -# Variables for the MARC environment -# - -PRODUCT="Marc" -EXITMSG=$MARC_TOOLS/MESSAGES -export EXITMSG -FLEXDIR=$DIR/../flexlm/licenses -export FLEXDIR -TIMCHK=3600 -export TIMCHK -BINDIR=$MARC_BIN -export BINDIR -AFMATDAT=$MARC_RUNTIME/AF_flowmat/ -export AFMATDAT -# -# define directory path to global unified material database -# -MATFILE= -export MATFILE - -# -# define memory limit -# first set to MEMLIMIT from include -# -ml option overrules if specified -memlimit=$MEMLIMIT -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -# -if test $MACHINENAME = "HP" -then - SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH - export SHLIB_PATH -fi -# the one for IBM is defined futher down - -LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH -LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH -export LD_LIBRARY_PATH -export LD_LIBRARY64_PATH -export LD_LIBRARYN32_PATH - -atexit() { -kill -15 $$ -# -if test $MPITYPE = "myrinet" -then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi -fi -} - -trap "atexit" 2 - -# -# defaults -# - -prog=marc -exefile=marc -jid= -rid= -pid= -sid= -did= -vid= -user= -usersnoext= -objs= -qid=background -cpu= -priority= -att= -trk= -verify=yes -prgsav=no -rmdll=no -cpdll=no -progdll= -pathdll= -error= -nprocd=0 -nprocdddm=1 -nprocdddmprint= -icreated=0 -nprocdarg= -nsolver=0 -nsolverarg=-ns -if test $nprocds -then - if test $nprocds -gt 1 - then - nprocdddm=$nprocds - nprocdddmprint=$nprocds - icreated=1 - nprocdarg=-nprocds - fi -fi -nthread=-1 -gpuids= -nauto=0 -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -nthreadprint=0 -itree=0 -iam= -link= -trkrun=0 -DIRJOB=`pwd` -DIRSCR=$DIRJOB -DIRSCRSET= -autoforge=0 -dotdat=.dat -dotdefhost=.defhost -host= -numhost= -mfile= -userhost= -makebdf= -cpinput=yes -cpresults=yes -marcdll=libmarc.$EXT_DLL -# define hostname and strip off extensions (alpha.aaa.com) -thishost=`hostname` -thishost=${thishost%%.*} -compatible=unknown -numfield=1 -justlist= -feature= -mpioption=false -MDSRCLIB=$MARC_LIB/mdsrc.a -# -# check run_marc_defaults file for default MPI setting -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MPI -# -value= -file= -if test -f $DIRSCRIPT/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$DIRSCRIPT/run_marc_defaults - fi -fi -if test -f $HOME/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$HOME/run_marc_defaults - fi -fi -if test -n "$value"; then - MARC_MPITYPE=$value - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - echo " " - echo " error, incorrect option for MARC_MPI" - echo " defined in $file: $MARC_MPITYPE" - echo " valid options: $MPI_DEFAULT $MPI_OTHER" - echo " " - exit - fi - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - fi -fi -# -# -# allow scratch directory to be specified with environmental variable -# MARCSCRATCH -if test $MARCSCRATCH -then - if test -d $MARCSCRATCH - then - DIRSCR=$MARCSCRATCH - else - echo "error, scratch directory '$MARCSCRATCH'" - echo " specified via environmental variable MARCSCRATCH does not exist" - exit - fi -fi -# -############################################################################## -# parse input - arguments always come in pairs # -############################################################################## - -arg=$1 -if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - shift - arg=$1 -fi -while [ -n "$arg" ] -do - shift - value=$1 - case $arg in - -al* | -AL*) - LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - $MARC_BIN/marc -alloc 1 - exit - ;; - -li* | -LI*) - justlist=yes - ;; - -fe* | -FE*) - feature=$value - ;; - -pr* | -PR*) - if test `dirname $value` = '.' - then - prog=`$BASENAME $value .marc` - progdll=`$BASENAME $value` - else - prog=`dirname $value`/`$BASENAME $value .marc` - progdll=`dirname $value`/`$BASENAME $value` - fi - prdir=`dirname $value` - case $prdir in - \/*) - ;; - *) - prog=`pwd`/$prdir/$prog - ;; - esac - ;; - -j* | -J*) - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - ;; - -r* | -R*) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - -si* | -SI*) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - -pi* | -PI*) - if test -f $value.t19 - then - pid=`$BASENAME $value .t19` - else - pid=`$BASENAME $value .t16` - fi - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - -bdf | -BDF) - makebdf=1 - ;; - -de* | -DE*) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - -vf | -VF) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - -u* | -U*) - - user=$value - - - - - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - -obj | -OBJ) - objs="$value" - ;; - -q* | -Q*) - qid=$value - ;; - -b* | -B*) - case $value in - y* | Y*) - qid=background - ;; - n* | N*) - qid=foreground - ;; - *) - ;; - esac - ;; - -at | -AT) - att=$value - ;; - -cpu* | -CPU*) - cpu=$value - ;; - -pq | -PQ*) - priority=$value - ;; - -v* | -V*) - verify=$value - ;; - -sa* | -SA*) - prgsav=$value - ;; - -np* | -NP*) - nprocdddm=$value - nprocdddmprint=$value - case $arg in - -nps* | -NPS* | -nprocds* | -NPROCDS*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - case $arg in - -np | -NP | -nprocd | -NPROCD) - icreated=0 - nprocdarg=-nprocd - ;; - esac - ;; - -ns* | -NS*) - nsolver=$value - ;; - -nt* | -NT*) - nthread=$value - ;; - -gp* | -GP*) - gpuids=$value - ;; - -it* | -IT*) - itree=$value - ;; - -iam | -IAM) - iam=$value - ;; - -au* | -AU*) - nauto=$value - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -me | -ME ) - mesh=$value - ;; - -ml | -ML ) - memlimit=$value - ;; - -mo | -MO ) - ;; - -mpi | -MPI ) - mpioption=true - MARC_MPITYPE=$value - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - fi - fi - ;; - -dir* | -DIR*) - DIRJOB=$value - case $DIRJOB in - \/*) - ;; - *) - DIRJOB=`pwd`/$DIRJOB - ;; - esac - if test -z "$DIRSCRSET" - then - DIRSCR=$DIRJOB - fi - ;; - -sd* | -SD*) - DIRSCR=$value - DIRSCRSET=yes - case $DIRSCR in - \/*) - ;; - *) - DIRSCR=`pwd`/$DIRSCR - ;; - esac - ;; - -ho* | -HO*) - host=$value - ;; - -co* | -CO*) - compatible=$value - ;; - -ci* | -CI*) - cpinput=$value - ;; - -cr* | -CR*) - cpresults=$value - ;; - *) - error="$error -$arg: invalid option" - break - ;; - esac - case $value in - -*) - error="$error -$arg: invalid name $value" - break - ;; - esac - shift - arg=$1 - if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - shift - arg=$1 - fi -done -argc=`expr $# % 2` -if test $argc -eq 1 -then -# -# odd number of arguments -# - error="$error -argument list incomplete" -fi - -if test $nprocdddm -gt 0 -then -nprocd=$nprocdddm -fi - -if test $nsolver -gt 0 -then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi -fi - -if test $nthread -eq -1 -then -nthread=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nthread -lt 0 -then -nthread=0 -fi - -nthreadprint=$nthread -if test $nthreadprint -eq 0 -then -nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi -fi - -nthread=$nthreadprint - -gpuoption= -if test "$gpuids" = "" ; then - gpuoption= -else - gpuoption="-gp $gpuids" -fi - -if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH -else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH -# Linux 64 + HPMPI, Below code is taken from include_linux64 - if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - fi -fi - -if test $nprocd -gt 1; then - if test -f $jid$dotdefhost; then - if test "$host" = ""; then - host=$jid$dotdefhost - fi - fi - if test -f hostfile_qa_$nprocd; then - if test "$host" = ""; then - host=hostfile_qa_$nprocd - fi - fi -fi - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then - dotdat=.inp - fi - - if test "$progdll"; then - /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll - rmdll=yes - pathdll=yes - progdll=${progdll}_$marcdll - else - progdll=$marcdll - fi - - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - pathdll=yes - fi -fi - -############################################################################## -# check parameter validity # -############################################################################## - -while test forever; do - -# -# check for input file existence -# -if test $nprocdddm -gt 1 -a $icreated -eq 0; then - if test ! -f $DIRJID/1$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/1$jid$dotdat not accessible" - fi - fi -else - if test ! -f $DIRJID/$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/$jid$dotdat not accessible" - fi - fi -fi - if test $nprocd -gt 1; then - if test "$host" ; then - if test ! -f $host; then - error="$error -host name file $host not accessible" - fi - fi - fi - -# -# check if the job is already running in the background -# -if test -f $DIRJOB/$jid.pid; then - error="$error -job is already running (the file $jid.pid exists)" -fi - -# -# if the program name is other than marc, then -# assume that this is a program in the users local directory -# - -bd=$MARC_BIN/ - -case $prog in - marc | MARC | $exefile) - program=$exefile - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - if test ! -f $user - then - error="$error -user subroutine file $user not accessible" - fi - fi - if test "$objs" - then - missingobjs= - for o in $objs - do - if test ! -f "$o" - then - if test -z "$missingobjs" - then - missingobjs="$o" - else - missingobjs="$missingobjs $o" - fi - fi - done - if test -n "$missingobjs" - then - error="$error -user object/library file(s) $missingobjs not accessible" - fi - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$vid" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRVID/1$vid.vfs - then - error="$error -view factor file $DIRVID/1$vid.vfs not accessible" - fi - else - if test ! -f $DIRVID/$vid.vfs - then - error="$error -view factor file $DIRVID/$vid.vfs not accessible" - fi - fi - fi - if $mpioption - then - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" - fi - fi - ;; - *) - program=$prog.marc - case $prog in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - error="$error -program option may not be used with user subroutine" - fi - if test "$objs" - then - error="$error -program option may not be used with user objects or libraries" - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$nauto" - then - if test $nauto -gt 2 - then - error="$error -incorrect option for auto restart " - fi - fi - if test "$ndcoup" - then - if test $ndcoup -gt 3 - then - error="$error -incorrect option for contact decoupling " - fi - fi - if test "$ndytran" - then - if test $ndytran -gt 1 - then - error="$error -incorrect option for Marc-Dytran Switch " - fi - fi - if $mpioption - then - if test ! -x $MARC_BIN/$exefile - then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE " - fi - fi - ;; -esac - -############################################################################## -# check argument integrity # -############################################################################## - -if test "$jid" -then - : -else - error="$error -job id required" -fi - -if test $nprocd -gt 1 -then - if test $nauto -gt 0 - then - error="$error -cannot run DDM job with auto restart (-au) option " - fi -fi -case $qid in - S* | s*) - qid=short - ;; - L* | l*) - qid=long - ;; - V* | v*) - qid=verylong - ;; - B* | b*) - qid=background - ;; - F* | f*) - qid=foreground - ;; - A* | a*) - qid=at - ;; - *) - error="$error -bad value for queue_id option" - ;; -esac - -case $prgsav in - N* | n*) - prgsav=no - ;; - Y* | y*) - prgsav=yes - ;; - *) - error="$error -bad value for save option" - ;; -esac - -case $verify in - N* | n*) - verify=no - ;; - Y* | y*) - verify=yes - ;; - *) - error="$error -bad value for verify option" - ;; -esac - -case $nprocdddm in - -* ) - error="$error -bad value for nprocd option" - ;; -esac - -case $nthread in - -* ) - error="$error -bad value for nthread option" - ;; -esac - -case $itree in - -* ) - error="$error -bad value for itree option" - ;; -esac -case $iam in - -* ) - error="$error -bad value for iam option" - ;; -esac -case $compatible in - N* | n*) - compatible=no - ;; - Y* | y*) - compatible=yes - ;; - unknown) - ;; - *) - error="$error -bad value for comp option" - ;; -esac -case $cpinput in - N* | n*) - cpinput=no - ;; - Y* | y*) - cpinput=yes - ;; - *) - error="$error -bad value for copy input option" - ;; -esac -case $cpresults in - N* | n*) - cpresults=no - ;; - Y* | y*) - cpresults=yes - ;; - *) - error="$error -bad value for copy results option" - ;; -esac - -# -# check for external file to run -# -if test -f $MARC_TOOLS/run_marc_check -then - . $MARC_TOOLS/run_marc_check -fi - -# -# pick up version data from bin/VERSION if it exists -# -if test -f $MARC_BIN/VERSION; then - ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` - if test -n "$ppp" ;then - PRODUCT=$ppp - fi - ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` - if test -n "$ppp" ;then - REVISION=", Build $ppp" - fi -fi -############################################################################## -# interact with the user to get the required information to run marc or # -# other marc system program # -############################################################################## - -deletelog=yes -if test $qid = background -a $verify = no -then -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto " > $jid.log -deletelog=no -fi -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto" - - -case $qid in - s* | S* | l* | L* | v* | V* ) - echo \ -"Queue priority : $priority -Queue CPU limit : $cpu -Queue start time : $att" - ;; -# * ) -# echo \ -#" " -# ;; -esac - -if test "$error" -then - if test $verify = yes - then - $ECHO "$error - -Please correct or quit(correct,quit,): $ECHOTXT" - error= - read answer - case $answer in - q* | Q*) - answer=quit - ;; - *) - answer=correct - ;; - esac - else - $ECHO "$error - $ECHOTXT" - echo " " - if test "$deletelog" = no - then - $ECHO "$error - $ECHOTXT" >> $jid.log - echo " " >> $jid.log - fi - answer=quit - fi -else - if test $verify = yes - then - $ECHO " -Are these parameters correct (yes,no,quit,)? $ECHOTXT" - read answer - case $answer in - q* | Q*) - answer=quit - ;; - y* | Y*) - answer=yes - ;; - *) - answer=no - ;; - esac - else - answer=yes - fi -fi - -case $answer in - no | correct) - -############################################################################## -# prompt for each value # -############################################################################## - - $ECHO " -Program name ($prog)? $ECHOTXT" - read value - if test "$value" - then - prog=$value - fi - $ECHO "Job ID ($jid)? $ECHOTXT" - read value - if test "$value" - then - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - fi - $ECHO "User subroutine name ($user)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - user= - ;; - *) - user=$value - - - - - - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - esac - fi - $ECHO "User objects or libraries ($objs)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - objs= - ;; - *) - objs="$value" - ;; - esac - fi - $ECHO "Restart File Job ID ($rid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - rid= - ;; - *) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - esac - fi - $ECHO "Substructure File ID ($sid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - sid= - ;; - *) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - esac - fi - $ECHO "Post File Job ID ($pid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - pid= - ;; - *) - pid=$value - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - esac - fi - $ECHO "Defaults File ID ($did)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - did= - ;; - *) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - esac - fi - $ECHO "View Factor File ID ($vid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - vid= - ;; - *) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - esac - fi - $ECHO "Save generated module ($prgsav)? $ECHOTXT" - read value - if test "$value" - then - prgsav=$value - fi - $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" - read value - if test "$value" - then - nprocdddm=$value - nprocdddmprint=$value - fi - $ECHO "Run on ($nthread) threads ? $ECHOTXT" - read value - if test "$value" - then - nthread=$value - fi - $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" - read value - if test "$value" - then - nsolver=$value - fi -# - if test $nprocdddm -gt 0 - then - nprocd=$nprocdddm - fi - if test $nsolver -gt 0 - then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi - fi - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - nthreadprint=$nthread - if test $nthreadprint -eq 0 - then - nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi - fi -# - $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" - read value - if test "$value" - then - gpuids=$value - fi - if test "$gpuids" = "" ; then - gpuoption= - else - gpuoption="-gp $gpuids" - fi - if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH - if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - fi - fi -# - if test $nprocd -gt 1 - then - $ECHO "Message passing type ($itree)? $ECHOTXT" - read value - if test "$value" - then - itree=$value - fi - $ECHO "Host file name ($host)? $ECHOTXT" - read value - if test "$value" - then - host=$value - fi - if test $nprocdddm -gt 1 - then - $ECHO "Single input file? $ECHOTXT" - read value - case $value in - y* | Y*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" - read value - if test "$value" - then - compatible=$value - fi - $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" - read value - if test "$value" - then - cpinput=$value - fi - $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" - read value - if test "$value" - then - cpresults=$value - fi - fi - fi - $ECHO "Run the job in the queue ($qid)? $ECHOTXT" - read value - if test "$value" - then - qid=$value - fi - case $qid in - s* | S* | l* | L* | v* | V* ) - $ECHO "Queue priority ($priority)? $ECHOTXT" - read value - if test "$value" - then - priority=$value - fi - $ECHO "Job starts at ($att)? $ECHOTXT" - read value - if test "$value" - then - att=$value - fi - $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" - read value - if test "$value" - then - cpu=$value - fi - ;; - * ) - ;; - esac - $ECHO "Auto Restart option ($nauto)? $ECHOTXT" - read value - if test "$value" - then - nauto=$value - fi - $ECHO "Run directory ($DIRJOB)? $ECHOTXT" - read value - if test "$value" - then - DIRJOB=$value - DIRSCR=$DIRJOB - fi - $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" - read value - if test "$value" - then - DIRSCR=$value - fi - ;; - quit) - exit 1 - ;; - *) - break - ;; - -esac - - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - -done - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - pathdll=yes - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - fi - - if test "$pathdll"; then -# -# reset share lib path -# - if test $MACHINENAME = "HP" - then - SHLIB_PATH=$DIRJOB:$SHLIB_PATH - export SHLIB_PATH - fi - if test $MACHINENAME = "IBM" - then - LIBPATH=$DIRJOB:$LIBPATH - export LIBPATH - fi -# - LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH - LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH - LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH - export LD_LIBRARY_PATH - export LD_LIBRARY64_PATH - export LD_LIBRARYN32_PATH - fi -fi -# end of dllrun>0 - - -if test $program = $exefile -o $program = $prog.marc -then - -# delete the old .log file unless we run in the background -if test "$deletelog" = yes -then - /bin/rm $jid.log 2>/dev/null -else - echo - echo running the job in the background, see $jid.log - echo -fi - -# -# check if this is an autoforge or rezoning or radiation job -# -if test $nprocd -eq 1 -then - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` - if test "$line" - then - autoforge=1 - fi -fi -# -# check that jobname for restarted run is not the same -# as restart file basename -# -if test "$rid" -then - if test "$jid" = "$rid" - then - echo " " - echo "ERROR: job name of current run is the same as job name" - echo " of the restarted job" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "ERROR: job name of current run is the same as job name" >> $jid.log - echo " of the restarted job" >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi -fi - -# -# user objects/libraries used -# - - if test "$objs" - then - program="$DIRJOB/$jid.marc" - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# user subroutine used -# -# add DAMASK options for linking - DAMASK="" - - if test "$user" - then - program=$usernoext.marc - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# Special case for IBM using POE but not an SP machine -# in this case we always need a host file, also for serial jobs. -# -if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP -then - MP_HOSTFILE=${jid}.host - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $nprocd -gt 1 - then - numdom=$nprocd - while test $numdom -gt 0 - do - hostname -s >> $MP_HOSTFILE - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - else - hostname -s > $MP_HOSTFILE - fi -fi -# -# check correctness of host file; fix for user sub -# - if test $nprocd -gt 1 - then - -# construct the path name to the executable (execpath) - execpath=$MARC_BIN/$exefile - usersub=0 - if test $program = $prog.marc - then - execpath=$prog.marc - usersub=1 - fi - if test "$objs" - then - execpath="$DIRJOB/$jid.marc" - usersub=1 - fi - if test "$user" - then - execpath=$usernoext.marc - usersub=1 - fi - export execpath - execname=`$BASENAME $execpath` - - if test "$host" - then - userhost=$host - case $userhost in - \/* | \.\/*) - ;; - *) - userhost=`pwd`/$userhost - ;; - esac - -# check that the number of processes specified in the hostfile is -# equal to nprocd specified by -nprocd. - numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` - if test $nprocd -ne $numproc - then - echo " " - echo "error, the number of processes specified in the host file" - echo "must be equal to the number of processes given by -nprocd/-nsolver" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, the number of processes specified in the host file" >> $jid.log - echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - -# check for Myrinet that the number of processes per host is -# less than number of available user ports, 5 -# .gmpi directory must exist in user's home directory -# and must have write permission from remote hosts - if test $MPITYPE = "myrinet" - then - numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` - if test $numproc -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes specified " - echo "in the hostfile must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes specified " >> $jid.log - echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - if test ! -d ~/.gmpi - then - echo " " - echo "error, for Myrinet a .gmpi directory must exist " - echo "under the user's home directory" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log - echo "under the user's home directory" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - homedir=`echo ~` - for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - echo " " - echo "error, for Myrinet a shared .gmpi directory must exist " - echo "under the user's home directory " - echo "with remote write permission" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log - echo "under the user's home directory " >> $jid.log - echo "with remote write permission" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - /bin/rm tmp.$$ - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - fi - fi - done - fi - fi - -# construct the host file $jid.host which is used by mpirun -# skip lines starting with # and only consider lines with more than -# one word in them. Note that the hostfile given to this script -# has two columns: the host name and the number of shared processes -# to run on this host. mpirun wants the number of _other_ -# processes to run in addition to the one being run on the machine -# on which the job is started. hence the $2-1 for fnr == 1. - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then -# HPMPI or HP hardware MPI - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ - -v mpihpspecial="$MPIHPSPECIAL" \ -'{if ( NF > 0) {\ - fnr++ ; \ - printf("-h %s -np %s",$1,$2); \ - printf(" %s",mpihpspecial); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ - if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ - }\ - }' > $jid.host -# end HPMPI or HP hardware MPI - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then -# IBM using hardware MPI (POE) - MP_HOSTFILE=$jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host -# end IBM using hardware MPI (POE) -# for Intel MPI, need to create a machinefile for DMP - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then -# Intel MPI - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - /bin/cp $host $jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Intel MPI for DMP -# for Solaris HPC 7.1, need to create a machinefile for DMP - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then -# Solaris HPC 7.1 - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Solaris HPC 7.1 for DMP -# for Myrinet, construct a configuration file in ~/.gmpi -# this must be readable by each process -# format is (hostname) (port number) for each process - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - grep -v '^#' $host | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ -{if ( NF > 0 ) \ - for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ -}' >> ~/.gmpi/$jid.host - else -# this is for mpich-1.2.5 and later, using the -pg option -# format: host nproc executable user arguments -# the arguments are added later - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s %s\n",path,user);\ - if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ - }\ - }' > $jid.host - fi -# end Myrinet - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then -# Compaq MPI via Memory Channel - grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host -# end Compaq MPI - else -# MPICH - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ - }\ - }' > $jid.host - fi -# define the variable host and host_filt -# host_filt is used for loops over hosts -# for Myrinet we need to use a filtered variant of userhost -# for others we can use $host - if test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - host=~/.gmpi/$jid.host - host_filt=$jid.host_tMp - grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt - else - host=$jid.host - host_filt=$host - fi - else - host=$jid.host - host_filt=$host - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - host_filt=$jid.mfile - fi - fi -# figure out if the machines in the hostfile are nfs mounted -# or distributed and set the variable "dirstatus" accordingly. -# only perform the check if user subroutine is used -# or a user subroutine executable is used - - numfield=1 - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - numfield=2 - fi - DIR1=$DIRJOB - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - counter=0 - echo " " - echo "checking if local or shared directories for host" - if test "$deletelog" = no - then - echo "checking if local or shared directories for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - dirstatus[$counter]="shared" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - dirstatus[$counter]="local" - /bin/rm tmp.$$ - else - if test ! -f $jid.$$ - then - dirstatus[$counter]="local" - $RSH $i /bin/rm $DIR1/$jid.$$ - else - /bin/rm $jid.$$ - fi - fi - if test -f tmp.$$ - then - /bin/rm tmp.$$ - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - echo " ${dirstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${dirstatus[$counter]}" >> $jid.log - fi - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - fi - -# figure out if this is a compatible set of machines -# unless explicitly specified with flag -comp -# only perform the check if user subroutine is used -# or a user subroutine executable is used -# Myrinet does not support heterogeneous - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - if test $compatible = "unknown" - then - thisname=$ARCH - compatible=yes - counter=0 - echo "checking if machines are compatible for host" - if test "$deletelog" = no - then - echo "checking if machines are compatible for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]="yes" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - othername=`$RSH $i uname -a | cut -f 1 -d " "` - if test $thisname != $othername - then - compatible=no - compstatus[$counter]="no" - fi - fi - echo " ${compstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${compstatus[$counter]}" >> $jid.log - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - else - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]=$compatible - fi - done - if test $compatible = "no" - then - echo "all machines assumed incompatible" - if test "$deletelog" = no - then - echo "all machines assumed incompatible" >> $jid.log - fi - else - echo "all machines compatible" - if test "$deletelog" = no - then - echo "all machines compatible" >> $jid.log - fi - fi - fi -# error out if user objects or libraries are used on incompatible machines - if test "$compatible" = "no" -a -n "$objs" - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" - if test "$deletelog" = no - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log - fi - exit 1 - fi -# modify new host file if NFS mounted heterogeneous machine - doit= - if test $program = $prog.marc - then - doit=yes - fi - if test "$user" - then - doit=yes - fi - if test "$doit" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - $AWK -v hst=$i '{fnr++ ; \ -if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ -printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} - /bin/mv $jid.host{$$} $jid.host - host=$jid.host - fi - fi - done - fi - fi # if test $program = $prog.marc -o $user -o $obj - - else # if test $host - # assume shared memory machine if no hostfile given and - # MPITYPE is set to mpich or Myrinet - # check for Myrinet that the total number of processes is - # less than number of available user ports, 5 - if test $MPITYPE = "mpich" -o $MPITYPE = "scali" - then - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - host=$jid.host - elif test $MPITYPE = "myrinet" - then - if test $nprocd -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes " - echo "must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes " >> $jid.log - echo "must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - echo `hostname` $nprocd | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ - {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ -' >> ~/.gmpi/$jid.host - host=~/.gmpi/$jid.host - else - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - - fi - fi # if test myrinet - - fi # if test $host - - fi # if test $nprocd -gt 1 - -fi # if test $program = $exefile -o $program = $prog.marc - -############################################################################## -# construct run stream (Marc only) # -############################################################################## - -# set maximum message length for ddm to a large number -# for vendor provided mpi -if test $itree -eq 0 -a $MPITYPE = hardware -then - itree=100000000 - if test $MACHINENAME = SGI - then - itree=100000001 - fi -fi -if test $itree -eq 0 -a $MPITYPE = hpmpi -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = myrinet -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = nec -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = scali -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = intelmpi -then - itree=100000000 -fi -if test $nprocdddm -lt 2 -then - nprocdarg= -else - nprocdarg="$nprocdarg $nprocdddm" -fi -if test $nsolver -eq 0 -then - nsolverarg= -else - nsolverarg="$nsolverarg $nsolver" -fi -if test $nprocdddm -lt 2 -a $nsolver -eq 0 -then -nprocd=0 -fi -if test $nprocd -gt 0 -then - if test "$host" - then - if test -z "$RUN_JOB2" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then - RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" - RUN_JOB=" -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - numhost=`uniq $jid.mfile | wc -l` - if test "$INTELMPI_VERSION" = "HYDRA" - then - RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n $numhost -r $RSH -f $jid.mfile - RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" - fi - -# intelmpi uses configfile. format: -# -host host1 -n n1 executable marcargs -# one such line per host -# collect the marcargs in RUN_JOB and construct the config file later -# collect the run stream in RUN_JOB_TMP - RUN_JOB="-jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - - - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then - RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - if test "$userhost" - then - RUN_JOB="$RUN_JOB -mhost $userhost" - fi - if test $MPITYPE = "scali" - then -# set default working directory to /tmp to allow -# different directory names - SCAMPI_WORKING_DIRECTORY=/tmp - export SCAMPI_WORKING_DIRECTORY - fi - else - if test -z "$RUN_JOB1" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - RUNNPROCD=$nprocd - if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" - then - RUNNPROCD= - MP_PROCS=$nprocd - export MP_PROCS - fi - if test $MPITYPE = "myrinet" - then - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n 1 -f $jid.hosts - fi - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - fi -else - if test $nauto -gt 0 -o $ndcoup -gt 0 - then - RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - else -# this is for a serial job without auto restart: - RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi -fi -if test "$rid" -then - RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" -fi -if test "$pid" -then - RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" -fi -if test "$sid" -then - RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" -fi -if test "$did" -then - RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" -fi -if test "$vid" -then - RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" -fi -if test $nauto -gt 0 -then - RUN_JOB="$RUN_JOB -autorst $nauto " -fi -if test $ndcoup -gt 0 -then - RUN_JOB="$RUN_JOB -dcoup $ndcoup " -fi -if test $ndytran -gt 0 -then - RUN_JOB="$RUN_JOB -dytran $ndytran " -fi -if test $mesh -gt 0 -then - RUN_JOB="$RUN_JOB -me $mesh " -fi -if test $noutcore -gt 0 -then - RUN_JOB="$RUN_JOB -outcore $noutcore " -fi -if test "$dllrun" -gt 0 -then - RUN_JOB="$RUN_JOB -dll $dllrun " -fi -if test "$trkrun" -gt 0 -then - RUN_JOB="$RUN_JOB -trk $trkrun " -fi -if test "$iam" -then - RUN_JOB="$RUN_JOB -iam $iam " -fi -if test "$justlist" -then - RUN_JOB="$RUN_JOB -list 1 " -fi -if test "$feature" -then - RUN_JOB="$RUN_JOB -feature $feature " -fi -if test "$memlimit" -ne 0 -then - RUN_JOB="$RUN_JOB -ml $memlimit " -fi -if test "$cpinput" -then - RUN_JOB="$RUN_JOB -ci $cpinput " -fi -if test "$cpresults" -then - RUN_JOB="$RUN_JOB -cr $cpresults " -fi -if test "$DIRSCR" != "$DIRJOB" -then - RUN_JOB="$RUN_JOB -dirscr $DIRSCR" -else - DIRSCR=$DIRJOB -fi -if test "$makebdf" -then - RUN_JOB="$RUN_JOB -bdf $makebdf " -fi -if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" -then - # append $RUN_JOB to all lines of the host file - # and set RUN_JOB - $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ - /bin/mv $host.$$ $host - RUN_JOB=$RUN_JOB_TMP -fi -if test $MPITYPE = "intelmpi" -a "$host" -then - # construct config file, append $RUN_JOB to all lines of the config file - # and set RUN_JOB - if test "$INTELMPI_VERSION" = "HYDRA" - then - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - else - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-host %s -n %s",$1,$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - fi - RUN_JOB=$RUN_JOB_TMP -fi -echo " " -echo "Final run stream value" -echo " RUNJOB="$RUN_JOB -if test "$deletelog" = no -then -echo " " >> $jid.log -echo "Final run stream value" >> $jid.log -echo " RUNJOB="$RUN_JOB >> $jid.log -fi - - -############################################################################## -# run marc using valgrind # -############################################################################## -#RUN_JOB="valgrind $RUN_JOB" -#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" -############################################################################## - - -############################################################################## -# run the requested program in a queue # -############################################################################## - -if test "$deletelog" = yes -then - echo - date -else - echo >> $jid.log - date >> $jid.log -fi -if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] -then - -/bin/rm -f $jid.runmarcscript - - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - userobj=$usernoext.o - fi - cat > $jid.runmarcscript << END4 - if test "$user" - then - if test $MACHINENAME = "CRAY" - then - $DFORTHIGH $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTHIGH $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $MARCCUDALIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } -END4 -else - prgsav=yes -fi -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# - -cat >> $jid.runmarcscript << END5 - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -# first remove all .out files and incremental restart files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null - /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null -fi - -if test $nprocdddm -gt 1 -then - $RUN_JOB 2>>$jid.log -else - $RUN_JOB 2>>$jid.log -fi - -if test $dllrun -eq 0; then - if test $prgsav = no - then - /bin/rm -f $bd$program 2>/dev/null - fi -else - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes - then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -END5 - - -# Submit to marc batch queue -# -if [ $qid = at ] -then -QUENAME=at -SUBMCMD= -else -# -# Submit to qsub queue -# -QUENAME=qsub -SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" -if test "$priority" -then - SUBMCMD=$SUBMCMD" -p $priority" -fi -if test "$att" -then - SUBMCMD=$SUBMCMD" -a $att" -fi -if test "$cpu" -then - SUBMCMD=$SUBMCMD" -lt $cpu" -fi - -fi -echo $QUENAME $SUBMCMD -#cat $jid.runmarcscript -$QUENAME $SUBMCMD < $jid.runmarcscript - -/bin/rm -f $jid.runmarcscript - -############################################################################## -# run the requested program in the background # -############################################################################## - -else -if test $qid = background -then - -# -# first remove all old .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi -# -# compile user subroutine if present -# -( -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_h $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - echo " $PRODUCT Exit number 3" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTHIGH $user || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTHIGH $user -o $userobj || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - echo " $PRODUCT Exit number 3" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc - -# - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -$RUN_JOB & - -marcpid=$! -echo $marcpid > $DIRJOB/$jid.pid -wait $marcpid - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -) 1>>$jid.log 2>&1 & - - -############################################################################## -# run the requested program in the foreground # -############################################################################## - -else - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_h $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTHIGH $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTHIGH $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi -# first remove all .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi - -$RUN_JOB - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - if test "$host" - then - mpdcleanup -a -f $jid.mfile - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.mfile 2> /dev/null - else - mpdcleanup -a -f $jid.hosts - /bin/rm $jid.hosts 2> /dev/null - fi - fi - fi -fi - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi - - -fi -fi diff --git a/installation/mods_MarcMentat/2012/Marc_tools/run_damask_hmp b/installation/mods_MarcMentat/2012/Marc_tools/run_damask_hmp deleted file mode 100644 index 1d71a2944..000000000 --- a/installation/mods_MarcMentat/2012/Marc_tools/run_damask_hmp +++ /dev/null @@ -1,3690 +0,0 @@ -#!/bin/ksh -############################################################################## -# # -# run_marc - run a marc job # -# ------------------------- # -# # -# usage: run_marc -j jid { options } # -# # -# where standard options are: required: defaults: # -# -------------------------- # -# # -# -j* jid job id number. ** YES ** . # -# -pr* prog program name. . marc # -# -v* y|n do or do not verify inputs. . yes # -# -q* s|l|v|b|f batch queue name or background, . short # -# foreground. # -# -b* as alternative to option -q* # -# # -# ( batch queues only : # -# -pq* intra queue priority. . . # -# -at DATE/TIME delay start of job. . . # -# format : January,1,1990,12:31 # -# or : today,5pm # -# -cpu* secs job CPU limit . . ) # -# # -# -r* rid restart file job id. . . # -# -si* sid substructure file id. . . # -# -pi* post post file job id. . . # -# -de* did defaults file . no # -# -vf vid viewfactor . no # -# # -# -u* user user subroutine. . . # -# -obj obj user objects or libraries. . . # -# -sa* y|n do or do not save load module. . no # -# -autorst auto restart flag for auto forge . no # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo selects i4 or i8 version # -# default: i4 or via defaults file run_marc_defaults # -# the -mo option will override # -# -mpi selects MPI version # -# each platform has a default MPI version and some # -# have an alternative version. see the include file # -# for the respective platform # -# MPI_DEFAULT defines the default MPI version # -# MPI_OTHER defines versions one can switch to # -# -dcoup for contact decoupling # -# currently not supported # -# -dir directory where the job i/o should take place. # -# defaults to current directory. # -# -sdir directory where scratch files are created # -# defaults to current directory. # -# # -# -alloc only perform memory allocation test, no analysis # -# -list y only list options in the input file, no analysis # -# -fe num set feature number "num" for the run. only one allowed # -# -dytran flag to switch from Dytran to Marc # -# dytran = 0, program will run w/o Marc-Dytran Switch # -# = 1, program will restart Marc after Dytran run # -# >= 2, Not supported yet. # -# currently not supported # -# -ou force analysis to use out-of-core control # -# =0, not used # -# =1, element storage out-of-core # -# -dll run marc using shared library libmarc.so and exe_marc # -# =1, used # -# =2, do not free streaming input memory # -# =3, run with marc input deck # -# -trk run marc for post-tracking # -# -gpuid run marc using GPGPU capability # -# specify gpuid on to be used in the analysis. Multiple # -# IDs may be assigned for DDM runs. # -# Separate a list of IDs with a colon. Each DMP # -# process will be assigned a GPU ID in round robin fastion# -# = 0 # -# = 0:1 etc... # -# # -# where parallel options are: # -# -------------------------- # -# # -# itree, host, and comp options are available for the domain # -# decomposition only. # -# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # -# # -# # -# -nprocd number of domains. # -# defaults to single domain solution. # -# -nprocds number of domains if single input file. # -# defaults to single domain solution. # -# -nps same as -nprocds. # -# -nsolver number of solver tasks for solver types 12 and 13 # -# these are distributed tasks operating via MPI # -# -nthread number of solver threads for solver types 6, 8, and 11 # -# also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. if both specified, nthread option# -# will be used. # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by 6, 8, and 11 # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor nthread specified. # -# -itree message passing tree type for domain decomposition. # -# for debugging purposes; should not normally be used. # -# -host hostfile name for distributed execution on network. # -# defaults to no hostfile, unless jobid.defhost exists. # -# if jobid.defhost exists, only -np(s) necessary # -# -comp* y|n to be used with user routines on a network of # -# incompatible machines. # -# if set to no, a separate executable will be created # -# for each machine on the network. # -# if set to yes, the executable located on the machine # -# from which marc is started will be used on all machines.# -# defaults to no if O/S versions different on machines. # -# # -# -ci y|n copy input files to remote hosts (default: yes) # -# if "yes", input files are automatically copied to # -# remote hosts for a network run if necessary. # -# -cr y|n copy post files from remote hosts (default: yes) # -# if "yes", post files are automatically copied back from # -# remote hosts for a network run if necessary. # -############################################################################## -# set DIR to the directory in which this script is -REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" -DIR=`dirname $REALCOM` -# make sure DIR has an absolute path -case $DIR in - \/*) - ;; - *) - DIR=`pwd`/$DIR - ;; -esac -DIRSCRIPT=$DIR -AWK=awk -ARCH=`uname -a | cut -f 1 -d " "` -# Sun has a bad awk, use nawk instead -if test $ARCH = "SunOS" -then - AWK=nawk -fi -BASENAME=basename -# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists -if test $ARCH = "SunOS" -then - if test -x /usr/ucb/basename - then - BASENAME=/usr/ucb/basename - fi -fi - -# echo command line in the case of ECHO_COMMAND is true -if test "$ECHO_COMMAND" = true ; then - echo command "$0" "$@" -fi - -# -# "mode" selects version, i4 or i8 -# default is i4 -# this can be changed by a file run_marc_defaults -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MODE i8 -# it can also be set by the environmental variable MARC_INTEGER_SIZE -# and by the command line option "-mo" -# -mode= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -f $HOME/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -n "$MARC_INTEGER_SIZE" ; then - mode=$MARC_INTEGER_SIZE -fi -if test -z "$mode" ; then - mode=i4 -fi -case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "error, version mode must be i4 or i8" - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i4 or i8" - echo " " - echo " use -mo i4 or -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - setmode=true - fi - if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - fi - if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -done - -# set to i4 version for 32 bit Linux -if test "`uname -s`" = "Linux"; then - if test "`uname -m`" = "i686"; then - mode=i4 - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -fi - - -. "$DIR/getarch" - -# Change_me -. $MARC_INCLUDE -# - -# -# Dynamically determine the echo syntax -# - -case "`echo '\c'`" in - '\c') - ECHO='echo -n' - ECHOTXT=' ' - ;; - *) - ECHO='echo' - ECHOTXT=' \c' - ;; -esac - -# -# Variables for the MARC environment -# - -PRODUCT="Marc" -EXITMSG=$MARC_TOOLS/MESSAGES -export EXITMSG -FLEXDIR=$DIR/../flexlm/licenses -export FLEXDIR -TIMCHK=3600 -export TIMCHK -BINDIR=$MARC_BIN -export BINDIR -AFMATDAT=$MARC_RUNTIME/AF_flowmat/ -export AFMATDAT -# -# define directory path to global unified material database -# -MATFILE= -export MATFILE - -# -# define memory limit -# first set to MEMLIMIT from include -# -ml option overrules if specified -memlimit=$MEMLIMIT -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -# -if test $MACHINENAME = "HP" -then - SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH - export SHLIB_PATH -fi -# the one for IBM is defined futher down - -LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH -LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH -export LD_LIBRARY_PATH -export LD_LIBRARY64_PATH -export LD_LIBRARYN32_PATH - -atexit() { -kill -15 $$ -# -if test $MPITYPE = "myrinet" -then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi -fi -} - -trap "atexit" 2 - -# -# defaults -# - -prog=marc -exefile=marc -jid= -rid= -pid= -sid= -did= -vid= -user= -usersnoext= -objs= -qid=background -cpu= -priority= -att= -trk= -verify=yes -prgsav=no -rmdll=no -cpdll=no -progdll= -pathdll= -error= -nprocd=0 -nprocdddm=1 -nprocdddmprint= -icreated=0 -nprocdarg= -nsolver=0 -nsolverarg=-ns -if test $nprocds -then - if test $nprocds -gt 1 - then - nprocdddm=$nprocds - nprocdddmprint=$nprocds - icreated=1 - nprocdarg=-nprocds - fi -fi -nthread=-1 -gpuids= -nauto=0 -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -nthreadprint=0 -itree=0 -iam= -link= -trkrun=0 -DIRJOB=`pwd` -DIRSCR=$DIRJOB -DIRSCRSET= -autoforge=0 -dotdat=.dat -dotdefhost=.defhost -host= -numhost= -mfile= -userhost= -makebdf= -cpinput=yes -cpresults=yes -marcdll=libmarc.$EXT_DLL -# define hostname and strip off extensions (alpha.aaa.com) -thishost=`hostname` -thishost=${thishost%%.*} -compatible=unknown -numfield=1 -justlist= -feature= -mpioption=false -MDSRCLIB=$MARC_LIB/mdsrc.a -# -# check run_marc_defaults file for default MPI setting -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MPI -# -value= -file= -if test -f $DIRSCRIPT/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$DIRSCRIPT/run_marc_defaults - fi -fi -if test -f $HOME/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$HOME/run_marc_defaults - fi -fi -if test -n "$value"; then - MARC_MPITYPE=$value - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - echo " " - echo " error, incorrect option for MARC_MPI" - echo " defined in $file: $MARC_MPITYPE" - echo " valid options: $MPI_DEFAULT $MPI_OTHER" - echo " " - exit - fi - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - fi -fi -# -# -# allow scratch directory to be specified with environmental variable -# MARCSCRATCH -if test $MARCSCRATCH -then - if test -d $MARCSCRATCH - then - DIRSCR=$MARCSCRATCH - else - echo "error, scratch directory '$MARCSCRATCH'" - echo " specified via environmental variable MARCSCRATCH does not exist" - exit - fi -fi -# -############################################################################## -# parse input - arguments always come in pairs # -############################################################################## - -arg=$1 -if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - shift - arg=$1 -fi -while [ -n "$arg" ] -do - shift - value=$1 - case $arg in - -al* | -AL*) - LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - $MARC_BIN/marc -alloc 1 - exit - ;; - -li* | -LI*) - justlist=yes - ;; - -fe* | -FE*) - feature=$value - ;; - -pr* | -PR*) - if test `dirname $value` = '.' - then - prog=`$BASENAME $value .marc` - progdll=`$BASENAME $value` - else - prog=`dirname $value`/`$BASENAME $value .marc` - progdll=`dirname $value`/`$BASENAME $value` - fi - prdir=`dirname $value` - case $prdir in - \/*) - ;; - *) - prog=`pwd`/$prdir/$prog - ;; - esac - ;; - -j* | -J*) - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - ;; - -r* | -R*) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - -si* | -SI*) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - -pi* | -PI*) - if test -f $value.t19 - then - pid=`$BASENAME $value .t19` - else - pid=`$BASENAME $value .t16` - fi - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - -bdf | -BDF) - makebdf=1 - ;; - -de* | -DE*) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - -vf | -VF) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - -u* | -U*) - - user=$value - - - - - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - -obj | -OBJ) - objs="$value" - ;; - -q* | -Q*) - qid=$value - ;; - -b* | -B*) - case $value in - y* | Y*) - qid=background - ;; - n* | N*) - qid=foreground - ;; - *) - ;; - esac - ;; - -at | -AT) - att=$value - ;; - -cpu* | -CPU*) - cpu=$value - ;; - -pq | -PQ*) - priority=$value - ;; - -v* | -V*) - verify=$value - ;; - -sa* | -SA*) - prgsav=$value - ;; - -np* | -NP*) - nprocdddm=$value - nprocdddmprint=$value - case $arg in - -nps* | -NPS* | -nprocds* | -NPROCDS*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - case $arg in - -np | -NP | -nprocd | -NPROCD) - icreated=0 - nprocdarg=-nprocd - ;; - esac - ;; - -ns* | -NS*) - nsolver=$value - ;; - -nt* | -NT*) - nthread=$value - ;; - -gp* | -GP*) - gpuids=$value - ;; - -it* | -IT*) - itree=$value - ;; - -iam | -IAM) - iam=$value - ;; - -au* | -AU*) - nauto=$value - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -me | -ME ) - mesh=$value - ;; - -ml | -ML ) - memlimit=$value - ;; - -mo | -MO ) - ;; - -mpi | -MPI ) - mpioption=true - MARC_MPITYPE=$value - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - fi - fi - ;; - -dir* | -DIR*) - DIRJOB=$value - case $DIRJOB in - \/*) - ;; - *) - DIRJOB=`pwd`/$DIRJOB - ;; - esac - if test -z "$DIRSCRSET" - then - DIRSCR=$DIRJOB - fi - ;; - -sd* | -SD*) - DIRSCR=$value - DIRSCRSET=yes - case $DIRSCR in - \/*) - ;; - *) - DIRSCR=`pwd`/$DIRSCR - ;; - esac - ;; - -ho* | -HO*) - host=$value - ;; - -co* | -CO*) - compatible=$value - ;; - -ci* | -CI*) - cpinput=$value - ;; - -cr* | -CR*) - cpresults=$value - ;; - *) - error="$error -$arg: invalid option" - break - ;; - esac - case $value in - -*) - error="$error -$arg: invalid name $value" - break - ;; - esac - shift - arg=$1 - if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - shift - arg=$1 - fi -done -argc=`expr $# % 2` -if test $argc -eq 1 -then -# -# odd number of arguments -# - error="$error -argument list incomplete" -fi - -if test $nprocdddm -gt 0 -then -nprocd=$nprocdddm -fi - -if test $nsolver -gt 0 -then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi -fi - -if test $nthread -eq -1 -then -nthread=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nthread -lt 0 -then -nthread=0 -fi - -nthreadprint=$nthread -if test $nthreadprint -eq 0 -then -nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi -fi - -nthread=$nthreadprint - -gpuoption= -if test "$gpuids" = "" ; then - gpuoption= -else - gpuoption="-gp $gpuids" -fi - -if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH -else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH -# Linux 64 + HPMPI, Below code is taken from include_linux64 - if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - fi -fi - -if test $nprocd -gt 1; then - if test -f $jid$dotdefhost; then - if test "$host" = ""; then - host=$jid$dotdefhost - fi - fi - if test -f hostfile_qa_$nprocd; then - if test "$host" = ""; then - host=hostfile_qa_$nprocd - fi - fi -fi - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then - dotdat=.inp - fi - - if test "$progdll"; then - /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll - rmdll=yes - pathdll=yes - progdll=${progdll}_$marcdll - else - progdll=$marcdll - fi - - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - pathdll=yes - fi -fi - -############################################################################## -# check parameter validity # -############################################################################## - -while test forever; do - -# -# check for input file existence -# -if test $nprocdddm -gt 1 -a $icreated -eq 0; then - if test ! -f $DIRJID/1$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/1$jid$dotdat not accessible" - fi - fi -else - if test ! -f $DIRJID/$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/$jid$dotdat not accessible" - fi - fi -fi - if test $nprocd -gt 1; then - if test "$host" ; then - if test ! -f $host; then - error="$error -host name file $host not accessible" - fi - fi - fi - -# -# check if the job is already running in the background -# -if test -f $DIRJOB/$jid.pid; then - error="$error -job is already running (the file $jid.pid exists)" -fi - -# -# if the program name is other than marc, then -# assume that this is a program in the users local directory -# - -bd=$MARC_BIN/ - -case $prog in - marc | MARC | $exefile) - program=$exefile - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - if test ! -f $user - then - error="$error -user subroutine file $user not accessible" - fi - fi - if test "$objs" - then - missingobjs= - for o in $objs - do - if test ! -f "$o" - then - if test -z "$missingobjs" - then - missingobjs="$o" - else - missingobjs="$missingobjs $o" - fi - fi - done - if test -n "$missingobjs" - then - error="$error -user object/library file(s) $missingobjs not accessible" - fi - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$vid" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRVID/1$vid.vfs - then - error="$error -view factor file $DIRVID/1$vid.vfs not accessible" - fi - else - if test ! -f $DIRVID/$vid.vfs - then - error="$error -view factor file $DIRVID/$vid.vfs not accessible" - fi - fi - fi - if $mpioption - then - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" - fi - fi - ;; - *) - program=$prog.marc - case $prog in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - error="$error -program option may not be used with user subroutine" - fi - if test "$objs" - then - error="$error -program option may not be used with user objects or libraries" - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$nauto" - then - if test $nauto -gt 2 - then - error="$error -incorrect option for auto restart " - fi - fi - if test "$ndcoup" - then - if test $ndcoup -gt 3 - then - error="$error -incorrect option for contact decoupling " - fi - fi - if test "$ndytran" - then - if test $ndytran -gt 1 - then - error="$error -incorrect option for Marc-Dytran Switch " - fi - fi - if $mpioption - then - if test ! -x $MARC_BIN/$exefile - then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE " - fi - fi - ;; -esac - -############################################################################## -# check argument integrity # -############################################################################## - -if test "$jid" -then - : -else - error="$error -job id required" -fi - -if test $nprocd -gt 1 -then - if test $nauto -gt 0 - then - error="$error -cannot run DDM job with auto restart (-au) option " - fi -fi -case $qid in - S* | s*) - qid=short - ;; - L* | l*) - qid=long - ;; - V* | v*) - qid=verylong - ;; - B* | b*) - qid=background - ;; - F* | f*) - qid=foreground - ;; - A* | a*) - qid=at - ;; - *) - error="$error -bad value for queue_id option" - ;; -esac - -case $prgsav in - N* | n*) - prgsav=no - ;; - Y* | y*) - prgsav=yes - ;; - *) - error="$error -bad value for save option" - ;; -esac - -case $verify in - N* | n*) - verify=no - ;; - Y* | y*) - verify=yes - ;; - *) - error="$error -bad value for verify option" - ;; -esac - -case $nprocdddm in - -* ) - error="$error -bad value for nprocd option" - ;; -esac - -case $nthread in - -* ) - error="$error -bad value for nthread option" - ;; -esac - -case $itree in - -* ) - error="$error -bad value for itree option" - ;; -esac -case $iam in - -* ) - error="$error -bad value for iam option" - ;; -esac -case $compatible in - N* | n*) - compatible=no - ;; - Y* | y*) - compatible=yes - ;; - unknown) - ;; - *) - error="$error -bad value for comp option" - ;; -esac -case $cpinput in - N* | n*) - cpinput=no - ;; - Y* | y*) - cpinput=yes - ;; - *) - error="$error -bad value for copy input option" - ;; -esac -case $cpresults in - N* | n*) - cpresults=no - ;; - Y* | y*) - cpresults=yes - ;; - *) - error="$error -bad value for copy results option" - ;; -esac - -# -# check for external file to run -# -if test -f $MARC_TOOLS/run_marc_check -then - . $MARC_TOOLS/run_marc_check -fi - -# -# pick up version data from bin/VERSION if it exists -# -if test -f $MARC_BIN/VERSION; then - ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` - if test -n "$ppp" ;then - PRODUCT=$ppp - fi - ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` - if test -n "$ppp" ;then - REVISION=", Build $ppp" - fi -fi -############################################################################## -# interact with the user to get the required information to run marc or # -# other marc system program # -############################################################################## - -deletelog=yes -if test $qid = background -a $verify = no -then -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto " > $jid.log -deletelog=no -fi -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto" - - -case $qid in - s* | S* | l* | L* | v* | V* ) - echo \ -"Queue priority : $priority -Queue CPU limit : $cpu -Queue start time : $att" - ;; -# * ) -# echo \ -#" " -# ;; -esac - -if test "$error" -then - if test $verify = yes - then - $ECHO "$error - -Please correct or quit(correct,quit,): $ECHOTXT" - error= - read answer - case $answer in - q* | Q*) - answer=quit - ;; - *) - answer=correct - ;; - esac - else - $ECHO "$error - $ECHOTXT" - echo " " - if test "$deletelog" = no - then - $ECHO "$error - $ECHOTXT" >> $jid.log - echo " " >> $jid.log - fi - answer=quit - fi -else - if test $verify = yes - then - $ECHO " -Are these parameters correct (yes,no,quit,)? $ECHOTXT" - read answer - case $answer in - q* | Q*) - answer=quit - ;; - y* | Y*) - answer=yes - ;; - *) - answer=no - ;; - esac - else - answer=yes - fi -fi - -case $answer in - no | correct) - -############################################################################## -# prompt for each value # -############################################################################## - - $ECHO " -Program name ($prog)? $ECHOTXT" - read value - if test "$value" - then - prog=$value - fi - $ECHO "Job ID ($jid)? $ECHOTXT" - read value - if test "$value" - then - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - fi - $ECHO "User subroutine name ($user)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - user= - ;; - *) - user=$value - - - - - - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - esac - fi - $ECHO "User objects or libraries ($objs)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - objs= - ;; - *) - objs="$value" - ;; - esac - fi - $ECHO "Restart File Job ID ($rid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - rid= - ;; - *) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - esac - fi - $ECHO "Substructure File ID ($sid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - sid= - ;; - *) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - esac - fi - $ECHO "Post File Job ID ($pid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - pid= - ;; - *) - pid=$value - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - esac - fi - $ECHO "Defaults File ID ($did)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - did= - ;; - *) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - esac - fi - $ECHO "View Factor File ID ($vid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - vid= - ;; - *) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - esac - fi - $ECHO "Save generated module ($prgsav)? $ECHOTXT" - read value - if test "$value" - then - prgsav=$value - fi - $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" - read value - if test "$value" - then - nprocdddm=$value - nprocdddmprint=$value - fi - $ECHO "Run on ($nthread) threads ? $ECHOTXT" - read value - if test "$value" - then - nthread=$value - fi - $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" - read value - if test "$value" - then - nsolver=$value - fi -# - if test $nprocdddm -gt 0 - then - nprocd=$nprocdddm - fi - if test $nsolver -gt 0 - then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi - fi - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - nthreadprint=$nthread - if test $nthreadprint -eq 0 - then - nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi - fi -# - $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" - read value - if test "$value" - then - gpuids=$value - fi - if test "$gpuids" = "" ; then - gpuoption= - else - gpuoption="-gp $gpuids" - fi - if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH - if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - fi - fi -# - if test $nprocd -gt 1 - then - $ECHO "Message passing type ($itree)? $ECHOTXT" - read value - if test "$value" - then - itree=$value - fi - $ECHO "Host file name ($host)? $ECHOTXT" - read value - if test "$value" - then - host=$value - fi - if test $nprocdddm -gt 1 - then - $ECHO "Single input file? $ECHOTXT" - read value - case $value in - y* | Y*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" - read value - if test "$value" - then - compatible=$value - fi - $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" - read value - if test "$value" - then - cpinput=$value - fi - $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" - read value - if test "$value" - then - cpresults=$value - fi - fi - fi - $ECHO "Run the job in the queue ($qid)? $ECHOTXT" - read value - if test "$value" - then - qid=$value - fi - case $qid in - s* | S* | l* | L* | v* | V* ) - $ECHO "Queue priority ($priority)? $ECHOTXT" - read value - if test "$value" - then - priority=$value - fi - $ECHO "Job starts at ($att)? $ECHOTXT" - read value - if test "$value" - then - att=$value - fi - $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" - read value - if test "$value" - then - cpu=$value - fi - ;; - * ) - ;; - esac - $ECHO "Auto Restart option ($nauto)? $ECHOTXT" - read value - if test "$value" - then - nauto=$value - fi - $ECHO "Run directory ($DIRJOB)? $ECHOTXT" - read value - if test "$value" - then - DIRJOB=$value - DIRSCR=$DIRJOB - fi - $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" - read value - if test "$value" - then - DIRSCR=$value - fi - ;; - quit) - exit 1 - ;; - *) - break - ;; - -esac - - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - -done - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - pathdll=yes - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - fi - - if test "$pathdll"; then -# -# reset share lib path -# - if test $MACHINENAME = "HP" - then - SHLIB_PATH=$DIRJOB:$SHLIB_PATH - export SHLIB_PATH - fi - if test $MACHINENAME = "IBM" - then - LIBPATH=$DIRJOB:$LIBPATH - export LIBPATH - fi -# - LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH - LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH - LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH - export LD_LIBRARY_PATH - export LD_LIBRARY64_PATH - export LD_LIBRARYN32_PATH - fi -fi -# end of dllrun>0 - - -if test $program = $exefile -o $program = $prog.marc -then - -# delete the old .log file unless we run in the background -if test "$deletelog" = yes -then - /bin/rm $jid.log 2>/dev/null -else - echo - echo running the job in the background, see $jid.log - echo -fi - -# -# check if this is an autoforge or rezoning or radiation job -# -if test $nprocd -eq 1 -then - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` - if test "$line" - then - autoforge=1 - fi -fi -# -# check that jobname for restarted run is not the same -# as restart file basename -# -if test "$rid" -then - if test "$jid" = "$rid" - then - echo " " - echo "ERROR: job name of current run is the same as job name" - echo " of the restarted job" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "ERROR: job name of current run is the same as job name" >> $jid.log - echo " of the restarted job" >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi -fi - -# -# user objects/libraries used -# - - if test "$objs" - then - program="$DIRJOB/$jid.marc" - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# user subroutine used -# -# add DAMASK options for linking - DAMASK="" - - if test "$user" - then - program=$usernoext.marc - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# Special case for IBM using POE but not an SP machine -# in this case we always need a host file, also for serial jobs. -# -if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP -then - MP_HOSTFILE=${jid}.host - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $nprocd -gt 1 - then - numdom=$nprocd - while test $numdom -gt 0 - do - hostname -s >> $MP_HOSTFILE - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - else - hostname -s > $MP_HOSTFILE - fi -fi -# -# check correctness of host file; fix for user sub -# - if test $nprocd -gt 1 - then - -# construct the path name to the executable (execpath) - execpath=$MARC_BIN/$exefile - usersub=0 - if test $program = $prog.marc - then - execpath=$prog.marc - usersub=1 - fi - if test "$objs" - then - execpath="$DIRJOB/$jid.marc" - usersub=1 - fi - if test "$user" - then - execpath=$usernoext.marc - usersub=1 - fi - export execpath - execname=`$BASENAME $execpath` - - if test "$host" - then - userhost=$host - case $userhost in - \/* | \.\/*) - ;; - *) - userhost=`pwd`/$userhost - ;; - esac - -# check that the number of processes specified in the hostfile is -# equal to nprocd specified by -nprocd. - numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` - if test $nprocd -ne $numproc - then - echo " " - echo "error, the number of processes specified in the host file" - echo "must be equal to the number of processes given by -nprocd/-nsolver" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, the number of processes specified in the host file" >> $jid.log - echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - -# check for Myrinet that the number of processes per host is -# less than number of available user ports, 5 -# .gmpi directory must exist in user's home directory -# and must have write permission from remote hosts - if test $MPITYPE = "myrinet" - then - numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` - if test $numproc -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes specified " - echo "in the hostfile must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes specified " >> $jid.log - echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - if test ! -d ~/.gmpi - then - echo " " - echo "error, for Myrinet a .gmpi directory must exist " - echo "under the user's home directory" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log - echo "under the user's home directory" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - homedir=`echo ~` - for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - echo " " - echo "error, for Myrinet a shared .gmpi directory must exist " - echo "under the user's home directory " - echo "with remote write permission" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log - echo "under the user's home directory " >> $jid.log - echo "with remote write permission" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - /bin/rm tmp.$$ - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - fi - fi - done - fi - fi - -# construct the host file $jid.host which is used by mpirun -# skip lines starting with # and only consider lines with more than -# one word in them. Note that the hostfile given to this script -# has two columns: the host name and the number of shared processes -# to run on this host. mpirun wants the number of _other_ -# processes to run in addition to the one being run on the machine -# on which the job is started. hence the $2-1 for fnr == 1. - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then -# HPMPI or HP hardware MPI - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ - -v mpihpspecial="$MPIHPSPECIAL" \ -'{if ( NF > 0) {\ - fnr++ ; \ - printf("-h %s -np %s",$1,$2); \ - printf(" %s",mpihpspecial); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ - if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ - }\ - }' > $jid.host -# end HPMPI or HP hardware MPI - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then -# IBM using hardware MPI (POE) - MP_HOSTFILE=$jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host -# end IBM using hardware MPI (POE) -# for Intel MPI, need to create a machinefile for DMP - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then -# Intel MPI - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - /bin/cp $host $jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Intel MPI for DMP -# for Solaris HPC 7.1, need to create a machinefile for DMP - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then -# Solaris HPC 7.1 - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Solaris HPC 7.1 for DMP -# for Myrinet, construct a configuration file in ~/.gmpi -# this must be readable by each process -# format is (hostname) (port number) for each process - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - grep -v '^#' $host | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ -{if ( NF > 0 ) \ - for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ -}' >> ~/.gmpi/$jid.host - else -# this is for mpich-1.2.5 and later, using the -pg option -# format: host nproc executable user arguments -# the arguments are added later - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s %s\n",path,user);\ - if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ - }\ - }' > $jid.host - fi -# end Myrinet - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then -# Compaq MPI via Memory Channel - grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host -# end Compaq MPI - else -# MPICH - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ - }\ - }' > $jid.host - fi -# define the variable host and host_filt -# host_filt is used for loops over hosts -# for Myrinet we need to use a filtered variant of userhost -# for others we can use $host - if test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - host=~/.gmpi/$jid.host - host_filt=$jid.host_tMp - grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt - else - host=$jid.host - host_filt=$host - fi - else - host=$jid.host - host_filt=$host - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - host_filt=$jid.mfile - fi - fi -# figure out if the machines in the hostfile are nfs mounted -# or distributed and set the variable "dirstatus" accordingly. -# only perform the check if user subroutine is used -# or a user subroutine executable is used - - numfield=1 - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - numfield=2 - fi - DIR1=$DIRJOB - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - counter=0 - echo " " - echo "checking if local or shared directories for host" - if test "$deletelog" = no - then - echo "checking if local or shared directories for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - dirstatus[$counter]="shared" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - dirstatus[$counter]="local" - /bin/rm tmp.$$ - else - if test ! -f $jid.$$ - then - dirstatus[$counter]="local" - $RSH $i /bin/rm $DIR1/$jid.$$ - else - /bin/rm $jid.$$ - fi - fi - if test -f tmp.$$ - then - /bin/rm tmp.$$ - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - echo " ${dirstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${dirstatus[$counter]}" >> $jid.log - fi - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - fi - -# figure out if this is a compatible set of machines -# unless explicitly specified with flag -comp -# only perform the check if user subroutine is used -# or a user subroutine executable is used -# Myrinet does not support heterogeneous - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - if test $compatible = "unknown" - then - thisname=$ARCH - compatible=yes - counter=0 - echo "checking if machines are compatible for host" - if test "$deletelog" = no - then - echo "checking if machines are compatible for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]="yes" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - othername=`$RSH $i uname -a | cut -f 1 -d " "` - if test $thisname != $othername - then - compatible=no - compstatus[$counter]="no" - fi - fi - echo " ${compstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${compstatus[$counter]}" >> $jid.log - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - else - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]=$compatible - fi - done - if test $compatible = "no" - then - echo "all machines assumed incompatible" - if test "$deletelog" = no - then - echo "all machines assumed incompatible" >> $jid.log - fi - else - echo "all machines compatible" - if test "$deletelog" = no - then - echo "all machines compatible" >> $jid.log - fi - fi - fi -# error out if user objects or libraries are used on incompatible machines - if test "$compatible" = "no" -a -n "$objs" - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" - if test "$deletelog" = no - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log - fi - exit 1 - fi -# modify new host file if NFS mounted heterogeneous machine - doit= - if test $program = $prog.marc - then - doit=yes - fi - if test "$user" - then - doit=yes - fi - if test "$doit" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - $AWK -v hst=$i '{fnr++ ; \ -if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ -printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} - /bin/mv $jid.host{$$} $jid.host - host=$jid.host - fi - fi - done - fi - fi # if test $program = $prog.marc -o $user -o $obj - - else # if test $host - # assume shared memory machine if no hostfile given and - # MPITYPE is set to mpich or Myrinet - # check for Myrinet that the total number of processes is - # less than number of available user ports, 5 - if test $MPITYPE = "mpich" -o $MPITYPE = "scali" - then - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - host=$jid.host - elif test $MPITYPE = "myrinet" - then - if test $nprocd -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes " - echo "must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes " >> $jid.log - echo "must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - echo `hostname` $nprocd | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ - {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ -' >> ~/.gmpi/$jid.host - host=~/.gmpi/$jid.host - else - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - - fi - fi # if test myrinet - - fi # if test $host - - fi # if test $nprocd -gt 1 - -fi # if test $program = $exefile -o $program = $prog.marc - -############################################################################## -# construct run stream (Marc only) # -############################################################################## - -# set maximum message length for ddm to a large number -# for vendor provided mpi -if test $itree -eq 0 -a $MPITYPE = hardware -then - itree=100000000 - if test $MACHINENAME = SGI - then - itree=100000001 - fi -fi -if test $itree -eq 0 -a $MPITYPE = hpmpi -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = myrinet -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = nec -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = scali -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = intelmpi -then - itree=100000000 -fi -if test $nprocdddm -lt 2 -then - nprocdarg= -else - nprocdarg="$nprocdarg $nprocdddm" -fi -if test $nsolver -eq 0 -then - nsolverarg= -else - nsolverarg="$nsolverarg $nsolver" -fi -if test $nprocdddm -lt 2 -a $nsolver -eq 0 -then -nprocd=0 -fi -if test $nprocd -gt 0 -then - if test "$host" - then - if test -z "$RUN_JOB2" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then - RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" - RUN_JOB=" -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - numhost=`uniq $jid.mfile | wc -l` - if test "$INTELMPI_VERSION" = "HYDRA" - then - RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n $numhost -r $RSH -f $jid.mfile - RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" - fi - -# intelmpi uses configfile. format: -# -host host1 -n n1 executable marcargs -# one such line per host -# collect the marcargs in RUN_JOB and construct the config file later -# collect the run stream in RUN_JOB_TMP - RUN_JOB="-jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - - - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then - RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - if test "$userhost" - then - RUN_JOB="$RUN_JOB -mhost $userhost" - fi - if test $MPITYPE = "scali" - then -# set default working directory to /tmp to allow -# different directory names - SCAMPI_WORKING_DIRECTORY=/tmp - export SCAMPI_WORKING_DIRECTORY - fi - else - if test -z "$RUN_JOB1" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - RUNNPROCD=$nprocd - if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" - then - RUNNPROCD= - MP_PROCS=$nprocd - export MP_PROCS - fi - if test $MPITYPE = "myrinet" - then - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n 1 -f $jid.hosts - fi - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - fi -else - if test $nauto -gt 0 -o $ndcoup -gt 0 - then - RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - else -# this is for a serial job without auto restart: - RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi -fi -if test "$rid" -then - RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" -fi -if test "$pid" -then - RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" -fi -if test "$sid" -then - RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" -fi -if test "$did" -then - RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" -fi -if test "$vid" -then - RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" -fi -if test $nauto -gt 0 -then - RUN_JOB="$RUN_JOB -autorst $nauto " -fi -if test $ndcoup -gt 0 -then - RUN_JOB="$RUN_JOB -dcoup $ndcoup " -fi -if test $ndytran -gt 0 -then - RUN_JOB="$RUN_JOB -dytran $ndytran " -fi -if test $mesh -gt 0 -then - RUN_JOB="$RUN_JOB -me $mesh " -fi -if test $noutcore -gt 0 -then - RUN_JOB="$RUN_JOB -outcore $noutcore " -fi -if test "$dllrun" -gt 0 -then - RUN_JOB="$RUN_JOB -dll $dllrun " -fi -if test "$trkrun" -gt 0 -then - RUN_JOB="$RUN_JOB -trk $trkrun " -fi -if test "$iam" -then - RUN_JOB="$RUN_JOB -iam $iam " -fi -if test "$justlist" -then - RUN_JOB="$RUN_JOB -list 1 " -fi -if test "$feature" -then - RUN_JOB="$RUN_JOB -feature $feature " -fi -if test "$memlimit" -ne 0 -then - RUN_JOB="$RUN_JOB -ml $memlimit " -fi -if test "$cpinput" -then - RUN_JOB="$RUN_JOB -ci $cpinput " -fi -if test "$cpresults" -then - RUN_JOB="$RUN_JOB -cr $cpresults " -fi -if test "$DIRSCR" != "$DIRJOB" -then - RUN_JOB="$RUN_JOB -dirscr $DIRSCR" -else - DIRSCR=$DIRJOB -fi -if test "$makebdf" -then - RUN_JOB="$RUN_JOB -bdf $makebdf " -fi -if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" -then - # append $RUN_JOB to all lines of the host file - # and set RUN_JOB - $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ - /bin/mv $host.$$ $host - RUN_JOB=$RUN_JOB_TMP -fi -if test $MPITYPE = "intelmpi" -a "$host" -then - # construct config file, append $RUN_JOB to all lines of the config file - # and set RUN_JOB - if test "$INTELMPI_VERSION" = "HYDRA" - then - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - else - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-host %s -n %s",$1,$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - fi - RUN_JOB=$RUN_JOB_TMP -fi -echo " " -echo "Final run stream value" -echo " RUNJOB="$RUN_JOB -if test "$deletelog" = no -then -echo " " >> $jid.log -echo "Final run stream value" >> $jid.log -echo " RUNJOB="$RUN_JOB >> $jid.log -fi - - -############################################################################## -# run marc using valgrind # -############################################################################## -#RUN_JOB="valgrind $RUN_JOB" -#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" -############################################################################## - - -############################################################################## -# run the requested program in a queue # -############################################################################## - -if test "$deletelog" = yes -then - echo - date -else - echo >> $jid.log - date >> $jid.log -fi -if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] -then - -/bin/rm -f $jid.runmarcscript - - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - userobj=$usernoext.o - fi - cat > $jid.runmarcscript << END4 - if test "$user" - then - if test $MACHINENAME = "CRAY" - then - $DFORTHIGHMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTHIGHMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $MARCCUDALIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } -END4 -else - prgsav=yes -fi -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# - -cat >> $jid.runmarcscript << END5 - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -# first remove all .out files and incremental restart files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null - /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null -fi - -if test $nprocdddm -gt 1 -then - $RUN_JOB 2>>$jid.log -else - $RUN_JOB 2>>$jid.log -fi - -if test $dllrun -eq 0; then - if test $prgsav = no - then - /bin/rm -f $bd$program 2>/dev/null - fi -else - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes - then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -END5 - - -# Submit to marc batch queue -# -if [ $qid = at ] -then -QUENAME=at -SUBMCMD= -else -# -# Submit to qsub queue -# -QUENAME=qsub -SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" -if test "$priority" -then - SUBMCMD=$SUBMCMD" -p $priority" -fi -if test "$att" -then - SUBMCMD=$SUBMCMD" -a $att" -fi -if test "$cpu" -then - SUBMCMD=$SUBMCMD" -lt $cpu" -fi - -fi -echo $QUENAME $SUBMCMD -#cat $jid.runmarcscript -$QUENAME $SUBMCMD < $jid.runmarcscript - -/bin/rm -f $jid.runmarcscript - -############################################################################## -# run the requested program in the background # -############################################################################## - -else -if test $qid = background -then - -# -# first remove all old .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi -# -# compile user subroutine if present -# -( -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_hmp $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - echo " $PRODUCT Exit number 3" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTHIGHMP $user || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTHIGHMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - echo " $PRODUCT Exit number 3" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc - -# - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -$RUN_JOB & - -marcpid=$! -echo $marcpid > $DIRJOB/$jid.pid -wait $marcpid - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -) 1>>$jid.log 2>&1 & - - -############################################################################## -# run the requested program in the foreground # -############################################################################## - -else - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_hmp $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTHIGHMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTHIGHMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi -# first remove all .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi - -$RUN_JOB - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - if test "$host" - then - mpdcleanup -a -f $jid.mfile - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.mfile 2> /dev/null - else - mpdcleanup -a -f $jid.hosts - /bin/rm $jid.hosts 2> /dev/null - fi - fi - fi -fi - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi - - -fi -fi diff --git a/installation/mods_MarcMentat/2012/Marc_tools/run_damask_l b/installation/mods_MarcMentat/2012/Marc_tools/run_damask_l deleted file mode 100644 index 1f59b49ce..000000000 --- a/installation/mods_MarcMentat/2012/Marc_tools/run_damask_l +++ /dev/null @@ -1,3690 +0,0 @@ -#!/bin/ksh -############################################################################## -# # -# run_marc - run a marc job # -# ------------------------- # -# # -# usage: run_marc -j jid { options } # -# # -# where standard options are: required: defaults: # -# -------------------------- # -# # -# -j* jid job id number. ** YES ** . # -# -pr* prog program name. . marc # -# -v* y|n do or do not verify inputs. . yes # -# -q* s|l|v|b|f batch queue name or background, . short # -# foreground. # -# -b* as alternative to option -q* # -# # -# ( batch queues only : # -# -pq* intra queue priority. . . # -# -at DATE/TIME delay start of job. . . # -# format : January,1,1990,12:31 # -# or : today,5pm # -# -cpu* secs job CPU limit . . ) # -# # -# -r* rid restart file job id. . . # -# -si* sid substructure file id. . . # -# -pi* post post file job id. . . # -# -de* did defaults file . no # -# -vf vid viewfactor . no # -# # -# -u* user user subroutine. . . # -# -obj obj user objects or libraries. . . # -# -sa* y|n do or do not save load module. . no # -# -autorst auto restart flag for auto forge . no # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo selects i4 or i8 version # -# default: i4 or via defaults file run_marc_defaults # -# the -mo option will override # -# -mpi selects MPI version # -# each platform has a default MPI version and some # -# have an alternative version. see the include file # -# for the respective platform # -# MPI_DEFAULT defines the default MPI version # -# MPI_OTHER defines versions one can switch to # -# -dcoup for contact decoupling # -# currently not supported # -# -dir directory where the job i/o should take place. # -# defaults to current directory. # -# -sdir directory where scratch files are created # -# defaults to current directory. # -# # -# -alloc only perform memory allocation test, no analysis # -# -list y only list options in the input file, no analysis # -# -fe num set feature number "num" for the run. only one allowed # -# -dytran flag to switch from Dytran to Marc # -# dytran = 0, program will run w/o Marc-Dytran Switch # -# = 1, program will restart Marc after Dytran run # -# >= 2, Not supported yet. # -# currently not supported # -# -ou force analysis to use out-of-core control # -# =0, not used # -# =1, element storage out-of-core # -# -dll run marc using shared library libmarc.so and exe_marc # -# =1, used # -# =2, do not free streaming input memory # -# =3, run with marc input deck # -# -trk run marc for post-tracking # -# -gpuid run marc using GPGPU capability # -# specify gpuid on to be used in the analysis. Multiple # -# IDs may be assigned for DDM runs. # -# Separate a list of IDs with a colon. Each DMP # -# process will be assigned a GPU ID in round robin fastion# -# = 0 # -# = 0:1 etc... # -# # -# where parallel options are: # -# -------------------------- # -# # -# itree, host, and comp options are available for the domain # -# decomposition only. # -# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # -# # -# # -# -nprocd number of domains. # -# defaults to single domain solution. # -# -nprocds number of domains if single input file. # -# defaults to single domain solution. # -# -nps same as -nprocds. # -# -nsolver number of solver tasks for solver types 12 and 13 # -# these are distributed tasks operating via MPI # -# -nthread number of solver threads for solver types 6, 8, and 11 # -# also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. if both specified, nthread option# -# will be used. # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by 6, 8, and 11 # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor nthread specified. # -# -itree message passing tree type for domain decomposition. # -# for debugging purposes; should not normally be used. # -# -host hostfile name for distributed execution on network. # -# defaults to no hostfile, unless jobid.defhost exists. # -# if jobid.defhost exists, only -np(s) necessary # -# -comp* y|n to be used with user routines on a network of # -# incompatible machines. # -# if set to no, a separate executable will be created # -# for each machine on the network. # -# if set to yes, the executable located on the machine # -# from which marc is started will be used on all machines.# -# defaults to no if O/S versions different on machines. # -# # -# -ci y|n copy input files to remote hosts (default: yes) # -# if "yes", input files are automatically copied to # -# remote hosts for a network run if necessary. # -# -cr y|n copy post files from remote hosts (default: yes) # -# if "yes", post files are automatically copied back from # -# remote hosts for a network run if necessary. # -############################################################################## -# set DIR to the directory in which this script is -REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" -DIR=`dirname $REALCOM` -# make sure DIR has an absolute path -case $DIR in - \/*) - ;; - *) - DIR=`pwd`/$DIR - ;; -esac -DIRSCRIPT=$DIR -AWK=awk -ARCH=`uname -a | cut -f 1 -d " "` -# Sun has a bad awk, use nawk instead -if test $ARCH = "SunOS" -then - AWK=nawk -fi -BASENAME=basename -# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists -if test $ARCH = "SunOS" -then - if test -x /usr/ucb/basename - then - BASENAME=/usr/ucb/basename - fi -fi - -# echo command line in the case of ECHO_COMMAND is true -if test "$ECHO_COMMAND" = true ; then - echo command "$0" "$@" -fi - -# -# "mode" selects version, i4 or i8 -# default is i4 -# this can be changed by a file run_marc_defaults -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MODE i8 -# it can also be set by the environmental variable MARC_INTEGER_SIZE -# and by the command line option "-mo" -# -mode= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -f $HOME/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -n "$MARC_INTEGER_SIZE" ; then - mode=$MARC_INTEGER_SIZE -fi -if test -z "$mode" ; then - mode=i4 -fi -case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "error, version mode must be i4 or i8" - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i4 or i8" - echo " " - echo " use -mo i4 or -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - setmode=true - fi - if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - fi - if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -done - -# set to i4 version for 32 bit Linux -if test "`uname -s`" = "Linux"; then - if test "`uname -m`" = "i686"; then - mode=i4 - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -fi - - -. "$DIR/getarch" - -# Change_me -. $MARC_INCLUDE -# - -# -# Dynamically determine the echo syntax -# - -case "`echo '\c'`" in - '\c') - ECHO='echo -n' - ECHOTXT=' ' - ;; - *) - ECHO='echo' - ECHOTXT=' \c' - ;; -esac - -# -# Variables for the MARC environment -# - -PRODUCT="Marc" -EXITMSG=$MARC_TOOLS/MESSAGES -export EXITMSG -FLEXDIR=$DIR/../flexlm/licenses -export FLEXDIR -TIMCHK=3600 -export TIMCHK -BINDIR=$MARC_BIN -export BINDIR -AFMATDAT=$MARC_RUNTIME/AF_flowmat/ -export AFMATDAT -# -# define directory path to global unified material database -# -MATFILE= -export MATFILE - -# -# define memory limit -# first set to MEMLIMIT from include -# -ml option overrules if specified -memlimit=$MEMLIMIT -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -# -if test $MACHINENAME = "HP" -then - SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH - export SHLIB_PATH -fi -# the one for IBM is defined futher down - -LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH -LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH -export LD_LIBRARY_PATH -export LD_LIBRARY64_PATH -export LD_LIBRARYN32_PATH - -atexit() { -kill -15 $$ -# -if test $MPITYPE = "myrinet" -then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi -fi -} - -trap "atexit" 2 - -# -# defaults -# - -prog=marc -exefile=marc -jid= -rid= -pid= -sid= -did= -vid= -user= -usersnoext= -objs= -qid=background -cpu= -priority= -att= -trk= -verify=yes -prgsav=no -rmdll=no -cpdll=no -progdll= -pathdll= -error= -nprocd=0 -nprocdddm=1 -nprocdddmprint= -icreated=0 -nprocdarg= -nsolver=0 -nsolverarg=-ns -if test $nprocds -then - if test $nprocds -gt 1 - then - nprocdddm=$nprocds - nprocdddmprint=$nprocds - icreated=1 - nprocdarg=-nprocds - fi -fi -nthread=-1 -gpuids= -nauto=0 -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -nthreadprint=0 -itree=0 -iam= -link= -trkrun=0 -DIRJOB=`pwd` -DIRSCR=$DIRJOB -DIRSCRSET= -autoforge=0 -dotdat=.dat -dotdefhost=.defhost -host= -numhost= -mfile= -userhost= -makebdf= -cpinput=yes -cpresults=yes -marcdll=libmarc.$EXT_DLL -# define hostname and strip off extensions (alpha.aaa.com) -thishost=`hostname` -thishost=${thishost%%.*} -compatible=unknown -numfield=1 -justlist= -feature= -mpioption=false -MDSRCLIB=$MARC_LIB/mdsrc.a -# -# check run_marc_defaults file for default MPI setting -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MPI -# -value= -file= -if test -f $DIRSCRIPT/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$DIRSCRIPT/run_marc_defaults - fi -fi -if test -f $HOME/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$HOME/run_marc_defaults - fi -fi -if test -n "$value"; then - MARC_MPITYPE=$value - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - echo " " - echo " error, incorrect option for MARC_MPI" - echo " defined in $file: $MARC_MPITYPE" - echo " valid options: $MPI_DEFAULT $MPI_OTHER" - echo " " - exit - fi - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - fi -fi -# -# -# allow scratch directory to be specified with environmental variable -# MARCSCRATCH -if test $MARCSCRATCH -then - if test -d $MARCSCRATCH - then - DIRSCR=$MARCSCRATCH - else - echo "error, scratch directory '$MARCSCRATCH'" - echo " specified via environmental variable MARCSCRATCH does not exist" - exit - fi -fi -# -############################################################################## -# parse input - arguments always come in pairs # -############################################################################## - -arg=$1 -if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - shift - arg=$1 -fi -while [ -n "$arg" ] -do - shift - value=$1 - case $arg in - -al* | -AL*) - LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - $MARC_BIN/marc -alloc 1 - exit - ;; - -li* | -LI*) - justlist=yes - ;; - -fe* | -FE*) - feature=$value - ;; - -pr* | -PR*) - if test `dirname $value` = '.' - then - prog=`$BASENAME $value .marc` - progdll=`$BASENAME $value` - else - prog=`dirname $value`/`$BASENAME $value .marc` - progdll=`dirname $value`/`$BASENAME $value` - fi - prdir=`dirname $value` - case $prdir in - \/*) - ;; - *) - prog=`pwd`/$prdir/$prog - ;; - esac - ;; - -j* | -J*) - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - ;; - -r* | -R*) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - -si* | -SI*) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - -pi* | -PI*) - if test -f $value.t19 - then - pid=`$BASENAME $value .t19` - else - pid=`$BASENAME $value .t16` - fi - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - -bdf | -BDF) - makebdf=1 - ;; - -de* | -DE*) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - -vf | -VF) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - -u* | -U*) - - user=$value - - - - - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - -obj | -OBJ) - objs="$value" - ;; - -q* | -Q*) - qid=$value - ;; - -b* | -B*) - case $value in - y* | Y*) - qid=background - ;; - n* | N*) - qid=foreground - ;; - *) - ;; - esac - ;; - -at | -AT) - att=$value - ;; - -cpu* | -CPU*) - cpu=$value - ;; - -pq | -PQ*) - priority=$value - ;; - -v* | -V*) - verify=$value - ;; - -sa* | -SA*) - prgsav=$value - ;; - -np* | -NP*) - nprocdddm=$value - nprocdddmprint=$value - case $arg in - -nps* | -NPS* | -nprocds* | -NPROCDS*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - case $arg in - -np | -NP | -nprocd | -NPROCD) - icreated=0 - nprocdarg=-nprocd - ;; - esac - ;; - -ns* | -NS*) - nsolver=$value - ;; - -nt* | -NT*) - nthread=$value - ;; - -gp* | -GP*) - gpuids=$value - ;; - -it* | -IT*) - itree=$value - ;; - -iam | -IAM) - iam=$value - ;; - -au* | -AU*) - nauto=$value - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -me | -ME ) - mesh=$value - ;; - -ml | -ML ) - memlimit=$value - ;; - -mo | -MO ) - ;; - -mpi | -MPI ) - mpioption=true - MARC_MPITYPE=$value - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - fi - fi - ;; - -dir* | -DIR*) - DIRJOB=$value - case $DIRJOB in - \/*) - ;; - *) - DIRJOB=`pwd`/$DIRJOB - ;; - esac - if test -z "$DIRSCRSET" - then - DIRSCR=$DIRJOB - fi - ;; - -sd* | -SD*) - DIRSCR=$value - DIRSCRSET=yes - case $DIRSCR in - \/*) - ;; - *) - DIRSCR=`pwd`/$DIRSCR - ;; - esac - ;; - -ho* | -HO*) - host=$value - ;; - -co* | -CO*) - compatible=$value - ;; - -ci* | -CI*) - cpinput=$value - ;; - -cr* | -CR*) - cpresults=$value - ;; - *) - error="$error -$arg: invalid option" - break - ;; - esac - case $value in - -*) - error="$error -$arg: invalid name $value" - break - ;; - esac - shift - arg=$1 - if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - shift - arg=$1 - fi -done -argc=`expr $# % 2` -if test $argc -eq 1 -then -# -# odd number of arguments -# - error="$error -argument list incomplete" -fi - -if test $nprocdddm -gt 0 -then -nprocd=$nprocdddm -fi - -if test $nsolver -gt 0 -then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi -fi - -if test $nthread -eq -1 -then -nthread=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nthread -lt 0 -then -nthread=0 -fi - -nthreadprint=$nthread -if test $nthreadprint -eq 0 -then -nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi -fi - -nthread=$nthreadprint - -gpuoption= -if test "$gpuids" = "" ; then - gpuoption= -else - gpuoption="-gp $gpuids" -fi - -if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH -else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH -# Linux 64 + HPMPI, Below code is taken from include_linux64 - if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - fi -fi - -if test $nprocd -gt 1; then - if test -f $jid$dotdefhost; then - if test "$host" = ""; then - host=$jid$dotdefhost - fi - fi - if test -f hostfile_qa_$nprocd; then - if test "$host" = ""; then - host=hostfile_qa_$nprocd - fi - fi -fi - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then - dotdat=.inp - fi - - if test "$progdll"; then - /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll - rmdll=yes - pathdll=yes - progdll=${progdll}_$marcdll - else - progdll=$marcdll - fi - - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - pathdll=yes - fi -fi - -############################################################################## -# check parameter validity # -############################################################################## - -while test forever; do - -# -# check for input file existence -# -if test $nprocdddm -gt 1 -a $icreated -eq 0; then - if test ! -f $DIRJID/1$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/1$jid$dotdat not accessible" - fi - fi -else - if test ! -f $DIRJID/$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/$jid$dotdat not accessible" - fi - fi -fi - if test $nprocd -gt 1; then - if test "$host" ; then - if test ! -f $host; then - error="$error -host name file $host not accessible" - fi - fi - fi - -# -# check if the job is already running in the background -# -if test -f $DIRJOB/$jid.pid; then - error="$error -job is already running (the file $jid.pid exists)" -fi - -# -# if the program name is other than marc, then -# assume that this is a program in the users local directory -# - -bd=$MARC_BIN/ - -case $prog in - marc | MARC | $exefile) - program=$exefile - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - if test ! -f $user - then - error="$error -user subroutine file $user not accessible" - fi - fi - if test "$objs" - then - missingobjs= - for o in $objs - do - if test ! -f "$o" - then - if test -z "$missingobjs" - then - missingobjs="$o" - else - missingobjs="$missingobjs $o" - fi - fi - done - if test -n "$missingobjs" - then - error="$error -user object/library file(s) $missingobjs not accessible" - fi - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$vid" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRVID/1$vid.vfs - then - error="$error -view factor file $DIRVID/1$vid.vfs not accessible" - fi - else - if test ! -f $DIRVID/$vid.vfs - then - error="$error -view factor file $DIRVID/$vid.vfs not accessible" - fi - fi - fi - if $mpioption - then - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" - fi - fi - ;; - *) - program=$prog.marc - case $prog in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - error="$error -program option may not be used with user subroutine" - fi - if test "$objs" - then - error="$error -program option may not be used with user objects or libraries" - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$nauto" - then - if test $nauto -gt 2 - then - error="$error -incorrect option for auto restart " - fi - fi - if test "$ndcoup" - then - if test $ndcoup -gt 3 - then - error="$error -incorrect option for contact decoupling " - fi - fi - if test "$ndytran" - then - if test $ndytran -gt 1 - then - error="$error -incorrect option for Marc-Dytran Switch " - fi - fi - if $mpioption - then - if test ! -x $MARC_BIN/$exefile - then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE " - fi - fi - ;; -esac - -############################################################################## -# check argument integrity # -############################################################################## - -if test "$jid" -then - : -else - error="$error -job id required" -fi - -if test $nprocd -gt 1 -then - if test $nauto -gt 0 - then - error="$error -cannot run DDM job with auto restart (-au) option " - fi -fi -case $qid in - S* | s*) - qid=short - ;; - L* | l*) - qid=long - ;; - V* | v*) - qid=verylong - ;; - B* | b*) - qid=background - ;; - F* | f*) - qid=foreground - ;; - A* | a*) - qid=at - ;; - *) - error="$error -bad value for queue_id option" - ;; -esac - -case $prgsav in - N* | n*) - prgsav=no - ;; - Y* | y*) - prgsav=yes - ;; - *) - error="$error -bad value for save option" - ;; -esac - -case $verify in - N* | n*) - verify=no - ;; - Y* | y*) - verify=yes - ;; - *) - error="$error -bad value for verify option" - ;; -esac - -case $nprocdddm in - -* ) - error="$error -bad value for nprocd option" - ;; -esac - -case $nthread in - -* ) - error="$error -bad value for nthread option" - ;; -esac - -case $itree in - -* ) - error="$error -bad value for itree option" - ;; -esac -case $iam in - -* ) - error="$error -bad value for iam option" - ;; -esac -case $compatible in - N* | n*) - compatible=no - ;; - Y* | y*) - compatible=yes - ;; - unknown) - ;; - *) - error="$error -bad value for comp option" - ;; -esac -case $cpinput in - N* | n*) - cpinput=no - ;; - Y* | y*) - cpinput=yes - ;; - *) - error="$error -bad value for copy input option" - ;; -esac -case $cpresults in - N* | n*) - cpresults=no - ;; - Y* | y*) - cpresults=yes - ;; - *) - error="$error -bad value for copy results option" - ;; -esac - -# -# check for external file to run -# -if test -f $MARC_TOOLS/run_marc_check -then - . $MARC_TOOLS/run_marc_check -fi - -# -# pick up version data from bin/VERSION if it exists -# -if test -f $MARC_BIN/VERSION; then - ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` - if test -n "$ppp" ;then - PRODUCT=$ppp - fi - ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` - if test -n "$ppp" ;then - REVISION=", Build $ppp" - fi -fi -############################################################################## -# interact with the user to get the required information to run marc or # -# other marc system program # -############################################################################## - -deletelog=yes -if test $qid = background -a $verify = no -then -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto " > $jid.log -deletelog=no -fi -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto" - - -case $qid in - s* | S* | l* | L* | v* | V* ) - echo \ -"Queue priority : $priority -Queue CPU limit : $cpu -Queue start time : $att" - ;; -# * ) -# echo \ -#" " -# ;; -esac - -if test "$error" -then - if test $verify = yes - then - $ECHO "$error - -Please correct or quit(correct,quit,): $ECHOTXT" - error= - read answer - case $answer in - q* | Q*) - answer=quit - ;; - *) - answer=correct - ;; - esac - else - $ECHO "$error - $ECHOTXT" - echo " " - if test "$deletelog" = no - then - $ECHO "$error - $ECHOTXT" >> $jid.log - echo " " >> $jid.log - fi - answer=quit - fi -else - if test $verify = yes - then - $ECHO " -Are these parameters correct (yes,no,quit,)? $ECHOTXT" - read answer - case $answer in - q* | Q*) - answer=quit - ;; - y* | Y*) - answer=yes - ;; - *) - answer=no - ;; - esac - else - answer=yes - fi -fi - -case $answer in - no | correct) - -############################################################################## -# prompt for each value # -############################################################################## - - $ECHO " -Program name ($prog)? $ECHOTXT" - read value - if test "$value" - then - prog=$value - fi - $ECHO "Job ID ($jid)? $ECHOTXT" - read value - if test "$value" - then - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - fi - $ECHO "User subroutine name ($user)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - user= - ;; - *) - user=$value - - - - - - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - esac - fi - $ECHO "User objects or libraries ($objs)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - objs= - ;; - *) - objs="$value" - ;; - esac - fi - $ECHO "Restart File Job ID ($rid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - rid= - ;; - *) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - esac - fi - $ECHO "Substructure File ID ($sid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - sid= - ;; - *) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - esac - fi - $ECHO "Post File Job ID ($pid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - pid= - ;; - *) - pid=$value - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - esac - fi - $ECHO "Defaults File ID ($did)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - did= - ;; - *) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - esac - fi - $ECHO "View Factor File ID ($vid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - vid= - ;; - *) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - esac - fi - $ECHO "Save generated module ($prgsav)? $ECHOTXT" - read value - if test "$value" - then - prgsav=$value - fi - $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" - read value - if test "$value" - then - nprocdddm=$value - nprocdddmprint=$value - fi - $ECHO "Run on ($nthread) threads ? $ECHOTXT" - read value - if test "$value" - then - nthread=$value - fi - $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" - read value - if test "$value" - then - nsolver=$value - fi -# - if test $nprocdddm -gt 0 - then - nprocd=$nprocdddm - fi - if test $nsolver -gt 0 - then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi - fi - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - nthreadprint=$nthread - if test $nthreadprint -eq 0 - then - nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi - fi -# - $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" - read value - if test "$value" - then - gpuids=$value - fi - if test "$gpuids" = "" ; then - gpuoption= - else - gpuoption="-gp $gpuids" - fi - if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH - if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - fi - fi -# - if test $nprocd -gt 1 - then - $ECHO "Message passing type ($itree)? $ECHOTXT" - read value - if test "$value" - then - itree=$value - fi - $ECHO "Host file name ($host)? $ECHOTXT" - read value - if test "$value" - then - host=$value - fi - if test $nprocdddm -gt 1 - then - $ECHO "Single input file? $ECHOTXT" - read value - case $value in - y* | Y*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" - read value - if test "$value" - then - compatible=$value - fi - $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" - read value - if test "$value" - then - cpinput=$value - fi - $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" - read value - if test "$value" - then - cpresults=$value - fi - fi - fi - $ECHO "Run the job in the queue ($qid)? $ECHOTXT" - read value - if test "$value" - then - qid=$value - fi - case $qid in - s* | S* | l* | L* | v* | V* ) - $ECHO "Queue priority ($priority)? $ECHOTXT" - read value - if test "$value" - then - priority=$value - fi - $ECHO "Job starts at ($att)? $ECHOTXT" - read value - if test "$value" - then - att=$value - fi - $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" - read value - if test "$value" - then - cpu=$value - fi - ;; - * ) - ;; - esac - $ECHO "Auto Restart option ($nauto)? $ECHOTXT" - read value - if test "$value" - then - nauto=$value - fi - $ECHO "Run directory ($DIRJOB)? $ECHOTXT" - read value - if test "$value" - then - DIRJOB=$value - DIRSCR=$DIRJOB - fi - $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" - read value - if test "$value" - then - DIRSCR=$value - fi - ;; - quit) - exit 1 - ;; - *) - break - ;; - -esac - - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - -done - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - pathdll=yes - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - fi - - if test "$pathdll"; then -# -# reset share lib path -# - if test $MACHINENAME = "HP" - then - SHLIB_PATH=$DIRJOB:$SHLIB_PATH - export SHLIB_PATH - fi - if test $MACHINENAME = "IBM" - then - LIBPATH=$DIRJOB:$LIBPATH - export LIBPATH - fi -# - LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH - LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH - LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH - export LD_LIBRARY_PATH - export LD_LIBRARY64_PATH - export LD_LIBRARYN32_PATH - fi -fi -# end of dllrun>0 - - -if test $program = $exefile -o $program = $prog.marc -then - -# delete the old .log file unless we run in the background -if test "$deletelog" = yes -then - /bin/rm $jid.log 2>/dev/null -else - echo - echo running the job in the background, see $jid.log - echo -fi - -# -# check if this is an autoforge or rezoning or radiation job -# -if test $nprocd -eq 1 -then - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` - if test "$line" - then - autoforge=1 - fi -fi -# -# check that jobname for restarted run is not the same -# as restart file basename -# -if test "$rid" -then - if test "$jid" = "$rid" - then - echo " " - echo "ERROR: job name of current run is the same as job name" - echo " of the restarted job" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "ERROR: job name of current run is the same as job name" >> $jid.log - echo " of the restarted job" >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi -fi - -# -# user objects/libraries used -# - - if test "$objs" - then - program="$DIRJOB/$jid.marc" - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# user subroutine used -# -# add DAMASK options for linking - DAMASK="" - - if test "$user" - then - program=$usernoext.marc - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# Special case for IBM using POE but not an SP machine -# in this case we always need a host file, also for serial jobs. -# -if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP -then - MP_HOSTFILE=${jid}.host - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $nprocd -gt 1 - then - numdom=$nprocd - while test $numdom -gt 0 - do - hostname -s >> $MP_HOSTFILE - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - else - hostname -s > $MP_HOSTFILE - fi -fi -# -# check correctness of host file; fix for user sub -# - if test $nprocd -gt 1 - then - -# construct the path name to the executable (execpath) - execpath=$MARC_BIN/$exefile - usersub=0 - if test $program = $prog.marc - then - execpath=$prog.marc - usersub=1 - fi - if test "$objs" - then - execpath="$DIRJOB/$jid.marc" - usersub=1 - fi - if test "$user" - then - execpath=$usernoext.marc - usersub=1 - fi - export execpath - execname=`$BASENAME $execpath` - - if test "$host" - then - userhost=$host - case $userhost in - \/* | \.\/*) - ;; - *) - userhost=`pwd`/$userhost - ;; - esac - -# check that the number of processes specified in the hostfile is -# equal to nprocd specified by -nprocd. - numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` - if test $nprocd -ne $numproc - then - echo " " - echo "error, the number of processes specified in the host file" - echo "must be equal to the number of processes given by -nprocd/-nsolver" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, the number of processes specified in the host file" >> $jid.log - echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - -# check for Myrinet that the number of processes per host is -# less than number of available user ports, 5 -# .gmpi directory must exist in user's home directory -# and must have write permission from remote hosts - if test $MPITYPE = "myrinet" - then - numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` - if test $numproc -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes specified " - echo "in the hostfile must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes specified " >> $jid.log - echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - if test ! -d ~/.gmpi - then - echo " " - echo "error, for Myrinet a .gmpi directory must exist " - echo "under the user's home directory" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log - echo "under the user's home directory" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - homedir=`echo ~` - for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - echo " " - echo "error, for Myrinet a shared .gmpi directory must exist " - echo "under the user's home directory " - echo "with remote write permission" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log - echo "under the user's home directory " >> $jid.log - echo "with remote write permission" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - /bin/rm tmp.$$ - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - fi - fi - done - fi - fi - -# construct the host file $jid.host which is used by mpirun -# skip lines starting with # and only consider lines with more than -# one word in them. Note that the hostfile given to this script -# has two columns: the host name and the number of shared processes -# to run on this host. mpirun wants the number of _other_ -# processes to run in addition to the one being run on the machine -# on which the job is started. hence the $2-1 for fnr == 1. - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then -# HPMPI or HP hardware MPI - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ - -v mpihpspecial="$MPIHPSPECIAL" \ -'{if ( NF > 0) {\ - fnr++ ; \ - printf("-h %s -np %s",$1,$2); \ - printf(" %s",mpihpspecial); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ - if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ - }\ - }' > $jid.host -# end HPMPI or HP hardware MPI - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then -# IBM using hardware MPI (POE) - MP_HOSTFILE=$jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host -# end IBM using hardware MPI (POE) -# for Intel MPI, need to create a machinefile for DMP - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then -# Intel MPI - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - /bin/cp $host $jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Intel MPI for DMP -# for Solaris HPC 7.1, need to create a machinefile for DMP - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then -# Solaris HPC 7.1 - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Solaris HPC 7.1 for DMP -# for Myrinet, construct a configuration file in ~/.gmpi -# this must be readable by each process -# format is (hostname) (port number) for each process - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - grep -v '^#' $host | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ -{if ( NF > 0 ) \ - for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ -}' >> ~/.gmpi/$jid.host - else -# this is for mpich-1.2.5 and later, using the -pg option -# format: host nproc executable user arguments -# the arguments are added later - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s %s\n",path,user);\ - if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ - }\ - }' > $jid.host - fi -# end Myrinet - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then -# Compaq MPI via Memory Channel - grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host -# end Compaq MPI - else -# MPICH - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ - }\ - }' > $jid.host - fi -# define the variable host and host_filt -# host_filt is used for loops over hosts -# for Myrinet we need to use a filtered variant of userhost -# for others we can use $host - if test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - host=~/.gmpi/$jid.host - host_filt=$jid.host_tMp - grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt - else - host=$jid.host - host_filt=$host - fi - else - host=$jid.host - host_filt=$host - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - host_filt=$jid.mfile - fi - fi -# figure out if the machines in the hostfile are nfs mounted -# or distributed and set the variable "dirstatus" accordingly. -# only perform the check if user subroutine is used -# or a user subroutine executable is used - - numfield=1 - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - numfield=2 - fi - DIR1=$DIRJOB - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - counter=0 - echo " " - echo "checking if local or shared directories for host" - if test "$deletelog" = no - then - echo "checking if local or shared directories for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - dirstatus[$counter]="shared" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - dirstatus[$counter]="local" - /bin/rm tmp.$$ - else - if test ! -f $jid.$$ - then - dirstatus[$counter]="local" - $RSH $i /bin/rm $DIR1/$jid.$$ - else - /bin/rm $jid.$$ - fi - fi - if test -f tmp.$$ - then - /bin/rm tmp.$$ - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - echo " ${dirstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${dirstatus[$counter]}" >> $jid.log - fi - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - fi - -# figure out if this is a compatible set of machines -# unless explicitly specified with flag -comp -# only perform the check if user subroutine is used -# or a user subroutine executable is used -# Myrinet does not support heterogeneous - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - if test $compatible = "unknown" - then - thisname=$ARCH - compatible=yes - counter=0 - echo "checking if machines are compatible for host" - if test "$deletelog" = no - then - echo "checking if machines are compatible for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]="yes" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - othername=`$RSH $i uname -a | cut -f 1 -d " "` - if test $thisname != $othername - then - compatible=no - compstatus[$counter]="no" - fi - fi - echo " ${compstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${compstatus[$counter]}" >> $jid.log - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - else - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]=$compatible - fi - done - if test $compatible = "no" - then - echo "all machines assumed incompatible" - if test "$deletelog" = no - then - echo "all machines assumed incompatible" >> $jid.log - fi - else - echo "all machines compatible" - if test "$deletelog" = no - then - echo "all machines compatible" >> $jid.log - fi - fi - fi -# error out if user objects or libraries are used on incompatible machines - if test "$compatible" = "no" -a -n "$objs" - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" - if test "$deletelog" = no - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log - fi - exit 1 - fi -# modify new host file if NFS mounted heterogeneous machine - doit= - if test $program = $prog.marc - then - doit=yes - fi - if test "$user" - then - doit=yes - fi - if test "$doit" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - $AWK -v hst=$i '{fnr++ ; \ -if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ -printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} - /bin/mv $jid.host{$$} $jid.host - host=$jid.host - fi - fi - done - fi - fi # if test $program = $prog.marc -o $user -o $obj - - else # if test $host - # assume shared memory machine if no hostfile given and - # MPITYPE is set to mpich or Myrinet - # check for Myrinet that the total number of processes is - # less than number of available user ports, 5 - if test $MPITYPE = "mpich" -o $MPITYPE = "scali" - then - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - host=$jid.host - elif test $MPITYPE = "myrinet" - then - if test $nprocd -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes " - echo "must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes " >> $jid.log - echo "must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - echo `hostname` $nprocd | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ - {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ -' >> ~/.gmpi/$jid.host - host=~/.gmpi/$jid.host - else - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - - fi - fi # if test myrinet - - fi # if test $host - - fi # if test $nprocd -gt 1 - -fi # if test $program = $exefile -o $program = $prog.marc - -############################################################################## -# construct run stream (Marc only) # -############################################################################## - -# set maximum message length for ddm to a large number -# for vendor provided mpi -if test $itree -eq 0 -a $MPITYPE = hardware -then - itree=100000000 - if test $MACHINENAME = SGI - then - itree=100000001 - fi -fi -if test $itree -eq 0 -a $MPITYPE = hpmpi -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = myrinet -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = nec -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = scali -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = intelmpi -then - itree=100000000 -fi -if test $nprocdddm -lt 2 -then - nprocdarg= -else - nprocdarg="$nprocdarg $nprocdddm" -fi -if test $nsolver -eq 0 -then - nsolverarg= -else - nsolverarg="$nsolverarg $nsolver" -fi -if test $nprocdddm -lt 2 -a $nsolver -eq 0 -then -nprocd=0 -fi -if test $nprocd -gt 0 -then - if test "$host" - then - if test -z "$RUN_JOB2" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then - RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" - RUN_JOB=" -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - numhost=`uniq $jid.mfile | wc -l` - if test "$INTELMPI_VERSION" = "HYDRA" - then - RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n $numhost -r $RSH -f $jid.mfile - RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" - fi - -# intelmpi uses configfile. format: -# -host host1 -n n1 executable marcargs -# one such line per host -# collect the marcargs in RUN_JOB and construct the config file later -# collect the run stream in RUN_JOB_TMP - RUN_JOB="-jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - - - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then - RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - if test "$userhost" - then - RUN_JOB="$RUN_JOB -mhost $userhost" - fi - if test $MPITYPE = "scali" - then -# set default working directory to /tmp to allow -# different directory names - SCAMPI_WORKING_DIRECTORY=/tmp - export SCAMPI_WORKING_DIRECTORY - fi - else - if test -z "$RUN_JOB1" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - RUNNPROCD=$nprocd - if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" - then - RUNNPROCD= - MP_PROCS=$nprocd - export MP_PROCS - fi - if test $MPITYPE = "myrinet" - then - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n 1 -f $jid.hosts - fi - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - fi -else - if test $nauto -gt 0 -o $ndcoup -gt 0 - then - RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - else -# this is for a serial job without auto restart: - RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi -fi -if test "$rid" -then - RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" -fi -if test "$pid" -then - RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" -fi -if test "$sid" -then - RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" -fi -if test "$did" -then - RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" -fi -if test "$vid" -then - RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" -fi -if test $nauto -gt 0 -then - RUN_JOB="$RUN_JOB -autorst $nauto " -fi -if test $ndcoup -gt 0 -then - RUN_JOB="$RUN_JOB -dcoup $ndcoup " -fi -if test $ndytran -gt 0 -then - RUN_JOB="$RUN_JOB -dytran $ndytran " -fi -if test $mesh -gt 0 -then - RUN_JOB="$RUN_JOB -me $mesh " -fi -if test $noutcore -gt 0 -then - RUN_JOB="$RUN_JOB -outcore $noutcore " -fi -if test "$dllrun" -gt 0 -then - RUN_JOB="$RUN_JOB -dll $dllrun " -fi -if test "$trkrun" -gt 0 -then - RUN_JOB="$RUN_JOB -trk $trkrun " -fi -if test "$iam" -then - RUN_JOB="$RUN_JOB -iam $iam " -fi -if test "$justlist" -then - RUN_JOB="$RUN_JOB -list 1 " -fi -if test "$feature" -then - RUN_JOB="$RUN_JOB -feature $feature " -fi -if test "$memlimit" -ne 0 -then - RUN_JOB="$RUN_JOB -ml $memlimit " -fi -if test "$cpinput" -then - RUN_JOB="$RUN_JOB -ci $cpinput " -fi -if test "$cpresults" -then - RUN_JOB="$RUN_JOB -cr $cpresults " -fi -if test "$DIRSCR" != "$DIRJOB" -then - RUN_JOB="$RUN_JOB -dirscr $DIRSCR" -else - DIRSCR=$DIRJOB -fi -if test "$makebdf" -then - RUN_JOB="$RUN_JOB -bdf $makebdf " -fi -if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" -then - # append $RUN_JOB to all lines of the host file - # and set RUN_JOB - $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ - /bin/mv $host.$$ $host - RUN_JOB=$RUN_JOB_TMP -fi -if test $MPITYPE = "intelmpi" -a "$host" -then - # construct config file, append $RUN_JOB to all lines of the config file - # and set RUN_JOB - if test "$INTELMPI_VERSION" = "HYDRA" - then - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - else - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-host %s -n %s",$1,$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - fi - RUN_JOB=$RUN_JOB_TMP -fi -echo " " -echo "Final run stream value" -echo " RUNJOB="$RUN_JOB -if test "$deletelog" = no -then -echo " " >> $jid.log -echo "Final run stream value" >> $jid.log -echo " RUNJOB="$RUN_JOB >> $jid.log -fi - - -############################################################################## -# run marc using valgrind # -############################################################################## -#RUN_JOB="valgrind $RUN_JOB" -#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" -############################################################################## - - -############################################################################## -# run the requested program in a queue # -############################################################################## - -if test "$deletelog" = yes -then - echo - date -else - echo >> $jid.log - date >> $jid.log -fi -if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] -then - -/bin/rm -f $jid.runmarcscript - - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - userobj=$usernoext.o - fi - cat > $jid.runmarcscript << END4 - if test "$user" - then - if test $MACHINENAME = "CRAY" - then - $DFORTLOW $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTLOW $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $MARCCUDALIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } -END4 -else - prgsav=yes -fi -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# - -cat >> $jid.runmarcscript << END5 - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -# first remove all .out files and incremental restart files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null - /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null -fi - -if test $nprocdddm -gt 1 -then - $RUN_JOB 2>>$jid.log -else - $RUN_JOB 2>>$jid.log -fi - -if test $dllrun -eq 0; then - if test $prgsav = no - then - /bin/rm -f $bd$program 2>/dev/null - fi -else - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes - then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -END5 - - -# Submit to marc batch queue -# -if [ $qid = at ] -then -QUENAME=at -SUBMCMD= -else -# -# Submit to qsub queue -# -QUENAME=qsub -SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" -if test "$priority" -then - SUBMCMD=$SUBMCMD" -p $priority" -fi -if test "$att" -then - SUBMCMD=$SUBMCMD" -a $att" -fi -if test "$cpu" -then - SUBMCMD=$SUBMCMD" -lt $cpu" -fi - -fi -echo $QUENAME $SUBMCMD -#cat $jid.runmarcscript -$QUENAME $SUBMCMD < $jid.runmarcscript - -/bin/rm -f $jid.runmarcscript - -############################################################################## -# run the requested program in the background # -############################################################################## - -else -if test $qid = background -then - -# -# first remove all old .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi -# -# compile user subroutine if present -# -( -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_l $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - echo " $PRODUCT Exit number 3" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTLOW $user || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTLOW $user -o $userobj || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - echo " $PRODUCT Exit number 3" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc - -# - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -$RUN_JOB & - -marcpid=$! -echo $marcpid > $DIRJOB/$jid.pid -wait $marcpid - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -) 1>>$jid.log 2>&1 & - - -############################################################################## -# run the requested program in the foreground # -############################################################################## - -else - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_l $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTLOW $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTLOW $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi -# first remove all .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi - -$RUN_JOB - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - if test "$host" - then - mpdcleanup -a -f $jid.mfile - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.mfile 2> /dev/null - else - mpdcleanup -a -f $jid.hosts - /bin/rm $jid.hosts 2> /dev/null - fi - fi - fi -fi - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi - - -fi -fi diff --git a/installation/mods_MarcMentat/2012/Marc_tools/run_damask_lmp b/installation/mods_MarcMentat/2012/Marc_tools/run_damask_lmp deleted file mode 100644 index 10b141e01..000000000 --- a/installation/mods_MarcMentat/2012/Marc_tools/run_damask_lmp +++ /dev/null @@ -1,3690 +0,0 @@ -#!/bin/ksh -############################################################################## -# # -# run_marc - run a marc job # -# ------------------------- # -# # -# usage: run_marc -j jid { options } # -# # -# where standard options are: required: defaults: # -# -------------------------- # -# # -# -j* jid job id number. ** YES ** . # -# -pr* prog program name. . marc # -# -v* y|n do or do not verify inputs. . yes # -# -q* s|l|v|b|f batch queue name or background, . short # -# foreground. # -# -b* as alternative to option -q* # -# # -# ( batch queues only : # -# -pq* intra queue priority. . . # -# -at DATE/TIME delay start of job. . . # -# format : January,1,1990,12:31 # -# or : today,5pm # -# -cpu* secs job CPU limit . . ) # -# # -# -r* rid restart file job id. . . # -# -si* sid substructure file id. . . # -# -pi* post post file job id. . . # -# -de* did defaults file . no # -# -vf vid viewfactor . no # -# # -# -u* user user subroutine. . . # -# -obj obj user objects or libraries. . . # -# -sa* y|n do or do not save load module. . no # -# -autorst auto restart flag for auto forge . no # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo selects i4 or i8 version # -# default: i4 or via defaults file run_marc_defaults # -# the -mo option will override # -# -mpi selects MPI version # -# each platform has a default MPI version and some # -# have an alternative version. see the include file # -# for the respective platform # -# MPI_DEFAULT defines the default MPI version # -# MPI_OTHER defines versions one can switch to # -# -dcoup for contact decoupling # -# currently not supported # -# -dir directory where the job i/o should take place. # -# defaults to current directory. # -# -sdir directory where scratch files are created # -# defaults to current directory. # -# # -# -alloc only perform memory allocation test, no analysis # -# -list y only list options in the input file, no analysis # -# -fe num set feature number "num" for the run. only one allowed # -# -dytran flag to switch from Dytran to Marc # -# dytran = 0, program will run w/o Marc-Dytran Switch # -# = 1, program will restart Marc after Dytran run # -# >= 2, Not supported yet. # -# currently not supported # -# -ou force analysis to use out-of-core control # -# =0, not used # -# =1, element storage out-of-core # -# -dll run marc using shared library libmarc.so and exe_marc # -# =1, used # -# =2, do not free streaming input memory # -# =3, run with marc input deck # -# -trk run marc for post-tracking # -# -gpuid run marc using GPGPU capability # -# specify gpuid on to be used in the analysis. Multiple # -# IDs may be assigned for DDM runs. # -# Separate a list of IDs with a colon. Each DMP # -# process will be assigned a GPU ID in round robin fastion# -# = 0 # -# = 0:1 etc... # -# # -# where parallel options are: # -# -------------------------- # -# # -# itree, host, and comp options are available for the domain # -# decomposition only. # -# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # -# # -# # -# -nprocd number of domains. # -# defaults to single domain solution. # -# -nprocds number of domains if single input file. # -# defaults to single domain solution. # -# -nps same as -nprocds. # -# -nsolver number of solver tasks for solver types 12 and 13 # -# these are distributed tasks operating via MPI # -# -nthread number of solver threads for solver types 6, 8, and 11 # -# also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. if both specified, nthread option# -# will be used. # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by 6, 8, and 11 # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor nthread specified. # -# -itree message passing tree type for domain decomposition. # -# for debugging purposes; should not normally be used. # -# -host hostfile name for distributed execution on network. # -# defaults to no hostfile, unless jobid.defhost exists. # -# if jobid.defhost exists, only -np(s) necessary # -# -comp* y|n to be used with user routines on a network of # -# incompatible machines. # -# if set to no, a separate executable will be created # -# for each machine on the network. # -# if set to yes, the executable located on the machine # -# from which marc is started will be used on all machines.# -# defaults to no if O/S versions different on machines. # -# # -# -ci y|n copy input files to remote hosts (default: yes) # -# if "yes", input files are automatically copied to # -# remote hosts for a network run if necessary. # -# -cr y|n copy post files from remote hosts (default: yes) # -# if "yes", post files are automatically copied back from # -# remote hosts for a network run if necessary. # -############################################################################## -# set DIR to the directory in which this script is -REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" -DIR=`dirname $REALCOM` -# make sure DIR has an absolute path -case $DIR in - \/*) - ;; - *) - DIR=`pwd`/$DIR - ;; -esac -DIRSCRIPT=$DIR -AWK=awk -ARCH=`uname -a | cut -f 1 -d " "` -# Sun has a bad awk, use nawk instead -if test $ARCH = "SunOS" -then - AWK=nawk -fi -BASENAME=basename -# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists -if test $ARCH = "SunOS" -then - if test -x /usr/ucb/basename - then - BASENAME=/usr/ucb/basename - fi -fi - -# echo command line in the case of ECHO_COMMAND is true -if test "$ECHO_COMMAND" = true ; then - echo command "$0" "$@" -fi - -# -# "mode" selects version, i4 or i8 -# default is i4 -# this can be changed by a file run_marc_defaults -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MODE i8 -# it can also be set by the environmental variable MARC_INTEGER_SIZE -# and by the command line option "-mo" -# -mode= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -f $HOME/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -n "$MARC_INTEGER_SIZE" ; then - mode=$MARC_INTEGER_SIZE -fi -if test -z "$mode" ; then - mode=i4 -fi -case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "error, version mode must be i4 or i8" - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i4 or i8" - echo " " - echo " use -mo i4 or -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - setmode=true - fi - if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - fi - if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -done - -# set to i4 version for 32 bit Linux -if test "`uname -s`" = "Linux"; then - if test "`uname -m`" = "i686"; then - mode=i4 - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -fi - - -. "$DIR/getarch" - -# Change_me -. $MARC_INCLUDE -# - -# -# Dynamically determine the echo syntax -# - -case "`echo '\c'`" in - '\c') - ECHO='echo -n' - ECHOTXT=' ' - ;; - *) - ECHO='echo' - ECHOTXT=' \c' - ;; -esac - -# -# Variables for the MARC environment -# - -PRODUCT="Marc" -EXITMSG=$MARC_TOOLS/MESSAGES -export EXITMSG -FLEXDIR=$DIR/../flexlm/licenses -export FLEXDIR -TIMCHK=3600 -export TIMCHK -BINDIR=$MARC_BIN -export BINDIR -AFMATDAT=$MARC_RUNTIME/AF_flowmat/ -export AFMATDAT -# -# define directory path to global unified material database -# -MATFILE= -export MATFILE - -# -# define memory limit -# first set to MEMLIMIT from include -# -ml option overrules if specified -memlimit=$MEMLIMIT -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -# -if test $MACHINENAME = "HP" -then - SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH - export SHLIB_PATH -fi -# the one for IBM is defined futher down - -LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH -LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH -export LD_LIBRARY_PATH -export LD_LIBRARY64_PATH -export LD_LIBRARYN32_PATH - -atexit() { -kill -15 $$ -# -if test $MPITYPE = "myrinet" -then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi -fi -} - -trap "atexit" 2 - -# -# defaults -# - -prog=marc -exefile=marc -jid= -rid= -pid= -sid= -did= -vid= -user= -usersnoext= -objs= -qid=background -cpu= -priority= -att= -trk= -verify=yes -prgsav=no -rmdll=no -cpdll=no -progdll= -pathdll= -error= -nprocd=0 -nprocdddm=1 -nprocdddmprint= -icreated=0 -nprocdarg= -nsolver=0 -nsolverarg=-ns -if test $nprocds -then - if test $nprocds -gt 1 - then - nprocdddm=$nprocds - nprocdddmprint=$nprocds - icreated=1 - nprocdarg=-nprocds - fi -fi -nthread=-1 -gpuids= -nauto=0 -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -nthreadprint=0 -itree=0 -iam= -link= -trkrun=0 -DIRJOB=`pwd` -DIRSCR=$DIRJOB -DIRSCRSET= -autoforge=0 -dotdat=.dat -dotdefhost=.defhost -host= -numhost= -mfile= -userhost= -makebdf= -cpinput=yes -cpresults=yes -marcdll=libmarc.$EXT_DLL -# define hostname and strip off extensions (alpha.aaa.com) -thishost=`hostname` -thishost=${thishost%%.*} -compatible=unknown -numfield=1 -justlist= -feature= -mpioption=false -MDSRCLIB=$MARC_LIB/mdsrc.a -# -# check run_marc_defaults file for default MPI setting -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MPI -# -value= -file= -if test -f $DIRSCRIPT/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$DIRSCRIPT/run_marc_defaults - fi -fi -if test -f $HOME/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$HOME/run_marc_defaults - fi -fi -if test -n "$value"; then - MARC_MPITYPE=$value - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - echo " " - echo " error, incorrect option for MARC_MPI" - echo " defined in $file: $MARC_MPITYPE" - echo " valid options: $MPI_DEFAULT $MPI_OTHER" - echo " " - exit - fi - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - fi -fi -# -# -# allow scratch directory to be specified with environmental variable -# MARCSCRATCH -if test $MARCSCRATCH -then - if test -d $MARCSCRATCH - then - DIRSCR=$MARCSCRATCH - else - echo "error, scratch directory '$MARCSCRATCH'" - echo " specified via environmental variable MARCSCRATCH does not exist" - exit - fi -fi -# -############################################################################## -# parse input - arguments always come in pairs # -############################################################################## - -arg=$1 -if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - shift - arg=$1 -fi -while [ -n "$arg" ] -do - shift - value=$1 - case $arg in - -al* | -AL*) - LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - $MARC_BIN/marc -alloc 1 - exit - ;; - -li* | -LI*) - justlist=yes - ;; - -fe* | -FE*) - feature=$value - ;; - -pr* | -PR*) - if test `dirname $value` = '.' - then - prog=`$BASENAME $value .marc` - progdll=`$BASENAME $value` - else - prog=`dirname $value`/`$BASENAME $value .marc` - progdll=`dirname $value`/`$BASENAME $value` - fi - prdir=`dirname $value` - case $prdir in - \/*) - ;; - *) - prog=`pwd`/$prdir/$prog - ;; - esac - ;; - -j* | -J*) - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - ;; - -r* | -R*) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - -si* | -SI*) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - -pi* | -PI*) - if test -f $value.t19 - then - pid=`$BASENAME $value .t19` - else - pid=`$BASENAME $value .t16` - fi - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - -bdf | -BDF) - makebdf=1 - ;; - -de* | -DE*) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - -vf | -VF) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - -u* | -U*) - - user=$value - - - - - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - -obj | -OBJ) - objs="$value" - ;; - -q* | -Q*) - qid=$value - ;; - -b* | -B*) - case $value in - y* | Y*) - qid=background - ;; - n* | N*) - qid=foreground - ;; - *) - ;; - esac - ;; - -at | -AT) - att=$value - ;; - -cpu* | -CPU*) - cpu=$value - ;; - -pq | -PQ*) - priority=$value - ;; - -v* | -V*) - verify=$value - ;; - -sa* | -SA*) - prgsav=$value - ;; - -np* | -NP*) - nprocdddm=$value - nprocdddmprint=$value - case $arg in - -nps* | -NPS* | -nprocds* | -NPROCDS*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - case $arg in - -np | -NP | -nprocd | -NPROCD) - icreated=0 - nprocdarg=-nprocd - ;; - esac - ;; - -ns* | -NS*) - nsolver=$value - ;; - -nt* | -NT*) - nthread=$value - ;; - -gp* | -GP*) - gpuids=$value - ;; - -it* | -IT*) - itree=$value - ;; - -iam | -IAM) - iam=$value - ;; - -au* | -AU*) - nauto=$value - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -me | -ME ) - mesh=$value - ;; - -ml | -ML ) - memlimit=$value - ;; - -mo | -MO ) - ;; - -mpi | -MPI ) - mpioption=true - MARC_MPITYPE=$value - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - fi - fi - ;; - -dir* | -DIR*) - DIRJOB=$value - case $DIRJOB in - \/*) - ;; - *) - DIRJOB=`pwd`/$DIRJOB - ;; - esac - if test -z "$DIRSCRSET" - then - DIRSCR=$DIRJOB - fi - ;; - -sd* | -SD*) - DIRSCR=$value - DIRSCRSET=yes - case $DIRSCR in - \/*) - ;; - *) - DIRSCR=`pwd`/$DIRSCR - ;; - esac - ;; - -ho* | -HO*) - host=$value - ;; - -co* | -CO*) - compatible=$value - ;; - -ci* | -CI*) - cpinput=$value - ;; - -cr* | -CR*) - cpresults=$value - ;; - *) - error="$error -$arg: invalid option" - break - ;; - esac - case $value in - -*) - error="$error -$arg: invalid name $value" - break - ;; - esac - shift - arg=$1 - if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - shift - arg=$1 - fi -done -argc=`expr $# % 2` -if test $argc -eq 1 -then -# -# odd number of arguments -# - error="$error -argument list incomplete" -fi - -if test $nprocdddm -gt 0 -then -nprocd=$nprocdddm -fi - -if test $nsolver -gt 0 -then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi -fi - -if test $nthread -eq -1 -then -nthread=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nthread -lt 0 -then -nthread=0 -fi - -nthreadprint=$nthread -if test $nthreadprint -eq 0 -then -nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi -fi - -nthread=$nthreadprint - -gpuoption= -if test "$gpuids" = "" ; then - gpuoption= -else - gpuoption="-gp $gpuids" -fi - -if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH -else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH -# Linux 64 + HPMPI, Below code is taken from include_linux64 - if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - fi -fi - -if test $nprocd -gt 1; then - if test -f $jid$dotdefhost; then - if test "$host" = ""; then - host=$jid$dotdefhost - fi - fi - if test -f hostfile_qa_$nprocd; then - if test "$host" = ""; then - host=hostfile_qa_$nprocd - fi - fi -fi - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then - dotdat=.inp - fi - - if test "$progdll"; then - /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll - rmdll=yes - pathdll=yes - progdll=${progdll}_$marcdll - else - progdll=$marcdll - fi - - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - pathdll=yes - fi -fi - -############################################################################## -# check parameter validity # -############################################################################## - -while test forever; do - -# -# check for input file existence -# -if test $nprocdddm -gt 1 -a $icreated -eq 0; then - if test ! -f $DIRJID/1$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/1$jid$dotdat not accessible" - fi - fi -else - if test ! -f $DIRJID/$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/$jid$dotdat not accessible" - fi - fi -fi - if test $nprocd -gt 1; then - if test "$host" ; then - if test ! -f $host; then - error="$error -host name file $host not accessible" - fi - fi - fi - -# -# check if the job is already running in the background -# -if test -f $DIRJOB/$jid.pid; then - error="$error -job is already running (the file $jid.pid exists)" -fi - -# -# if the program name is other than marc, then -# assume that this is a program in the users local directory -# - -bd=$MARC_BIN/ - -case $prog in - marc | MARC | $exefile) - program=$exefile - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - if test ! -f $user - then - error="$error -user subroutine file $user not accessible" - fi - fi - if test "$objs" - then - missingobjs= - for o in $objs - do - if test ! -f "$o" - then - if test -z "$missingobjs" - then - missingobjs="$o" - else - missingobjs="$missingobjs $o" - fi - fi - done - if test -n "$missingobjs" - then - error="$error -user object/library file(s) $missingobjs not accessible" - fi - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$vid" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRVID/1$vid.vfs - then - error="$error -view factor file $DIRVID/1$vid.vfs not accessible" - fi - else - if test ! -f $DIRVID/$vid.vfs - then - error="$error -view factor file $DIRVID/$vid.vfs not accessible" - fi - fi - fi - if $mpioption - then - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" - fi - fi - ;; - *) - program=$prog.marc - case $prog in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - error="$error -program option may not be used with user subroutine" - fi - if test "$objs" - then - error="$error -program option may not be used with user objects or libraries" - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$nauto" - then - if test $nauto -gt 2 - then - error="$error -incorrect option for auto restart " - fi - fi - if test "$ndcoup" - then - if test $ndcoup -gt 3 - then - error="$error -incorrect option for contact decoupling " - fi - fi - if test "$ndytran" - then - if test $ndytran -gt 1 - then - error="$error -incorrect option for Marc-Dytran Switch " - fi - fi - if $mpioption - then - if test ! -x $MARC_BIN/$exefile - then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE " - fi - fi - ;; -esac - -############################################################################## -# check argument integrity # -############################################################################## - -if test "$jid" -then - : -else - error="$error -job id required" -fi - -if test $nprocd -gt 1 -then - if test $nauto -gt 0 - then - error="$error -cannot run DDM job with auto restart (-au) option " - fi -fi -case $qid in - S* | s*) - qid=short - ;; - L* | l*) - qid=long - ;; - V* | v*) - qid=verylong - ;; - B* | b*) - qid=background - ;; - F* | f*) - qid=foreground - ;; - A* | a*) - qid=at - ;; - *) - error="$error -bad value for queue_id option" - ;; -esac - -case $prgsav in - N* | n*) - prgsav=no - ;; - Y* | y*) - prgsav=yes - ;; - *) - error="$error -bad value for save option" - ;; -esac - -case $verify in - N* | n*) - verify=no - ;; - Y* | y*) - verify=yes - ;; - *) - error="$error -bad value for verify option" - ;; -esac - -case $nprocdddm in - -* ) - error="$error -bad value for nprocd option" - ;; -esac - -case $nthread in - -* ) - error="$error -bad value for nthread option" - ;; -esac - -case $itree in - -* ) - error="$error -bad value for itree option" - ;; -esac -case $iam in - -* ) - error="$error -bad value for iam option" - ;; -esac -case $compatible in - N* | n*) - compatible=no - ;; - Y* | y*) - compatible=yes - ;; - unknown) - ;; - *) - error="$error -bad value for comp option" - ;; -esac -case $cpinput in - N* | n*) - cpinput=no - ;; - Y* | y*) - cpinput=yes - ;; - *) - error="$error -bad value for copy input option" - ;; -esac -case $cpresults in - N* | n*) - cpresults=no - ;; - Y* | y*) - cpresults=yes - ;; - *) - error="$error -bad value for copy results option" - ;; -esac - -# -# check for external file to run -# -if test -f $MARC_TOOLS/run_marc_check -then - . $MARC_TOOLS/run_marc_check -fi - -# -# pick up version data from bin/VERSION if it exists -# -if test -f $MARC_BIN/VERSION; then - ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` - if test -n "$ppp" ;then - PRODUCT=$ppp - fi - ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` - if test -n "$ppp" ;then - REVISION=", Build $ppp" - fi -fi -############################################################################## -# interact with the user to get the required information to run marc or # -# other marc system program # -############################################################################## - -deletelog=yes -if test $qid = background -a $verify = no -then -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto " > $jid.log -deletelog=no -fi -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto" - - -case $qid in - s* | S* | l* | L* | v* | V* ) - echo \ -"Queue priority : $priority -Queue CPU limit : $cpu -Queue start time : $att" - ;; -# * ) -# echo \ -#" " -# ;; -esac - -if test "$error" -then - if test $verify = yes - then - $ECHO "$error - -Please correct or quit(correct,quit,): $ECHOTXT" - error= - read answer - case $answer in - q* | Q*) - answer=quit - ;; - *) - answer=correct - ;; - esac - else - $ECHO "$error - $ECHOTXT" - echo " " - if test "$deletelog" = no - then - $ECHO "$error - $ECHOTXT" >> $jid.log - echo " " >> $jid.log - fi - answer=quit - fi -else - if test $verify = yes - then - $ECHO " -Are these parameters correct (yes,no,quit,)? $ECHOTXT" - read answer - case $answer in - q* | Q*) - answer=quit - ;; - y* | Y*) - answer=yes - ;; - *) - answer=no - ;; - esac - else - answer=yes - fi -fi - -case $answer in - no | correct) - -############################################################################## -# prompt for each value # -############################################################################## - - $ECHO " -Program name ($prog)? $ECHOTXT" - read value - if test "$value" - then - prog=$value - fi - $ECHO "Job ID ($jid)? $ECHOTXT" - read value - if test "$value" - then - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - fi - $ECHO "User subroutine name ($user)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - user= - ;; - *) - user=$value - - - - - - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - esac - fi - $ECHO "User objects or libraries ($objs)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - objs= - ;; - *) - objs="$value" - ;; - esac - fi - $ECHO "Restart File Job ID ($rid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - rid= - ;; - *) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - esac - fi - $ECHO "Substructure File ID ($sid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - sid= - ;; - *) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - esac - fi - $ECHO "Post File Job ID ($pid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - pid= - ;; - *) - pid=$value - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - esac - fi - $ECHO "Defaults File ID ($did)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - did= - ;; - *) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - esac - fi - $ECHO "View Factor File ID ($vid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - vid= - ;; - *) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - esac - fi - $ECHO "Save generated module ($prgsav)? $ECHOTXT" - read value - if test "$value" - then - prgsav=$value - fi - $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" - read value - if test "$value" - then - nprocdddm=$value - nprocdddmprint=$value - fi - $ECHO "Run on ($nthread) threads ? $ECHOTXT" - read value - if test "$value" - then - nthread=$value - fi - $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" - read value - if test "$value" - then - nsolver=$value - fi -# - if test $nprocdddm -gt 0 - then - nprocd=$nprocdddm - fi - if test $nsolver -gt 0 - then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi - fi - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - nthreadprint=$nthread - if test $nthreadprint -eq 0 - then - nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi - fi -# - $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" - read value - if test "$value" - then - gpuids=$value - fi - if test "$gpuids" = "" ; then - gpuoption= - else - gpuoption="-gp $gpuids" - fi - if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH - if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - fi - fi -# - if test $nprocd -gt 1 - then - $ECHO "Message passing type ($itree)? $ECHOTXT" - read value - if test "$value" - then - itree=$value - fi - $ECHO "Host file name ($host)? $ECHOTXT" - read value - if test "$value" - then - host=$value - fi - if test $nprocdddm -gt 1 - then - $ECHO "Single input file? $ECHOTXT" - read value - case $value in - y* | Y*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" - read value - if test "$value" - then - compatible=$value - fi - $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" - read value - if test "$value" - then - cpinput=$value - fi - $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" - read value - if test "$value" - then - cpresults=$value - fi - fi - fi - $ECHO "Run the job in the queue ($qid)? $ECHOTXT" - read value - if test "$value" - then - qid=$value - fi - case $qid in - s* | S* | l* | L* | v* | V* ) - $ECHO "Queue priority ($priority)? $ECHOTXT" - read value - if test "$value" - then - priority=$value - fi - $ECHO "Job starts at ($att)? $ECHOTXT" - read value - if test "$value" - then - att=$value - fi - $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" - read value - if test "$value" - then - cpu=$value - fi - ;; - * ) - ;; - esac - $ECHO "Auto Restart option ($nauto)? $ECHOTXT" - read value - if test "$value" - then - nauto=$value - fi - $ECHO "Run directory ($DIRJOB)? $ECHOTXT" - read value - if test "$value" - then - DIRJOB=$value - DIRSCR=$DIRJOB - fi - $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" - read value - if test "$value" - then - DIRSCR=$value - fi - ;; - quit) - exit 1 - ;; - *) - break - ;; - -esac - - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - -done - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - pathdll=yes - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - fi - - if test "$pathdll"; then -# -# reset share lib path -# - if test $MACHINENAME = "HP" - then - SHLIB_PATH=$DIRJOB:$SHLIB_PATH - export SHLIB_PATH - fi - if test $MACHINENAME = "IBM" - then - LIBPATH=$DIRJOB:$LIBPATH - export LIBPATH - fi -# - LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH - LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH - LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH - export LD_LIBRARY_PATH - export LD_LIBRARY64_PATH - export LD_LIBRARYN32_PATH - fi -fi -# end of dllrun>0 - - -if test $program = $exefile -o $program = $prog.marc -then - -# delete the old .log file unless we run in the background -if test "$deletelog" = yes -then - /bin/rm $jid.log 2>/dev/null -else - echo - echo running the job in the background, see $jid.log - echo -fi - -# -# check if this is an autoforge or rezoning or radiation job -# -if test $nprocd -eq 1 -then - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` - if test "$line" - then - autoforge=1 - fi -fi -# -# check that jobname for restarted run is not the same -# as restart file basename -# -if test "$rid" -then - if test "$jid" = "$rid" - then - echo " " - echo "ERROR: job name of current run is the same as job name" - echo " of the restarted job" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "ERROR: job name of current run is the same as job name" >> $jid.log - echo " of the restarted job" >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi -fi - -# -# user objects/libraries used -# - - if test "$objs" - then - program="$DIRJOB/$jid.marc" - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# user subroutine used -# -# add DAMASK options for linking - DAMASK="" - - if test "$user" - then - program=$usernoext.marc - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# Special case for IBM using POE but not an SP machine -# in this case we always need a host file, also for serial jobs. -# -if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP -then - MP_HOSTFILE=${jid}.host - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $nprocd -gt 1 - then - numdom=$nprocd - while test $numdom -gt 0 - do - hostname -s >> $MP_HOSTFILE - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - else - hostname -s > $MP_HOSTFILE - fi -fi -# -# check correctness of host file; fix for user sub -# - if test $nprocd -gt 1 - then - -# construct the path name to the executable (execpath) - execpath=$MARC_BIN/$exefile - usersub=0 - if test $program = $prog.marc - then - execpath=$prog.marc - usersub=1 - fi - if test "$objs" - then - execpath="$DIRJOB/$jid.marc" - usersub=1 - fi - if test "$user" - then - execpath=$usernoext.marc - usersub=1 - fi - export execpath - execname=`$BASENAME $execpath` - - if test "$host" - then - userhost=$host - case $userhost in - \/* | \.\/*) - ;; - *) - userhost=`pwd`/$userhost - ;; - esac - -# check that the number of processes specified in the hostfile is -# equal to nprocd specified by -nprocd. - numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` - if test $nprocd -ne $numproc - then - echo " " - echo "error, the number of processes specified in the host file" - echo "must be equal to the number of processes given by -nprocd/-nsolver" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, the number of processes specified in the host file" >> $jid.log - echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - -# check for Myrinet that the number of processes per host is -# less than number of available user ports, 5 -# .gmpi directory must exist in user's home directory -# and must have write permission from remote hosts - if test $MPITYPE = "myrinet" - then - numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` - if test $numproc -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes specified " - echo "in the hostfile must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes specified " >> $jid.log - echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - if test ! -d ~/.gmpi - then - echo " " - echo "error, for Myrinet a .gmpi directory must exist " - echo "under the user's home directory" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log - echo "under the user's home directory" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - homedir=`echo ~` - for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - echo " " - echo "error, for Myrinet a shared .gmpi directory must exist " - echo "under the user's home directory " - echo "with remote write permission" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log - echo "under the user's home directory " >> $jid.log - echo "with remote write permission" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - /bin/rm tmp.$$ - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - fi - fi - done - fi - fi - -# construct the host file $jid.host which is used by mpirun -# skip lines starting with # and only consider lines with more than -# one word in them. Note that the hostfile given to this script -# has two columns: the host name and the number of shared processes -# to run on this host. mpirun wants the number of _other_ -# processes to run in addition to the one being run on the machine -# on which the job is started. hence the $2-1 for fnr == 1. - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then -# HPMPI or HP hardware MPI - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ - -v mpihpspecial="$MPIHPSPECIAL" \ -'{if ( NF > 0) {\ - fnr++ ; \ - printf("-h %s -np %s",$1,$2); \ - printf(" %s",mpihpspecial); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ - if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ - }\ - }' > $jid.host -# end HPMPI or HP hardware MPI - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then -# IBM using hardware MPI (POE) - MP_HOSTFILE=$jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host -# end IBM using hardware MPI (POE) -# for Intel MPI, need to create a machinefile for DMP - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then -# Intel MPI - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - /bin/cp $host $jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Intel MPI for DMP -# for Solaris HPC 7.1, need to create a machinefile for DMP - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then -# Solaris HPC 7.1 - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Solaris HPC 7.1 for DMP -# for Myrinet, construct a configuration file in ~/.gmpi -# this must be readable by each process -# format is (hostname) (port number) for each process - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - grep -v '^#' $host | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ -{if ( NF > 0 ) \ - for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ -}' >> ~/.gmpi/$jid.host - else -# this is for mpich-1.2.5 and later, using the -pg option -# format: host nproc executable user arguments -# the arguments are added later - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s %s\n",path,user);\ - if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ - }\ - }' > $jid.host - fi -# end Myrinet - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then -# Compaq MPI via Memory Channel - grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host -# end Compaq MPI - else -# MPICH - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ - }\ - }' > $jid.host - fi -# define the variable host and host_filt -# host_filt is used for loops over hosts -# for Myrinet we need to use a filtered variant of userhost -# for others we can use $host - if test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - host=~/.gmpi/$jid.host - host_filt=$jid.host_tMp - grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt - else - host=$jid.host - host_filt=$host - fi - else - host=$jid.host - host_filt=$host - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - host_filt=$jid.mfile - fi - fi -# figure out if the machines in the hostfile are nfs mounted -# or distributed and set the variable "dirstatus" accordingly. -# only perform the check if user subroutine is used -# or a user subroutine executable is used - - numfield=1 - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - numfield=2 - fi - DIR1=$DIRJOB - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - counter=0 - echo " " - echo "checking if local or shared directories for host" - if test "$deletelog" = no - then - echo "checking if local or shared directories for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - dirstatus[$counter]="shared" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - dirstatus[$counter]="local" - /bin/rm tmp.$$ - else - if test ! -f $jid.$$ - then - dirstatus[$counter]="local" - $RSH $i /bin/rm $DIR1/$jid.$$ - else - /bin/rm $jid.$$ - fi - fi - if test -f tmp.$$ - then - /bin/rm tmp.$$ - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - echo " ${dirstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${dirstatus[$counter]}" >> $jid.log - fi - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - fi - -# figure out if this is a compatible set of machines -# unless explicitly specified with flag -comp -# only perform the check if user subroutine is used -# or a user subroutine executable is used -# Myrinet does not support heterogeneous - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - if test $compatible = "unknown" - then - thisname=$ARCH - compatible=yes - counter=0 - echo "checking if machines are compatible for host" - if test "$deletelog" = no - then - echo "checking if machines are compatible for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]="yes" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - othername=`$RSH $i uname -a | cut -f 1 -d " "` - if test $thisname != $othername - then - compatible=no - compstatus[$counter]="no" - fi - fi - echo " ${compstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${compstatus[$counter]}" >> $jid.log - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - else - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]=$compatible - fi - done - if test $compatible = "no" - then - echo "all machines assumed incompatible" - if test "$deletelog" = no - then - echo "all machines assumed incompatible" >> $jid.log - fi - else - echo "all machines compatible" - if test "$deletelog" = no - then - echo "all machines compatible" >> $jid.log - fi - fi - fi -# error out if user objects or libraries are used on incompatible machines - if test "$compatible" = "no" -a -n "$objs" - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" - if test "$deletelog" = no - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log - fi - exit 1 - fi -# modify new host file if NFS mounted heterogeneous machine - doit= - if test $program = $prog.marc - then - doit=yes - fi - if test "$user" - then - doit=yes - fi - if test "$doit" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - $AWK -v hst=$i '{fnr++ ; \ -if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ -printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} - /bin/mv $jid.host{$$} $jid.host - host=$jid.host - fi - fi - done - fi - fi # if test $program = $prog.marc -o $user -o $obj - - else # if test $host - # assume shared memory machine if no hostfile given and - # MPITYPE is set to mpich or Myrinet - # check for Myrinet that the total number of processes is - # less than number of available user ports, 5 - if test $MPITYPE = "mpich" -o $MPITYPE = "scali" - then - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - host=$jid.host - elif test $MPITYPE = "myrinet" - then - if test $nprocd -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes " - echo "must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes " >> $jid.log - echo "must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - echo `hostname` $nprocd | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ - {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ -' >> ~/.gmpi/$jid.host - host=~/.gmpi/$jid.host - else - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - - fi - fi # if test myrinet - - fi # if test $host - - fi # if test $nprocd -gt 1 - -fi # if test $program = $exefile -o $program = $prog.marc - -############################################################################## -# construct run stream (Marc only) # -############################################################################## - -# set maximum message length for ddm to a large number -# for vendor provided mpi -if test $itree -eq 0 -a $MPITYPE = hardware -then - itree=100000000 - if test $MACHINENAME = SGI - then - itree=100000001 - fi -fi -if test $itree -eq 0 -a $MPITYPE = hpmpi -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = myrinet -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = nec -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = scali -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = intelmpi -then - itree=100000000 -fi -if test $nprocdddm -lt 2 -then - nprocdarg= -else - nprocdarg="$nprocdarg $nprocdddm" -fi -if test $nsolver -eq 0 -then - nsolverarg= -else - nsolverarg="$nsolverarg $nsolver" -fi -if test $nprocdddm -lt 2 -a $nsolver -eq 0 -then -nprocd=0 -fi -if test $nprocd -gt 0 -then - if test "$host" - then - if test -z "$RUN_JOB2" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then - RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" - RUN_JOB=" -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - numhost=`uniq $jid.mfile | wc -l` - if test "$INTELMPI_VERSION" = "HYDRA" - then - RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n $numhost -r $RSH -f $jid.mfile - RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" - fi - -# intelmpi uses configfile. format: -# -host host1 -n n1 executable marcargs -# one such line per host -# collect the marcargs in RUN_JOB and construct the config file later -# collect the run stream in RUN_JOB_TMP - RUN_JOB="-jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - - - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then - RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - if test "$userhost" - then - RUN_JOB="$RUN_JOB -mhost $userhost" - fi - if test $MPITYPE = "scali" - then -# set default working directory to /tmp to allow -# different directory names - SCAMPI_WORKING_DIRECTORY=/tmp - export SCAMPI_WORKING_DIRECTORY - fi - else - if test -z "$RUN_JOB1" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - RUNNPROCD=$nprocd - if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" - then - RUNNPROCD= - MP_PROCS=$nprocd - export MP_PROCS - fi - if test $MPITYPE = "myrinet" - then - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n 1 -f $jid.hosts - fi - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - fi -else - if test $nauto -gt 0 -o $ndcoup -gt 0 - then - RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - else -# this is for a serial job without auto restart: - RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi -fi -if test "$rid" -then - RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" -fi -if test "$pid" -then - RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" -fi -if test "$sid" -then - RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" -fi -if test "$did" -then - RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" -fi -if test "$vid" -then - RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" -fi -if test $nauto -gt 0 -then - RUN_JOB="$RUN_JOB -autorst $nauto " -fi -if test $ndcoup -gt 0 -then - RUN_JOB="$RUN_JOB -dcoup $ndcoup " -fi -if test $ndytran -gt 0 -then - RUN_JOB="$RUN_JOB -dytran $ndytran " -fi -if test $mesh -gt 0 -then - RUN_JOB="$RUN_JOB -me $mesh " -fi -if test $noutcore -gt 0 -then - RUN_JOB="$RUN_JOB -outcore $noutcore " -fi -if test "$dllrun" -gt 0 -then - RUN_JOB="$RUN_JOB -dll $dllrun " -fi -if test "$trkrun" -gt 0 -then - RUN_JOB="$RUN_JOB -trk $trkrun " -fi -if test "$iam" -then - RUN_JOB="$RUN_JOB -iam $iam " -fi -if test "$justlist" -then - RUN_JOB="$RUN_JOB -list 1 " -fi -if test "$feature" -then - RUN_JOB="$RUN_JOB -feature $feature " -fi -if test "$memlimit" -ne 0 -then - RUN_JOB="$RUN_JOB -ml $memlimit " -fi -if test "$cpinput" -then - RUN_JOB="$RUN_JOB -ci $cpinput " -fi -if test "$cpresults" -then - RUN_JOB="$RUN_JOB -cr $cpresults " -fi -if test "$DIRSCR" != "$DIRJOB" -then - RUN_JOB="$RUN_JOB -dirscr $DIRSCR" -else - DIRSCR=$DIRJOB -fi -if test "$makebdf" -then - RUN_JOB="$RUN_JOB -bdf $makebdf " -fi -if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" -then - # append $RUN_JOB to all lines of the host file - # and set RUN_JOB - $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ - /bin/mv $host.$$ $host - RUN_JOB=$RUN_JOB_TMP -fi -if test $MPITYPE = "intelmpi" -a "$host" -then - # construct config file, append $RUN_JOB to all lines of the config file - # and set RUN_JOB - if test "$INTELMPI_VERSION" = "HYDRA" - then - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - else - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-host %s -n %s",$1,$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - fi - RUN_JOB=$RUN_JOB_TMP -fi -echo " " -echo "Final run stream value" -echo " RUNJOB="$RUN_JOB -if test "$deletelog" = no -then -echo " " >> $jid.log -echo "Final run stream value" >> $jid.log -echo " RUNJOB="$RUN_JOB >> $jid.log -fi - - -############################################################################## -# run marc using valgrind # -############################################################################## -#RUN_JOB="valgrind $RUN_JOB" -#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" -############################################################################## - - -############################################################################## -# run the requested program in a queue # -############################################################################## - -if test "$deletelog" = yes -then - echo - date -else - echo >> $jid.log - date >> $jid.log -fi -if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] -then - -/bin/rm -f $jid.runmarcscript - - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - userobj=$usernoext.o - fi - cat > $jid.runmarcscript << END4 - if test "$user" - then - if test $MACHINENAME = "CRAY" - then - $DFORTLOWMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTLOWMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $MARCCUDALIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } -END4 -else - prgsav=yes -fi -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# - -cat >> $jid.runmarcscript << END5 - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -# first remove all .out files and incremental restart files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null - /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null -fi - -if test $nprocdddm -gt 1 -then - $RUN_JOB 2>>$jid.log -else - $RUN_JOB 2>>$jid.log -fi - -if test $dllrun -eq 0; then - if test $prgsav = no - then - /bin/rm -f $bd$program 2>/dev/null - fi -else - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes - then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -END5 - - -# Submit to marc batch queue -# -if [ $qid = at ] -then -QUENAME=at -SUBMCMD= -else -# -# Submit to qsub queue -# -QUENAME=qsub -SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" -if test "$priority" -then - SUBMCMD=$SUBMCMD" -p $priority" -fi -if test "$att" -then - SUBMCMD=$SUBMCMD" -a $att" -fi -if test "$cpu" -then - SUBMCMD=$SUBMCMD" -lt $cpu" -fi - -fi -echo $QUENAME $SUBMCMD -#cat $jid.runmarcscript -$QUENAME $SUBMCMD < $jid.runmarcscript - -/bin/rm -f $jid.runmarcscript - -############################################################################## -# run the requested program in the background # -############################################################################## - -else -if test $qid = background -then - -# -# first remove all old .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi -# -# compile user subroutine if present -# -( -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_lmp $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - echo " $PRODUCT Exit number 3" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTLOWMP $user || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTLOWMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - echo " $PRODUCT Exit number 3" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc - -# - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -$RUN_JOB & - -marcpid=$! -echo $marcpid > $DIRJOB/$jid.pid -wait $marcpid - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -) 1>>$jid.log 2>&1 & - - -############################################################################## -# run the requested program in the foreground # -############################################################################## - -else - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_lmp $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTLOWMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTLOWMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi -# first remove all .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi - -$RUN_JOB - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - if test "$host" - then - mpdcleanup -a -f $jid.mfile - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.mfile 2> /dev/null - else - mpdcleanup -a -f $jid.hosts - /bin/rm $jid.hosts 2> /dev/null - fi - fi - fi -fi - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi - - -fi -fi diff --git a/installation/mods_MarcMentat/2012/Marc_tools/run_damask_mp b/installation/mods_MarcMentat/2012/Marc_tools/run_damask_mp deleted file mode 100644 index 9cb386a7d..000000000 --- a/installation/mods_MarcMentat/2012/Marc_tools/run_damask_mp +++ /dev/null @@ -1,3690 +0,0 @@ -#!/bin/ksh -############################################################################## -# # -# run_marc - run a marc job # -# ------------------------- # -# # -# usage: run_marc -j jid { options } # -# # -# where standard options are: required: defaults: # -# -------------------------- # -# # -# -j* jid job id number. ** YES ** . # -# -pr* prog program name. . marc # -# -v* y|n do or do not verify inputs. . yes # -# -q* s|l|v|b|f batch queue name or background, . short # -# foreground. # -# -b* as alternative to option -q* # -# # -# ( batch queues only : # -# -pq* intra queue priority. . . # -# -at DATE/TIME delay start of job. . . # -# format : January,1,1990,12:31 # -# or : today,5pm # -# -cpu* secs job CPU limit . . ) # -# # -# -r* rid restart file job id. . . # -# -si* sid substructure file id. . . # -# -pi* post post file job id. . . # -# -de* did defaults file . no # -# -vf vid viewfactor . no # -# # -# -u* user user subroutine. . . # -# -obj obj user objects or libraries. . . # -# -sa* y|n do or do not save load module. . no # -# -autorst auto restart flag for auto forge . no # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo selects i4 or i8 version # -# default: i4 or via defaults file run_marc_defaults # -# the -mo option will override # -# -mpi selects MPI version # -# each platform has a default MPI version and some # -# have an alternative version. see the include file # -# for the respective platform # -# MPI_DEFAULT defines the default MPI version # -# MPI_OTHER defines versions one can switch to # -# -dcoup for contact decoupling # -# currently not supported # -# -dir directory where the job i/o should take place. # -# defaults to current directory. # -# -sdir directory where scratch files are created # -# defaults to current directory. # -# # -# -alloc only perform memory allocation test, no analysis # -# -list y only list options in the input file, no analysis # -# -fe num set feature number "num" for the run. only one allowed # -# -dytran flag to switch from Dytran to Marc # -# dytran = 0, program will run w/o Marc-Dytran Switch # -# = 1, program will restart Marc after Dytran run # -# >= 2, Not supported yet. # -# currently not supported # -# -ou force analysis to use out-of-core control # -# =0, not used # -# =1, element storage out-of-core # -# -dll run marc using shared library libmarc.so and exe_marc # -# =1, used # -# =2, do not free streaming input memory # -# =3, run with marc input deck # -# -trk run marc for post-tracking # -# -gpuid run marc using GPGPU capability # -# specify gpuid on to be used in the analysis. Multiple # -# IDs may be assigned for DDM runs. # -# Separate a list of IDs with a colon. Each DMP # -# process will be assigned a GPU ID in round robin fastion# -# = 0 # -# = 0:1 etc... # -# # -# where parallel options are: # -# -------------------------- # -# # -# itree, host, and comp options are available for the domain # -# decomposition only. # -# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # -# # -# # -# -nprocd number of domains. # -# defaults to single domain solution. # -# -nprocds number of domains if single input file. # -# defaults to single domain solution. # -# -nps same as -nprocds. # -# -nsolver number of solver tasks for solver types 12 and 13 # -# these are distributed tasks operating via MPI # -# -nthread number of solver threads for solver types 6, 8, and 11 # -# also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. if both specified, nthread option# -# will be used. # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by 6, 8, and 11 # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor nthread specified. # -# -itree message passing tree type for domain decomposition. # -# for debugging purposes; should not normally be used. # -# -host hostfile name for distributed execution on network. # -# defaults to no hostfile, unless jobid.defhost exists. # -# if jobid.defhost exists, only -np(s) necessary # -# -comp* y|n to be used with user routines on a network of # -# incompatible machines. # -# if set to no, a separate executable will be created # -# for each machine on the network. # -# if set to yes, the executable located on the machine # -# from which marc is started will be used on all machines.# -# defaults to no if O/S versions different on machines. # -# # -# -ci y|n copy input files to remote hosts (default: yes) # -# if "yes", input files are automatically copied to # -# remote hosts for a network run if necessary. # -# -cr y|n copy post files from remote hosts (default: yes) # -# if "yes", post files are automatically copied back from # -# remote hosts for a network run if necessary. # -############################################################################## -# set DIR to the directory in which this script is -REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" -DIR=`dirname $REALCOM` -# make sure DIR has an absolute path -case $DIR in - \/*) - ;; - *) - DIR=`pwd`/$DIR - ;; -esac -DIRSCRIPT=$DIR -AWK=awk -ARCH=`uname -a | cut -f 1 -d " "` -# Sun has a bad awk, use nawk instead -if test $ARCH = "SunOS" -then - AWK=nawk -fi -BASENAME=basename -# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists -if test $ARCH = "SunOS" -then - if test -x /usr/ucb/basename - then - BASENAME=/usr/ucb/basename - fi -fi - -# echo command line in the case of ECHO_COMMAND is true -if test "$ECHO_COMMAND" = true ; then - echo command "$0" "$@" -fi - -# -# "mode" selects version, i4 or i8 -# default is i4 -# this can be changed by a file run_marc_defaults -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MODE i8 -# it can also be set by the environmental variable MARC_INTEGER_SIZE -# and by the command line option "-mo" -# -mode= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -f $HOME/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -n "$MARC_INTEGER_SIZE" ; then - mode=$MARC_INTEGER_SIZE -fi -if test -z "$mode" ; then - mode=i4 -fi -case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "error, version mode must be i4 or i8" - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i4 or i8" - echo " " - echo " use -mo i4 or -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - setmode=true - fi - if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - fi - if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -done - -# set to i4 version for 32 bit Linux -if test "`uname -s`" = "Linux"; then - if test "`uname -m`" = "i686"; then - mode=i4 - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -fi - - -. "$DIR/getarch" - -# Change_me -. $MARC_INCLUDE -# - -# -# Dynamically determine the echo syntax -# - -case "`echo '\c'`" in - '\c') - ECHO='echo -n' - ECHOTXT=' ' - ;; - *) - ECHO='echo' - ECHOTXT=' \c' - ;; -esac - -# -# Variables for the MARC environment -# - -PRODUCT="Marc" -EXITMSG=$MARC_TOOLS/MESSAGES -export EXITMSG -FLEXDIR=$DIR/../flexlm/licenses -export FLEXDIR -TIMCHK=3600 -export TIMCHK -BINDIR=$MARC_BIN -export BINDIR -AFMATDAT=$MARC_RUNTIME/AF_flowmat/ -export AFMATDAT -# -# define directory path to global unified material database -# -MATFILE= -export MATFILE - -# -# define memory limit -# first set to MEMLIMIT from include -# -ml option overrules if specified -memlimit=$MEMLIMIT -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -# -if test $MACHINENAME = "HP" -then - SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH - export SHLIB_PATH -fi -# the one for IBM is defined futher down - -LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH -LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH -export LD_LIBRARY_PATH -export LD_LIBRARY64_PATH -export LD_LIBRARYN32_PATH - -atexit() { -kill -15 $$ -# -if test $MPITYPE = "myrinet" -then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi -fi -} - -trap "atexit" 2 - -# -# defaults -# - -prog=marc -exefile=marc -jid= -rid= -pid= -sid= -did= -vid= -user= -usersnoext= -objs= -qid=background -cpu= -priority= -att= -trk= -verify=yes -prgsav=no -rmdll=no -cpdll=no -progdll= -pathdll= -error= -nprocd=0 -nprocdddm=1 -nprocdddmprint= -icreated=0 -nprocdarg= -nsolver=0 -nsolverarg=-ns -if test $nprocds -then - if test $nprocds -gt 1 - then - nprocdddm=$nprocds - nprocdddmprint=$nprocds - icreated=1 - nprocdarg=-nprocds - fi -fi -nthread=-1 -gpuids= -nauto=0 -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -nthreadprint=0 -itree=0 -iam= -link= -trkrun=0 -DIRJOB=`pwd` -DIRSCR=$DIRJOB -DIRSCRSET= -autoforge=0 -dotdat=.dat -dotdefhost=.defhost -host= -numhost= -mfile= -userhost= -makebdf= -cpinput=yes -cpresults=yes -marcdll=libmarc.$EXT_DLL -# define hostname and strip off extensions (alpha.aaa.com) -thishost=`hostname` -thishost=${thishost%%.*} -compatible=unknown -numfield=1 -justlist= -feature= -mpioption=false -MDSRCLIB=$MARC_LIB/mdsrc.a -# -# check run_marc_defaults file for default MPI setting -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MPI -# -value= -file= -if test -f $DIRSCRIPT/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$DIRSCRIPT/run_marc_defaults - fi -fi -if test -f $HOME/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$HOME/run_marc_defaults - fi -fi -if test -n "$value"; then - MARC_MPITYPE=$value - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - echo " " - echo " error, incorrect option for MARC_MPI" - echo " defined in $file: $MARC_MPITYPE" - echo " valid options: $MPI_DEFAULT $MPI_OTHER" - echo " " - exit - fi - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - fi -fi -# -# -# allow scratch directory to be specified with environmental variable -# MARCSCRATCH -if test $MARCSCRATCH -then - if test -d $MARCSCRATCH - then - DIRSCR=$MARCSCRATCH - else - echo "error, scratch directory '$MARCSCRATCH'" - echo " specified via environmental variable MARCSCRATCH does not exist" - exit - fi -fi -# -############################################################################## -# parse input - arguments always come in pairs # -############################################################################## - -arg=$1 -if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - shift - arg=$1 -fi -while [ -n "$arg" ] -do - shift - value=$1 - case $arg in - -al* | -AL*) - LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - $MARC_BIN/marc -alloc 1 - exit - ;; - -li* | -LI*) - justlist=yes - ;; - -fe* | -FE*) - feature=$value - ;; - -pr* | -PR*) - if test `dirname $value` = '.' - then - prog=`$BASENAME $value .marc` - progdll=`$BASENAME $value` - else - prog=`dirname $value`/`$BASENAME $value .marc` - progdll=`dirname $value`/`$BASENAME $value` - fi - prdir=`dirname $value` - case $prdir in - \/*) - ;; - *) - prog=`pwd`/$prdir/$prog - ;; - esac - ;; - -j* | -J*) - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - ;; - -r* | -R*) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - -si* | -SI*) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - -pi* | -PI*) - if test -f $value.t19 - then - pid=`$BASENAME $value .t19` - else - pid=`$BASENAME $value .t16` - fi - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - -bdf | -BDF) - makebdf=1 - ;; - -de* | -DE*) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - -vf | -VF) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - -u* | -U*) - - user=$value - - - - - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - -obj | -OBJ) - objs="$value" - ;; - -q* | -Q*) - qid=$value - ;; - -b* | -B*) - case $value in - y* | Y*) - qid=background - ;; - n* | N*) - qid=foreground - ;; - *) - ;; - esac - ;; - -at | -AT) - att=$value - ;; - -cpu* | -CPU*) - cpu=$value - ;; - -pq | -PQ*) - priority=$value - ;; - -v* | -V*) - verify=$value - ;; - -sa* | -SA*) - prgsav=$value - ;; - -np* | -NP*) - nprocdddm=$value - nprocdddmprint=$value - case $arg in - -nps* | -NPS* | -nprocds* | -NPROCDS*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - case $arg in - -np | -NP | -nprocd | -NPROCD) - icreated=0 - nprocdarg=-nprocd - ;; - esac - ;; - -ns* | -NS*) - nsolver=$value - ;; - -nt* | -NT*) - nthread=$value - ;; - -gp* | -GP*) - gpuids=$value - ;; - -it* | -IT*) - itree=$value - ;; - -iam | -IAM) - iam=$value - ;; - -au* | -AU*) - nauto=$value - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -me | -ME ) - mesh=$value - ;; - -ml | -ML ) - memlimit=$value - ;; - -mo | -MO ) - ;; - -mpi | -MPI ) - mpioption=true - MARC_MPITYPE=$value - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - fi - fi - ;; - -dir* | -DIR*) - DIRJOB=$value - case $DIRJOB in - \/*) - ;; - *) - DIRJOB=`pwd`/$DIRJOB - ;; - esac - if test -z "$DIRSCRSET" - then - DIRSCR=$DIRJOB - fi - ;; - -sd* | -SD*) - DIRSCR=$value - DIRSCRSET=yes - case $DIRSCR in - \/*) - ;; - *) - DIRSCR=`pwd`/$DIRSCR - ;; - esac - ;; - -ho* | -HO*) - host=$value - ;; - -co* | -CO*) - compatible=$value - ;; - -ci* | -CI*) - cpinput=$value - ;; - -cr* | -CR*) - cpresults=$value - ;; - *) - error="$error -$arg: invalid option" - break - ;; - esac - case $value in - -*) - error="$error -$arg: invalid name $value" - break - ;; - esac - shift - arg=$1 - if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - shift - arg=$1 - fi -done -argc=`expr $# % 2` -if test $argc -eq 1 -then -# -# odd number of arguments -# - error="$error -argument list incomplete" -fi - -if test $nprocdddm -gt 0 -then -nprocd=$nprocdddm -fi - -if test $nsolver -gt 0 -then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi -fi - -if test $nthread -eq -1 -then -nthread=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nthread -lt 0 -then -nthread=0 -fi - -nthreadprint=$nthread -if test $nthreadprint -eq 0 -then -nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi -fi - -nthread=$nthreadprint - -gpuoption= -if test "$gpuids" = "" ; then - gpuoption= -else - gpuoption="-gp $gpuids" -fi - -if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH -else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH -# Linux 64 + HPMPI, Below code is taken from include_linux64 - if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - fi -fi - -if test $nprocd -gt 1; then - if test -f $jid$dotdefhost; then - if test "$host" = ""; then - host=$jid$dotdefhost - fi - fi - if test -f hostfile_qa_$nprocd; then - if test "$host" = ""; then - host=hostfile_qa_$nprocd - fi - fi -fi - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then - dotdat=.inp - fi - - if test "$progdll"; then - /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll - rmdll=yes - pathdll=yes - progdll=${progdll}_$marcdll - else - progdll=$marcdll - fi - - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - pathdll=yes - fi -fi - -############################################################################## -# check parameter validity # -############################################################################## - -while test forever; do - -# -# check for input file existence -# -if test $nprocdddm -gt 1 -a $icreated -eq 0; then - if test ! -f $DIRJID/1$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/1$jid$dotdat not accessible" - fi - fi -else - if test ! -f $DIRJID/$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/$jid$dotdat not accessible" - fi - fi -fi - if test $nprocd -gt 1; then - if test "$host" ; then - if test ! -f $host; then - error="$error -host name file $host not accessible" - fi - fi - fi - -# -# check if the job is already running in the background -# -if test -f $DIRJOB/$jid.pid; then - error="$error -job is already running (the file $jid.pid exists)" -fi - -# -# if the program name is other than marc, then -# assume that this is a program in the users local directory -# - -bd=$MARC_BIN/ - -case $prog in - marc | MARC | $exefile) - program=$exefile - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - if test ! -f $user - then - error="$error -user subroutine file $user not accessible" - fi - fi - if test "$objs" - then - missingobjs= - for o in $objs - do - if test ! -f "$o" - then - if test -z "$missingobjs" - then - missingobjs="$o" - else - missingobjs="$missingobjs $o" - fi - fi - done - if test -n "$missingobjs" - then - error="$error -user object/library file(s) $missingobjs not accessible" - fi - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$vid" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRVID/1$vid.vfs - then - error="$error -view factor file $DIRVID/1$vid.vfs not accessible" - fi - else - if test ! -f $DIRVID/$vid.vfs - then - error="$error -view factor file $DIRVID/$vid.vfs not accessible" - fi - fi - fi - if $mpioption - then - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" - fi - fi - ;; - *) - program=$prog.marc - case $prog in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - error="$error -program option may not be used with user subroutine" - fi - if test "$objs" - then - error="$error -program option may not be used with user objects or libraries" - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$nauto" - then - if test $nauto -gt 2 - then - error="$error -incorrect option for auto restart " - fi - fi - if test "$ndcoup" - then - if test $ndcoup -gt 3 - then - error="$error -incorrect option for contact decoupling " - fi - fi - if test "$ndytran" - then - if test $ndytran -gt 1 - then - error="$error -incorrect option for Marc-Dytran Switch " - fi - fi - if $mpioption - then - if test ! -x $MARC_BIN/$exefile - then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE " - fi - fi - ;; -esac - -############################################################################## -# check argument integrity # -############################################################################## - -if test "$jid" -then - : -else - error="$error -job id required" -fi - -if test $nprocd -gt 1 -then - if test $nauto -gt 0 - then - error="$error -cannot run DDM job with auto restart (-au) option " - fi -fi -case $qid in - S* | s*) - qid=short - ;; - L* | l*) - qid=long - ;; - V* | v*) - qid=verylong - ;; - B* | b*) - qid=background - ;; - F* | f*) - qid=foreground - ;; - A* | a*) - qid=at - ;; - *) - error="$error -bad value for queue_id option" - ;; -esac - -case $prgsav in - N* | n*) - prgsav=no - ;; - Y* | y*) - prgsav=yes - ;; - *) - error="$error -bad value for save option" - ;; -esac - -case $verify in - N* | n*) - verify=no - ;; - Y* | y*) - verify=yes - ;; - *) - error="$error -bad value for verify option" - ;; -esac - -case $nprocdddm in - -* ) - error="$error -bad value for nprocd option" - ;; -esac - -case $nthread in - -* ) - error="$error -bad value for nthread option" - ;; -esac - -case $itree in - -* ) - error="$error -bad value for itree option" - ;; -esac -case $iam in - -* ) - error="$error -bad value for iam option" - ;; -esac -case $compatible in - N* | n*) - compatible=no - ;; - Y* | y*) - compatible=yes - ;; - unknown) - ;; - *) - error="$error -bad value for comp option" - ;; -esac -case $cpinput in - N* | n*) - cpinput=no - ;; - Y* | y*) - cpinput=yes - ;; - *) - error="$error -bad value for copy input option" - ;; -esac -case $cpresults in - N* | n*) - cpresults=no - ;; - Y* | y*) - cpresults=yes - ;; - *) - error="$error -bad value for copy results option" - ;; -esac - -# -# check for external file to run -# -if test -f $MARC_TOOLS/run_marc_check -then - . $MARC_TOOLS/run_marc_check -fi - -# -# pick up version data from bin/VERSION if it exists -# -if test -f $MARC_BIN/VERSION; then - ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` - if test -n "$ppp" ;then - PRODUCT=$ppp - fi - ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` - if test -n "$ppp" ;then - REVISION=", Build $ppp" - fi -fi -############################################################################## -# interact with the user to get the required information to run marc or # -# other marc system program # -############################################################################## - -deletelog=yes -if test $qid = background -a $verify = no -then -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto " > $jid.log -deletelog=no -fi -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto" - - -case $qid in - s* | S* | l* | L* | v* | V* ) - echo \ -"Queue priority : $priority -Queue CPU limit : $cpu -Queue start time : $att" - ;; -# * ) -# echo \ -#" " -# ;; -esac - -if test "$error" -then - if test $verify = yes - then - $ECHO "$error - -Please correct or quit(correct,quit,): $ECHOTXT" - error= - read answer - case $answer in - q* | Q*) - answer=quit - ;; - *) - answer=correct - ;; - esac - else - $ECHO "$error - $ECHOTXT" - echo " " - if test "$deletelog" = no - then - $ECHO "$error - $ECHOTXT" >> $jid.log - echo " " >> $jid.log - fi - answer=quit - fi -else - if test $verify = yes - then - $ECHO " -Are these parameters correct (yes,no,quit,)? $ECHOTXT" - read answer - case $answer in - q* | Q*) - answer=quit - ;; - y* | Y*) - answer=yes - ;; - *) - answer=no - ;; - esac - else - answer=yes - fi -fi - -case $answer in - no | correct) - -############################################################################## -# prompt for each value # -############################################################################## - - $ECHO " -Program name ($prog)? $ECHOTXT" - read value - if test "$value" - then - prog=$value - fi - $ECHO "Job ID ($jid)? $ECHOTXT" - read value - if test "$value" - then - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - fi - $ECHO "User subroutine name ($user)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - user= - ;; - *) - user=$value - - - - - - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - esac - fi - $ECHO "User objects or libraries ($objs)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - objs= - ;; - *) - objs="$value" - ;; - esac - fi - $ECHO "Restart File Job ID ($rid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - rid= - ;; - *) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - esac - fi - $ECHO "Substructure File ID ($sid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - sid= - ;; - *) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - esac - fi - $ECHO "Post File Job ID ($pid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - pid= - ;; - *) - pid=$value - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - esac - fi - $ECHO "Defaults File ID ($did)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - did= - ;; - *) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - esac - fi - $ECHO "View Factor File ID ($vid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - vid= - ;; - *) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - esac - fi - $ECHO "Save generated module ($prgsav)? $ECHOTXT" - read value - if test "$value" - then - prgsav=$value - fi - $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" - read value - if test "$value" - then - nprocdddm=$value - nprocdddmprint=$value - fi - $ECHO "Run on ($nthread) threads ? $ECHOTXT" - read value - if test "$value" - then - nthread=$value - fi - $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" - read value - if test "$value" - then - nsolver=$value - fi -# - if test $nprocdddm -gt 0 - then - nprocd=$nprocdddm - fi - if test $nsolver -gt 0 - then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi - fi - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - nthreadprint=$nthread - if test $nthreadprint -eq 0 - then - nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi - fi -# - $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" - read value - if test "$value" - then - gpuids=$value - fi - if test "$gpuids" = "" ; then - gpuoption= - else - gpuoption="-gp $gpuids" - fi - if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH - if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - fi - fi -# - if test $nprocd -gt 1 - then - $ECHO "Message passing type ($itree)? $ECHOTXT" - read value - if test "$value" - then - itree=$value - fi - $ECHO "Host file name ($host)? $ECHOTXT" - read value - if test "$value" - then - host=$value - fi - if test $nprocdddm -gt 1 - then - $ECHO "Single input file? $ECHOTXT" - read value - case $value in - y* | Y*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" - read value - if test "$value" - then - compatible=$value - fi - $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" - read value - if test "$value" - then - cpinput=$value - fi - $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" - read value - if test "$value" - then - cpresults=$value - fi - fi - fi - $ECHO "Run the job in the queue ($qid)? $ECHOTXT" - read value - if test "$value" - then - qid=$value - fi - case $qid in - s* | S* | l* | L* | v* | V* ) - $ECHO "Queue priority ($priority)? $ECHOTXT" - read value - if test "$value" - then - priority=$value - fi - $ECHO "Job starts at ($att)? $ECHOTXT" - read value - if test "$value" - then - att=$value - fi - $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" - read value - if test "$value" - then - cpu=$value - fi - ;; - * ) - ;; - esac - $ECHO "Auto Restart option ($nauto)? $ECHOTXT" - read value - if test "$value" - then - nauto=$value - fi - $ECHO "Run directory ($DIRJOB)? $ECHOTXT" - read value - if test "$value" - then - DIRJOB=$value - DIRSCR=$DIRJOB - fi - $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" - read value - if test "$value" - then - DIRSCR=$value - fi - ;; - quit) - exit 1 - ;; - *) - break - ;; - -esac - - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - -done - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - pathdll=yes - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - fi - - if test "$pathdll"; then -# -# reset share lib path -# - if test $MACHINENAME = "HP" - then - SHLIB_PATH=$DIRJOB:$SHLIB_PATH - export SHLIB_PATH - fi - if test $MACHINENAME = "IBM" - then - LIBPATH=$DIRJOB:$LIBPATH - export LIBPATH - fi -# - LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH - LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH - LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH - export LD_LIBRARY_PATH - export LD_LIBRARY64_PATH - export LD_LIBRARYN32_PATH - fi -fi -# end of dllrun>0 - - -if test $program = $exefile -o $program = $prog.marc -then - -# delete the old .log file unless we run in the background -if test "$deletelog" = yes -then - /bin/rm $jid.log 2>/dev/null -else - echo - echo running the job in the background, see $jid.log - echo -fi - -# -# check if this is an autoforge or rezoning or radiation job -# -if test $nprocd -eq 1 -then - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` - if test "$line" - then - autoforge=1 - fi -fi -# -# check that jobname for restarted run is not the same -# as restart file basename -# -if test "$rid" -then - if test "$jid" = "$rid" - then - echo " " - echo "ERROR: job name of current run is the same as job name" - echo " of the restarted job" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "ERROR: job name of current run is the same as job name" >> $jid.log - echo " of the restarted job" >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi -fi - -# -# user objects/libraries used -# - - if test "$objs" - then - program="$DIRJOB/$jid.marc" - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# user subroutine used -# -# add DAMASK options for linking - DAMASK="" - - if test "$user" - then - program=$usernoext.marc - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# Special case for IBM using POE but not an SP machine -# in this case we always need a host file, also for serial jobs. -# -if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP -then - MP_HOSTFILE=${jid}.host - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $nprocd -gt 1 - then - numdom=$nprocd - while test $numdom -gt 0 - do - hostname -s >> $MP_HOSTFILE - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - else - hostname -s > $MP_HOSTFILE - fi -fi -# -# check correctness of host file; fix for user sub -# - if test $nprocd -gt 1 - then - -# construct the path name to the executable (execpath) - execpath=$MARC_BIN/$exefile - usersub=0 - if test $program = $prog.marc - then - execpath=$prog.marc - usersub=1 - fi - if test "$objs" - then - execpath="$DIRJOB/$jid.marc" - usersub=1 - fi - if test "$user" - then - execpath=$usernoext.marc - usersub=1 - fi - export execpath - execname=`$BASENAME $execpath` - - if test "$host" - then - userhost=$host - case $userhost in - \/* | \.\/*) - ;; - *) - userhost=`pwd`/$userhost - ;; - esac - -# check that the number of processes specified in the hostfile is -# equal to nprocd specified by -nprocd. - numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` - if test $nprocd -ne $numproc - then - echo " " - echo "error, the number of processes specified in the host file" - echo "must be equal to the number of processes given by -nprocd/-nsolver" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, the number of processes specified in the host file" >> $jid.log - echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - -# check for Myrinet that the number of processes per host is -# less than number of available user ports, 5 -# .gmpi directory must exist in user's home directory -# and must have write permission from remote hosts - if test $MPITYPE = "myrinet" - then - numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` - if test $numproc -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes specified " - echo "in the hostfile must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes specified " >> $jid.log - echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - if test ! -d ~/.gmpi - then - echo " " - echo "error, for Myrinet a .gmpi directory must exist " - echo "under the user's home directory" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log - echo "under the user's home directory" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - homedir=`echo ~` - for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - echo " " - echo "error, for Myrinet a shared .gmpi directory must exist " - echo "under the user's home directory " - echo "with remote write permission" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log - echo "under the user's home directory " >> $jid.log - echo "with remote write permission" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - /bin/rm tmp.$$ - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - fi - fi - done - fi - fi - -# construct the host file $jid.host which is used by mpirun -# skip lines starting with # and only consider lines with more than -# one word in them. Note that the hostfile given to this script -# has two columns: the host name and the number of shared processes -# to run on this host. mpirun wants the number of _other_ -# processes to run in addition to the one being run on the machine -# on which the job is started. hence the $2-1 for fnr == 1. - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then -# HPMPI or HP hardware MPI - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ - -v mpihpspecial="$MPIHPSPECIAL" \ -'{if ( NF > 0) {\ - fnr++ ; \ - printf("-h %s -np %s",$1,$2); \ - printf(" %s",mpihpspecial); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ - if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ - }\ - }' > $jid.host -# end HPMPI or HP hardware MPI - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then -# IBM using hardware MPI (POE) - MP_HOSTFILE=$jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host -# end IBM using hardware MPI (POE) -# for Intel MPI, need to create a machinefile for DMP - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then -# Intel MPI - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - /bin/cp $host $jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Intel MPI for DMP -# for Solaris HPC 7.1, need to create a machinefile for DMP - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then -# Solaris HPC 7.1 - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Solaris HPC 7.1 for DMP -# for Myrinet, construct a configuration file in ~/.gmpi -# this must be readable by each process -# format is (hostname) (port number) for each process - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - grep -v '^#' $host | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ -{if ( NF > 0 ) \ - for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ -}' >> ~/.gmpi/$jid.host - else -# this is for mpich-1.2.5 and later, using the -pg option -# format: host nproc executable user arguments -# the arguments are added later - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s %s\n",path,user);\ - if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ - }\ - }' > $jid.host - fi -# end Myrinet - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then -# Compaq MPI via Memory Channel - grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host -# end Compaq MPI - else -# MPICH - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ - }\ - }' > $jid.host - fi -# define the variable host and host_filt -# host_filt is used for loops over hosts -# for Myrinet we need to use a filtered variant of userhost -# for others we can use $host - if test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - host=~/.gmpi/$jid.host - host_filt=$jid.host_tMp - grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt - else - host=$jid.host - host_filt=$host - fi - else - host=$jid.host - host_filt=$host - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - host_filt=$jid.mfile - fi - fi -# figure out if the machines in the hostfile are nfs mounted -# or distributed and set the variable "dirstatus" accordingly. -# only perform the check if user subroutine is used -# or a user subroutine executable is used - - numfield=1 - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - numfield=2 - fi - DIR1=$DIRJOB - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - counter=0 - echo " " - echo "checking if local or shared directories for host" - if test "$deletelog" = no - then - echo "checking if local or shared directories for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - dirstatus[$counter]="shared" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - dirstatus[$counter]="local" - /bin/rm tmp.$$ - else - if test ! -f $jid.$$ - then - dirstatus[$counter]="local" - $RSH $i /bin/rm $DIR1/$jid.$$ - else - /bin/rm $jid.$$ - fi - fi - if test -f tmp.$$ - then - /bin/rm tmp.$$ - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - echo " ${dirstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${dirstatus[$counter]}" >> $jid.log - fi - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - fi - -# figure out if this is a compatible set of machines -# unless explicitly specified with flag -comp -# only perform the check if user subroutine is used -# or a user subroutine executable is used -# Myrinet does not support heterogeneous - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - if test $compatible = "unknown" - then - thisname=$ARCH - compatible=yes - counter=0 - echo "checking if machines are compatible for host" - if test "$deletelog" = no - then - echo "checking if machines are compatible for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]="yes" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - othername=`$RSH $i uname -a | cut -f 1 -d " "` - if test $thisname != $othername - then - compatible=no - compstatus[$counter]="no" - fi - fi - echo " ${compstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${compstatus[$counter]}" >> $jid.log - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - else - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]=$compatible - fi - done - if test $compatible = "no" - then - echo "all machines assumed incompatible" - if test "$deletelog" = no - then - echo "all machines assumed incompatible" >> $jid.log - fi - else - echo "all machines compatible" - if test "$deletelog" = no - then - echo "all machines compatible" >> $jid.log - fi - fi - fi -# error out if user objects or libraries are used on incompatible machines - if test "$compatible" = "no" -a -n "$objs" - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" - if test "$deletelog" = no - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log - fi - exit 1 - fi -# modify new host file if NFS mounted heterogeneous machine - doit= - if test $program = $prog.marc - then - doit=yes - fi - if test "$user" - then - doit=yes - fi - if test "$doit" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - $AWK -v hst=$i '{fnr++ ; \ -if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ -printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} - /bin/mv $jid.host{$$} $jid.host - host=$jid.host - fi - fi - done - fi - fi # if test $program = $prog.marc -o $user -o $obj - - else # if test $host - # assume shared memory machine if no hostfile given and - # MPITYPE is set to mpich or Myrinet - # check for Myrinet that the total number of processes is - # less than number of available user ports, 5 - if test $MPITYPE = "mpich" -o $MPITYPE = "scali" - then - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - host=$jid.host - elif test $MPITYPE = "myrinet" - then - if test $nprocd -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes " - echo "must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes " >> $jid.log - echo "must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - echo `hostname` $nprocd | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ - {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ -' >> ~/.gmpi/$jid.host - host=~/.gmpi/$jid.host - else - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - - fi - fi # if test myrinet - - fi # if test $host - - fi # if test $nprocd -gt 1 - -fi # if test $program = $exefile -o $program = $prog.marc - -############################################################################## -# construct run stream (Marc only) # -############################################################################## - -# set maximum message length for ddm to a large number -# for vendor provided mpi -if test $itree -eq 0 -a $MPITYPE = hardware -then - itree=100000000 - if test $MACHINENAME = SGI - then - itree=100000001 - fi -fi -if test $itree -eq 0 -a $MPITYPE = hpmpi -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = myrinet -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = nec -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = scali -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = intelmpi -then - itree=100000000 -fi -if test $nprocdddm -lt 2 -then - nprocdarg= -else - nprocdarg="$nprocdarg $nprocdddm" -fi -if test $nsolver -eq 0 -then - nsolverarg= -else - nsolverarg="$nsolverarg $nsolver" -fi -if test $nprocdddm -lt 2 -a $nsolver -eq 0 -then -nprocd=0 -fi -if test $nprocd -gt 0 -then - if test "$host" - then - if test -z "$RUN_JOB2" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then - RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" - RUN_JOB=" -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - numhost=`uniq $jid.mfile | wc -l` - if test "$INTELMPI_VERSION" = "HYDRA" - then - RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n $numhost -r $RSH -f $jid.mfile - RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" - fi - -# intelmpi uses configfile. format: -# -host host1 -n n1 executable marcargs -# one such line per host -# collect the marcargs in RUN_JOB and construct the config file later -# collect the run stream in RUN_JOB_TMP - RUN_JOB="-jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - - - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then - RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - if test "$userhost" - then - RUN_JOB="$RUN_JOB -mhost $userhost" - fi - if test $MPITYPE = "scali" - then -# set default working directory to /tmp to allow -# different directory names - SCAMPI_WORKING_DIRECTORY=/tmp - export SCAMPI_WORKING_DIRECTORY - fi - else - if test -z "$RUN_JOB1" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - RUNNPROCD=$nprocd - if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" - then - RUNNPROCD= - MP_PROCS=$nprocd - export MP_PROCS - fi - if test $MPITYPE = "myrinet" - then - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n 1 -f $jid.hosts - fi - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - fi -else - if test $nauto -gt 0 -o $ndcoup -gt 0 - then - RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - else -# this is for a serial job without auto restart: - RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi -fi -if test "$rid" -then - RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" -fi -if test "$pid" -then - RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" -fi -if test "$sid" -then - RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" -fi -if test "$did" -then - RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" -fi -if test "$vid" -then - RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" -fi -if test $nauto -gt 0 -then - RUN_JOB="$RUN_JOB -autorst $nauto " -fi -if test $ndcoup -gt 0 -then - RUN_JOB="$RUN_JOB -dcoup $ndcoup " -fi -if test $ndytran -gt 0 -then - RUN_JOB="$RUN_JOB -dytran $ndytran " -fi -if test $mesh -gt 0 -then - RUN_JOB="$RUN_JOB -me $mesh " -fi -if test $noutcore -gt 0 -then - RUN_JOB="$RUN_JOB -outcore $noutcore " -fi -if test "$dllrun" -gt 0 -then - RUN_JOB="$RUN_JOB -dll $dllrun " -fi -if test "$trkrun" -gt 0 -then - RUN_JOB="$RUN_JOB -trk $trkrun " -fi -if test "$iam" -then - RUN_JOB="$RUN_JOB -iam $iam " -fi -if test "$justlist" -then - RUN_JOB="$RUN_JOB -list 1 " -fi -if test "$feature" -then - RUN_JOB="$RUN_JOB -feature $feature " -fi -if test "$memlimit" -ne 0 -then - RUN_JOB="$RUN_JOB -ml $memlimit " -fi -if test "$cpinput" -then - RUN_JOB="$RUN_JOB -ci $cpinput " -fi -if test "$cpresults" -then - RUN_JOB="$RUN_JOB -cr $cpresults " -fi -if test "$DIRSCR" != "$DIRJOB" -then - RUN_JOB="$RUN_JOB -dirscr $DIRSCR" -else - DIRSCR=$DIRJOB -fi -if test "$makebdf" -then - RUN_JOB="$RUN_JOB -bdf $makebdf " -fi -if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" -then - # append $RUN_JOB to all lines of the host file - # and set RUN_JOB - $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ - /bin/mv $host.$$ $host - RUN_JOB=$RUN_JOB_TMP -fi -if test $MPITYPE = "intelmpi" -a "$host" -then - # construct config file, append $RUN_JOB to all lines of the config file - # and set RUN_JOB - if test "$INTELMPI_VERSION" = "HYDRA" - then - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - else - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-host %s -n %s",$1,$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - fi - RUN_JOB=$RUN_JOB_TMP -fi -echo " " -echo "Final run stream value" -echo " RUNJOB="$RUN_JOB -if test "$deletelog" = no -then -echo " " >> $jid.log -echo "Final run stream value" >> $jid.log -echo " RUNJOB="$RUN_JOB >> $jid.log -fi - - -############################################################################## -# run marc using valgrind # -############################################################################## -#RUN_JOB="valgrind $RUN_JOB" -#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" -############################################################################## - - -############################################################################## -# run the requested program in a queue # -############################################################################## - -if test "$deletelog" = yes -then - echo - date -else - echo >> $jid.log - date >> $jid.log -fi -if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] -then - -/bin/rm -f $jid.runmarcscript - - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - userobj=$usernoext.o - fi - cat > $jid.runmarcscript << END4 - if test "$user" - then - if test $MACHINENAME = "CRAY" - then - $DFORTRANMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTRANMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $MARCCUDALIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } -END4 -else - prgsav=yes -fi -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# - -cat >> $jid.runmarcscript << END5 - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -# first remove all .out files and incremental restart files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null - /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null -fi - -if test $nprocdddm -gt 1 -then - $RUN_JOB 2>>$jid.log -else - $RUN_JOB 2>>$jid.log -fi - -if test $dllrun -eq 0; then - if test $prgsav = no - then - /bin/rm -f $bd$program 2>/dev/null - fi -else - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes - then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -END5 - - -# Submit to marc batch queue -# -if [ $qid = at ] -then -QUENAME=at -SUBMCMD= -else -# -# Submit to qsub queue -# -QUENAME=qsub -SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" -if test "$priority" -then - SUBMCMD=$SUBMCMD" -p $priority" -fi -if test "$att" -then - SUBMCMD=$SUBMCMD" -a $att" -fi -if test "$cpu" -then - SUBMCMD=$SUBMCMD" -lt $cpu" -fi - -fi -echo $QUENAME $SUBMCMD -#cat $jid.runmarcscript -$QUENAME $SUBMCMD < $jid.runmarcscript - -/bin/rm -f $jid.runmarcscript - -############################################################################## -# run the requested program in the background # -############################################################################## - -else -if test $qid = background -then - -# -# first remove all old .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi -# -# compile user subroutine if present -# -( -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_mp $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - echo " $PRODUCT Exit number 3" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTRANMP $user || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTRANMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - echo " $PRODUCT Exit number 3" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc - -# - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -$RUN_JOB & - -marcpid=$! -echo $marcpid > $DIRJOB/$jid.pid -wait $marcpid - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -) 1>>$jid.log 2>&1 & - - -############################################################################## -# run the requested program in the foreground # -############################################################################## - -else - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_mp $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTRANMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTRANMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi -# first remove all .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi - -$RUN_JOB - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - if test "$host" - then - mpdcleanup -a -f $jid.mfile - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.mfile 2> /dev/null - else - mpdcleanup -a -f $jid.hosts - /bin/rm $jid.hosts 2> /dev/null - fi - fi - fi -fi - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi - - -fi -fi diff --git a/installation/mods_MarcMentat/2012/Marc_tools/run_marc.original b/installation/mods_MarcMentat/2012/Marc_tools/run_marc.original deleted file mode 100644 index 2141711e3..000000000 --- a/installation/mods_MarcMentat/2012/Marc_tools/run_marc.original +++ /dev/null @@ -1,3732 +0,0 @@ -#!/bin/ksh -############################################################################## -# # -# run_marc - run a marc job # -# ------------------------- # -# # -# usage: run_marc -j jid { options } # -# # -# where standard options are: required: defaults: # -# -------------------------- # -# # -# -j* jid job id number. ** YES ** . # -# -pr* prog program name. . marc # -# -v* y|n do or do not verify inputs. . yes # -# -q* s|l|v|b|f batch queue name or background, . short # -# foreground. # -# -b* as alternative to option -q* # -# # -# ( batch queues only : # -# -pq* intra queue priority. . . # -# -at DATE/TIME delay start of job. . . # -# format : January,1,1990,12:31 # -# or : today,5pm # -# -cpu* secs job CPU limit . . ) # -# # -# -r* rid restart file job id. . . # -# -si* sid substructure file id. . . # -# -pi* post post file job id. . . # -# -de* did defaults file . no # -# -vf vid viewfactor . no # -# # -# -u* user user subroutine. . . # -# -obj obj user objects or libraries. . . # -# -sa* y|n do or do not save load module. . no # -# -autorst auto restart flag for auto forge . no # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo selects i4 or i8 version # -# default: i4 or via defaults file run_marc_defaults # -# the -mo option will override # -# -mpi selects MPI version # -# each platform has a default MPI version and some # -# have an alternative version. see the include file # -# for the respective platform # -# MPI_DEFAULT defines the default MPI version # -# MPI_OTHER defines versions one can switch to # -# -dcoup for contact decoupling # -# currently not supported # -# -dir directory where the job i/o should take place. # -# defaults to current directory. # -# -sdir directory where scratch files are created # -# defaults to current directory. # -# # -# -alloc only perform memory allocation test, no analysis # -# -list y only list options in the input file, no analysis # -# -fe num set feature number "num" for the run. only one allowed # -# -dytran flag to switch from Dytran to Marc # -# dytran = 0, program will run w/o Marc-Dytran Switch # -# = 1, program will restart Marc after Dytran run # -# >= 2, Not supported yet. # -# currently not supported # -# -ou force analysis to use out-of-core control # -# =0, not used # -# =1, element storage out-of-core # -# -dll run marc using shared library libmarc.so and exe_marc # -# =1, used # -# =2, do not free streaming input memory # -# =3, run with marc input deck # -# -trk run marc for post-tracking # -# -gpuid run marc using GPGPU capability # -# specify gpuid on to be used in the analysis. Multiple # -# IDs may be assigned for DDM runs. # -# Separate a list of IDs with a colon. Each DMP # -# process will be assigned a GPU ID in round robin fastion# -# = 0 # -# = 0:1 etc... # -# # -# where parallel options are: # -# -------------------------- # -# # -# itree, host, and comp options are available for the domain # -# decomposition only. # -# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # -# # -# # -# -nprocd number of domains. # -# defaults to single domain solution. # -# -nprocds number of domains if single input file. # -# defaults to single domain solution. # -# -nps same as -nprocds. # -# -nsolver number of solver tasks for solver types 12 and 13 # -# these are distributed tasks operating via MPI # -# -nthread number of solver threads for solver types 6, 8, and 11 # -# also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. if both specified, nthread option# -# will be used. # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by 6, 8, and 11 # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor nthread specified. # -# -itree message passing tree type for domain decomposition. # -# for debugging purposes; should not normally be used. # -# -host hostfile name for distributed execution on network. # -# defaults to no hostfile, unless jobid.defhost exists. # -# if jobid.defhost exists, only -np(s) necessary # -# -comp* y|n to be used with user routines on a network of # -# incompatible machines. # -# if set to no, a separate executable will be created # -# for each machine on the network. # -# if set to yes, the executable located on the machine # -# from which marc is started will be used on all machines.# -# defaults to no if O/S versions different on machines. # -# # -# -ci y|n copy input files to remote hosts (default: yes) # -# if "yes", input files are automatically copied to # -# remote hosts for a network run if necessary. # -# -cr y|n copy post files from remote hosts (default: yes) # -# if "yes", post files are automatically copied back from # -# remote hosts for a network run if necessary. # -############################################################################## -# set DIR to the directory in which this script is -REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" -DIR=`dirname $REALCOM` -# make sure DIR has an absolute path -case $DIR in - \/*) - ;; - *) - DIR=`pwd`/$DIR - ;; -esac -DIRSCRIPT=$DIR -AWK=awk -ARCH=`uname -a | cut -f 1 -d " "` -# Sun has a bad awk, use nawk instead -if test $ARCH = "SunOS" -then - AWK=nawk -fi -BASENAME=basename -# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists -if test $ARCH = "SunOS" -then - if test -x /usr/ucb/basename - then - BASENAME=/usr/ucb/basename - fi -fi - -# echo command line in the case of ECHO_COMMAND is true -if test "$ECHO_COMMAND" = true ; then - echo command "$0" "$@" -fi - -# -# "mode" selects version, i4 or i8 -# default is i4 -# this can be changed by a file run_marc_defaults -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MODE i8 -# it can also be set by the environmental variable MARC_INTEGER_SIZE -# and by the command line option "-mo" -# -mode= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -f $HOME/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -n "$MARC_INTEGER_SIZE" ; then - mode=$MARC_INTEGER_SIZE -fi -if test -z "$mode" ; then - mode=i4 -fi -case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "error, version mode must be i4 or i8" - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i4 or i8" - echo " " - echo " use -mo i4 or -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - setmode=true - fi - if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - fi - if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -done - -# set to i4 version for 32 bit Linux -if test "`uname -s`" = "Linux"; then - if test "`uname -m`" = "i686"; then - mode=i4 - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -fi - - -. "$DIR/getarch" - -# Change_me -. $MARC_INCLUDE -# - -# -# Dynamically determine the echo syntax -# - -case "`echo '\c'`" in - '\c') - ECHO='echo -n' - ECHOTXT=' ' - ;; - *) - ECHO='echo' - ECHOTXT=' \c' - ;; -esac - -# -# Variables for the MARC environment -# - -PRODUCT="Marc" -EXITMSG=$MARC_TOOLS/MESSAGES -export EXITMSG -FLEXDIR=$DIR/../flexlm/licenses -export FLEXDIR -TIMCHK=3600 -export TIMCHK -BINDIR=$MARC_BIN -export BINDIR -AFMATDAT=$MARC_RUNTIME/AF_flowmat/ -export AFMATDAT -# -# define directory path to global unified material database -# -MATFILE= -export MATFILE - -# -# define memory limit -# first set to MEMLIMIT from include -# -ml option overrules if specified -memlimit=$MEMLIMIT -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -# -if test $MACHINENAME = "HP" -then - SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH - export SHLIB_PATH -fi -# the one for IBM is defined futher down - -LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH -LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH -export LD_LIBRARY_PATH -export LD_LIBRARY64_PATH -export LD_LIBRARYN32_PATH - -atexit() { -kill -15 $$ -# -if test $MPITYPE = "myrinet" -then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi -fi -} - -trap "atexit" 2 - -# -# defaults -# - -prog=marc -exefile=marc -jid= -rid= -pid= -sid= -did= -vid= -user= -usersubname= -objs= -qid=background -cpu= -priority= -att= -trk= -verify=yes -prgsav=no -rmdll=no -cpdll=no -progdll= -pathdll= -error= -nprocd=0 -nprocdddm=1 -nprocdddmprint= -icreated=0 -nprocdarg= -nsolver=0 -nsolverarg=-ns -if test $nprocds -then - if test $nprocds -gt 1 - then - nprocdddm=$nprocds - nprocdddmprint=$nprocds - icreated=1 - nprocdarg=-nprocds - fi -fi -nthread=-1 -gpuids= -nauto=0 -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -nthreadprint=0 -itree=0 -iam= -link= -trkrun=0 -DIRJOB=`pwd` -DIRSCR=$DIRJOB -DIRSCRSET= -autoforge=0 -dotdat=.dat -dotdefhost=.defhost -host= -numhost= -mfile= -userhost= -makebdf= -cpinput=yes -cpresults=yes -marcdll=libmarc.$EXT_DLL -# define hostname and strip off extensions (alpha.aaa.com) -thishost=`hostname` -thishost=${thishost%%.*} -compatible=unknown -numfield=1 -justlist= -feature= -mpioption=false -MDSRCLIB=$MARC_LIB/mdsrc.a -# -# check run_marc_defaults file for default MPI setting -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MPI -# -value= -file= -if test -f $DIRSCRIPT/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$DIRSCRIPT/run_marc_defaults - fi -fi -if test -f $HOME/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$HOME/run_marc_defaults - fi -fi -if test -n "$value"; then - MARC_MPITYPE=$value - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - echo " " - echo " error, incorrect option for MARC_MPI" - echo " defined in $file: $MARC_MPITYPE" - echo " valid options: $MPI_DEFAULT $MPI_OTHER" - echo " " - exit - fi - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - fi -fi -# -# -# allow scratch directory to be specified with environmental variable -# MARCSCRATCH -if test $MARCSCRATCH -then - if test -d $MARCSCRATCH - then - DIRSCR=$MARCSCRATCH - else - echo "error, scratch directory '$MARCSCRATCH'" - echo " specified via environmental variable MARCSCRATCH does not exist" - exit - fi -fi -# -############################################################################## -# parse input - arguments always come in pairs # -############################################################################## - -arg=$1 -if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - shift - arg=$1 -fi -while [ -n "$arg" ] -do - shift - value=$1 - case $arg in - -al* | -AL*) - LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - $MARC_BIN/marc -alloc 1 - exit - ;; - -li* | -LI*) - justlist=yes - ;; - -fe* | -FE*) - feature=$value - ;; - -pr* | -PR*) - if test `dirname $value` = '.' - then - prog=`$BASENAME $value .marc` - progdll=`$BASENAME $value` - else - prog=`dirname $value`/`$BASENAME $value .marc` - progdll=`dirname $value`/`$BASENAME $value` - fi - prdir=`dirname $value` - case $prdir in - \/*) - ;; - *) - prog=`pwd`/$prdir/$prog - ;; - esac - ;; - -j* | -J*) - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - ;; - -r* | -R*) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - -si* | -SI*) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - -pi* | -PI*) - if test -f $value.t19 - then - pid=`$BASENAME $value .t19` - else - pid=`$BASENAME $value .t16` - fi - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - -bdf | -BDF) - makebdf=1 - ;; - -de* | -DE*) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - -vf | -VF) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - -u* | -U*) - user=`dirname $value`/`$BASENAME $value .f` - basefile=`$BASENAME $value` - if test ${basefile##*.} = F - then - user=`dirname $value`/`$BASENAME $value .F` - fi - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - if test -f $user.f - then - usersubname=$user.f - elif test -f $user.F - then - usersubname=$user.F - else - usersubname=$user - fi - ;; - -obj | -OBJ) - objs="$value" - ;; - -q* | -Q*) - qid=$value - ;; - -b* | -B*) - case $value in - y* | Y*) - qid=background - ;; - n* | N*) - qid=foreground - ;; - *) - ;; - esac - ;; - -at | -AT) - att=$value - ;; - -cpu* | -CPU*) - cpu=$value - ;; - -pq | -PQ*) - priority=$value - ;; - -v* | -V*) - verify=$value - ;; - -sa* | -SA*) - prgsav=$value - ;; - -np* | -NP*) - nprocdddm=$value - nprocdddmprint=$value - case $arg in - -nps* | -NPS* | -nprocds* | -NPROCDS*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - case $arg in - -np | -NP | -nprocd | -NPROCD) - icreated=0 - nprocdarg=-nprocd - ;; - esac - ;; - -ns* | -NS*) - nsolver=$value - ;; - -nt* | -NT*) - nthread=$value - ;; - -gp* | -GP*) - gpuids=$value - ;; - -it* | -IT*) - itree=$value - ;; - -iam | -IAM) - iam=$value - ;; - -au* | -AU*) - nauto=$value - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -me | -ME ) - mesh=$value - ;; - -ml | -ML ) - memlimit=$value - ;; - -mo | -MO ) - ;; - -mpi | -MPI ) - mpioption=true - MARC_MPITYPE=$value - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - fi - fi - ;; - -dir* | -DIR*) - DIRJOB=$value - case $DIRJOB in - \/*) - ;; - *) - DIRJOB=`pwd`/$DIRJOB - ;; - esac - if test -z "$DIRSCRSET" - then - DIRSCR=$DIRJOB - fi - ;; - -sd* | -SD*) - DIRSCR=$value - DIRSCRSET=yes - case $DIRSCR in - \/*) - ;; - *) - DIRSCR=`pwd`/$DIRSCR - ;; - esac - ;; - -ho* | -HO*) - host=$value - ;; - -co* | -CO*) - compatible=$value - ;; - -ci* | -CI*) - cpinput=$value - ;; - -cr* | -CR*) - cpresults=$value - ;; - *) - error="$error -$arg: invalid option" - break - ;; - esac - case $value in - -*) - error="$error -$arg: invalid name $value" - break - ;; - esac - shift - arg=$1 - if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - shift - arg=$1 - fi -done -argc=`expr $# % 2` -if test $argc -eq 1 -then -# -# odd number of arguments -# - error="$error -argument list incomplete" -fi - -if test $nprocdddm -gt 0 -then -nprocd=$nprocdddm -fi - -if test $nsolver -gt 0 -then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi -fi - -if test $nthread -eq -1 -then -nthread=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nthread -lt 0 -then -nthread=0 -fi - -nthreadprint=$nthread -if test $nthreadprint -eq 0 -then -nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi -fi - -nthread=$nthreadprint - -gpuoption= -if test "$gpuids" = "" ; then - gpuoption= -else - gpuoption="-gp $gpuids" -fi - -if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH -else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH -# Linux 64 + HPMPI, Below code is taken from include_linux64 - if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - fi -fi - -if test $nprocd -gt 1; then - if test -f $jid$dotdefhost; then - if test "$host" = ""; then - host=$jid$dotdefhost - fi - fi - if test -f hostfile_qa_$nprocd; then - if test "$host" = ""; then - host=hostfile_qa_$nprocd - fi - fi -fi - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then - dotdat=.inp - fi - - if test "$progdll"; then - /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll - rmdll=yes - pathdll=yes - progdll=${progdll}_$marcdll - else - progdll=$marcdll - fi - - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - pathdll=yes - fi -fi - -############################################################################## -# check parameter validity # -############################################################################## - -while test forever; do - -# -# check for input file existence -# -if test $nprocdddm -gt 1 -a $icreated -eq 0; then - if test ! -f $DIRJID/1$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/1$jid$dotdat not accessible" - fi - fi -else - if test ! -f $DIRJID/$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/$jid$dotdat not accessible" - fi - fi -fi - if test $nprocd -gt 1; then - if test "$host" ; then - if test ! -f $host; then - error="$error -host name file $host not accessible" - fi - fi - fi - -# -# check if the job is already running in the background -# -if test -f $DIRJOB/$jid.pid; then - error="$error -job is already running (the file $jid.pid exists)" -fi - -# -# if the program name is other than marc, then -# assume that this is a program in the users local directory -# - -bd=$MARC_BIN/ - -case $prog in - marc | MARC | $exefile) - program=$exefile - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$usersubname" - then - if test ! -f $usersubname - then - error="$error -user subroutine file $usersubname not accessible" - fi - fi - if test "$objs" - then - missingobjs= - for o in $objs - do - if test ! -f "$o" - then - if test -z "$missingobjs" - then - missingobjs="$o" - else - missingobjs="$missingobjs $o" - fi - fi - done - if test -n "$missingobjs" - then - error="$error -user object/library file(s) $missingobjs not accessible" - fi - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$vid" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRVID/1$vid.vfs - then - error="$error -view factor file $DIRVID/1$vid.vfs not accessible" - fi - else - if test ! -f $DIRVID/$vid.vfs - then - error="$error -view factor file $DIRVID/$vid.vfs not accessible" - fi - fi - fi - if $mpioption - then - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" - fi - fi - ;; - *) - program=$prog.marc - case $prog in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - error="$error -program option may not be used with user subroutine" - fi - if test "$objs" - then - error="$error -program option may not be used with user objects or libraries" - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$nauto" - then - if test $nauto -gt 2 - then - error="$error -incorrect option for auto restart " - fi - fi - if test "$ndcoup" - then - if test $ndcoup -gt 3 - then - error="$error -incorrect option for contact decoupling " - fi - fi - if test "$ndytran" - then - if test $ndytran -gt 1 - then - error="$error -incorrect option for Marc-Dytran Switch " - fi - fi - if $mpioption - then - if test ! -x $MARC_BIN/$exefile - then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE " - fi - fi - ;; -esac - -############################################################################## -# check argument integrity # -############################################################################## - -if test "$jid" -then - : -else - error="$error -job id required" -fi - -if test $nprocd -gt 1 -then - if test $nauto -gt 0 - then - error="$error -cannot run DDM job with auto restart (-au) option " - fi -fi -case $qid in - S* | s*) - qid=short - ;; - L* | l*) - qid=long - ;; - V* | v*) - qid=verylong - ;; - B* | b*) - qid=background - ;; - F* | f*) - qid=foreground - ;; - A* | a*) - qid=at - ;; - *) - error="$error -bad value for queue_id option" - ;; -esac - -case $prgsav in - N* | n*) - prgsav=no - ;; - Y* | y*) - prgsav=yes - ;; - *) - error="$error -bad value for save option" - ;; -esac - -case $verify in - N* | n*) - verify=no - ;; - Y* | y*) - verify=yes - ;; - *) - error="$error -bad value for verify option" - ;; -esac - -case $nprocdddm in - -* ) - error="$error -bad value for nprocd option" - ;; -esac - -case $nthread in - -* ) - error="$error -bad value for nthread option" - ;; -esac - -case $itree in - -* ) - error="$error -bad value for itree option" - ;; -esac -case $iam in - -* ) - error="$error -bad value for iam option" - ;; -esac -case $compatible in - N* | n*) - compatible=no - ;; - Y* | y*) - compatible=yes - ;; - unknown) - ;; - *) - error="$error -bad value for comp option" - ;; -esac -case $cpinput in - N* | n*) - cpinput=no - ;; - Y* | y*) - cpinput=yes - ;; - *) - error="$error -bad value for copy input option" - ;; -esac -case $cpresults in - N* | n*) - cpresults=no - ;; - Y* | y*) - cpresults=yes - ;; - *) - error="$error -bad value for copy results option" - ;; -esac - -# -# check for external file to run -# -if test -f $MARC_TOOLS/run_marc_check -then - . $MARC_TOOLS/run_marc_check -fi - -# -# pick up version data from bin/VERSION if it exists -# -if test -f $MARC_BIN/VERSION; then - ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` - if test -n "$ppp" ;then - PRODUCT=$ppp - fi - ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` - if test -n "$ppp" ;then - REVISION=", Build $ppp" - fi -fi -############################################################################## -# interact with the user to get the required information to run marc or # -# other marc system program # -############################################################################## - -deletelog=yes -if test $qid = background -a $verify = no -then -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $usersubname -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto " > $jid.log -deletelog=no -fi -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $usersubname -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto" - - -case $qid in - s* | S* | l* | L* | v* | V* ) - echo \ -"Queue priority : $priority -Queue CPU limit : $cpu -Queue start time : $att" - ;; -# * ) -# echo \ -#" " -# ;; -esac - -if test "$error" -then - if test $verify = yes - then - $ECHO "$error - -Please correct or quit(correct,quit,): $ECHOTXT" - error= - read answer - case $answer in - q* | Q*) - answer=quit - ;; - *) - answer=correct - ;; - esac - else - $ECHO "$error - $ECHOTXT" - echo " " - if test "$deletelog" = no - then - $ECHO "$error - $ECHOTXT" >> $jid.log - echo " " >> $jid.log - fi - answer=quit - fi -else - if test $verify = yes - then - $ECHO " -Are these parameters correct (yes,no,quit,)? $ECHOTXT" - read answer - case $answer in - q* | Q*) - answer=quit - ;; - y* | Y*) - answer=yes - ;; - *) - answer=no - ;; - esac - else - answer=yes - fi -fi - -case $answer in - no | correct) - -############################################################################## -# prompt for each value # -############################################################################## - - $ECHO " -Program name ($prog)? $ECHOTXT" - read value - if test "$value" - then - prog=$value - fi - $ECHO "Job ID ($jid)? $ECHOTXT" - read value - if test "$value" - then - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - fi - $ECHO "User subroutine name ($user)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - user= - ;; - *) - user=`dirname $value`/`$BASENAME $value .f` - basefile=`$BASENAME $value` - if test ${basefile##*.} = F - then - user=`dirname $value`/`$BASENAME $value .F` - fi - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - if test -f $user.f - then - usersubname=$user.f - elif test -f $user.F - then - usersubname=$user.F - else - usersubname=$user - fi - ;; - esac - fi - $ECHO "User objects or libraries ($objs)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - objs= - ;; - *) - objs="$value" - ;; - esac - fi - $ECHO "Restart File Job ID ($rid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - rid= - ;; - *) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - esac - fi - $ECHO "Substructure File ID ($sid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - sid= - ;; - *) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - esac - fi - $ECHO "Post File Job ID ($pid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - pid= - ;; - *) - pid=$value - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - esac - fi - $ECHO "Defaults File ID ($did)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - did= - ;; - *) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - esac - fi - $ECHO "View Factor File ID ($vid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - vid= - ;; - *) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - esac - fi - $ECHO "Save generated module ($prgsav)? $ECHOTXT" - read value - if test "$value" - then - prgsav=$value - fi - $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" - read value - if test "$value" - then - nprocdddm=$value - nprocdddmprint=$value - fi - $ECHO "Run on ($nthread) threads ? $ECHOTXT" - read value - if test "$value" - then - nthread=$value - fi - $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" - read value - if test "$value" - then - nsolver=$value - fi -# - if test $nprocdddm -gt 0 - then - nprocd=$nprocdddm - fi - if test $nsolver -gt 0 - then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi - fi - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - nthreadprint=$nthread - if test $nthreadprint -eq 0 - then - nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi - fi -# - $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" - read value - if test "$value" - then - gpuids=$value - fi - if test "$gpuids" = "" ; then - gpuoption= - else - gpuoption="-gp $gpuids" - fi - if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH - if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - fi - fi -# - if test $nprocd -gt 1 - then - $ECHO "Message passing type ($itree)? $ECHOTXT" - read value - if test "$value" - then - itree=$value - fi - $ECHO "Host file name ($host)? $ECHOTXT" - read value - if test "$value" - then - host=$value - fi - if test $nprocdddm -gt 1 - then - $ECHO "Single input file? $ECHOTXT" - read value - case $value in - y* | Y*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" - read value - if test "$value" - then - compatible=$value - fi - $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" - read value - if test "$value" - then - cpinput=$value - fi - $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" - read value - if test "$value" - then - cpresults=$value - fi - fi - fi - $ECHO "Run the job in the queue ($qid)? $ECHOTXT" - read value - if test "$value" - then - qid=$value - fi - case $qid in - s* | S* | l* | L* | v* | V* ) - $ECHO "Queue priority ($priority)? $ECHOTXT" - read value - if test "$value" - then - priority=$value - fi - $ECHO "Job starts at ($att)? $ECHOTXT" - read value - if test "$value" - then - att=$value - fi - $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" - read value - if test "$value" - then - cpu=$value - fi - ;; - * ) - ;; - esac - $ECHO "Auto Restart option ($nauto)? $ECHOTXT" - read value - if test "$value" - then - nauto=$value - fi - $ECHO "Run directory ($DIRJOB)? $ECHOTXT" - read value - if test "$value" - then - DIRJOB=$value - DIRSCR=$DIRJOB - fi - $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" - read value - if test "$value" - then - DIRSCR=$value - fi - ;; - quit) - exit 1 - ;; - *) - break - ;; - -esac - - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - -done - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - pathdll=yes - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - fi - - if test "$pathdll"; then -# -# reset share lib path -# - if test $MACHINENAME = "HP" - then - SHLIB_PATH=$DIRJOB:$SHLIB_PATH - export SHLIB_PATH - fi - if test $MACHINENAME = "IBM" - then - LIBPATH=$DIRJOB:$LIBPATH - export LIBPATH - fi -# - LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH - LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH - LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH - export LD_LIBRARY_PATH - export LD_LIBRARY64_PATH - export LD_LIBRARYN32_PATH - fi -fi -# end of dllrun>0 - - -if test $program = $exefile -o $program = $prog.marc -then - -# delete the old .log file unless we run in the background -if test "$deletelog" = yes -then - /bin/rm $jid.log 2>/dev/null -else - echo - echo running the job in the background, see $jid.log - echo -fi - -# -# check if this is an autoforge or rezoning or radiation job -# -if test $nprocd -eq 1 -then - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` - if test "$line" - then - autoforge=1 - fi -fi -# -# check that jobname for restarted run is not the same -# as restart file basename -# -if test "$rid" -then - if test "$jid" = "$rid" - then - echo " " - echo "ERROR: job name of current run is the same as job name" - echo " of the restarted job" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "ERROR: job name of current run is the same as job name" >> $jid.log - echo " of the restarted job" >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi -fi - -# -# user objects/libraries used -# - - if test "$objs" - then - program="$DIRJOB/$jid.marc" - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# user subroutine used -# - - if test "$user" - then -# program=$user.marc - program=$DIRJOB/`$BASENAME $user .f`.marc - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# Special case for IBM using POE but not an SP machine -# in this case we always need a host file, also for serial jobs. -# -if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP -then - MP_HOSTFILE=${jid}.host - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $nprocd -gt 1 - then - numdom=$nprocd - while test $numdom -gt 0 - do - hostname -s >> $MP_HOSTFILE - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - else - hostname -s > $MP_HOSTFILE - fi -fi -# -# check correctness of host file; fix for user sub -# - if test $nprocd -gt 1 - then - -# construct the path name to the executable (execpath) - execpath=$MARC_BIN/$exefile - usersub=0 - if test $program = $prog.marc - then - execpath=$prog.marc - usersub=1 - fi - if test "$objs" - then - execpath="$DIRJOB/$jid.marc" - usersub=1 - fi - if test "$user" - then - execpath=$DIRJOB/`$BASENAME $user .f`.marc - usersub=1 - fi - export execpath - execname=`$BASENAME $execpath` - - if test "$host" - then - userhost=$host - case $userhost in - \/* | \.\/*) - ;; - *) - userhost=`pwd`/$userhost - ;; - esac - -# check that the number of processes specified in the hostfile is -# equal to nprocd specified by -nprocd. - numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` - if test $nprocd -ne $numproc - then - echo " " - echo "error, the number of processes specified in the host file" - echo "must be equal to the number of processes given by -nprocd/-nsolver" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, the number of processes specified in the host file" >> $jid.log - echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - -# check for Myrinet that the number of processes per host is -# less than number of available user ports, 5 -# .gmpi directory must exist in user's home directory -# and must have write permission from remote hosts - if test $MPITYPE = "myrinet" - then - numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` - if test $numproc -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes specified " - echo "in the hostfile must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes specified " >> $jid.log - echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - if test ! -d ~/.gmpi - then - echo " " - echo "error, for Myrinet a .gmpi directory must exist " - echo "under the user's home directory" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log - echo "under the user's home directory" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - homedir=`echo ~` - for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - echo " " - echo "error, for Myrinet a shared .gmpi directory must exist " - echo "under the user's home directory " - echo "with remote write permission" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log - echo "under the user's home directory " >> $jid.log - echo "with remote write permission" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - /bin/rm tmp.$$ - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - fi - fi - done - fi - fi - -# construct the host file $jid.host which is used by mpirun -# skip lines starting with # and only consider lines with more than -# one word in them. Note that the hostfile given to this script -# has two columns: the host name and the number of shared processes -# to run on this host. mpirun wants the number of _other_ -# processes to run in addition to the one being run on the machine -# on which the job is started. hence the $2-1 for fnr == 1. - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then -# HPMPI or HP hardware MPI - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ - -v mpihpspecial="$MPIHPSPECIAL" \ -'{if ( NF > 0) {\ - fnr++ ; \ - printf("-h %s -np %s",$1,$2); \ - printf(" %s",mpihpspecial); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ - if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ - }\ - }' > $jid.host -# end HPMPI or HP hardware MPI - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then -# IBM using hardware MPI (POE) - MP_HOSTFILE=$jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host -# end IBM using hardware MPI (POE) -# for Intel MPI, need to create a machinefile for DMP - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then -# Intel MPI - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - /bin/cp $host $jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Intel MPI for DMP -# for Solaris HPC 7.1, need to create a machinefile for DMP - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then -# Solaris HPC 7.1 - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Solaris HPC 7.1 for DMP -# for Myrinet, construct a configuration file in ~/.gmpi -# this must be readable by each process -# format is (hostname) (port number) for each process - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - grep -v '^#' $host | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ -{if ( NF > 0 ) \ - for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ -}' >> ~/.gmpi/$jid.host - else -# this is for mpich-1.2.5 and later, using the -pg option -# format: host nproc executable user arguments -# the arguments are added later - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s %s\n",path,user);\ - if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ - }\ - }' > $jid.host - fi -# end Myrinet - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then -# Compaq MPI via Memory Channel - grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host -# end Compaq MPI - else -# MPICH - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ - }\ - }' > $jid.host - fi -# define the variable host and host_filt -# host_filt is used for loops over hosts -# for Myrinet we need to use a filtered variant of userhost -# for others we can use $host - if test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - host=~/.gmpi/$jid.host - host_filt=$jid.host_tMp - grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt - else - host=$jid.host - host_filt=$host - fi - else - host=$jid.host - host_filt=$host - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - host_filt=$jid.mfile - fi - fi -# figure out if the machines in the hostfile are nfs mounted -# or distributed and set the variable "dirstatus" accordingly. -# only perform the check if user subroutine is used -# or a user subroutine executable is used - - numfield=1 - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - numfield=2 - fi - DIR1=$DIRJOB - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - counter=0 - echo " " - echo "checking if local or shared directories for host" - if test "$deletelog" = no - then - echo "checking if local or shared directories for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - dirstatus[$counter]="shared" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - dirstatus[$counter]="local" - /bin/rm tmp.$$ - else - if test ! -f $jid.$$ - then - dirstatus[$counter]="local" - $RSH $i /bin/rm $DIR1/$jid.$$ - else - /bin/rm $jid.$$ - fi - fi - if test -f tmp.$$ - then - /bin/rm tmp.$$ - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - echo " ${dirstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${dirstatus[$counter]}" >> $jid.log - fi - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - fi - -# figure out if this is a compatible set of machines -# unless explicitly specified with flag -comp -# only perform the check if user subroutine is used -# or a user subroutine executable is used -# Myrinet does not support heterogeneous - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - if test $compatible = "unknown" - then - thisname=$ARCH - compatible=yes - counter=0 - echo "checking if machines are compatible for host" - if test "$deletelog" = no - then - echo "checking if machines are compatible for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]="yes" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - othername=`$RSH $i uname -a | cut -f 1 -d " "` - if test $thisname != $othername - then - compatible=no - compstatus[$counter]="no" - fi - fi - echo " ${compstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${compstatus[$counter]}" >> $jid.log - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - else - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]=$compatible - fi - done - if test $compatible = "no" - then - echo "all machines assumed incompatible" - if test "$deletelog" = no - then - echo "all machines assumed incompatible" >> $jid.log - fi - else - echo "all machines compatible" - if test "$deletelog" = no - then - echo "all machines compatible" >> $jid.log - fi - fi - fi -# error out if user objects or libraries are used on incompatible machines - if test "$compatible" = "no" -a -n "$objs" - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" - if test "$deletelog" = no - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log - fi - exit 1 - fi -# modify new host file if NFS mounted heterogeneous machine - doit= - if test $program = $prog.marc - then - doit=yes - fi - if test "$user" - then - doit=yes - fi - if test "$doit" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - $AWK -v hst=$i '{fnr++ ; \ -if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ -printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} - /bin/mv $jid.host{$$} $jid.host - host=$jid.host - fi - fi - done - fi - fi # if test $program = $prog.marc -o $user -o $obj - - else # if test $host - # assume shared memory machine if no hostfile given and - # MPITYPE is set to mpich or Myrinet - # check for Myrinet that the total number of processes is - # less than number of available user ports, 5 - if test $MPITYPE = "mpich" -o $MPITYPE = "scali" - then - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - host=$jid.host - elif test $MPITYPE = "myrinet" - then - if test $nprocd -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes " - echo "must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes " >> $jid.log - echo "must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - echo `hostname` $nprocd | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ - {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ -' >> ~/.gmpi/$jid.host - host=~/.gmpi/$jid.host - else - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - - fi - fi # if test myrinet - - fi # if test $host - - fi # if test $nprocd -gt 1 - -fi # if test $program = $exefile -o $program = $prog.marc - -############################################################################## -# construct run stream (Marc only) # -############################################################################## - -# set maximum message length for ddm to a large number -# for vendor provided mpi -if test $itree -eq 0 -a $MPITYPE = hardware -then - itree=100000000 - if test $MACHINENAME = SGI - then - itree=100000001 - fi -fi -if test $itree -eq 0 -a $MPITYPE = hpmpi -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = myrinet -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = nec -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = scali -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = intelmpi -then - itree=100000000 -fi -if test $nprocdddm -lt 2 -then - nprocdarg= -else - nprocdarg="$nprocdarg $nprocdddm" -fi -if test $nsolver -eq 0 -then - nsolverarg= -else - nsolverarg="$nsolverarg $nsolver" -fi -if test $nprocdddm -lt 2 -a $nsolver -eq 0 -then -nprocd=0 -fi -if test $nprocd -gt 0 -then - if test "$host" - then - if test -z "$RUN_JOB2" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then - RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" - RUN_JOB=" -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - numhost=`uniq $jid.mfile | wc -l` - if test "$INTELMPI_VERSION" = "HYDRA" - then - RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n $numhost -r $RSH -f $jid.mfile - RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" - fi - -# intelmpi uses configfile. format: -# -host host1 -n n1 executable marcargs -# one such line per host -# collect the marcargs in RUN_JOB and construct the config file later -# collect the run stream in RUN_JOB_TMP - RUN_JOB="-jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - - - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then - RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - if test "$userhost" - then - RUN_JOB="$RUN_JOB -mhost $userhost" - fi - if test $MPITYPE = "scali" - then -# set default working directory to /tmp to allow -# different directory names - SCAMPI_WORKING_DIRECTORY=/tmp - export SCAMPI_WORKING_DIRECTORY - fi - else - if test -z "$RUN_JOB1" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - RUNNPROCD=$nprocd - if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" - then - RUNNPROCD= - MP_PROCS=$nprocd - export MP_PROCS - fi - if test $MPITYPE = "myrinet" - then - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n 1 -f $jid.hosts - fi - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - fi -else - if test $nauto -gt 0 -o $ndcoup -gt 0 - then - RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - else -# this is for a serial job without auto restart: - RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi -fi -if test "$rid" -then - RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" -fi -if test "$pid" -then - RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" -fi -if test "$sid" -then - RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" -fi -if test "$did" -then - RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" -fi -if test "$vid" -then - RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" -fi -if test $nauto -gt 0 -then - RUN_JOB="$RUN_JOB -autorst $nauto " -fi -if test $ndcoup -gt 0 -then - RUN_JOB="$RUN_JOB -dcoup $ndcoup " -fi -if test $ndytran -gt 0 -then - RUN_JOB="$RUN_JOB -dytran $ndytran " -fi -if test $mesh -gt 0 -then - RUN_JOB="$RUN_JOB -me $mesh " -fi -if test $noutcore -gt 0 -then - RUN_JOB="$RUN_JOB -outcore $noutcore " -fi -if test "$dllrun" -gt 0 -then - RUN_JOB="$RUN_JOB -dll $dllrun " -fi -if test "$trkrun" -gt 0 -then - RUN_JOB="$RUN_JOB -trk $trkrun " -fi -if test "$iam" -then - RUN_JOB="$RUN_JOB -iam $iam " -fi -if test "$justlist" -then - RUN_JOB="$RUN_JOB -list 1 " -fi -if test "$feature" -then - RUN_JOB="$RUN_JOB -feature $feature " -fi -if test "$memlimit" -ne 0 -then - RUN_JOB="$RUN_JOB -ml $memlimit " -fi -if test "$cpinput" -then - RUN_JOB="$RUN_JOB -ci $cpinput " -fi -if test "$cpresults" -then - RUN_JOB="$RUN_JOB -cr $cpresults " -fi -if test "$DIRSCR" != "$DIRJOB" -then - RUN_JOB="$RUN_JOB -dirscr $DIRSCR" -else - DIRSCR=$DIRJOB -fi -if test "$makebdf" -then - RUN_JOB="$RUN_JOB -bdf $makebdf " -fi -if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" -then - # append $RUN_JOB to all lines of the host file - # and set RUN_JOB - $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ - /bin/mv $host.$$ $host - RUN_JOB=$RUN_JOB_TMP -fi -if test $MPITYPE = "intelmpi" -a "$host" -then - # construct config file, append $RUN_JOB to all lines of the config file - # and set RUN_JOB - if test "$INTELMPI_VERSION" = "HYDRA" - then - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - else - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-host %s -n %s",$1,$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - fi - RUN_JOB=$RUN_JOB_TMP -fi -echo " " -echo "Final run stream value" -echo " RUNJOB="$RUN_JOB -if test "$deletelog" = no -then -echo " " >> $jid.log -echo "Final run stream value" >> $jid.log -echo " RUNJOB="$RUN_JOB >> $jid.log -fi - - -############################################################################## -# run marc using valgrind # -############################################################################## -#RUN_JOB="valgrind $RUN_JOB" -#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" -############################################################################## - - -############################################################################## -# run the requested program in a queue # -############################################################################## - -if test "$deletelog" = yes -then - echo - date -else - echo >> $jid.log - date >> $jid.log -fi -if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] -then - -/bin/rm -f $jid.runmarcscript - - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - userobj=$DIRJOB/`$BASENAME $user .f`.o - basefile=`$BASENAME $usersubname` - if test ${basefile##*.} = f - then - usersub=$DIRJOB/`$BASENAME $user .f`.F - ln -sf "$user.f" "$usersub" - else - usersub=$usersubname - fi - - fi - cat > $jid.runmarcscript << END4 - if test "$user" - then - if test ${basefile##*.} = f - then - ln -sf "$user.f" "$usersub" - fi - if test $MACHINENAME = "CRAY" - then - $FORTRAN $usersub || \ - { - echo "$0: compile failed for $user.f" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $FORTRAN $usersub -o $userobj || \ - { - echo "$0: compile failed for $user.f" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - if test ${basefile##*.} = f - then - /bin/rm -f "$usersub" - fi - fi - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $MARCCUDALIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } -END4 -else - prgsav=yes -fi -/bin/rm $userobj 2>/dev/null - -# -# run marc -# - -cat >> $jid.runmarcscript << END5 - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -# first remove all .out files and incremental restart files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null - /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null -fi - -if test $nprocdddm -gt 1 -then - $RUN_JOB 2>>$jid.log -else - $RUN_JOB 2>>$jid.log -fi - -if test $dllrun -eq 0; then - if test $prgsav = no - then - /bin/rm -f $bd$program 2>/dev/null - fi -else - if test $cpdll = yes; then - filename=`basename $usersubname .f` - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes - then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -END5 - - -# Submit to marc batch queue -# -if [ $qid = at ] -then -QUENAME=at -SUBMCMD= -else -# -# Submit to qsub queue -# -QUENAME=qsub -SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" -if test "$priority" -then - SUBMCMD=$SUBMCMD" -p $priority" -fi -if test "$att" -then - SUBMCMD=$SUBMCMD" -a $att" -fi -if test "$cpu" -then - SUBMCMD=$SUBMCMD" -lt $cpu" -fi - -fi -echo $QUENAME $SUBMCMD -#cat $jid.runmarcscript -$QUENAME $SUBMCMD < $jid.runmarcscript - -/bin/rm -f $jid.runmarcscript - -############################################################################## -# run the requested program in the background # -############################################################################## - -else -if test $qid = background -then - -# -# first remove all old .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi -# -# compile user subroutine if present -# -( -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user.f $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_user $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user.f on host $i" - echo " $PRODUCT Exit number 3" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser.f 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user.f on host `hostname`" - fi - userobj=$DIRJOB/`$BASENAME $user .f`.o - basefile=`$BASENAME $usersubname` - if test ${basefile##*.} = f - then - usersub=$DIRJOB/`$BASENAME $user .f`.F - ln -sf "$user.f" "$usersub" - else - usersub=$usersubname - fi - if test $MACHINENAME = "CRAY" - then - $FORTRAN $usersub || \ - { - echo "$0: compile failed for $user.f" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $FORTRAN $usersub -o $userobj || \ - { - echo "$0: compile failed for $user.f" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - if test ${basefile##*.} = f - then - /bin/rm -f "$usersub" - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - echo " $PRODUCT Exit number 3" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null - -# -# run marc - -# - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -$RUN_JOB & - -marcpid=$! -echo $marcpid > $DIRJOB/$jid.pid -wait $marcpid - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=`basename $usersubname .f` - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -) 1>>$jid.log 2>&1 & - - -############################################################################## -# run the requested program in the foreground # -############################################################################## - -else - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user.f $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_user $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user.f on host $i" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser.f 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user.f on host `hostname`" - fi - userobj=$DIRJOB/`$BASENAME $user .f`.o - basefile=`$BASENAME $usersubname` - if test ${basefile##*.} = f - then - usersub=$DIRJOB/`$BASENAME $user .f`.F - ln -sf "$user.f" "$usersub" - else - usersub=$usersubname - fi - if test $MACHINENAME = "CRAY" - then - $FORTRAN $usersub || \ - { - echo "$0: compile failed for $user.f" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $FORTRAN $usersub -o $userobj || \ - { - echo "$0: compile failed for $user.f" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - if test ${basefile##*.} = f - then - /bin/rm -f "$usersub" - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null - -# -# run marc -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi -# first remove all .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi - -$RUN_JOB - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - if test "$host" - then - mpdcleanup -a -f $jid.mfile - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.mfile 2> /dev/null - else - mpdcleanup -a -f $jid.hosts - /bin/rm $jid.hosts 2> /dev/null - fi - fi - fi -fi - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=`basename $usersubname .f` - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi - - -fi -fi diff --git a/installation/mods_MarcMentat/2012/Mentat_bin/edit_window b/installation/mods_MarcMentat/2012/Mentat_bin/edit_window deleted file mode 100644 index afc8e2b39..000000000 --- a/installation/mods_MarcMentat/2012/Mentat_bin/edit_window +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# This script opens a window running an editor. The default window is an -# xterm, and the default editor is vi. These may be customized. - -if [ "`uname`" = "SunOS" ]; then - dir=/usr/openwin/bin -else - dir=/usr/bin/X11 -fi - -# $dir/xterm -T "vi $*" -n "vi $*" -e vi $* -%EDITOR% $* \ No newline at end of file diff --git a/installation/mods_MarcMentat/2012/Mentat_bin/edit_window.org b/installation/mods_MarcMentat/2012/Mentat_bin/edit_window.org deleted file mode 100644 index d6138d5c8..000000000 --- a/installation/mods_MarcMentat/2012/Mentat_bin/edit_window.org +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# This script opens a window running an editor. The default window is an -# xterm, and the default editor is vi. These may be customized. - -if [ "`uname`" = "SunOS" ]; then - dir=/usr/openwin/bin -else - dir=/usr/bin/X11 -fi - -$dir/xterm -T "vi $*" -n "vi $*" -e vi $* diff --git a/installation/mods_MarcMentat/2012/Mentat_bin/kill4 b/installation/mods_MarcMentat/2012/Mentat_bin/kill4 deleted file mode 100644 index 6d1ff84bf..000000000 --- a/installation/mods_MarcMentat/2012/Mentat_bin/kill4 +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "usage: $0 job_name" - exit 1 -fi - -echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2012/Mentat_bin/kill5 b/installation/mods_MarcMentat/2012/Mentat_bin/kill5 deleted file mode 100644 index 6d1ff84bf..000000000 --- a/installation/mods_MarcMentat/2012/Mentat_bin/kill5 +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "usage: $0 job_name" - exit 1 -fi - -echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2012/Mentat_bin/kill6 b/installation/mods_MarcMentat/2012/Mentat_bin/kill6 deleted file mode 100644 index 6d1ff84bf..000000000 --- a/installation/mods_MarcMentat/2012/Mentat_bin/kill6 +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "usage: $0 job_name" - exit 1 -fi - -echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2012/Mentat_bin/kill7 b/installation/mods_MarcMentat/2012/Mentat_bin/kill7 deleted file mode 100644 index 6d1ff84bf..000000000 --- a/installation/mods_MarcMentat/2012/Mentat_bin/kill7 +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "usage: $0 job_name" - exit 1 -fi - -echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2012/Mentat_bin/kill8 b/installation/mods_MarcMentat/2012/Mentat_bin/kill8 deleted file mode 100644 index 6d1ff84bf..000000000 --- a/installation/mods_MarcMentat/2012/Mentat_bin/kill8 +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "usage: $0 job_name" - exit 1 -fi - -echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2012/Mentat_bin/kill9 b/installation/mods_MarcMentat/2012/Mentat_bin/kill9 deleted file mode 100644 index 6d1ff84bf..000000000 --- a/installation/mods_MarcMentat/2012/Mentat_bin/kill9 +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "usage: $0 job_name" - exit 1 -fi - -echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2012/Mentat_bin/submit1.org b/installation/mods_MarcMentat/2012/Mentat_bin/submit1.org deleted file mode 100644 index 61276a7fa..000000000 --- a/installation/mods_MarcMentat/2012/Mentat_bin/submit1.org +++ /dev/null @@ -1,163 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=/msc/marc2012 -if test $MARCDIR1 -then - DIR=$MARCDIR1 -fi - -SRCEXT=.f -RSTEXT=.t08 -PSTEXT=.t19 -PSTEXTB=.t16 -VWFCEXT=.vfs - -slv=$1 -version=$2 -ndom_fea_solver=$3 -ndom_preprocessor=$4 -hostfile=$5 -compat=$6 -job=$7 -srcfile=$8 -srcmeth=$9 -shift 9 # cannot use $10, $11, ... -restart=$1 -postfile=$2 -viewfactorsfile=$3 -autorst=$4 -copy_datfile="-ci $5" -copy_postfile="-cr $6" -scr_dir=$7 -dcoup=$8 -nthread=$9 -shift 9 # cannot use $10, $11, ... -nsolver=$1 -mode=$2 -gpu=$3 - -if [ "$slv" != "" -a "$slv" != "marc" ]; then - slv="-iam sfm" -else - slv="" -fi - -if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then - nprocds="-nprocds $ndom_fea_solver" -else - nprocd="" - if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then - nprocd="-nprocd $ndom_preprocessor" - else - nprocd="" - fi -fi - -if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then - srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` - case "$srcmeth" in - -) - srcfile="-u $srcfile" - ;; - compsave) - srcfile="-u $srcfile -save y" - ;; - runsaved) - srcfile="-prog $srcfile" - ;; - esac -else - srcfile="" -fi - -if [ "$restart" != "" -a "$restart" != "-" ]; then - restart=`echo $restart | sed "s/$RSTEXT$//"` - restart="-r $restart" -else - restart="" -fi - -if [ "$postfile" != "" -a "$postfile" != "-" ]; then - postfile=`echo $postfile | sed "s/$PSTEXT$//"` - postfile=`echo $postfile | sed "s/$PSTEXTB$//"` - postfile="-pid $postfile" -else - postfile="" -fi - -if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then - viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` - viewfactorsfile="-vf $viewfactorsfile" -else - viewfactorsfile="" -fi - -if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then - hostfile="-ho $hostfile" -else - hostfile="" -fi - -if [ "$compat" != "" -a "$compat" != "-" ]; then - compat="-co $compat" -else - compat="" -fi - -if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then - scr_dir="-sd $scr_dir" -else - scr_dir="" -fi - -if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then - dcoup="-dcoup $dcoup" -else - dcoup="" -fi - -if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then - nthread="-nthread $nthread" -else - nthread="" -fi - -if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then - nsolver="-nsolver $nsolver" -else - nsolver="" -fi - -case "$mode" in - 4) mode="-mo i4" ;; - 8) mode="-mo i8" ;; - *) mode= ;; -esac - -if [ "$gpu" != "" -a "$gpu" != "-" ]; then - gpu="-gpu $gpu" -else - gpu="" -fi - -rm -f $job.cnt -rm -f $job.sts -rm -f $job.out -rm -f $job.log - -# To prevent a mismatch with the python version used by the solver -# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH -# unset environment variables PYTHONHOME and PYTHONPATH -unset PYTHONHOME -unset PYTHONPATH - -"${DIR}/tools/run_marc" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ - $srcfile $restart $postfile $viewfactorsfile $hostfile \ - $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ - $nthread $nsolver $mode $gpu > /dev/null 2>&1 -sleep 1 -exit 0 diff --git a/installation/mods_MarcMentat/2012/Mentat_bin/submit4 b/installation/mods_MarcMentat/2012/Mentat_bin/submit4 deleted file mode 100644 index dda98f475..000000000 --- a/installation/mods_MarcMentat/2012/Mentat_bin/submit4 +++ /dev/null @@ -1,164 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=%INSTALLDIR%/marc%VERSION% -if test $MARCDIR1 -then - DIR=$MARCDIR1 -fi - -SRCEXT=.f -RSTEXT=.t08 -PSTEXT=.t19 -PSTEXTB=.t16 -VWFCEXT=.vfs - -slv=$1 -version=$2 -ndom_fea_solver=$3 -ndom_preprocessor=$4 -hostfile=$5 -compat=$6 -job=$7 -srcfile=$8 -srcmeth=$9 -shift 9 # cannot use $10, $11, ... -restart=$1 -postfile=$2 -viewfactorsfile=$3 -autorst=$4 -copy_datfile="-ci $5" -copy_postfile="-cr $6" -scr_dir=$7 -dcoup=$8 -nthread=$9 -shift 9 # cannot use $10, $11, ... -nsolver=$1 -mode=$2 -gpu=$3 - -if [ "$slv" != "" -a "$slv" != "marc" ]; then - slv="-iam sfm" -else - slv="" -fi - -if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then - nprocds="-nprocds $ndom_fea_solver" -else - nprocd="" - if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then - nprocd="-nprocd $ndom_preprocessor" - else - nprocd="" - fi -fi - -if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then -# srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` - case "$srcmeth" in - -) - srcfile="-u $srcfile" - ;; - compsave) - srcfile="-u $srcfile -save y" - ;; - runsaved) - srcfile=${srcfile%.*}".marc" - srcfile="-prog $srcfile" - ;; - esac -else - srcfile="" -fi - -if [ "$restart" != "" -a "$restart" != "-" ]; then - restart=`echo $restart | sed "s/$RSTEXT$//"` - restart="-r $restart" -else - restart="" -fi - -if [ "$postfile" != "" -a "$postfile" != "-" ]; then - postfile=`echo $postfile | sed "s/$PSTEXT$//"` - postfile=`echo $postfile | sed "s/$PSTEXTB$//"` - postfile="-pid $postfile" -else - postfile="" -fi - -if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then - viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` - viewfactorsfile="-vf $viewfactorsfile" -else - viewfactorsfile="" -fi - -if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then - hostfile="-ho $hostfile" -else - hostfile="" -fi - -if [ "$compat" != "" -a "$compat" != "-" ]; then - compat="-co $compat" -else - compat="" -fi - -if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then - scr_dir="-sd $scr_dir" -else - scr_dir="" -fi - -if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then - dcoup="-dcoup $dcoup" -else - dcoup="" -fi - -if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then - nthread="-nthread $nthread" -else - nthread="" -fi - -if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then - nsolver="-nsolver $nsolver" -else - nsolver="" -fi - -case "$mode" in - 4) mode="-mo i4" ;; - 8) mode="-mo i8" ;; - *) mode= ;; -esac - -if [ "$gpu" != "" -a "$gpu" != "-" ]; then - gpu="-gpu $gpu" -else - gpu="" -fi - -rm -f $job.cnt -rm -f $job.sts -rm -f $job.out -rm -f $job.log - -# To prevent a mismatch with the python version used by the solver -# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH -# unset environment variables PYTHONHOME and PYTHONPATH -unset PYTHONHOME -unset PYTHONPATH - -"${DIR}/tools/run_damask_hmp" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ - $srcfile $restart $postfile $viewfactorsfile $hostfile \ - $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ - $nthread $nsolver $mode $gpu > /dev/null 2>&1 -sleep 1 -exit 0 diff --git a/installation/mods_MarcMentat/2012/Mentat_bin/submit5 b/installation/mods_MarcMentat/2012/Mentat_bin/submit5 deleted file mode 100644 index 1f96942d2..000000000 --- a/installation/mods_MarcMentat/2012/Mentat_bin/submit5 +++ /dev/null @@ -1,164 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=%INSTALLDIR%/marc%VERSION% -if test $MARCDIR1 -then - DIR=$MARCDIR1 -fi - -SRCEXT=.f -RSTEXT=.t08 -PSTEXT=.t19 -PSTEXTB=.t16 -VWFCEXT=.vfs - -slv=$1 -version=$2 -ndom_fea_solver=$3 -ndom_preprocessor=$4 -hostfile=$5 -compat=$6 -job=$7 -srcfile=$8 -srcmeth=$9 -shift 9 # cannot use $10, $11, ... -restart=$1 -postfile=$2 -viewfactorsfile=$3 -autorst=$4 -copy_datfile="-ci $5" -copy_postfile="-cr $6" -scr_dir=$7 -dcoup=$8 -nthread=$9 -shift 9 # cannot use $10, $11, ... -nsolver=$1 -mode=$2 -gpu=$3 - -if [ "$slv" != "" -a "$slv" != "marc" ]; then - slv="-iam sfm" -else - slv="" -fi - -if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then - nprocds="-nprocds $ndom_fea_solver" -else - nprocd="" - if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then - nprocd="-nprocd $ndom_preprocessor" - else - nprocd="" - fi -fi - -if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then -# srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` - case "$srcmeth" in - -) - srcfile="-u $srcfile" - ;; - compsave) - srcfile="-u $srcfile -save y" - ;; - runsaved) - srcfile=${srcfile%.*}".marc" - srcfile="-prog $srcfile" - ;; - esac -else - srcfile="" -fi - -if [ "$restart" != "" -a "$restart" != "-" ]; then - restart=`echo $restart | sed "s/$RSTEXT$//"` - restart="-r $restart" -else - restart="" -fi - -if [ "$postfile" != "" -a "$postfile" != "-" ]; then - postfile=`echo $postfile | sed "s/$PSTEXT$//"` - postfile=`echo $postfile | sed "s/$PSTEXTB$//"` - postfile="-pid $postfile" -else - postfile="" -fi - -if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then - viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` - viewfactorsfile="-vf $viewfactorsfile" -else - viewfactorsfile="" -fi - -if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then - hostfile="-ho $hostfile" -else - hostfile="" -fi - -if [ "$compat" != "" -a "$compat" != "-" ]; then - compat="-co $compat" -else - compat="" -fi - -if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then - scr_dir="-sd $scr_dir" -else - scr_dir="" -fi - -if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then - dcoup="-dcoup $dcoup" -else - dcoup="" -fi - -if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then - nthread="-nthread $nthread" -else - nthread="" -fi - -if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then - nsolver="-nsolver $nsolver" -else - nsolver="" -fi - -case "$mode" in - 4) mode="-mo i4" ;; - 8) mode="-mo i8" ;; - *) mode= ;; -esac - -if [ "$gpu" != "" -a "$gpu" != "-" ]; then - gpu="-gpu $gpu" -else - gpu="" -fi - -rm -f $job.cnt -rm -f $job.sts -rm -f $job.out -rm -f $job.log - -# To prevent a mismatch with the python version used by the solver -# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH -# unset environment variables PYTHONHOME and PYTHONPATH -unset PYTHONHOME -unset PYTHONPATH - -"${DIR}/tools/run_damask_mp" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ - $srcfile $restart $postfile $viewfactorsfile $hostfile \ - $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ - $nthread $nsolver $mode $gpu > /dev/null 2>&1 -sleep 1 -exit 0 diff --git a/installation/mods_MarcMentat/2012/Mentat_bin/submit6 b/installation/mods_MarcMentat/2012/Mentat_bin/submit6 deleted file mode 100644 index a9a74f4f3..000000000 --- a/installation/mods_MarcMentat/2012/Mentat_bin/submit6 +++ /dev/null @@ -1,164 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=%INSTALLDIR%/marc%VERSION% -if test $MARCDIR1 -then - DIR=$MARCDIR1 -fi - -SRCEXT=.f -RSTEXT=.t08 -PSTEXT=.t19 -PSTEXTB=.t16 -VWFCEXT=.vfs - -slv=$1 -version=$2 -ndom_fea_solver=$3 -ndom_preprocessor=$4 -hostfile=$5 -compat=$6 -job=$7 -srcfile=$8 -srcmeth=$9 -shift 9 # cannot use $10, $11, ... -restart=$1 -postfile=$2 -viewfactorsfile=$3 -autorst=$4 -copy_datfile="-ci $5" -copy_postfile="-cr $6" -scr_dir=$7 -dcoup=$8 -nthread=$9 -shift 9 # cannot use $10, $11, ... -nsolver=$1 -mode=$2 -gpu=$3 - -if [ "$slv" != "" -a "$slv" != "marc" ]; then - slv="-iam sfm" -else - slv="" -fi - -if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then - nprocds="-nprocds $ndom_fea_solver" -else - nprocd="" - if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then - nprocd="-nprocd $ndom_preprocessor" - else - nprocd="" - fi -fi - -if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then -# srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` - case "$srcmeth" in - -) - srcfile="-u $srcfile" - ;; - compsave) - srcfile="-u $srcfile -save y" - ;; - runsaved) - srcfile=${srcfile%.*}".marc" - srcfile="-prog $srcfile" - ;; - esac -else - srcfile="" -fi - -if [ "$restart" != "" -a "$restart" != "-" ]; then - restart=`echo $restart | sed "s/$RSTEXT$//"` - restart="-r $restart" -else - restart="" -fi - -if [ "$postfile" != "" -a "$postfile" != "-" ]; then - postfile=`echo $postfile | sed "s/$PSTEXT$//"` - postfile=`echo $postfile | sed "s/$PSTEXTB$//"` - postfile="-pid $postfile" -else - postfile="" -fi - -if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then - viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` - viewfactorsfile="-vf $viewfactorsfile" -else - viewfactorsfile="" -fi - -if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then - hostfile="-ho $hostfile" -else - hostfile="" -fi - -if [ "$compat" != "" -a "$compat" != "-" ]; then - compat="-co $compat" -else - compat="" -fi - -if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then - scr_dir="-sd $scr_dir" -else - scr_dir="" -fi - -if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then - dcoup="-dcoup $dcoup" -else - dcoup="" -fi - -if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then - nthread="-nthread $nthread" -else - nthread="" -fi - -if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then - nsolver="-nsolver $nsolver" -else - nsolver="" -fi - -case "$mode" in - 4) mode="-mo i4" ;; - 8) mode="-mo i8" ;; - *) mode= ;; -esac - -if [ "$gpu" != "" -a "$gpu" != "-" ]; then - gpu="-gpu $gpu" -else - gpu="" -fi - -rm -f $job.cnt -rm -f $job.sts -rm -f $job.out -rm -f $job.log - -# To prevent a mismatch with the python version used by the solver -# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH -# unset environment variables PYTHONHOME and PYTHONPATH -unset PYTHONHOME -unset PYTHONPATH - -"${DIR}/tools/run_damask_lmp" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ - $srcfile $restart $postfile $viewfactorsfile $hostfile \ - $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ - $nthread $nsolver $mode $gpu > /dev/null 2>&1 -sleep 1 -exit 0 diff --git a/installation/mods_MarcMentat/2012/Mentat_bin/submit7 b/installation/mods_MarcMentat/2012/Mentat_bin/submit7 deleted file mode 100644 index edbc1701c..000000000 --- a/installation/mods_MarcMentat/2012/Mentat_bin/submit7 +++ /dev/null @@ -1,164 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=%INSTALLDIR%/marc%VERSION% -if test $MARCDIR1 -then - DIR=$MARCDIR1 -fi - -SRCEXT=.f -RSTEXT=.t08 -PSTEXT=.t19 -PSTEXTB=.t16 -VWFCEXT=.vfs - -slv=$1 -version=$2 -ndom_fea_solver=$3 -ndom_preprocessor=$4 -hostfile=$5 -compat=$6 -job=$7 -srcfile=$8 -srcmeth=$9 -shift 9 # cannot use $10, $11, ... -restart=$1 -postfile=$2 -viewfactorsfile=$3 -autorst=$4 -copy_datfile="-ci $5" -copy_postfile="-cr $6" -scr_dir=$7 -dcoup=$8 -nthread=$9 -shift 9 # cannot use $10, $11, ... -nsolver=$1 -mode=$2 -gpu=$3 - -if [ "$slv" != "" -a "$slv" != "marc" ]; then - slv="-iam sfm" -else - slv="" -fi - -if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then - nprocds="-nprocds $ndom_fea_solver" -else - nprocd="" - if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then - nprocd="-nprocd $ndom_preprocessor" - else - nprocd="" - fi -fi - -if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then -# srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` - case "$srcmeth" in - -) - srcfile="-u $srcfile" - ;; - compsave) - srcfile="-u $srcfile -save y" - ;; - runsaved) - srcfile=${srcfile%.*}".marc" - srcfile="-prog $srcfile" - ;; - esac -else - srcfile="" -fi - -if [ "$restart" != "" -a "$restart" != "-" ]; then - restart=`echo $restart | sed "s/$RSTEXT$//"` - restart="-r $restart" -else - restart="" -fi - -if [ "$postfile" != "" -a "$postfile" != "-" ]; then - postfile=`echo $postfile | sed "s/$PSTEXT$//"` - postfile=`echo $postfile | sed "s/$PSTEXTB$//"` - postfile="-pid $postfile" -else - postfile="" -fi - -if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then - viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` - viewfactorsfile="-vf $viewfactorsfile" -else - viewfactorsfile="" -fi - -if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then - hostfile="-ho $hostfile" -else - hostfile="" -fi - -if [ "$compat" != "" -a "$compat" != "-" ]; then - compat="-co $compat" -else - compat="" -fi - -if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then - scr_dir="-sd $scr_dir" -else - scr_dir="" -fi - -if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then - dcoup="-dcoup $dcoup" -else - dcoup="" -fi - -if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then - nthread="-nthread $nthread" -else - nthread="" -fi - -if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then - nsolver="-nsolver $nsolver" -else - nsolver="" -fi - -case "$mode" in - 4) mode="-mo i4" ;; - 8) mode="-mo i8" ;; - *) mode= ;; -esac - -if [ "$gpu" != "" -a "$gpu" != "-" ]; then - gpu="-gpu $gpu" -else - gpu="" -fi - -rm -f $job.cnt -rm -f $job.sts -rm -f $job.out -rm -f $job.log - -# To prevent a mismatch with the python version used by the solver -# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH -# unset environment variables PYTHONHOME and PYTHONPATH -unset PYTHONHOME -unset PYTHONPATH - -"${DIR}/tools/run_damask_h" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ - $srcfile $restart $postfile $viewfactorsfile $hostfile \ - $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ - $nthread $nsolver $mode $gpu > /dev/null 2>&1 -sleep 1 -exit 0 diff --git a/installation/mods_MarcMentat/2012/Mentat_bin/submit8 b/installation/mods_MarcMentat/2012/Mentat_bin/submit8 deleted file mode 100644 index 872125981..000000000 --- a/installation/mods_MarcMentat/2012/Mentat_bin/submit8 +++ /dev/null @@ -1,164 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=%INSTALLDIR%/marc%VERSION% -if test $MARCDIR1 -then - DIR=$MARCDIR1 -fi - -SRCEXT=.f -RSTEXT=.t08 -PSTEXT=.t19 -PSTEXTB=.t16 -VWFCEXT=.vfs - -slv=$1 -version=$2 -ndom_fea_solver=$3 -ndom_preprocessor=$4 -hostfile=$5 -compat=$6 -job=$7 -srcfile=$8 -srcmeth=$9 -shift 9 # cannot use $10, $11, ... -restart=$1 -postfile=$2 -viewfactorsfile=$3 -autorst=$4 -copy_datfile="-ci $5" -copy_postfile="-cr $6" -scr_dir=$7 -dcoup=$8 -nthread=$9 -shift 9 # cannot use $10, $11, ... -nsolver=$1 -mode=$2 -gpu=$3 - -if [ "$slv" != "" -a "$slv" != "marc" ]; then - slv="-iam sfm" -else - slv="" -fi - -if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then - nprocds="-nprocds $ndom_fea_solver" -else - nprocd="" - if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then - nprocd="-nprocd $ndom_preprocessor" - else - nprocd="" - fi -fi - -if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then -# srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` - case "$srcmeth" in - -) - srcfile="-u $srcfile" - ;; - compsave) - srcfile="-u $srcfile -save y" - ;; - runsaved) - srcfile=${srcfile%.*}".marc" - srcfile="-prog $srcfile" - ;; - esac -else - srcfile="" -fi - -if [ "$restart" != "" -a "$restart" != "-" ]; then - restart=`echo $restart | sed "s/$RSTEXT$//"` - restart="-r $restart" -else - restart="" -fi - -if [ "$postfile" != "" -a "$postfile" != "-" ]; then - postfile=`echo $postfile | sed "s/$PSTEXT$//"` - postfile=`echo $postfile | sed "s/$PSTEXTB$//"` - postfile="-pid $postfile" -else - postfile="" -fi - -if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then - viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` - viewfactorsfile="-vf $viewfactorsfile" -else - viewfactorsfile="" -fi - -if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then - hostfile="-ho $hostfile" -else - hostfile="" -fi - -if [ "$compat" != "" -a "$compat" != "-" ]; then - compat="-co $compat" -else - compat="" -fi - -if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then - scr_dir="-sd $scr_dir" -else - scr_dir="" -fi - -if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then - dcoup="-dcoup $dcoup" -else - dcoup="" -fi - -if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then - nthread="-nthread $nthread" -else - nthread="" -fi - -if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then - nsolver="-nsolver $nsolver" -else - nsolver="" -fi - -case "$mode" in - 4) mode="-mo i4" ;; - 8) mode="-mo i8" ;; - *) mode= ;; -esac - -if [ "$gpu" != "" -a "$gpu" != "-" ]; then - gpu="-gpu $gpu" -else - gpu="" -fi - -rm -f $job.cnt -rm -f $job.sts -rm -f $job.out -rm -f $job.log - -# To prevent a mismatch with the python version used by the solver -# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH -# unset environment variables PYTHONHOME and PYTHONPATH -unset PYTHONHOME -unset PYTHONPATH - -"${DIR}/tools/run_damask" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ - $srcfile $restart $postfile $viewfactorsfile $hostfile \ - $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ - $nthread $nsolver $mode $gpu > /dev/null 2>&1 -sleep 1 -exit 0 diff --git a/installation/mods_MarcMentat/2012/Mentat_bin/submit9 b/installation/mods_MarcMentat/2012/Mentat_bin/submit9 deleted file mode 100644 index 44a4865fb..000000000 --- a/installation/mods_MarcMentat/2012/Mentat_bin/submit9 +++ /dev/null @@ -1,164 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=%INSTALLDIR%/marc%VERSION% -if test $MARCDIR1 -then - DIR=$MARCDIR1 -fi - -SRCEXT=.f -RSTEXT=.t08 -PSTEXT=.t19 -PSTEXTB=.t16 -VWFCEXT=.vfs - -slv=$1 -version=$2 -ndom_fea_solver=$3 -ndom_preprocessor=$4 -hostfile=$5 -compat=$6 -job=$7 -srcfile=$8 -srcmeth=$9 -shift 9 # cannot use $10, $11, ... -restart=$1 -postfile=$2 -viewfactorsfile=$3 -autorst=$4 -copy_datfile="-ci $5" -copy_postfile="-cr $6" -scr_dir=$7 -dcoup=$8 -nthread=$9 -shift 9 # cannot use $10, $11, ... -nsolver=$1 -mode=$2 -gpu=$3 - -if [ "$slv" != "" -a "$slv" != "marc" ]; then - slv="-iam sfm" -else - slv="" -fi - -if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then - nprocds="-nprocds $ndom_fea_solver" -else - nprocd="" - if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then - nprocd="-nprocd $ndom_preprocessor" - else - nprocd="" - fi -fi - -if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then -# srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` - case "$srcmeth" in - -) - srcfile="-u $srcfile" - ;; - compsave) - srcfile="-u $srcfile -save y" - ;; - runsaved) - srcfile=${srcfile%.*}".marc" - srcfile="-prog $srcfile" - ;; - esac -else - srcfile="" -fi - -if [ "$restart" != "" -a "$restart" != "-" ]; then - restart=`echo $restart | sed "s/$RSTEXT$//"` - restart="-r $restart" -else - restart="" -fi - -if [ "$postfile" != "" -a "$postfile" != "-" ]; then - postfile=`echo $postfile | sed "s/$PSTEXT$//"` - postfile=`echo $postfile | sed "s/$PSTEXTB$//"` - postfile="-pid $postfile" -else - postfile="" -fi - -if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then - viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` - viewfactorsfile="-vf $viewfactorsfile" -else - viewfactorsfile="" -fi - -if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then - hostfile="-ho $hostfile" -else - hostfile="" -fi - -if [ "$compat" != "" -a "$compat" != "-" ]; then - compat="-co $compat" -else - compat="" -fi - -if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then - scr_dir="-sd $scr_dir" -else - scr_dir="" -fi - -if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then - dcoup="-dcoup $dcoup" -else - dcoup="" -fi - -if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then - nthread="-nthread $nthread" -else - nthread="" -fi - -if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then - nsolver="-nsolver $nsolver" -else - nsolver="" -fi - -case "$mode" in - 4) mode="-mo i4" ;; - 8) mode="-mo i8" ;; - *) mode= ;; -esac - -if [ "$gpu" != "" -a "$gpu" != "-" ]; then - gpu="-gpu $gpu" -else - gpu="" -fi - -rm -f $job.cnt -rm -f $job.sts -rm -f $job.out -rm -f $job.log - -# To prevent a mismatch with the python version used by the solver -# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH -# unset environment variables PYTHONHOME and PYTHONPATH -unset PYTHONHOME -unset PYTHONPATH - -"${DIR}/tools/run_damask_l" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ - $srcfile $restart $postfile $viewfactorsfile $hostfile \ - $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ - $nthread $nsolver $mode $gpu > /dev/null 2>&1 -sleep 1 -exit 0 diff --git a/installation/mods_MarcMentat/2012/Mentat_menus/job_run.ms b/installation/mods_MarcMentat/2012/Mentat_menus/job_run.ms deleted file mode 100644 index daf207061..000000000 --- a/installation/mods_MarcMentat/2012/Mentat_menus/job_run.ms +++ /dev/null @@ -1,2942 +0,0 @@ -#ifndef AUTOFORGE -popmenu job_title_pm file jobs.ms -popdown job_title_ok file jobs.ms -#ifndef QT_MENTAT -popmenu marc_input_style_pm file job_common.ms -popmenu marc_input_style_run_adv_pm file job_common.ms -popmenu marc_version_run_pm file job_common.ms -#endif -group job_solver_gr file job_common.ms -group user_domains_gr file domain_decomposition.ms -group user_domains_generate_gr file domain_decomposition.ms -group user_domains_tail_gr file domain_decomposition.ms -group job_solver_opts_gr file job_common.ms -popmenu ddm_options file job_common.ms -#ifdef QT_MENTAT -browser edit_browser file file.ms -browser directory_browser file file.ms -screen domains file domain_decomposition.ms -#else -popmenu edit_browser_popmenu file file.ms -popmenu directory_browser_popmenu file file.ms -#endif - -#ifndef QT_MENTAT -popmenu usersub_file_browser_pm { - - group { -#endif - - browser usersub_file_browser { - position 0 0 - size 82 72 - text "$usersub_file_browser_label" ($usersub_file_browser_label) - filter "*.f *.f90" - nvisible 10 - select_files true - cancel_action popdown - ok_action popdown - command "$usersub_file_browser_command" ($usersub_file_browser_command) - } -#ifndef QT_MENTAT - } - - window { - title " Select MARC User Subroutine File" - origin 30 30 - size 82 72 - } - - mode dialog - disable_right_mouse_button -} -#endif - -#ifndef QT_MENTAT -popmenu host_file_browser_pm { - - group { -#endif - - browser host_file_browser { - position 0 0 - size 82 72 - text "$host_file_browser_label" ($host_file_browser_label) - filter "*" - nvisible 10 - select_files true - cancel_action popdown - ok_action popdown - command "$host_file_browser_command" ($host_file_browser_command) - } -#ifndef QT_MENTAT - } - - window { - title " Select MARC Host File" - origin 30 30 - size 82 72 - } - - mode dialog - disable_right_mouse_button -} -#endif - -popmenu job_run_popmenu { - -#ifdef QT_MENTAT - text "RUN JOB" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 50 4 - text "RUN JOB" - } -#endif - -#ifdef QT_MENTAT - label { - position 0 0 - size 6 4 - text "NAME" - } - - display { - position +6 = - size 26 4 - display "job_name" - } - - label { - position 0 +4 - size 6 4 - text "TYPE" - } - - display { - position +6 = - size 26 4 - display job_class_label - } -#endif - - button { -#ifdef QT_MENTAT - position 1 9 -#else - position 1 5 -#endif - size 24 4 - text "USER SUBROUTINE FILE" -#ifdef QT_MENTAT - browser usersub_file_browser -#else - popmenu usersub_file_browser_pm -#endif - settext $usersub_file_browser_label "SELECT USER SUBROUTINE FILE" - set $usersub_file_browser_command "*job_usersub_file" - help job_usersub_file - } - - toggle { - position +26 = - size 22 4 - text "SELECTED USER SUBS" - toggle job_usersubs - help job_run_seluser - visible job_usersubs - popmenu job_usersub_pm - } - - display { - position 1 +4 - size 48 4 - display job_usersub_file - } - - button { - position 1 +4 - size 12 4 - text "EDIT" - command "*job_edit_usersub_file" - visible job_usersub_file - } - - button { - position +12 = - size 12 4 - text "CLEAR" - command "*job_clear_usersub_file" - visible job_usersub_file - } - - roller { - position +12 = - size 24 4 - nvalues 3 - texts "COMPILE / NO SAVE" - "COMPILE AND SAVE" - "RUN SAVED EXECUTABLE" - help job_run_compile - roller "job_option user_source" - visible job_usersub_file -#ifdef QT_MENTAT - commands "*job_option user_source:compile_nosave" - "*job_option user_source:compile_save" - "*job_option user_source:run_saved" -#else - popmenu job_user_source_pm -#endif - } - - frame { - position 1 +6 - size 48 14 - border_width 1 - border_color black - - group { - - toggle { - position 1 1 - size 23 4 - text "PARALLELIZATION/\{GPU}" - help job_run_parallel - toggle "or(*job_option parallel:on, \ - solver_multi_procs, \ - solver_multi_threads, \ - and(job_solver_mfront_sparse,\ - job_nonsym_off,\ - *job_option solver_use_gpu:on))" - popmenu job_run_parallelization_pm - set $popname2 "job_run_parallelization_pm" - } - - frame { - position +23 = - size 23 12 - border_width 1 - border_color black - - group { - - display { - position 0 0 - size 23 4 - display job_ddm_domains - } - - display { - position = +4 - size 23 4 - display job_solver_procs - visible solver_allows_multi_procs - } - - display { - position = = - size 23 4 - display job_solver_threads - visible "and(solver_allows_multi_threads,\ - not(and(job_solver_mfront_sparse,\ - *job_option parallel:on)))" - } - - display { - position = +4 - size 23 4 - display job_solver_gpu - visible "and(job_solver_mfront_sparse,job_nonsym_off)" - } - } - } - } - } - - button { - position 1 +16 - size 8 4 - text "TITLE" - popmenu job_title_pm - command "*job_title" - } - -# see also job_common.ms -# see also the ADVANCED JOB SUBMISSION popmenu in this file - - label { - position +10 = - size 7 4 - text "STYLE" - border_width 1 - border_color black - } - - roller { - position +7 = - size 16 4 - nvalues 3 - texts "TABLE-DRIVEN" - "MULTI-PHYSICS" - "OLD" - rollers "job_input_style_table_driven" - "job_input_style_multi_physics" - "job_input_style_old" -#ifdef QT_MENTAT - commands "*job_option input_style:new *job_option input_physics_style:old" - "*job_option input_physics_style:new *job_option input_style:new" - "*job_option input_style:old *job_option input_physics_style:old" - visibles "job_allows_input_style_table_driven" - "job_allows_input_style_multi_physics" - "job_allows_input_style_old" -#else - popmenu marc_input_style_pm -#endif - help job_option_input_style - } - - button { - position +18 = - size 13 4 - text "SAVE MODEL" - command "*save_model" - } - - button { - position 1 +6 - size 16 6 - text "SUBMIT (1)" - command "*submit_job 1 *monitor_job" - } - - button { - position +16 = - size 16 6 - text "ADV. JOB SUBM." - popmenu job_submit_adv_pm - } - - button { - position +16 = - size 16 6 - text "DAMASK" - popmenu damask - } - - button { - position 1 +6 - size 16 6 - text "UPDATE" - command "*update_job" - } - - button { - position +16 = - size 16 6 - text "MONITOR" - command "*monitor_job" - } - - button { - position +16 = - size 16 6 - text "KILL" - command "*kill_job *monitor_job" - } - - label { - position 1 +7 - size 32 4 - text "STATUS" - border_width 1 - border_color black - } - - display { - position +32 = - size 16 4 - display "job_status" - } - - label { - position -32 +4 - size 32 4 - text "CURRENT INCREMENT (CYCLE)" - border_width 1 - border_color black - } - - display { - position +32 = - size 16 4 - display "job_increment" - } - - label { - position -32 +4 - size 32 4 - text "SINGULARITY RATIO" - border_width 1 - border_color black - } - - float { - position +32 = - size 16 4 - display "job_singularity_ratio" - } - - label { - position -32 +4 - size 32 4 - text "CONVERGENCE RATIO" - border_width 1 - border_color black - } - - float { - position +32 = - size 16 4 - display "job_convergence_ratio" - } - - - label { - position 1 +4 - size 32 4 - text "ANALYSIS TIME" - border_width 1 - border_color black - } - - float { - position +32 = - size 16 4 - display "job_analysis_time" - } - - label { - position -32 +4 - size 32 4 - text "WALL TIME" - border_width 1 - border_color black - } - - float { - position +32 = - size 16 4 - display "job_time" - } - - frame { - position 1 +4 - size 48 8 - - group { - - frame { - position 0 0 - size 48 8 - text "TOTAL" - border_width 1 - border_color black - group { - - label { - position +6 = - size 12 4 - text "CYCLES" - border_width 1 - border_color black - } - - integer { - position +12 = - size 10 4 - display "acc_job_cycles" - border_width 1 - border_color black - } - - label { - position -12 +4 - size 12 4 - text "SEPARATIONS" - border_width 1 - border_color black - } - - integer { - position +12 = - size 10 4 - display "acc_job_separations" - border_width 1 - border_color black - } - - label { - position +10 -4 - size 10 4 - text "CUT BACKS" - border_width 1 - border_color black - } - - integer { - position +10 = - size 10 4 - display "acc_job_cut_backs" - border_width 1 - border_color black - } - - label { - position -10 +4 - size 10 4 - text "REMESHES" - border_width 1 - border_color black - } - - integer { - position +10 = - size 10 4 - display "acc_job_remeshes" - border_width 1 - border_color black - } - } - } - } - } - - label { - position 1 +8 - size 18 4 - text "EXIT NUMBER" - border_width 1 - border_color black - } - - integer { - position +18 = - size 10 4 - display "job_exit" - } - - button { - position +10 = - size 20 4 - text "EXIT MESSAGE" - popmenu job_exit_msg_pm - help exit_message - } - - label { - position 1 +6 - size 5 4 - text "EDIT" - border_width 1 - border_color black - } - - button { - position +5 = - size 12 4 - text "OUTPUT FILE" - command "*job_edit_output" - } - - button { - position +12 = - size 9 4 - text "LOG FILE" - command "*job_edit_log_file" - } - - button { - position +9 = - size 12 4 - text "STATUS FILE" - command "*job_edit_status_file" - } - - button { - position +12 = - size 10 4 - text "ANY FILE" - settext $edit_browser_label "EDIT FILE" - set $edit_browser_command "*edit_file" -#ifdef QT_MENTAT - browser edit_browser -#else - popmenu edit_browser_popmenu -#endif - help edit_file - } - - popdown { - position 1 +6 - size 32 4 - text "OPEN POST FILE (RESULTS MENU)" - screen results - command "*post_open_default" - } - - button { - position 1 +6 - size 12 8 - text "RESET" - command "*job_submit_reset" - } - - popdown { - position +36 = - size 12 8 - text "OK" - } - } - - window job_run_wi { - parent mentat - origin 35 4 - size 50 113 - background_color body - border_width 1 - border_color border - buffering single - } - -#ifdef QT_MENTAT - mode permanent -#else - mode dialog -#endif -} - -popmenu job_usersub_pm { - -#ifdef QT_MENTAT - text "CURRENTLY SELECTED USER SUBROUTINES" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 66 4 - text "CURRENTLY SELECTED USER SUBROUTINES" - } -#endif - - display { - position 1 +5 - size 64 86 - display "job_usersubs" - } - - popdown { - position 27 +88 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 38 8 - size 66 102 - background_color body - border_width 1 - border_color border - buffering single - } - mode dialog -} - -popmenu job_submit_adv_pm { - -#ifdef QT_MENTAT - text "ADVANCED JOB SUBMISSION" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 50 4 - text "ADVANCED JOB SUBMISSION" - } -#endif - - label { - position 1 5 - size 19 4 - text "INITIAL ALLOCATION" - border_width 1 - border_color black - } -#ifdef QT_MENTAT - label { - position +19 = - size 15 4 - text "GENERAL MEMORY" - } -#else - button { - position +19 = - size 15 4 - text "GENERAL MEMORY" - help job_param_general_init_allocation - command "*job_param general_init_allocation" - } -#endif - text { - position +15 = - size 10 4 - display "job_param_value_general_init_allocation" - command "*job_param general_init_allocation" - help job_param_general_init_allocation - } - - label { - position +10 = - size 4 4 - text "MB" - border_width 1 - border_color black - } - - toggle { - position 1 +5 - size 32 4 - text "OUT-OF-CORE ELEMENT STORAGE" - help job_param_elsto - toggle "*job_option elsto:on" - true_command "*job_option elsto:on" - false_command "*job_option elsto:off" - } - - toggle { - position 1 +4 - size 32 4 - text "OUT-OF-CORE INCREMENTAL BACKUP" - help job_param_inc_backup_storage - toggle "*job_option inc_backup_storage:out_of_core" - true_command "*job_option inc_backup_storage:out_of_core" - false_command "*job_option inc_backup_storage:in_core" - } - - toggle { - position +34 = - size 14 4 - text "CHECK SIZES" - help job_run_check - toggle "*job_option check:on" - true_command "*job_option check:on" - false_command "*job_option check:off" - } - - label { - position 1 +6 - size 16 4 - text "INTEGER SIZE" - border_width 1 - border_color black - } - - roller { - position +16 = - size 32 4 - nvalues 3 - texts "DEFAULT" - "4-BYTE INTEGERS" - "8-BYTE INTEGERS" -#ifdef QT_MENTAT - commands "*job_option marc_integer_size:default" - "*job_option marc_integer_size:i4" - "*job_option marc_integer_size:i8" -#else - popmenu marc_integer_size_pm -#endif - help job_run_intsize - roller "job_option marc_integer_size" - } - - frame { - position 1 +6 - size 48 12 - text "MARC INPUT FILE" - border_width 1 - border_color black - - group { - - label { - position 0 4 - size 9 4 - text "VERSION" - border_width 1 - border_color black - } - - roller { - position +9 = - size 14 4 - nvalues 15 - nvisible 15 - texts "DEFAULT" -#if 0 - "2012" -#endif - "2011" - "2010.2" - "2010" - "2008" - "2007" - "2005R3" - "2005" - "2003" - "2001" - "2000" -#if 0 - "8" -#endif - "K7" - "K6.2" - "K5" - "K4" - help job_param_version - rollers "job_input_version_default" -#if 0 - "job_input_version_2012" -#endif - "job_input_version_2011" - "job_input_version_2010.2" - "job_input_version_2010" - "job_input_version_2008" - "job_input_version_2007" - "job_input_version_2005r3" - "job_input_version_2005" - "job_input_version_2003" - "job_input_version_2001" - "job_input_version_2000" -#if 0 - "job_input_version_8" -#endif - "job_input_version_k7" - "job_input_version_k6" - "job_input_version_k5" - "job_input_version_k4" -#ifdef QT_MENTAT - commands "*job_option version:default" -#if 0 - "*job_option version:2012" -#endif - "*job_option version:2011" - "*job_option version:2010.2" - "*job_option version:2010" - "*job_option version:2008" - "*job_option version:2007" - "*job_option version:2005r3" - "*job_option version:2005" - "*job_option version:2003" - "*job_option version:2001" - "*job_option version:2000" -#if 0 - "*job_option version:8" -#endif - "*job_option version:k7" - "*job_option version:k6" - "*job_option version:k5" - "*job_option version:k4" - visibles "job_allows_input_version_default" -#if 0 - "job_allows_input_version_2012" -#endif - "job_allows_input_version_2011" - "job_allows_input_version_2010.2" - "job_allows_input_version_2010" - "job_allows_input_version_2008" - "job_allows_input_version_2007" - "job_allows_input_version_2005r3" - "job_allows_input_version_2005" - "job_allows_input_version_2003" - "job_allows_input_version_2001" - "job_allows_input_version_2000" -#if 0 - "job_allows_input_version_8" -#endif - "job_allows_input_version_k7" - "job_allows_input_version_k6" - "job_allows_input_version_k5" - "job_allows_input_version_k4" -#else - popmenu marc_version_run_pm -#endif - } - -# see also job_common.ms -# see also the RUN JOB popmenu in this file - - label { - position +14 = - size 7 4 - text "STYLE" - border_width 1 - border_color black - } - - roller { - position +7 = - size 18 4 - nvalues 3 - texts "TABLE-DRIVEN" - "MULTI-PHYSICS" - "OLD" - rollers "job_input_style_table_driven" - "job_input_style_multi_physics" - "job_input_style_old" -#ifdef QT_MENTAT - commands "*job_option input_style:new *job_option input_physics_style:old" - "*job_option input_physics_style:new *job_option input_style:new" - "*job_option input_style:old *job_option input_physics_style:old" - visibles "job_allows_input_style_table_driven" - "job_allows_input_style_multi_physics" - "job_allows_input_style_old" -#else - popmenu marc_input_style_run_adv_pm -#endif - help job_option_input_style - } - - toggle { - position 0 +4 - size 48 4 - text "EXTENDED PRECISION" - help job_run_precision - toggle "*job_option inp_file_prec:extended" - true_command "*job_option inp_file_prec:extended" - false_command "*job_option inp_file_prec:normal" - } - } - } - - button { - position 1 +14 - size 24 4 - text "SCRATCH DIRECTORY" - settext $directory_browser_label "JOB SCRATCH DIRECTORY" - set $directory_browser_command "*job_scratch_directory" -#ifdef QT_MENTAT - browser directory_browser -#else - popmenu directory_browser_popmenu -#endif - help job_scratch_directory - } - - button { - position +24 = - size 24 4 - text "CLEAR" - command "*job_clear_scratch_directory" - visible job_scratch_directory - } - - text { - position 1 +4 - size 48 4 - display job_scratch_dir - command "*job_scratch_directory" - } - -#ifdef DCOM - toggle { - position 1 +6 - size 8 4 - text "DCOM" - toggle "*job_option dcom:on" - help job_run_dcom - true_command "*job_option dcom:on" - false_command "*job_option dcom:off" - visible win32_available - } - - button { - position +8 = - size 12 4 - text "HOSTNAME" - command "*job_dcom_hostname" - visible "and(win32_available, *job_option dcom:on)" - } - - text job_dcom_hostname { - position +12 = - size 28 4 - display "job_dcom_hostname" - command "*job_dcom_hostname" - visible "and(win32_available, *job_option dcom:on)" - } -#endif - - button { - position 1 +6 - size 24 4 - text "TITLE" - popmenu job_title_pm - command "*job_title" - } - - button { - position +24 = - size 24 4 - text "SAVE MODEL" - command "*save_model" - } - - button { - position +4 +6 - size 20 4 - text "WRITE INPUT FILE" - command "*job_write_input" - } - - button { - position = +4 - size 20 4 - text "EDIT INPUT FILE" - command "*job_edit_input" - } - - popdown { - position 1 +5 - size 20 6 - text "SUBMIT 1" - command "*submit_job 1 *monitor_job" - } - - popdown { - position +28 = - size 20 6 - text "EXECUTE 1" - command "*execute_job 1 *monitor_job" - } - - popdown { - position -28 +6 - size 20 6 - text "SUBMIT 2" - command "*submit_job 2 *monitor_job" - } - - popdown { - position +28 = - size 20 6 - text "EXECUTE 2" - command "*execute_job 2 *monitor_job" - } - - popdown { - position -28 +6 - size 20 6 - text "SUBMIT 3" - command "*submit_job 3 *monitor_job" - } - - popdown { - position +28 = - size 20 6 - text "EXECUTE 3" - command "*execute_job 3 *monitor_job" - } - - popdown { - position 19 +8 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 38 8 -#ifdef DCOM - size 50 100 -#else - size 50 94 -#endif - background_color body - border_width 1 - border_color border - buffering single - } - mode dialog -} - -popmenu damask { - -#ifdef QT_MENTAT - text "DAMASK.MPIE.DE" -#endif - - group { -#ifndef QT_MENTAT - label { - position 0 0 - size 50 4 - text "DAMASK.MPIE.DE" - } -#endif - - label { - position 1 6 - size 13 6 - text "Optimzation" - border_width 1 - border_color black - } - - label { - position +13 = - size 20 6 - text "write Input" - border_width 1 - border_color black - } - - label { - position +18 = - size 30 6 - text "do not write Inp." - border_width 1 - border_color black - } - - label { - position -32 +6 - size 12 6 - text "O2 / OpenMP" - border_width 1 - border_color black - } - - popdown { - position +12 = - size 20 6 - text "Submit" - command "*submit_job 4 *monitor_job" - } - - popdown { - position +20 = - size 20 6 - text "Execute" - command "*execute_job 4 *monitor_job" - } - - label { - position -32 +6 - size 12 6 - text "O1 / OpenMP" - border_width 1 - border_color black - } - - popdown { - position +12 = - size 20 6 - text "Submit" - command "*submit_job 5 *monitor_job" - } - - popdown { - position +20 = - size 20 6 - text "Execute" - command "*execute_job 5 *monitor_job" - } - - label { - position -32 +6 - size 12 6 - text "O0 / OpenMP" - border_width 1 - border_color black - } - - popdown { - position +12 = - size 20 6 - text "Submit" - command "*submit_job 6 *monitor_job" - } - - popdown { - position +20 = - size 20 6 - text "Execute" - command "*execute_job 6 *monitor_job" - } - - label { - position -29 +8 - size 9 6 - text "O2" - border_width 1 - border_color black - } - - popdown { - position +9 = - size 20 6 - text "Submit" - command "*submit_job 7 *monitor_job" - } - - popdown { - position +20 = - size 20 6 - text "Execute" - command "*execute_job 7 *monitor_job" - } - - label { - position -29 +6 - size 9 6 - text "O1" - border_width 1 - border_color black - } - - popdown { - position +9 = - size 20 6 - text "Submit" - command "*submit_job 8 *monitor_job" - } - - popdown { - position +20 = - size 20 6 - text "Execute" - command "*execute_job 8 *monitor_job" - } - - label { - position -29 +6 - size 9 6 - text "O0" - border_width 1 - border_color black - } - - popdown { - position +9 = - size 20 6 - text "Submit" - command "*submit_job 9 *monitor_job" - } - - popdown { - position +20 = - size 20 6 - text "Execute" - command "*execute_job 9 *monitor_job" - } - - popdown { - position 19 +8 - size 12 8 - text "CANCEL" - } -} - - - - window { - parent mentat - origin 38 8 -#ifdef DCOM - size 50 100 -#else - size 50 94 -#endif - background_color body - border_width 1 - border_color border - buffering single - } - mode dialog -} - -popmenu job_exit_msg_pm { - -#ifdef QT_MENTAT - text "EXIT MESSAGE" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 86 4 - text "EXIT MESSAGE" - } - - display { - position 1 5 - size 84 74 - display "job_exit_msg" - } -#endif - -#ifdef QT_MENTAT - - text { - position 1 5 - size 84 74 - multiline - readonly - display "job_exit_msg" - } - -#endif - popdown { - position 37 +76 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 38 8 - size 86 90 - background_color body - border_width 1 - border_color border - buffering single - } - mode dialog -} - -#ifndef QT_MENTAT -popmenu job_user_source_pm { - window { - parent job_run_wi - origin 25 17 - size 24 17 - border_width 1 - border_color border - background_color body - } - mode dialog - - group job_user_source_gr -} - - -group job_user_source_gr { - popdown { - position 0 0 - size 24 4 - text "COMPILE / NO SAVE" - command "*job_option user_source:compile_nosave" - } - - popdown { - position = +4 - size 24 4 - text "COMPILE AND SAVE" - command "*job_option user_source:compile_save" - } - - popdown { - position = +4 - size 24 4 - text "RUN SAVED EXECUTABLE" - command "*job_option user_source:run_saved" - } - - popdown { - position = +5 - size 24 4 - text "CANCEL" - } -} -#endif - -popmenu job_run_parallelization_pm { - -#ifdef QT_MENTAT - text "PARALLELIZATION/\{GPU}" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 50 4 - text "PARALLELIZATION/GPU" - } -#endif - -#ifdef QT_MENTAT - label { - position 0 0 - size 6 4 - text "NAME" - } - - display { - position +6 = - size 26 4 - display "job_name" - } - - label { - position 0 +4 - size 6 4 - text "TYPE" - } - - display { - position +6 = - size 26 4 - display job_class_label - } -#endif - - frame { -#ifdef QT_MENTAT - position 1 9 -#else - position 1 5 -#endif - size 48 28 - group job_ddm_gr - text "DOMAIN DECOMPOSITION" - border_width 1 - border_color black - } - - frame { - position 1 +29 - size 48 35 - group job_parallel_matrix_solver_gr - text "MATRIX SOLVER" - border_width 1 - border_color black - } - - frame { - position 1 +36 - size 48 28 - group job_parallel_env_gr - text "PARALLELIZATION ENVIRONMENT" - border_width 1 - border_color black - visible "or(*job_option parallel:on, \ - solver_multi_procs)" - } - - popdown { - position 19 +30 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 38 8 - size 50 109 - background_color body - border_width 1 - border_color border - buffering single - } -#ifdef QT_MENTAT - mode permanent -#else - mode dialog -#endif -} - -group job_ddm_gr { - - toggle { - position 1 4 - size 30 4 - text "USE \{DDM}" - toggle "*job_option parallel:on" - help job_run_ddm_use - true_command "*job_option parallel:on" - false_command "*job_option parallel:off" - } - - frame { - position +2 +5 - size 44 18 - group job_ddm_use_gr - visible "*job_option parallel:on" - } -} - -group job_ddm_use_gr { - roller { - position 0 0 - size 30 4 - nvalues 2 - texts "DECOMPOSITION IN MARC" - "DECOMPOSITION IN MENTAT" - roller "job_option ddm_generator" -#ifdef QT_MENTAT - commands "*job_option ddm_generator:fea_solver" - "*job_option ddm_generator:preprocessor" -#else - popmenu job_ddm_generator_pm -#endif - help job_run_ddm_generator - } - - frame { - position 0 +5 - size 44 8 - group job_ddm_fea_solver_gr - visible "*job_option ddm_generator:fea_solver" - } - - frame { - position = = - size 44 8 - group job_ddm_preprocessor_gr - visible "*job_option ddm_generator:preprocessor" - } - - text { - position 0 +9 - size 22 4 - text "SINGLE INPUT FILE" - readonly - visible "*job_option ddm_generator:fea_solver" - } - - roller { - position = = - size 22 4 - nvalues 2 - texts "MULTIPLE INPUT FILES" - "SINGLE INPUT FILE" - roller "job_option ddm_single_input" - commands "*job_option ddm_single_input:off" - "*job_option ddm_single_input:on" - visible "*job_option ddm_generator:preprocessor" - help job_run_ddm_single_input - } - - roller { - position +23 = - size 21 4 - nvalues 2 - texts "MULTIPLE POST FILES" - "SINGLE POST FILE" - roller "job_option ddm_single_post" - commands "*job_option ddm_single_post:off" - "*job_option ddm_single_post:on" - help job_run_ddm_single_post - } -} - -#ifndef QT_MENTAT -popmenu job_ddm_generator_pm { - - window { - parent mentat - origin 42 26 - size 30 13 - border_width 1 - border_color border - background_color body - } - - mode dialog - - group job_ddm_generator_gr -} - -group job_ddm_generator_gr { - popdown { - position 0 0 - size 30 4 - text "DECOMPOSITION IN MARC" - command "*job_option ddm_generator:fea_solver" - help job_run_ddm_generator - } - - popdown { - position = +4 - size 30 4 - text "DECOMPOSITION IN MENTAT" - command "*job_option ddm_generator:preprocessor" - help job_run_ddm_generator - } - - popdown { - position = +5 - size 30 4 - text "CANCEL" - help job_run_ddm_generator - } -} -#endif - -group job_ddm_fea_solver_gr { -#ifdef QT_MENTAT - label { - position 0 0 - size 10 4 - text "# DOMAINS" - } -#else - button { - position 0 0 - size 10 4 - text "# DOMAINS" - command "*job_param ndomains" - } -#endif - text { - position +10 = - size 4 4 - display "job_param_value_ndomains" - command "*job_param ndomains" - } - - label { - position +4 = - size 7 4 - text "METHOD" - border_width 1 - border_color black - } - - roller { - position +7 = - size 23 4 - nvalues 7 - texts "METIS BEST" - "METIS ELEMENT" - "METIS NODE" - "REC. COORD. BISECTION" - "VECTOR" - "RADIAL" - "ANGULAR" - help set_job_decomp_type - rollers "*job_option ddm_method:metis_best" - "*job_option ddm_method:metis_element_based" - "*job_option ddm_method:metis_node_based" - "*job_option ddm_method:recur_coord_bisect" - "*job_option ddm_method:vector" - "*job_option ddm_method:radial" - "*job_option ddm_method:angular" -#ifdef QT_MENTAT - commands "*job_option ddm_method:metis_best" - "*job_option ddm_method:metis_element_based" - "*job_option ddm_method:metis_node_based" - "*job_option ddm_method:recur_coord_bisect" - "*job_option ddm_method:vector" - "*job_option ddm_method:radial" - "*job_option ddm_method:angular" -#else - popmenu job_ddm_method_pm -#endif - } - - button { - position +4 +4 - size 19 4 - text "ADVANCED SETTINGS" -#ifdef QT_MENTAT - popmenu job_ddm_fea_solver_pm -#else - screen job_ddm_fea_solver_sc - command "@popdown($popname2) @popdown($popname1)" ($popname2, $popname1) -#endif - } -} - -#ifndef QT_MENTAT -popmenu job_ddm_method_pm { - - window { - parent mentat - origin 56 31 - size 30 33 - border_width 1 - border_color border - background_color body - } - - mode dialog - - group job_ddm_method_gr -} - -group job_ddm_method_gr { - - popdown { - position 0 0 - size 30 4 - text "METIS BEST" - command "*job_option ddm_method:metis_best" - } - - popdown { - position = +4 - size 30 4 - text "METIS ELEMENT BASED" - command "*job_option ddm_method:metis_element_based" - } - - popdown { - position = +4 - size 30 4 - text "METIS NODE BASED" - command "*job_option ddm_method:metis_node_based" - } - - popdown { - position = +4 - size 30 4 - text "RECURSIVE COORDINATE BISECTION" - command "*job_option ddm_method:recur_coord_bisect" - } - - popdown { - position = +4 - size 30 4 - text "VECTOR" - command "*job_option ddm_method:vector" - } - - popdown { - position = +4 - size 30 4 - text "RADIAL" - command "*job_option ddm_method:radial" - } - - popdown { - position = +4 - size 30 4 - text "ANGULAR" - command "*job_option ddm_method:angular" - } - - popdown { - position = +5 - size 30 4 - text "CANCEL" - } -} -#endif - -#ifdef QT_MENTAT -popmenu job_ddm_fea_solver_pm { - - text "JOB PARALLELIZATION" -#else -screen job_ddm_fea_solver_sc { - - menu { -#endif - - group { - units 32 120 - -#ifndef QT_MENTAT - label { - position 0 0 - size 32 4 - text "JOB PARALLELIZATION" - } -#endif - - label { - position 0 5 - size 6 4 - text "NAME" - } - - display { - position +6 = - size 26 4 - display "job_name" - } - -#ifdef QT_MENTAT - label { - position 0 +4 - size 6 4 - text "TYPE" - } - - display { - position +6 = - size 26 4 - display job_class_label - } -#endif - - frame { -#ifdef QT_MENTAT - position 0 +9 -#else - position 0 +5 -#endif - size 32 56 - text "ADVANCED DECOMPOSITION IN MARC" - border_width 1 - border_color black - - group { -#ifdef QT_MENTAT - label { - position 1 4 - size 16 4 - text "# DOMAINS" - } -#else - button { - position 1 4 - size 16 4 - text "# DOMAINS" - command "*job_param ndomains" - } -#endif - text { - position +16 = - size 14 4 - display "job_param_value_ndomains" - command "*job_param ndomains" - } - - label { - position 1 +4 - size 7 4 - text "METHOD" - border_width 1 - border_color black - } - - roller { - position +7 = - size 23 4 - nvalues 7 - texts "METIS BEST" - "METIS ELEMENT" - "METIS NODE" - "REC. COORD. BISECTION" - "VECTOR" - "RADIAL" - "ANGULAR" - help set_job_decomp_type - rollers "*job_option ddm_method:metis_best" - "*job_option ddm_method:metis_element_based" - "*job_option ddm_method:metis_node_based" - "*job_option ddm_method:recur_coord_bisect" - "*job_option ddm_method:vector" - "*job_option ddm_method:radial" - "*job_option ddm_method:angular" -#ifdef QT_MENTAT - commands "*job_option ddm_method:metis_best" - "*job_option ddm_method:metis_element_based" - "*job_option ddm_method:metis_node_based" - "*job_option ddm_method:recur_coord_bisect" - "*job_option ddm_method:vector" - "*job_option ddm_method:radial" - "*job_option ddm_method:angular" -#else - popmenu job_ddm_method2_pm -#endif - } - - frame { - position 1 +5 - size 30 20 - group job_ddm_direction_gr - visible "or(*job_option ddm_method:vector, \ - *job_option ddm_method:radial, \ - *job_option ddm_method:angular)" - } - - toggle { - position 1 +21 - size 30 4 - text "DOMAIN ISLAND REMOVAL" - toggle "*job_option ddm_island_removal:on" - true_command "*job_option ddm_island_removal:on" - false_command "*job_option ddm_island_removal:off" - } - - toggle { - position = +4 - size 30 4 - text "COARSE GRAPH" - toggle "*job_option ddm_graph:coarse" - true_command "*job_option ddm_graph:coarse" - false_command "*job_option ddm_graph:fine" - visible "or(*job_option ddm_method:metis_best, \ - *job_option ddm_method:metis_element_based, \ - *job_option ddm_method:metis_node_based)" - } - - toggle { - position = +4 - size 30 4 - text "DETECT CONTACT" - toggle "*job_option ddm_detect_contact:on" - true_command "*job_option ddm_detect_contact:on" - false_command "*job_option ddm_detect_contact:off" - visible "or(*job_option ddm_method:metis_best, \ - *job_option ddm_method:metis_element_based, \ - *job_option ddm_method:metis_node_based)" - } -#ifdef QT_MENTAT - label { - position 1 +5 - size 30 4 - text "ELEMENT WEIGHT COEFFICIENT" - } -#else - button { - position 1 +5 - size 30 4 - text "ELEMENT WEIGHT COEFFICIENT" - command "*job_param ddm_elem_weight_coeff" - } -#endif - text { - position = +4 - size 30 4 - display "job_param_value_ddm_elem_weight_coeff" - command "*job_param ddm_elem_weight_coeff" - } - } - } - -#ifdef QT_MENTAT - popdown { - position 0 +57 - size 32 8 - text "OK" - } -#else - frame { - position 0 +57 - size 32 8 - group ok2_gr - } - - frame select_frame - frame inactive_return -#endif - } -#ifndef QT_MENTAT - window main_window - disable_right_mouse_button - } - - menu transform -} # job_ddm_fea_solver_sc -#else - mode permanent -} # job_ddm_fea_solver_pm -#endif - -#ifndef QT_MENTAT -popmenu job_ddm_method2_pm { - - window { - parent mentat - origin 1 22 - size 30 33 - border_width 1 - border_color border - background_color body - } - - mode dialog - - group job_ddm_method_gr -} -#endif - -group job_ddm_direction_gr { - button { - position 0 0 - size 15 4 - text "DIRECTION" - command "*job_vector ddm_sort_direction_x" - visible "*job_option ddm_method:vector" - } - - button { - position = = - size 15 4 - text "DIRECTION" - command "*job_vector ddm_sort_direction_x" - visible "not(*job_option ddm_method:vector)" - } - - button { - position +15 = - size 15 4 - text "FROM / TO" - command "*job_vector_from_to ddm_sort_direction_x" - } - - text { - position -15 +4 - size 10 4 - command "*job_param ddm_sort_direction_x" - display "job_param_value_ddm_sort_direction_x" - help ddm_job_decomp_user_direction_x - } - - text { - position +10 = - size 10 4 - command "*job_param ddm_sort_direction_y" - display "job_param_value_ddm_sort_direction_y" - } - - text { - position +10 = - size 10 4 - command "*job_param ddm_sort_direction_z" - display "job_param_value_ddm_sort_direction_z" - } - - frame { - position 0 +4 - size 30 8 - group job_ddm_sort_point_gr - visible "not(*job_option ddm_method:vector)" - } -} - -group job_ddm_sort_point_gr { - label { - position 0 0 - size 14 4 - border_width 1 - border_color black - text "POINT ON AXIS" - } - - roller { - position +14 = - size 10 4 - nvalues 2 - texts "DEFAULT" - "USER" - roller "job_option ddm_sort_point" -#ifdef QT_MENTAT - commands "*job_option ddm_sort_point:default" - "*job_option ddm_sort_point:user" -#else - popmenu job_ddm_sort_point_meth_pm -#endif - } - - button { - position +10 = - size 6 4 - text "SET" - command "*job_position ddm_sort_point_x" - visible "*job_option ddm_sort_point:user" - } - - text { - position 0 +4 - size 10 4 - command "*job_param ddm_sort_point_x" - display "job_param_value_ddm_sort_point_x" - visible "*job_option ddm_sort_point:user" - } - - text { - position +10 = - size 10 4 - command "*job_param ddm_sort_point_y" - display "job_param_value_ddm_sort_point_y" - visible "*job_option ddm_sort_point:user" - } - - text { - position +10 = - size 10 4 - command "*job_param ddm_sort_point_z" - display "job_param_value_ddm_sort_point_z" - visible "*job_option ddm_sort_point:user" - } -} - -#ifndef QT_MENTAT -popmenu job_ddm_sort_point_meth_pm { - - window { - parent mentat - origin 15 35 - size 14 13 - border_width 1 - border_color border - background_color body - } - - mode dialog - - group job_ddm_sort_point_meth_gr -} - -group job_ddm_sort_point_meth_gr { - popdown { - position 0 0 - size 14 4 - text "DEFAULT" - command "*job_option ddm_sort_point:default" - } - - popdown { - position = +4 - size 14 4 - text "USER DEFINED" - command "*job_option ddm_sort_point:user" - } - - popdown { - position = +5 - size 14 4 - text "CANCEL" - } -} -#endif - -group job_ddm_preprocessor_gr { - label { - position 0 0 - size 10 4 - text "# DOMAINS" - border_width 1 - border_color black - } - - integer { - position +10 = - size 4 4 - display valid_domains - } - - button { - position +4 = - size 30 4 - text "USER DOMAINS" -#ifdef QT_MENTAT - screen domains -#else - screen job_ddm_user_domains_sc - command "@popdown($popname2) @popdown($popname1)" ($popname2, $popname1) -#endif - help job_run_ddm_user_domains - } -} - -#ifndef QT_MENTAT -screen job_ddm_user_domains_sc { - - menu { - - group { - units 32 120 - - label { - position 0 0 - size 32 4 - text "USER DOMAINS" - } - - frame { - position 0 5 - size 32 28 - group user_domains_gr - } - - frame { - position 0 +29 - size 32 49 - group user_domains_generate_gr - } - - frame { - position 0 +50 - size 32 8 - group user_domains_tail_gr - } - - frame { - position 0 92 - size 32 8 - group ok2_gr - } - - frame select_frame - frame inactive_return - } - window main_window - disable_right_mouse_button - - } - - menu transform - -} # job_ddm_user_domains_sc -#endif - -group job_parallel_matrix_solver_gr { - - label { - position 3 4 - size 12 4 - text "SOLUTION" - border_width 1 - border_color black - } - - roller { - position +12 = - size 18 4 - nvalues 2 - texts "SYMMETRIC" - "NONSYMMETRIC" - rollers job_nonsym_off - job_nonsym_on - commands "*job_option solver_nonsym:off" - "*job_option solver_nonsym:on" - help job_param_solver_method - } - - label { - position -12 +4 - size 6 4 - text "TYPE" - border_width 1 - border_color black - } - - roller { - position +6 = - size 24 4 - nvalues 9 - help job_param_solver_method - texts "MULTIFRONTAL SPARSE" - "MIXED DIRECT-ITERATIVE" - "CASI ITERATIVE" - "PARDISO DIRECT SPARSE" - "MUMPS PARALLEL DIRECT" - "HARDWARE SPARSE" - "ITERATIVE SPARSE" - "DIRECT PROFILE" - "DIRECT SPARSE" - rollers job_solver_mfront_sparse - job_solver_mixed_direct_iterative - job_solver_it_ext - job_solver_pardiso - job_solver_mumps - job_solver_sparse - job_solver_it_sparse - job_solver_dir_profile - job_solver_dir_sparse -#ifdef QT_MENTAT - commands "*job_option solver:mfront_sparse" - "*job_option solver:mixed_direct_iterative" - "*job_option solver:it_ext" - "*job_option solver:pardiso" - "*job_option solver:mumps" - "*job_option solver:sparse" - "*job_option solver:it_sparse" - "*job_option solver:dir_profile" - "*job_option solver:dir_sparse" - visibles job_allows_solver_mfront_sparse - job_allows_solver_mixed_direct_iterative - job_allows_solver_it_ext - job_allows_solver_pardiso - job_allows_solver_mumps - job_allows_solver_sparse - job_allows_solver_it_sparse - job_allows_solver_dir_profile - job_allows_solver_dir_sparse - help job_param_solver_method -#else - popmenu job_set_parallel_matrix_solver_pm -#endif - } - - button { - position +24 = - size 14 4 - text "OPTIONS" - popmenu job_parallel_matrix_solver_opt_pm - } - - frame { - position = +4 - size 14 4 - group job_run_solver_ddm_opts_gr - visible "*job_option parallel:on" - } - - frame { - position 1 +5 - size 46 8 - group job_solver_multi_procs_gr - visible solver_allows_multi_procs - } - - frame { - position = = - size 46 8 - group job_solver_multi_threads_gr - visible solver_allows_multi_threads - } - - frame { - position 1 +9 - size 46 8 - group job_solver_gpu_gr - visible "and(job_solver_mfront_sparse,job_nonsym_off)" - } -} - -#ifndef QT_MENTAT -popmenu job_set_parallel_matrix_solver_pm { - window { - parent mentat - origin 48 54 - size 24 42 - border_width 1 - border_color border - background_color body - } - mode dialog - - group job_solver_gr -} -#endif - -popmenu job_parallel_matrix_solver_opt_pm { - -#ifdef QT_MENTAT - text "MATRIX SOLVER OPTIONS" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 38 4 - text "MATRIX SOLVER OPTIONS" - } -#endif - - frame { - position 1 5 - size 36 23 - group job_solver_opts_gr - } - - popdown { - position 13 +25 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 41 12 - size 38 39 - border_width 1 - border_color border - background_color body - } - mode dialog -} - -group job_run_solver_ddm_opts_gr { - button { - position 0 0 - size 14 4 - text "\{DDM} OPTIONS" - popmenu ddm_options -# see also job_common.ms! - visible "not(or(job_solver_it_sparse, \ - job_solver_it_ext, \ - job_solver_mixed_direct_iterative, \ - job_solver_pardiso, \ - job_solver_mumps))" - } -} - -group job_solver_multi_procs_gr { - frame { - position 0 0 - size 46 8 - group job_solver_multi_procs_parallel_off_gr - visible "*job_option parallel:off" - } - - frame { - position = = - size 46 8 - group job_solver_multi_procs_parallel_on_gr - visible "*job_option parallel:on" - } -} - -group job_solver_multi_procs_parallel_off_gr { - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - true_command "*job_option nsolver_procs_serial:on" - false_command "*job_option nsolver_procs_serial:off" - toggle "*job_option nsolver_procs_serial:on" - help job_run_multithreading - } -#ifdef QT_MENTAT - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - visible "*job_option nsolver_procs_serial:on" - } -#else - button { - position +2 +4 - size 14 4 - text "# PROCESSES" - command "*job_param nsolver_procs" - visible "*job_option nsolver_procs_serial:on" - } -#endif - text { - position +14 = - size 14 4 - display "job_param_value_nsolver_procs" - command "*job_param nsolver_procs" - visible "*job_option nsolver_procs_serial:on" - } -} - -group job_solver_multi_procs_parallel_on_gr { - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - help job_run_multithreading - toggle true -#ifdef QT_MENTAT - set $dummy dummy -#endif - } - - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - border_width 1 - border_color black - } - - roller { - position +14 = - size 14 4 - nvalues 2 - texts "AUTOMATIC" - "USER" - commands "*job_option nsolver_procs_ddm:automatic" - "*job_option nsolver_procs_ddm:user" - help job_run_multithreading - rollers "*job_option nsolver_procs_ddm:automatic" - "*job_option nsolver_procs_ddm:user" - } - - frame { - position +14 = - size 16 4 - group job_nsolver_procs_ddm_automatic_gr - visible "*job_option nsolver_procs_ddm:automatic" - } - - frame { - position = = - size 16 4 - group job_nsolver_procs_ddm_user_gr - visible "*job_option nsolver_procs_ddm:user" - } -} - -group job_nsolver_procs_ddm_automatic_gr { - label { - position 0 0 - size 8 4 - text "VALUE" - border_width 1 - border_color black - } - - integer { - position +8 = - size 8 4 - display valid_domains - visible "*job_option ddm_generator:preprocessor" - } - - integer { - position = = - size 8 4 - display "job_param_ndomains" - visible "*job_option ddm_generator:fea_solver" - } -} - -group job_nsolver_procs_ddm_user_gr { -#ifdef QT_MENTAT - label { - position 0 0 - size 8 4 - text "VALUE" - } -#else - button { - position 0 0 - size 8 4 - text "VALUE" - command "*job_param nsolver_procs" - } -#endif - text { - position +8 = - size 8 4 - display "job_param_value_nsolver_procs" - command "*job_param nsolver_procs" - } -} - -group job_solver_multi_threads_gr { - frame { - position 0 0 - size 30 8 - group job_solver_multi_threads_mfront_sparse_gr - visible "and(job_solver_mfront_sparse,*job_option parallel:off)" - } - - frame { - position = = - size 46 8 - group job_solver_multi_threads_pardiso_parallel_off_gr - visible "and(job_solver_pardiso,*job_option parallel:off)" - } - - frame { - position = = - size 46 8 - group job_solver_multi_threads_pardiso_parallel_on_gr - visible "and(job_solver_pardiso,*job_option parallel:on)" - } -} - -group job_solver_multi_threads_mfront_sparse_gr { - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - toggle "*job_option mfront_sparse_multi_threading:on" - true_command "*job_option mfront_sparse_multi_threading:on" - false_command "*job_option mfront_sparse_multi_threading:off" - help job_run_multithreading - } -#ifdef QT_MENTAT - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - visible "*job_option mfront_sparse_multi_threading:on" - } -#else - button { - position +2 +4 - size 14 4 - text "# PROCESSES" - command "*job_param nthreads" - visible "*job_option mfront_sparse_multi_threading:on" - } -#endif - text { - position +14 = - size 14 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - visible "*job_option mfront_sparse_multi_threading:on" - } -} - -group job_solver_gpu_gr { - toggle { - position 0 0 - size 30 4 - text "USE \{GPU(s)}" - toggle "*job_option solver_use_gpu:on" - true_command "*job_option solver_use_gpu:on" - false_command "*job_option solver_use_gpu:off" - help job_solver_gpu - } - - label { - position +2 +4 - size 16 4 - text "\{GPU} SELECTION" - border_width 1 - border_color black - visible "*job_option solver_use_gpu:on" - } - - roller { - position +16 = - size 12 4 - nvalues 2 - texts "AUTOMATIC" - "USER" - commands "*job_option solver_gpus:automatic" - "*job_option solver_gpus:user" - rollers "*job_option solver_gpus:automatic" - "*job_option solver_gpus:user" - visible "*job_option solver_use_gpu:on" - help job_solver_gpu - } - - text { - position +12 = - size 16 4 - display job_solver_gpus - command "*clear_job_solver_gpus *job_solver_gpus" - visible "and(*job_option solver_use_gpu:on,*job_option solver_gpus:user)" - } -} - -group job_solver_multi_threads_pardiso_parallel_off_gr { - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - toggle "*job_option pardiso_multi_threading:on" - true_command "*job_option pardiso_multi_threading:on" - false_command "*job_option pardiso_multi_threading:off" - help job_run_multithreading - } -#ifdef QT_MENTAT - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - visible "*job_option pardiso_multi_threading:on" - } -#else - button { - position +2 +4 - size 14 4 - text "# PROCESSES" - command "*job_param nthreads" - visible "*job_option pardiso_multi_threading:on" - } -#endif - text { - position +14 = - size 14 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - visible "*job_option pardiso_multi_threading:on" - } -} - -group job_solver_multi_threads_pardiso_parallel_on_gr { - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - help job_run_multithreading - toggle true -#ifdef QT_MENTAT - set $dummy dummy -#endif - } - - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - border_color black - border_width 1 - } - - roller { - position +14 = - size 14 4 - nvalues 2 - texts "AUTOMATIC" - "USER" - commands "*job_option pardiso_multi_threading_ddm:automatic" - "*job_option pardiso_multi_threading_ddm:user" - help job_run_multithreading - rollers "*job_option pardiso_multi_threading_ddm:automatic" - "*job_option pardiso_multi_threading_ddm:user" - } - - frame { - position +14 = - size 16 4 - group job_pardiso_multi_threads_ddm_automatic_gr - visible "*job_option pardiso_multi_threading_ddm:automatic" - } - - frame { - position = = - size 16 4 - group job_pardiso_multi_threads_ddm_user_gr - visible "*job_option pardiso_multi_threading_ddm:user" - } -} - -group job_pardiso_multi_threads_ddm_automatic_gr { - label { - position 0 0 - size 8 4 - text "VALUE" - border_width 1 - border_color black - } - - integer { - position +8 = - size 8 4 - display valid_domains - visible "*job_option ddm_generator:preprocessor" - } - - integer { - position = = - size 8 4 - display "job_param_ndomains" - visible "*job_option ddm_generator:fea_solver" - } -} - -group job_pardiso_multi_threads_ddm_user_gr { -#ifdef QT_MENTAT - label { - position 0 0 - size 8 4 - text "VALUE" - } -#else - button { - position 0 0 - size 8 4 - text "VALUE" - command "*job_param nthreads" - } -#endif - text { - position +8 = - size 8 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - } -} - -group job_parallel_env_gr { - - roller { - position 1 4 - size 30 4 - nvalues 2 - texts "SINGLE MACHINE" - "NETWORK" - help job_run_ddm_setup - roller "job_option parallel_setup" - commands "*job_option parallel_setup:single" - "*job_option parallel_setup:network" - } - - frame { - position +2 +5 - size 44 18 - group job_parallel_env_network_gr - visible "*job_option parallel_setup:network" - } -} - -group job_parallel_env_network_gr { - button { - position 0 0 - size 28 4 - text "HOST FILE" -#ifdef QT_MENTAT - browser host_file_browser -#else - popmenu host_file_browser_pm -#endif - settext $host_file_browser_label "SELECT HOST FILE" - set $host_file_browser_command "*job_host_file" - help job_host_file - } - - button { - position +28 = - size 8 4 - text "EDIT" - command "*job_edit_host_file" - help job_edit_host_file - visible job_host_file - } - - button { - position +8 = - size 8 4 - text "CLEAR" - command "*job_clear_host_file" - help job_clear_host_file - visible job_host_file - } - - display { - position 0 +4 - size 44 4 - display job_host_file - } - - frame { - position 0 +5 - size 44 9 - group job_parallel_env_network_ddm_gr - visible "*job_option parallel:on" - } -} - -group job_parallel_env_network_ddm_gr { - toggle { - position 0 0 - size 22 4 - text "COPY INPUT FILE" - toggle "*job_option copy_input_file:on" - true_command "*job_option copy_input_file:on" - false_command "*job_option copy_input_file:off" - help job_host_copy_inputfile - } - - toggle { - position +23 = - size 21 4 - text "COPY POST FILE" - toggle "*job_option copy_post_file:on" - true_command "*job_option copy_post_file:on" - false_command "*job_option copy_post_file:off" - help job_host_copy_inputfile - } - - label { - position 0 +5 - size 10 4 - text "HOSTS" - border_width 1 - border_color black - visible job_usersub_file - } - - roller { - position +10 = - size 18 4 - nvalues 2 - texts "COMPATIBLE" - "INCOMPATIBLE" - roller "job_option network_hosts" - commands "*job_option network_hosts:compatible" - "*job_option network_hosts:incompatible" - help job_host_comp - visible job_usersub_file - } -} - -#ifndef QT_MENTAT -popmenu marc_integer_size_pm { - window { - parent mentat - origin 55 32 - size 32 17 - border_width 1 - border_color border - background_color body - } - mode dialog - - group marc_integer_size_gr -} - -group marc_integer_size_gr { - popdown { - position 0 0 - size 32 4 - text "DEFAULT" - command "*job_option marc_integer_size:default" - help job_run_intsize - } - - popdown { - position = +4 - size 32 4 - text "4-BYTE INTEGERS" - command "*job_option marc_integer_size:i4" - help job_run_intsize - } - - popdown { - position = +4 - size 32 4 - text "8-BYTE INTEGERS" - command "*job_option marc_integer_size:i8" - help job_run_intsize - } - - popdown { - position = +5 - size 32 4 - text "CANCEL" - help job_run_intsize - } -} -#endif -#endif diff --git a/installation/mods_MarcMentat/2012/Mentat_menus/job_run.ms.org b/installation/mods_MarcMentat/2012/Mentat_menus/job_run.ms.org deleted file mode 100644 index 7a7418765..000000000 --- a/installation/mods_MarcMentat/2012/Mentat_menus/job_run.ms.org +++ /dev/null @@ -1,2739 +0,0 @@ -#ifndef AUTOFORGE -popmenu job_title_pm file jobs.ms -popdown job_title_ok file jobs.ms -#ifndef QT_MENTAT -popmenu marc_input_style_pm file job_common.ms -popmenu marc_input_style_run_adv_pm file job_common.ms -popmenu marc_version_run_pm file job_common.ms -#endif -group job_solver_gr file job_common.ms -group user_domains_gr file domain_decomposition.ms -group user_domains_generate_gr file domain_decomposition.ms -group user_domains_tail_gr file domain_decomposition.ms -group job_solver_opts_gr file job_common.ms -popmenu ddm_options file job_common.ms -#ifdef QT_MENTAT -browser edit_browser file file.ms -browser directory_browser file file.ms -screen domains file domain_decomposition.ms -#else -popmenu edit_browser_popmenu file file.ms -popmenu directory_browser_popmenu file file.ms -#endif - -#ifndef QT_MENTAT -popmenu usersub_file_browser_pm { - - group { -#endif - - browser usersub_file_browser { - position 0 0 - size 82 72 - text "$usersub_file_browser_label" ($usersub_file_browser_label) - filter "*.f *.F" - nvisible 10 - select_files true - cancel_action popdown - ok_action popdown - command "$usersub_file_browser_command" ($usersub_file_browser_command) - } -#ifndef QT_MENTAT - } - - window { - title " Select MARC User Subroutine File" - origin 30 30 - size 82 72 - } - - mode dialog - disable_right_mouse_button -} -#endif - -#ifndef QT_MENTAT -popmenu host_file_browser_pm { - - group { -#endif - - browser host_file_browser { - position 0 0 - size 82 72 - text "$host_file_browser_label" ($host_file_browser_label) - filter "*" - nvisible 10 - select_files true - cancel_action popdown - ok_action popdown - command "$host_file_browser_command" ($host_file_browser_command) - } -#ifndef QT_MENTAT - } - - window { - title " Select MARC Host File" - origin 30 30 - size 82 72 - } - - mode dialog - disable_right_mouse_button -} -#endif - -popmenu job_run_popmenu { - -#ifdef QT_MENTAT - text "RUN JOB" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 50 4 - text "RUN JOB" - } -#endif - -#ifdef QT_MENTAT - label { - position 0 0 - size 6 4 - text "NAME" - } - - display { - position +6 = - size 26 4 - display "job_name" - } - - label { - position 0 +4 - size 6 4 - text "TYPE" - } - - display { - position +6 = - size 26 4 - display job_class_label - } -#endif - - button { -#ifdef QT_MENTAT - position 1 9 -#else - position 1 5 -#endif - size 24 4 - text "USER SUBROUTINE FILE" -#ifdef QT_MENTAT - browser usersub_file_browser -#else - popmenu usersub_file_browser_pm -#endif - settext $usersub_file_browser_label "SELECT USER SUBROUTINE FILE" - set $usersub_file_browser_command "*job_usersub_file" - help job_usersub_file - } - - toggle { - position +26 = - size 22 4 - text "SELECTED USER SUBS" - toggle job_usersubs - help job_run_seluser - visible job_usersubs - popmenu job_usersub_pm - } - - display { - position 1 +4 - size 48 4 - display job_usersub_file - } - - button { - position 1 +4 - size 12 4 - text "EDIT" - command "*job_edit_usersub_file" - visible job_usersub_file - } - - button { - position +12 = - size 12 4 - text "CLEAR" - command "*job_clear_usersub_file" - visible job_usersub_file - } - - roller { - position +12 = - size 24 4 - nvalues 3 - texts "COMPILE / NO SAVE" - "COMPILE AND SAVE" - "RUN SAVED EXECUTABLE" - help job_run_compile - roller "job_option user_source" - visible job_usersub_file -#ifdef QT_MENTAT - commands "*job_option user_source:compile_nosave" - "*job_option user_source:compile_save" - "*job_option user_source:run_saved" -#else - popmenu job_user_source_pm -#endif - } - - frame { - position 1 +6 - size 48 14 - border_width 1 - border_color black - - group { - - toggle { - position 1 1 - size 23 4 - text "PARALLELIZATION/\{GPU}" - help job_run_parallel - toggle "or(*job_option parallel:on, \ - solver_multi_procs, \ - solver_multi_threads, \ - and(job_solver_mfront_sparse,\ - job_nonsym_off,\ - *job_option solver_use_gpu:on))" - popmenu job_run_parallelization_pm - set $popname2 "job_run_parallelization_pm" - } - - frame { - position +23 = - size 23 12 - border_width 1 - border_color black - - group { - - display { - position 0 0 - size 23 4 - display job_ddm_domains - } - - display { - position = +4 - size 23 4 - display job_solver_procs - visible solver_allows_multi_procs - } - - display { - position = = - size 23 4 - display job_solver_threads - visible "and(solver_allows_multi_threads,\ - not(and(job_solver_mfront_sparse,\ - *job_option parallel:on)))" - } - - display { - position = +4 - size 23 4 - display job_solver_gpu - visible "and(job_solver_mfront_sparse,job_nonsym_off)" - } - } - } - } - } - - button { - position 1 +16 - size 8 4 - text "TITLE" - popmenu job_title_pm - command "*job_title" - } - -# see also job_common.ms -# see also the ADVANCED JOB SUBMISSION popmenu in this file - - label { - position +10 = - size 7 4 - text "STYLE" - border_width 1 - border_color black - } - - roller { - position +7 = - size 16 4 - nvalues 3 - texts "TABLE-DRIVEN" - "MULTI-PHYSICS" - "OLD" - rollers "job_input_style_table_driven" - "job_input_style_multi_physics" - "job_input_style_old" -#ifdef QT_MENTAT - commands "*job_option input_style:new *job_option input_physics_style:old" - "*job_option input_physics_style:new *job_option input_style:new" - "*job_option input_style:old *job_option input_physics_style:old" - visibles "job_allows_input_style_table_driven" - "job_allows_input_style_multi_physics" - "job_allows_input_style_old" -#else - popmenu marc_input_style_pm -#endif - help job_option_input_style - } - - button { - position +18 = - size 13 4 - text "SAVE MODEL" - command "*save_model" - } - - button { - position 1 +6 - size 16 6 - text "SUBMIT (1)" - command "*submit_job 1 *monitor_job" - } - - button { - position +16 = - size 32 6 - text "ADVANCED JOB SUBMISSION" - popmenu job_submit_adv_pm - } - - button { - position 1 +6 - size 16 6 - text "UPDATE" - command "*update_job" - } - - button { - position +16 = - size 16 6 - text "MONITOR" - command "*monitor_job" - } - - button { - position +16 = - size 16 6 - text "KILL" - command "*kill_job *monitor_job" - } - - label { - position 1 +7 - size 32 4 - text "STATUS" - border_width 1 - border_color black - } - - display { - position +32 = - size 16 4 - display "job_status" - } - - label { - position -32 +4 - size 32 4 - text "CURRENT INCREMENT (CYCLE)" - border_width 1 - border_color black - } - - display { - position +32 = - size 16 4 - display "job_increment" - } - - label { - position -32 +4 - size 32 4 - text "SINGULARITY RATIO" - border_width 1 - border_color black - } - - float { - position +32 = - size 16 4 - display "job_singularity_ratio" - } - - label { - position -32 +4 - size 32 4 - text "CONVERGENCE RATIO" - border_width 1 - border_color black - } - - float { - position +32 = - size 16 4 - display "job_convergence_ratio" - } - - - label { - position 1 +4 - size 32 4 - text "ANALYSIS TIME" - border_width 1 - border_color black - } - - float { - position +32 = - size 16 4 - display "job_analysis_time" - } - - label { - position -32 +4 - size 32 4 - text "WALL TIME" - border_width 1 - border_color black - } - - float { - position +32 = - size 16 4 - display "job_time" - } - - frame { - position 1 +4 - size 48 8 - - group { - - frame { - position 0 0 - size 48 8 - text "TOTAL" - border_width 1 - border_color black - group { - - label { - position +6 = - size 12 4 - text "CYCLES" - border_width 1 - border_color black - } - - integer { - position +12 = - size 10 4 - display "acc_job_cycles" - border_width 1 - border_color black - } - - label { - position -12 +4 - size 12 4 - text "SEPARATIONS" - border_width 1 - border_color black - } - - integer { - position +12 = - size 10 4 - display "acc_job_separations" - border_width 1 - border_color black - } - - label { - position +10 -4 - size 10 4 - text "CUT BACKS" - border_width 1 - border_color black - } - - integer { - position +10 = - size 10 4 - display "acc_job_cut_backs" - border_width 1 - border_color black - } - - label { - position -10 +4 - size 10 4 - text "REMESHES" - border_width 1 - border_color black - } - - integer { - position +10 = - size 10 4 - display "acc_job_remeshes" - border_width 1 - border_color black - } - } - } - } - } - - label { - position 1 +8 - size 18 4 - text "EXIT NUMBER" - border_width 1 - border_color black - } - - integer { - position +18 = - size 10 4 - display "job_exit" - } - - button { - position +10 = - size 20 4 - text "EXIT MESSAGE" - popmenu job_exit_msg_pm - help exit_message - } - - label { - position 1 +6 - size 5 4 - text "EDIT" - border_width 1 - border_color black - } - - button { - position +5 = - size 12 4 - text "OUTPUT FILE" - command "*job_edit_output" - } - - button { - position +12 = - size 9 4 - text "LOG FILE" - command "*job_edit_log_file" - } - - button { - position +9 = - size 12 4 - text "STATUS FILE" - command "*job_edit_status_file" - } - - button { - position +12 = - size 10 4 - text "ANY FILE" - settext $edit_browser_label "EDIT FILE" - set $edit_browser_command "*edit_file" -#ifdef QT_MENTAT - browser edit_browser -#else - popmenu edit_browser_popmenu -#endif - help edit_file - } - - popdown { - position 1 +6 - size 32 4 - text "OPEN POST FILE (RESULTS MENU)" - screen results - command "*post_open_default" - } - - button { - position 1 +6 - size 12 8 - text "RESET" - command "*job_submit_reset" - } - - popdown { - position +36 = - size 12 8 - text "OK" - } - } - - window job_run_wi { - parent mentat - origin 35 4 - size 50 113 - background_color body - border_width 1 - border_color border - buffering single - } - -#ifdef QT_MENTAT - mode permanent -#else - mode dialog -#endif -} - -popmenu job_usersub_pm { - -#ifdef QT_MENTAT - text "CURRENTLY SELECTED USER SUBROUTINES" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 66 4 - text "CURRENTLY SELECTED USER SUBROUTINES" - } -#endif - - display { - position 1 +5 - size 64 86 - display "job_usersubs" - } - - popdown { - position 27 +88 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 38 8 - size 66 102 - background_color body - border_width 1 - border_color border - buffering single - } - mode dialog -} - -popmenu job_submit_adv_pm { - -#ifdef QT_MENTAT - text "ADVANCED JOB SUBMISSION" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 50 4 - text "ADVANCED JOB SUBMISSION" - } -#endif - - label { - position 1 5 - size 19 4 - text "INITIAL ALLOCATION" - border_width 1 - border_color black - } -#ifdef QT_MENTAT - label { - position +19 = - size 15 4 - text "GENERAL MEMORY" - } -#else - button { - position +19 = - size 15 4 - text "GENERAL MEMORY" - help job_param_general_init_allocation - command "*job_param general_init_allocation" - } -#endif - text { - position +15 = - size 10 4 - display "job_param_value_general_init_allocation" - command "*job_param general_init_allocation" - help job_param_general_init_allocation - } - - label { - position +10 = - size 4 4 - text "MB" - border_width 1 - border_color black - } - - toggle { - position 1 +5 - size 32 4 - text "OUT-OF-CORE ELEMENT STORAGE" - help job_param_elsto - toggle "*job_option elsto:on" - true_command "*job_option elsto:on" - false_command "*job_option elsto:off" - } - - toggle { - position 1 +4 - size 32 4 - text "OUT-OF-CORE INCREMENTAL BACKUP" - help job_param_inc_backup_storage - toggle "*job_option inc_backup_storage:out_of_core" - true_command "*job_option inc_backup_storage:out_of_core" - false_command "*job_option inc_backup_storage:in_core" - } - - toggle { - position +34 = - size 14 4 - text "CHECK SIZES" - help job_run_check - toggle "*job_option check:on" - true_command "*job_option check:on" - false_command "*job_option check:off" - } - - label { - position 1 +6 - size 16 4 - text "INTEGER SIZE" - border_width 1 - border_color black - } - - roller { - position +16 = - size 32 4 - nvalues 3 - texts "DEFAULT" - "4-BYTE INTEGERS" - "8-BYTE INTEGERS" -#ifdef QT_MENTAT - commands "*job_option marc_integer_size:default" - "*job_option marc_integer_size:i4" - "*job_option marc_integer_size:i8" -#else - popmenu marc_integer_size_pm -#endif - help job_run_intsize - roller "job_option marc_integer_size" - } - - frame { - position 1 +6 - size 48 12 - text "MARC INPUT FILE" - border_width 1 - border_color black - - group { - - label { - position 0 4 - size 9 4 - text "VERSION" - border_width 1 - border_color black - } - - roller { - position +9 = - size 14 4 - nvalues 15 - nvisible 15 - texts "DEFAULT" -#if 0 - "2012" -#endif - "2011" - "2010.2" - "2010" - "2008" - "2007" - "2005R3" - "2005" - "2003" - "2001" - "2000" -#if 0 - "8" -#endif - "K7" - "K6.2" - "K5" - "K4" - help job_param_version - rollers "job_input_version_default" -#if 0 - "job_input_version_2012" -#endif - "job_input_version_2011" - "job_input_version_2010.2" - "job_input_version_2010" - "job_input_version_2008" - "job_input_version_2007" - "job_input_version_2005r3" - "job_input_version_2005" - "job_input_version_2003" - "job_input_version_2001" - "job_input_version_2000" -#if 0 - "job_input_version_8" -#endif - "job_input_version_k7" - "job_input_version_k6" - "job_input_version_k5" - "job_input_version_k4" -#ifdef QT_MENTAT - commands "*job_option version:default" -#if 0 - "*job_option version:2012" -#endif - "*job_option version:2011" - "*job_option version:2010.2" - "*job_option version:2010" - "*job_option version:2008" - "*job_option version:2007" - "*job_option version:2005r3" - "*job_option version:2005" - "*job_option version:2003" - "*job_option version:2001" - "*job_option version:2000" -#if 0 - "*job_option version:8" -#endif - "*job_option version:k7" - "*job_option version:k6" - "*job_option version:k5" - "*job_option version:k4" - visibles "job_allows_input_version_default" -#if 0 - "job_allows_input_version_2012" -#endif - "job_allows_input_version_2011" - "job_allows_input_version_2010.2" - "job_allows_input_version_2010" - "job_allows_input_version_2008" - "job_allows_input_version_2007" - "job_allows_input_version_2005r3" - "job_allows_input_version_2005" - "job_allows_input_version_2003" - "job_allows_input_version_2001" - "job_allows_input_version_2000" -#if 0 - "job_allows_input_version_8" -#endif - "job_allows_input_version_k7" - "job_allows_input_version_k6" - "job_allows_input_version_k5" - "job_allows_input_version_k4" -#else - popmenu marc_version_run_pm -#endif - } - -# see also job_common.ms -# see also the RUN JOB popmenu in this file - - label { - position +14 = - size 7 4 - text "STYLE" - border_width 1 - border_color black - } - - roller { - position +7 = - size 18 4 - nvalues 3 - texts "TABLE-DRIVEN" - "MULTI-PHYSICS" - "OLD" - rollers "job_input_style_table_driven" - "job_input_style_multi_physics" - "job_input_style_old" -#ifdef QT_MENTAT - commands "*job_option input_style:new *job_option input_physics_style:old" - "*job_option input_physics_style:new *job_option input_style:new" - "*job_option input_style:old *job_option input_physics_style:old" - visibles "job_allows_input_style_table_driven" - "job_allows_input_style_multi_physics" - "job_allows_input_style_old" -#else - popmenu marc_input_style_run_adv_pm -#endif - help job_option_input_style - } - - toggle { - position 0 +4 - size 48 4 - text "EXTENDED PRECISION" - help job_run_precision - toggle "*job_option inp_file_prec:extended" - true_command "*job_option inp_file_prec:extended" - false_command "*job_option inp_file_prec:normal" - } - } - } - - button { - position 1 +14 - size 24 4 - text "SCRATCH DIRECTORY" - settext $directory_browser_label "JOB SCRATCH DIRECTORY" - set $directory_browser_command "*job_scratch_directory" -#ifdef QT_MENTAT - browser directory_browser -#else - popmenu directory_browser_popmenu -#endif - help job_scratch_directory - } - - button { - position +24 = - size 24 4 - text "CLEAR" - command "*job_clear_scratch_directory" - visible job_scratch_directory - } - - text { - position 1 +4 - size 48 4 - display job_scratch_dir - command "*job_scratch_directory" - } - -#ifdef DCOM - toggle { - position 1 +6 - size 8 4 - text "DCOM" - toggle "*job_option dcom:on" - help job_run_dcom - true_command "*job_option dcom:on" - false_command "*job_option dcom:off" - visible win32_available - } - - button { - position +8 = - size 12 4 - text "HOSTNAME" - command "*job_dcom_hostname" - visible "and(win32_available, *job_option dcom:on)" - } - - text job_dcom_hostname { - position +12 = - size 28 4 - display "job_dcom_hostname" - command "*job_dcom_hostname" - visible "and(win32_available, *job_option dcom:on)" - } -#endif - - button { - position 1 +6 - size 24 4 - text "TITLE" - popmenu job_title_pm - command "*job_title" - } - - button { - position +24 = - size 24 4 - text "SAVE MODEL" - command "*save_model" - } - - button { - position +4 +6 - size 20 4 - text "WRITE INPUT FILE" - command "*job_write_input" - } - - button { - position = +4 - size 20 4 - text "EDIT INPUT FILE" - command "*job_edit_input" - } - - popdown { - position 1 +5 - size 20 6 - text "SUBMIT 1" - command "*submit_job 1 *monitor_job" - } - - popdown { - position +28 = - size 20 6 - text "EXECUTE 1" - command "*execute_job 1 *monitor_job" - } - - popdown { - position -28 +6 - size 20 6 - text "SUBMIT 2" - command "*submit_job 2 *monitor_job" - } - - popdown { - position +28 = - size 20 6 - text "EXECUTE 2" - command "*execute_job 2 *monitor_job" - } - - popdown { - position -28 +6 - size 20 6 - text "SUBMIT 3" - command "*submit_job 3 *monitor_job" - } - - popdown { - position +28 = - size 20 6 - text "EXECUTE 3" - command "*execute_job 3 *monitor_job" - } - - popdown { - position 19 +8 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 38 8 -#ifdef DCOM - size 50 100 -#else - size 50 94 -#endif - background_color body - border_width 1 - border_color border - buffering single - } - mode dialog -} - -popmenu job_exit_msg_pm { - -#ifdef QT_MENTAT - text "EXIT MESSAGE" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 86 4 - text "EXIT MESSAGE" - } - - display { - position 1 5 - size 84 74 - display "job_exit_msg" - } -#endif - -#ifdef QT_MENTAT - - text { - position 1 5 - size 84 74 - multiline - readonly - display "job_exit_msg" - } - -#endif - popdown { - position 37 +76 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 38 8 - size 86 90 - background_color body - border_width 1 - border_color border - buffering single - } - mode dialog -} - -#ifndef QT_MENTAT -popmenu job_user_source_pm { - window { - parent job_run_wi - origin 25 17 - size 24 17 - border_width 1 - border_color border - background_color body - } - mode dialog - - group job_user_source_gr -} - - -group job_user_source_gr { - popdown { - position 0 0 - size 24 4 - text "COMPILE / NO SAVE" - command "*job_option user_source:compile_nosave" - } - - popdown { - position = +4 - size 24 4 - text "COMPILE AND SAVE" - command "*job_option user_source:compile_save" - } - - popdown { - position = +4 - size 24 4 - text "RUN SAVED EXECUTABLE" - command "*job_option user_source:run_saved" - } - - popdown { - position = +5 - size 24 4 - text "CANCEL" - } -} -#endif - -popmenu job_run_parallelization_pm { - -#ifdef QT_MENTAT - text "PARALLELIZATION/\{GPU}" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 50 4 - text "PARALLELIZATION/GPU" - } -#endif - -#ifdef QT_MENTAT - label { - position 0 0 - size 6 4 - text "NAME" - } - - display { - position +6 = - size 26 4 - display "job_name" - } - - label { - position 0 +4 - size 6 4 - text "TYPE" - } - - display { - position +6 = - size 26 4 - display job_class_label - } -#endif - - frame { -#ifdef QT_MENTAT - position 1 9 -#else - position 1 5 -#endif - size 48 28 - group job_ddm_gr - text "DOMAIN DECOMPOSITION" - border_width 1 - border_color black - } - - frame { - position 1 +29 - size 48 35 - group job_parallel_matrix_solver_gr - text "MATRIX SOLVER" - border_width 1 - border_color black - } - - frame { - position 1 +36 - size 48 28 - group job_parallel_env_gr - text "PARALLELIZATION ENVIRONMENT" - border_width 1 - border_color black - visible "or(*job_option parallel:on, \ - solver_multi_procs)" - } - - popdown { - position 19 +30 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 38 8 - size 50 109 - background_color body - border_width 1 - border_color border - buffering single - } -#ifdef QT_MENTAT - mode permanent -#else - mode dialog -#endif -} - -group job_ddm_gr { - - toggle { - position 1 4 - size 30 4 - text "USE \{DDM}" - toggle "*job_option parallel:on" - help job_run_ddm_use - true_command "*job_option parallel:on" - false_command "*job_option parallel:off" - } - - frame { - position +2 +5 - size 44 18 - group job_ddm_use_gr - visible "*job_option parallel:on" - } -} - -group job_ddm_use_gr { - roller { - position 0 0 - size 30 4 - nvalues 2 - texts "DECOMPOSITION IN MARC" - "DECOMPOSITION IN MENTAT" - roller "job_option ddm_generator" -#ifdef QT_MENTAT - commands "*job_option ddm_generator:fea_solver" - "*job_option ddm_generator:preprocessor" -#else - popmenu job_ddm_generator_pm -#endif - help job_run_ddm_generator - } - - frame { - position 0 +5 - size 44 8 - group job_ddm_fea_solver_gr - visible "*job_option ddm_generator:fea_solver" - } - - frame { - position = = - size 44 8 - group job_ddm_preprocessor_gr - visible "*job_option ddm_generator:preprocessor" - } - - text { - position 0 +9 - size 22 4 - text "SINGLE INPUT FILE" - readonly - visible "*job_option ddm_generator:fea_solver" - } - - roller { - position = = - size 22 4 - nvalues 2 - texts "MULTIPLE INPUT FILES" - "SINGLE INPUT FILE" - roller "job_option ddm_single_input" - commands "*job_option ddm_single_input:off" - "*job_option ddm_single_input:on" - visible "*job_option ddm_generator:preprocessor" - help job_run_ddm_single_input - } - - roller { - position +23 = - size 21 4 - nvalues 2 - texts "MULTIPLE POST FILES" - "SINGLE POST FILE" - roller "job_option ddm_single_post" - commands "*job_option ddm_single_post:off" - "*job_option ddm_single_post:on" - help job_run_ddm_single_post - } -} - -#ifndef QT_MENTAT -popmenu job_ddm_generator_pm { - - window { - parent mentat - origin 42 26 - size 30 13 - border_width 1 - border_color border - background_color body - } - - mode dialog - - group job_ddm_generator_gr -} - -group job_ddm_generator_gr { - popdown { - position 0 0 - size 30 4 - text "DECOMPOSITION IN MARC" - command "*job_option ddm_generator:fea_solver" - help job_run_ddm_generator - } - - popdown { - position = +4 - size 30 4 - text "DECOMPOSITION IN MENTAT" - command "*job_option ddm_generator:preprocessor" - help job_run_ddm_generator - } - - popdown { - position = +5 - size 30 4 - text "CANCEL" - help job_run_ddm_generator - } -} -#endif - -group job_ddm_fea_solver_gr { -#ifdef QT_MENTAT - label { - position 0 0 - size 10 4 - text "# DOMAINS" - } -#else - button { - position 0 0 - size 10 4 - text "# DOMAINS" - command "*job_param ndomains" - } -#endif - text { - position +10 = - size 4 4 - display "job_param_value_ndomains" - command "*job_param ndomains" - } - - label { - position +4 = - size 7 4 - text "METHOD" - border_width 1 - border_color black - } - - roller { - position +7 = - size 23 4 - nvalues 7 - texts "METIS BEST" - "METIS ELEMENT" - "METIS NODE" - "REC. COORD. BISECTION" - "VECTOR" - "RADIAL" - "ANGULAR" - help set_job_decomp_type - rollers "*job_option ddm_method:metis_best" - "*job_option ddm_method:metis_element_based" - "*job_option ddm_method:metis_node_based" - "*job_option ddm_method:recur_coord_bisect" - "*job_option ddm_method:vector" - "*job_option ddm_method:radial" - "*job_option ddm_method:angular" -#ifdef QT_MENTAT - commands "*job_option ddm_method:metis_best" - "*job_option ddm_method:metis_element_based" - "*job_option ddm_method:metis_node_based" - "*job_option ddm_method:recur_coord_bisect" - "*job_option ddm_method:vector" - "*job_option ddm_method:radial" - "*job_option ddm_method:angular" -#else - popmenu job_ddm_method_pm -#endif - } - - button { - position +4 +4 - size 19 4 - text "ADVANCED SETTINGS" -#ifdef QT_MENTAT - popmenu job_ddm_fea_solver_pm -#else - screen job_ddm_fea_solver_sc - command "@popdown($popname2) @popdown($popname1)" ($popname2, $popname1) -#endif - } -} - -#ifndef QT_MENTAT -popmenu job_ddm_method_pm { - - window { - parent mentat - origin 56 31 - size 30 33 - border_width 1 - border_color border - background_color body - } - - mode dialog - - group job_ddm_method_gr -} - -group job_ddm_method_gr { - - popdown { - position 0 0 - size 30 4 - text "METIS BEST" - command "*job_option ddm_method:metis_best" - } - - popdown { - position = +4 - size 30 4 - text "METIS ELEMENT BASED" - command "*job_option ddm_method:metis_element_based" - } - - popdown { - position = +4 - size 30 4 - text "METIS NODE BASED" - command "*job_option ddm_method:metis_node_based" - } - - popdown { - position = +4 - size 30 4 - text "RECURSIVE COORDINATE BISECTION" - command "*job_option ddm_method:recur_coord_bisect" - } - - popdown { - position = +4 - size 30 4 - text "VECTOR" - command "*job_option ddm_method:vector" - } - - popdown { - position = +4 - size 30 4 - text "RADIAL" - command "*job_option ddm_method:radial" - } - - popdown { - position = +4 - size 30 4 - text "ANGULAR" - command "*job_option ddm_method:angular" - } - - popdown { - position = +5 - size 30 4 - text "CANCEL" - } -} -#endif - -#ifdef QT_MENTAT -popmenu job_ddm_fea_solver_pm { - - text "JOB PARALLELIZATION" -#else -screen job_ddm_fea_solver_sc { - - menu { -#endif - - group { - units 32 120 - -#ifndef QT_MENTAT - label { - position 0 0 - size 32 4 - text "JOB PARALLELIZATION" - } -#endif - - label { - position 0 5 - size 6 4 - text "NAME" - } - - display { - position +6 = - size 26 4 - display "job_name" - } - -#ifdef QT_MENTAT - label { - position 0 +4 - size 6 4 - text "TYPE" - } - - display { - position +6 = - size 26 4 - display job_class_label - } -#endif - - frame { -#ifdef QT_MENTAT - position 0 +9 -#else - position 0 +5 -#endif - size 32 56 - text "ADVANCED DECOMPOSITION IN MARC" - border_width 1 - border_color black - - group { -#ifdef QT_MENTAT - label { - position 1 4 - size 16 4 - text "# DOMAINS" - } -#else - button { - position 1 4 - size 16 4 - text "# DOMAINS" - command "*job_param ndomains" - } -#endif - text { - position +16 = - size 14 4 - display "job_param_value_ndomains" - command "*job_param ndomains" - } - - label { - position 1 +4 - size 7 4 - text "METHOD" - border_width 1 - border_color black - } - - roller { - position +7 = - size 23 4 - nvalues 7 - texts "METIS BEST" - "METIS ELEMENT" - "METIS NODE" - "REC. COORD. BISECTION" - "VECTOR" - "RADIAL" - "ANGULAR" - help set_job_decomp_type - rollers "*job_option ddm_method:metis_best" - "*job_option ddm_method:metis_element_based" - "*job_option ddm_method:metis_node_based" - "*job_option ddm_method:recur_coord_bisect" - "*job_option ddm_method:vector" - "*job_option ddm_method:radial" - "*job_option ddm_method:angular" -#ifdef QT_MENTAT - commands "*job_option ddm_method:metis_best" - "*job_option ddm_method:metis_element_based" - "*job_option ddm_method:metis_node_based" - "*job_option ddm_method:recur_coord_bisect" - "*job_option ddm_method:vector" - "*job_option ddm_method:radial" - "*job_option ddm_method:angular" -#else - popmenu job_ddm_method2_pm -#endif - } - - frame { - position 1 +5 - size 30 20 - group job_ddm_direction_gr - visible "or(*job_option ddm_method:vector, \ - *job_option ddm_method:radial, \ - *job_option ddm_method:angular)" - } - - toggle { - position 1 +21 - size 30 4 - text "DOMAIN ISLAND REMOVAL" - toggle "*job_option ddm_island_removal:on" - true_command "*job_option ddm_island_removal:on" - false_command "*job_option ddm_island_removal:off" - } - - toggle { - position = +4 - size 30 4 - text "COARSE GRAPH" - toggle "*job_option ddm_graph:coarse" - true_command "*job_option ddm_graph:coarse" - false_command "*job_option ddm_graph:fine" - visible "or(*job_option ddm_method:metis_best, \ - *job_option ddm_method:metis_element_based, \ - *job_option ddm_method:metis_node_based)" - } - - toggle { - position = +4 - size 30 4 - text "DETECT CONTACT" - toggle "*job_option ddm_detect_contact:on" - true_command "*job_option ddm_detect_contact:on" - false_command "*job_option ddm_detect_contact:off" - visible "or(*job_option ddm_method:metis_best, \ - *job_option ddm_method:metis_element_based, \ - *job_option ddm_method:metis_node_based)" - } -#ifdef QT_MENTAT - label { - position 1 +5 - size 30 4 - text "ELEMENT WEIGHT COEFFICIENT" - } -#else - button { - position 1 +5 - size 30 4 - text "ELEMENT WEIGHT COEFFICIENT" - command "*job_param ddm_elem_weight_coeff" - } -#endif - text { - position = +4 - size 30 4 - display "job_param_value_ddm_elem_weight_coeff" - command "*job_param ddm_elem_weight_coeff" - } - } - } - -#ifdef QT_MENTAT - popdown { - position 0 +57 - size 32 8 - text "OK" - } -#else - frame { - position 0 +57 - size 32 8 - group ok2_gr - } - - frame select_frame - frame inactive_return -#endif - } -#ifndef QT_MENTAT - window main_window - disable_right_mouse_button - } - - menu transform -} # job_ddm_fea_solver_sc -#else - mode permanent -} # job_ddm_fea_solver_pm -#endif - -#ifndef QT_MENTAT -popmenu job_ddm_method2_pm { - - window { - parent mentat - origin 1 22 - size 30 33 - border_width 1 - border_color border - background_color body - } - - mode dialog - - group job_ddm_method_gr -} -#endif - -group job_ddm_direction_gr { - button { - position 0 0 - size 15 4 - text "DIRECTION" - command "*job_vector ddm_sort_direction_x" - visible "*job_option ddm_method:vector" - } - - button { - position = = - size 15 4 - text "DIRECTION" - command "*job_vector ddm_sort_direction_x" - visible "not(*job_option ddm_method:vector)" - } - - button { - position +15 = - size 15 4 - text "FROM / TO" - command "*job_vector_from_to ddm_sort_direction_x" - } - - text { - position -15 +4 - size 10 4 - command "*job_param ddm_sort_direction_x" - display "job_param_value_ddm_sort_direction_x" - help ddm_job_decomp_user_direction_x - } - - text { - position +10 = - size 10 4 - command "*job_param ddm_sort_direction_y" - display "job_param_value_ddm_sort_direction_y" - } - - text { - position +10 = - size 10 4 - command "*job_param ddm_sort_direction_z" - display "job_param_value_ddm_sort_direction_z" - } - - frame { - position 0 +4 - size 30 8 - group job_ddm_sort_point_gr - visible "not(*job_option ddm_method:vector)" - } -} - -group job_ddm_sort_point_gr { - label { - position 0 0 - size 14 4 - border_width 1 - border_color black - text "POINT ON AXIS" - } - - roller { - position +14 = - size 10 4 - nvalues 2 - texts "DEFAULT" - "USER" - roller "job_option ddm_sort_point" -#ifdef QT_MENTAT - commands "*job_option ddm_sort_point:default" - "*job_option ddm_sort_point:user" -#else - popmenu job_ddm_sort_point_meth_pm -#endif - } - - button { - position +10 = - size 6 4 - text "SET" - command "*job_position ddm_sort_point_x" - visible "*job_option ddm_sort_point:user" - } - - text { - position 0 +4 - size 10 4 - command "*job_param ddm_sort_point_x" - display "job_param_value_ddm_sort_point_x" - visible "*job_option ddm_sort_point:user" - } - - text { - position +10 = - size 10 4 - command "*job_param ddm_sort_point_y" - display "job_param_value_ddm_sort_point_y" - visible "*job_option ddm_sort_point:user" - } - - text { - position +10 = - size 10 4 - command "*job_param ddm_sort_point_z" - display "job_param_value_ddm_sort_point_z" - visible "*job_option ddm_sort_point:user" - } -} - -#ifndef QT_MENTAT -popmenu job_ddm_sort_point_meth_pm { - - window { - parent mentat - origin 15 35 - size 14 13 - border_width 1 - border_color border - background_color body - } - - mode dialog - - group job_ddm_sort_point_meth_gr -} - -group job_ddm_sort_point_meth_gr { - popdown { - position 0 0 - size 14 4 - text "DEFAULT" - command "*job_option ddm_sort_point:default" - } - - popdown { - position = +4 - size 14 4 - text "USER DEFINED" - command "*job_option ddm_sort_point:user" - } - - popdown { - position = +5 - size 14 4 - text "CANCEL" - } -} -#endif - -group job_ddm_preprocessor_gr { - label { - position 0 0 - size 10 4 - text "# DOMAINS" - border_width 1 - border_color black - } - - integer { - position +10 = - size 4 4 - display valid_domains - } - - button { - position +4 = - size 30 4 - text "USER DOMAINS" -#ifdef QT_MENTAT - screen domains -#else - screen job_ddm_user_domains_sc - command "@popdown($popname2) @popdown($popname1)" ($popname2, $popname1) -#endif - help job_run_ddm_user_domains - } -} - -#ifndef QT_MENTAT -screen job_ddm_user_domains_sc { - - menu { - - group { - units 32 120 - - label { - position 0 0 - size 32 4 - text "USER DOMAINS" - } - - frame { - position 0 5 - size 32 28 - group user_domains_gr - } - - frame { - position 0 +29 - size 32 49 - group user_domains_generate_gr - } - - frame { - position 0 +50 - size 32 8 - group user_domains_tail_gr - } - - frame { - position 0 92 - size 32 8 - group ok2_gr - } - - frame select_frame - frame inactive_return - } - window main_window - disable_right_mouse_button - - } - - menu transform - -} # job_ddm_user_domains_sc -#endif - -group job_parallel_matrix_solver_gr { - - label { - position 3 4 - size 12 4 - text "SOLUTION" - border_width 1 - border_color black - } - - roller { - position +12 = - size 18 4 - nvalues 2 - texts "SYMMETRIC" - "NONSYMMETRIC" - rollers job_nonsym_off - job_nonsym_on - commands "*job_option solver_nonsym:off" - "*job_option solver_nonsym:on" - help job_param_solver_method - } - - label { - position -12 +4 - size 6 4 - text "TYPE" - border_width 1 - border_color black - } - - roller { - position +6 = - size 24 4 - nvalues 9 - help job_param_solver_method - texts "MULTIFRONTAL SPARSE" - "MIXED DIRECT-ITERATIVE" - "CASI ITERATIVE" - "PARDISO DIRECT SPARSE" - "MUMPS PARALLEL DIRECT" - "HARDWARE SPARSE" - "ITERATIVE SPARSE" - "DIRECT PROFILE" - "DIRECT SPARSE" - rollers job_solver_mfront_sparse - job_solver_mixed_direct_iterative - job_solver_it_ext - job_solver_pardiso - job_solver_mumps - job_solver_sparse - job_solver_it_sparse - job_solver_dir_profile - job_solver_dir_sparse -#ifdef QT_MENTAT - commands "*job_option solver:mfront_sparse" - "*job_option solver:mixed_direct_iterative" - "*job_option solver:it_ext" - "*job_option solver:pardiso" - "*job_option solver:mumps" - "*job_option solver:sparse" - "*job_option solver:it_sparse" - "*job_option solver:dir_profile" - "*job_option solver:dir_sparse" - visibles job_allows_solver_mfront_sparse - job_allows_solver_mixed_direct_iterative - job_allows_solver_it_ext - job_allows_solver_pardiso - job_allows_solver_mumps - job_allows_solver_sparse - job_allows_solver_it_sparse - job_allows_solver_dir_profile - job_allows_solver_dir_sparse - help job_param_solver_method -#else - popmenu job_set_parallel_matrix_solver_pm -#endif - } - - button { - position +24 = - size 14 4 - text "OPTIONS" - popmenu job_parallel_matrix_solver_opt_pm - } - - frame { - position = +4 - size 14 4 - group job_run_solver_ddm_opts_gr - visible "*job_option parallel:on" - } - - frame { - position 1 +5 - size 46 8 - group job_solver_multi_procs_gr - visible solver_allows_multi_procs - } - - frame { - position = = - size 46 8 - group job_solver_multi_threads_gr - visible solver_allows_multi_threads - } - - frame { - position 1 +9 - size 46 8 - group job_solver_gpu_gr - visible "and(job_solver_mfront_sparse,job_nonsym_off)" - } -} - -#ifndef QT_MENTAT -popmenu job_set_parallel_matrix_solver_pm { - window { - parent mentat - origin 48 54 - size 24 42 - border_width 1 - border_color border - background_color body - } - mode dialog - - group job_solver_gr -} -#endif - -popmenu job_parallel_matrix_solver_opt_pm { - -#ifdef QT_MENTAT - text "MATRIX SOLVER OPTIONS" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 38 4 - text "MATRIX SOLVER OPTIONS" - } -#endif - - frame { - position 1 5 - size 36 23 - group job_solver_opts_gr - } - - popdown { - position 13 +25 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 41 12 - size 38 39 - border_width 1 - border_color border - background_color body - } - mode dialog -} - -group job_run_solver_ddm_opts_gr { - button { - position 0 0 - size 14 4 - text "\{DDM} OPTIONS" - popmenu ddm_options -# see also job_common.ms! - visible "not(or(job_solver_it_sparse, \ - job_solver_it_ext, \ - job_solver_mixed_direct_iterative, \ - job_solver_pardiso, \ - job_solver_mumps))" - } -} - -group job_solver_multi_procs_gr { - frame { - position 0 0 - size 46 8 - group job_solver_multi_procs_parallel_off_gr - visible "*job_option parallel:off" - } - - frame { - position = = - size 46 8 - group job_solver_multi_procs_parallel_on_gr - visible "*job_option parallel:on" - } -} - -group job_solver_multi_procs_parallel_off_gr { - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - true_command "*job_option nsolver_procs_serial:on" - false_command "*job_option nsolver_procs_serial:off" - toggle "*job_option nsolver_procs_serial:on" - help job_run_multithreading - } -#ifdef QT_MENTAT - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - visible "*job_option nsolver_procs_serial:on" - } -#else - button { - position +2 +4 - size 14 4 - text "# PROCESSES" - command "*job_param nsolver_procs" - visible "*job_option nsolver_procs_serial:on" - } -#endif - text { - position +14 = - size 14 4 - display "job_param_value_nsolver_procs" - command "*job_param nsolver_procs" - visible "*job_option nsolver_procs_serial:on" - } -} - -group job_solver_multi_procs_parallel_on_gr { - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - help job_run_multithreading - toggle true -#ifdef QT_MENTAT - set $dummy dummy -#endif - } - - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - border_width 1 - border_color black - } - - roller { - position +14 = - size 14 4 - nvalues 2 - texts "AUTOMATIC" - "USER" - commands "*job_option nsolver_procs_ddm:automatic" - "*job_option nsolver_procs_ddm:user" - help job_run_multithreading - rollers "*job_option nsolver_procs_ddm:automatic" - "*job_option nsolver_procs_ddm:user" - } - - frame { - position +14 = - size 16 4 - group job_nsolver_procs_ddm_automatic_gr - visible "*job_option nsolver_procs_ddm:automatic" - } - - frame { - position = = - size 16 4 - group job_nsolver_procs_ddm_user_gr - visible "*job_option nsolver_procs_ddm:user" - } -} - -group job_nsolver_procs_ddm_automatic_gr { - label { - position 0 0 - size 8 4 - text "VALUE" - border_width 1 - border_color black - } - - integer { - position +8 = - size 8 4 - display valid_domains - visible "*job_option ddm_generator:preprocessor" - } - - integer { - position = = - size 8 4 - display "job_param_ndomains" - visible "*job_option ddm_generator:fea_solver" - } -} - -group job_nsolver_procs_ddm_user_gr { -#ifdef QT_MENTAT - label { - position 0 0 - size 8 4 - text "VALUE" - } -#else - button { - position 0 0 - size 8 4 - text "VALUE" - command "*job_param nsolver_procs" - } -#endif - text { - position +8 = - size 8 4 - display "job_param_value_nsolver_procs" - command "*job_param nsolver_procs" - } -} - -group job_solver_multi_threads_gr { - frame { - position 0 0 - size 30 8 - group job_solver_multi_threads_mfront_sparse_gr - visible "and(job_solver_mfront_sparse,*job_option parallel:off)" - } - - frame { - position = = - size 46 8 - group job_solver_multi_threads_pardiso_parallel_off_gr - visible "and(job_solver_pardiso,*job_option parallel:off)" - } - - frame { - position = = - size 46 8 - group job_solver_multi_threads_pardiso_parallel_on_gr - visible "and(job_solver_pardiso,*job_option parallel:on)" - } -} - -group job_solver_multi_threads_mfront_sparse_gr { - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - toggle "*job_option mfront_sparse_multi_threading:on" - true_command "*job_option mfront_sparse_multi_threading:on" - false_command "*job_option mfront_sparse_multi_threading:off" - help job_run_multithreading - } -#ifdef QT_MENTAT - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - visible "*job_option mfront_sparse_multi_threading:on" - } -#else - button { - position +2 +4 - size 14 4 - text "# PROCESSES" - command "*job_param nthreads" - visible "*job_option mfront_sparse_multi_threading:on" - } -#endif - text { - position +14 = - size 14 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - visible "*job_option mfront_sparse_multi_threading:on" - } -} - -group job_solver_gpu_gr { - toggle { - position 0 0 - size 30 4 - text "USE \{GPU(s)}" - toggle "*job_option solver_use_gpu:on" - true_command "*job_option solver_use_gpu:on" - false_command "*job_option solver_use_gpu:off" - help job_solver_gpu - } - - label { - position +2 +4 - size 16 4 - text "\{GPU} SELECTION" - border_width 1 - border_color black - visible "*job_option solver_use_gpu:on" - } - - roller { - position +16 = - size 12 4 - nvalues 2 - texts "AUTOMATIC" - "USER" - commands "*job_option solver_gpus:automatic" - "*job_option solver_gpus:user" - rollers "*job_option solver_gpus:automatic" - "*job_option solver_gpus:user" - visible "*job_option solver_use_gpu:on" - help job_solver_gpu - } - - text { - position +12 = - size 16 4 - display job_solver_gpus - command "*clear_job_solver_gpus *job_solver_gpus" - visible "and(*job_option solver_use_gpu:on,*job_option solver_gpus:user)" - } -} - -group job_solver_multi_threads_pardiso_parallel_off_gr { - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - toggle "*job_option pardiso_multi_threading:on" - true_command "*job_option pardiso_multi_threading:on" - false_command "*job_option pardiso_multi_threading:off" - help job_run_multithreading - } -#ifdef QT_MENTAT - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - visible "*job_option pardiso_multi_threading:on" - } -#else - button { - position +2 +4 - size 14 4 - text "# PROCESSES" - command "*job_param nthreads" - visible "*job_option pardiso_multi_threading:on" - } -#endif - text { - position +14 = - size 14 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - visible "*job_option pardiso_multi_threading:on" - } -} - -group job_solver_multi_threads_pardiso_parallel_on_gr { - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - help job_run_multithreading - toggle true -#ifdef QT_MENTAT - set $dummy dummy -#endif - } - - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - border_color black - border_width 1 - } - - roller { - position +14 = - size 14 4 - nvalues 2 - texts "AUTOMATIC" - "USER" - commands "*job_option pardiso_multi_threading_ddm:automatic" - "*job_option pardiso_multi_threading_ddm:user" - help job_run_multithreading - rollers "*job_option pardiso_multi_threading_ddm:automatic" - "*job_option pardiso_multi_threading_ddm:user" - } - - frame { - position +14 = - size 16 4 - group job_pardiso_multi_threads_ddm_automatic_gr - visible "*job_option pardiso_multi_threading_ddm:automatic" - } - - frame { - position = = - size 16 4 - group job_pardiso_multi_threads_ddm_user_gr - visible "*job_option pardiso_multi_threading_ddm:user" - } -} - -group job_pardiso_multi_threads_ddm_automatic_gr { - label { - position 0 0 - size 8 4 - text "VALUE" - border_width 1 - border_color black - } - - integer { - position +8 = - size 8 4 - display valid_domains - visible "*job_option ddm_generator:preprocessor" - } - - integer { - position = = - size 8 4 - display "job_param_ndomains" - visible "*job_option ddm_generator:fea_solver" - } -} - -group job_pardiso_multi_threads_ddm_user_gr { -#ifdef QT_MENTAT - label { - position 0 0 - size 8 4 - text "VALUE" - } -#else - button { - position 0 0 - size 8 4 - text "VALUE" - command "*job_param nthreads" - } -#endif - text { - position +8 = - size 8 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - } -} - -group job_parallel_env_gr { - - roller { - position 1 4 - size 30 4 - nvalues 2 - texts "SINGLE MACHINE" - "NETWORK" - help job_run_ddm_setup - roller "job_option parallel_setup" - commands "*job_option parallel_setup:single" - "*job_option parallel_setup:network" - } - - frame { - position +2 +5 - size 44 18 - group job_parallel_env_network_gr - visible "*job_option parallel_setup:network" - } -} - -group job_parallel_env_network_gr { - button { - position 0 0 - size 28 4 - text "HOST FILE" -#ifdef QT_MENTAT - browser host_file_browser -#else - popmenu host_file_browser_pm -#endif - settext $host_file_browser_label "SELECT HOST FILE" - set $host_file_browser_command "*job_host_file" - help job_host_file - } - - button { - position +28 = - size 8 4 - text "EDIT" - command "*job_edit_host_file" - help job_edit_host_file - visible job_host_file - } - - button { - position +8 = - size 8 4 - text "CLEAR" - command "*job_clear_host_file" - help job_clear_host_file - visible job_host_file - } - - display { - position 0 +4 - size 44 4 - display job_host_file - } - - frame { - position 0 +5 - size 44 9 - group job_parallel_env_network_ddm_gr - visible "*job_option parallel:on" - } -} - -group job_parallel_env_network_ddm_gr { - toggle { - position 0 0 - size 22 4 - text "COPY INPUT FILE" - toggle "*job_option copy_input_file:on" - true_command "*job_option copy_input_file:on" - false_command "*job_option copy_input_file:off" - help job_host_copy_inputfile - } - - toggle { - position +23 = - size 21 4 - text "COPY POST FILE" - toggle "*job_option copy_post_file:on" - true_command "*job_option copy_post_file:on" - false_command "*job_option copy_post_file:off" - help job_host_copy_inputfile - } - - label { - position 0 +5 - size 10 4 - text "HOSTS" - border_width 1 - border_color black - visible job_usersub_file - } - - roller { - position +10 = - size 18 4 - nvalues 2 - texts "COMPATIBLE" - "INCOMPATIBLE" - roller "job_option network_hosts" - commands "*job_option network_hosts:compatible" - "*job_option network_hosts:incompatible" - help job_host_comp - visible job_usersub_file - } -} - -#ifndef QT_MENTAT -popmenu marc_integer_size_pm { - window { - parent mentat - origin 55 32 - size 32 17 - border_width 1 - border_color border - background_color body - } - mode dialog - - group marc_integer_size_gr -} - -group marc_integer_size_gr { - popdown { - position 0 0 - size 32 4 - text "DEFAULT" - command "*job_option marc_integer_size:default" - help job_run_intsize - } - - popdown { - position = +4 - size 32 4 - text "4-BYTE INTEGERS" - command "*job_option marc_integer_size:i4" - help job_run_intsize - } - - popdown { - position = +4 - size 32 4 - text "8-BYTE INTEGERS" - command "*job_option marc_integer_size:i8" - help job_run_intsize - } - - popdown { - position = +5 - size 32 4 - text "CANCEL" - help job_run_intsize - } -} -#endif -#endif diff --git a/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask b/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask deleted file mode 100644 index 2d144b8a4..000000000 --- a/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/ksh -# 1st arg: $DIR -# 2nd arg: $DIRJOB -# 3rd arg: $user -# 4th arg: $program -DIR=$1 -user=$3 -program=$4 -usernoext=$user -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - -# add BLAS options for linking - BLAS="%BLAS%" - -. $DIR/tools/include -DIRJOB=$2 -cd $DIRJOB -echo "Compiling and linking user subroutine $user on host `hostname`" -echo "program: $program" - $DFORTRAN $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - userobj=$usernoext.o - - - $LOAD ${program} $DIR/lib/main.o\ - $DIR/lib/blkdta.o $DIR/lib/comm?.o \ - ${userobj-} \ - $DIR/lib/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ../lib/mdsrc.a \ - ../lib/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $BLAS \ - $SYSLIBS || \ - { - echo "$0: link failed for $usernoext.o on host `hostname`" - exit 1 - } - /bin/rm $userobj - /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_h b/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_h deleted file mode 100644 index 01464f095..000000000 --- a/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_h +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/ksh -# 1st arg: $DIR -# 2nd arg: $DIRJOB -# 3rd arg: $user -# 4th arg: $program -DIR=$1 -user=$3 -program=$4 -usernoext=$user -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - -# add BLAS options for linking - BLAS="%BLAS%" - -. $DIR/tools/include -DIRJOB=$2 -cd $DIRJOB -echo "Compiling and linking user subroutine $user on host `hostname`" -echo "program: $program" - $DFORTHIGH $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - userobj=$usernoext.o - - - $LOAD ${program} $DIR/lib/main.o\ - $DIR/lib/blkdta.o $DIR/lib/comm?.o \ - ${userobj-} \ - $DIR/lib/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ../lib/mdsrc.a \ - ../lib/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $BLAS \ - $SYSLIBS || \ - { - echo "$0: link failed for $usernoext.o on host `hostname`" - exit 1 - } - /bin/rm $userobj - /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_hmp b/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_hmp deleted file mode 100644 index 36ced6543..000000000 --- a/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_hmp +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/ksh -# 1st arg: $DIR -# 2nd arg: $DIRJOB -# 3rd arg: $user -# 4th arg: $program -DIR=$1 -user=$3 -program=$4 -usernoext=$user -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - -# add BLAS options for linking - BLAS="%BLAS%" - -. $DIR/tools/include -DIRJOB=$2 -cd $DIRJOB -echo "Compiling and linking user subroutine $user on host `hostname`" -echo "program: $program" - $DFORTHIGHMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - userobj=$usernoext.o - - - $LOAD ${program} $DIR/lib/main.o\ - $DIR/lib/blkdta.o $DIR/lib/comm?.o \ - ${userobj-} \ - $DIR/lib/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ../lib/mdsrc.a \ - ../lib/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $BLAS \ - $SYSLIBS || \ - { - echo "$0: link failed for $usernoext.o on host `hostname`" - exit 1 - } - /bin/rm $userobj - /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_l b/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_l deleted file mode 100644 index 31b5cd175..000000000 --- a/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_l +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/ksh -# 1st arg: $DIR -# 2nd arg: $DIRJOB -# 3rd arg: $user -# 4th arg: $program -DIR=$1 -user=$3 -program=$4 -usernoext=$user -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - -# add BLAS options for linking - BLAS="%BLAS%" - -. $DIR/tools/include -DIRJOB=$2 -cd $DIRJOB -echo "Compiling and linking user subroutine $user on host `hostname`" -echo "program: $program" - $DFORTLOW $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - userobj=$usernoext.o - - - $LOAD ${program} $DIR/lib/main.o\ - $DIR/lib/blkdta.o $DIR/lib/comm?.o \ - ${userobj-} \ - $DIR/lib/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ../lib/mdsrc.a \ - ../lib/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $BLAS \ - $SYSLIBS || \ - { - echo "$0: link failed for $usernoext.o on host `hostname`" - exit 1 - } - /bin/rm $userobj - /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_lmp b/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_lmp deleted file mode 100644 index 8a0c1255d..000000000 --- a/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_lmp +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/ksh -# 1st arg: $DIR -# 2nd arg: $DIRJOB -# 3rd arg: $user -# 4th arg: $program -DIR=$1 -user=$3 -program=$4 -usernoext=$user -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - -# add BLAS options for linking - BLAS="%BLAS%" - -. $DIR/tools/include -DIRJOB=$2 -cd $DIRJOB -echo "Compiling and linking user subroutine $user on host `hostname`" -echo "program: $program" - $DFORTRANLOWMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - userobj=$usernoext.o - - - $LOAD ${program} $DIR/lib/main.o\ - $DIR/lib/blkdta.o $DIR/lib/comm?.o \ - ${userobj-} \ - $DIR/lib/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ../lib/mdsrc.a \ - ../lib/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $BLAS \ - $SYSLIBS || \ - { - echo "$0: link failed for $usernoext.o on host `hostname`" - exit 1 - } - /bin/rm $userobj - /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_mp b/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_mp deleted file mode 100644 index 986d9ae04..000000000 --- a/installation/mods_MarcMentat/2013.1/Marc_tools/comp_damask_mp +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/ksh -# 1st arg: $DIR -# 2nd arg: $DIRJOB -# 3rd arg: $user -# 4th arg: $program -DIR=$1 -user=$3 -program=$4 -usernoext=$user -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - -# add BLAS options for linking - BLAS="%BLAS%" - -. $DIR/tools/include -DIRJOB=$2 -cd $DIRJOB -echo "Compiling and linking user subroutine $user on host `hostname`" -echo "program: $program" - $DFORTRANMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - userobj=$usernoext.o - - - $LOAD ${program} $DIR/lib/main.o\ - $DIR/lib/blkdta.o $DIR/lib/comm?.o \ - ${userobj-} \ - $DIR/lib/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ../lib/mdsrc.a \ - ../lib/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $BLAS \ - $SYSLIBS || \ - { - echo "$0: link failed for $usernoext.o on host `hostname`" - exit 1 - } - /bin/rm $userobj - /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2013.1/Marc_tools/comp_user.original b/installation/mods_MarcMentat/2013.1/Marc_tools/comp_user.original deleted file mode 100644 index 8679bb041..000000000 --- a/installation/mods_MarcMentat/2013.1/Marc_tools/comp_user.original +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/ksh -# 1st arg: $DIR -# 2nd arg: $DIRJOB -# 3rd arg: $user -# 4th arg: $program -DIR=$1 -user=$3 -program=$4 -. $DIR/tools/include -DIRJOB=$2 -cd $DIRJOB -echo "Compiling and linking user subroutine $user.f on host `hostname`" -echo "program: $program" - $FORTRAN $user.f || \ - { - echo "$0: compile failed for $user.f" - exit 1 - } - /bin/rm $program 2>/dev/null - userobj=$user.o - - - $LOAD ${program} $DIR/lib/main.o\ - $DIR/lib/blkdta.o $DIR/lib/comm?.o \ - ${userobj-} \ - $DIR/lib/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ../lib/mdsrc.a \ - ../lib/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $SYSLIBS || \ - { - echo "$0: link failed for $user.o on host `hostname`" - exit 1 - } - /bin/rm $userobj diff --git a/installation/mods_MarcMentat/2013.1/Marc_tools/include_linux64 b/installation/mods_MarcMentat/2013.1/Marc_tools/include_linux64 deleted file mode 100644 index 10cc5f6ce..000000000 --- a/installation/mods_MarcMentat/2013.1/Marc_tools/include_linux64 +++ /dev/null @@ -1,742 +0,0 @@ -# -# General definitions for the Marc 2011 version -# -# EM64T -# ( LP64 - i4 version) -# (ILP64 - i8 version) -# -# Linux RedHat 5.4 -# -# 64 bit MPI version -# -# Intel(R) Fortran Compiler -# Version 12.0.4 -# -# Intel(R) C Compiler -# Version 12.0.4 -# -# DATE -# -# To check the O/S level, type: -# uname -a -# -# Distributed parallel MPI libraries: -# 1) HP MPI 2.3 -# To check the mpi version, type: -# mpirun -version -# 2) Intel MPI 4.0.1.007 -# To check the mpi version, type: -# mpirun -version -# -# MKL Libraries: -# Intel(R) MKL 10.3.0.084 -# -# To check the Compiler level, type using the compiler -# installation path: -# ifort -V -# icc -V -# -# REMARKS : This file contains the definitions of variables used during -# compilation loading and use of the MARC programmes . The -# current machine type is identified by means of the variable -# MACHINE , defined below. -# -# -# MPI_ROOT: root directory in which mpi shared libraries, etc. are located -# DIRJOB : directory in which spawned jobs should look for Marc input -# MPI_ARCH: system architecture -# MPI_EPATH: path where executable resides -# - -REVISION="VERSION, BUILD" -HOSTNAME=`hostname` - -# find available memory in Mbyte on the machine -# can be set explicitly -MEMLIMIT=`free -m | awk '/Mem:/ {print $2}'` - -# set _OEM_NASTRAN to 1 for MD Nastran build -# override _OEM_NASTRAN setting with MARC_MD_NASTRAN environment variable -_OEM_NASTRAN="${MARC_MD_NASTRAN:-0}" - -# uncomment the following line for an autoforge build -#AUTOFORGE=1 -AUTOFORGE=0 -export AUTOFORGE - -# integer size -if test "$MARC_INTEGER_SIZE" = "" ; then - INTEGER_PATH= -else - INTEGER_PATH=/$MARC_INTEGER_SIZE -fi - -FCOMP=ifort - -# -# settings for Metis -# -METIS="-I$METIS_SOURCE" -METISLIBS="$MARC_LIB/metis.a " - -# -# settings for MPI -# -# RCP and RSH are used for parallel network runs -# replace with similar commands like rsh if needed -RCP=/usr/bin/scp -RSH=/usr/bin/ssh -# - - -MPI_DEFAULT=intelmpi -MPI_OTHER=hpmpi - -MPITYPE=$MPI_DEFAULT - -if test $AUTOFORGE -then - if test $AUTOFORGE = 1 - then - MPITYPE=none - fi -fi - - -# overrule MPITYPE setting with environmental variable MARC_MPITYPE -if test $MARC_MPITYPE -then - MPITYPE=$MARC_MPITYPE -fi - -# always set MPITYPE to none for MD Nastran -if test "$_OEM_NASTRAN" -ne 0 -then - MPITYPE=none -fi - -# Edit following lines to build with GPGPU version of BCS Solver for -# NVIDIA platforms -#BCSGPUSOLVER=NONE -BCSGPUSOLVER=BCSGPU - -SOLVERFLAGS= -if test "$BCSGPUSOLVER" = BCSGPU -then - SOLVERFLAGS="$SOLVERFLAGS -DBCSGPU -DCUDA" - BCS_DIR=bcsgpusolver - export PATH=$MARC_CUDA/bin:$MARC_CUDA/nvvm:$PATH - export LD_LIBRARY_PATH=$MARC_CUDA/lib64:$LD_LIBRARY_PATH -else - BCS_DIR=bcssolver -fi -# -# settings for MPI -# -DDM= -if test $MPITYPE != none -then - if test $MPITYPE = hpmpi - then - FCOMPMPI=mpif90 - export MPI_ROOT=$MARC_HPMPI - export MPI_REMSH=$RSH - export MPI_F77=$FCOMP - ARCHITECTURE=linux_amd64 - DDM="-I$MPI_ROOT/include/64 -DDDM -DHPMPI" - MPI_CLEAN= - export MPI_EPATH=$MARC_BIN - export LD_LIBRARY_PATH=$MPI_ROOT/lib/$ARCHITECTURE:$MARC_LIB:$MARC_LIB_SHARED:$LD_LIBRARY_PATH - export MPIHPSPECIAL="-e MPI_FLAGS=E,T,y1" -# Below line is moved in run_marc file -# export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - export MPIHPSPECIAL="$MPIHPSPECIAL -e BINDIR=$MARC_BIN" - if test -n "$MSC_LICENSE_FILE" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e MSC_LICENSE_FILE=$MSC_LICENSE_FILE" - fi - if test -n "$LM_LICENSE_FILE" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LM_LICENSE_FILE=$LM_LICENSE_FILE" - fi - export MPIHPSPECIAL="$MPIHPSPECIAL -e MPI_LIC_CHECKER=$MPI_ROOT/bin/licensing/amd64_s8/lichk.x" - RUN_JOB2="$MPI_ROOT/bin/mpirun ${MPIRUNOPTIONS} -prot -f " - RUN_JOB1="$MPI_ROOT/bin/mpirun ${MPIRUNOPTIONS} -prot -w $MPIHPSPECIAL -np " - RUN_JOB0= - fi - if test $MPITYPE = intelmpi - then - INTELMPI_VERSION=HYDRA - FCOMPMPI=mpiifort - MPI_ROOT=$MARC_INTELMPI - DDM="-I${MPI_ROOT}/include64 -DDDM" - PATH=$MPI_ROOT/bin64:$PATH - export PATH - LD_LIBRARY_PATH=$MPI_ROOT/lib64:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - if test $INTELMPI_VERSION = HYDRA - then - RUN_JOB1="${MPI_ROOT}/bin64/mpiexec.hydra -genvall -n " - RUN_JOB2="${MPI_ROOT}/bin64/mpiexec.hydra -genvall" - else - RUN_JOB1="${MPI_ROOT}/bin64/mpiexec -n " - RUN_JOB2="${MPI_ROOT}/bin64/mpiexec -configfile " - fi - RUN_JOB0= - MPI_CLEAN= - MPI_EPATH=$MARC_BIN - MPIR_HOME=$MPI_ROOT - MPICH_F77=$FCOMP - MPICH_F77LINKER=$FCOMP - export MPI_ROOT MPI_EPATH MPIR_HOME MPICH_F77 MPICH_F77LINKER - I_MPI_PIN_DOMAIN=node - export I_MPI_PIN_DOMAIN - fi -else - MPI_ROOT=$MARC_DUMMYMPI - export MPI_ROOT=$MARC_DUMMYMPI - DDM="-I$MPI_ROOT/include" -fi - -# -# variables for the "maintain" script -# - -MACHINENAME=LINUX -MACHINE64BIT=yes -MACHINE=Linux_EM64T -DEV=/dev/tape -GETLOG="whoami" -CLEAR="clear" -MY_UNAME=`uname -a` - -# Edit following 2 lines to build with VKI Solver -#VKISOLVER=VKI -VKISOLVER=NONE - -# Edit following 2 lines to build with CASI Solver -CASISOLVER=CASI -#CASISOLVER=NONE - -# Edit following 2 lines to build with MF2 Solver -MF2SOLVER=NONE -#MF2SOLVER=SERIAL -#MF2SOLVER=MF2PARALLEL - -# Edit following lines to build with Intel(c) Multithreaded solver (PARDISO) -#INTELSOLVER=NONE -INTELSOLVER=PARDISO - -# Edit following lines to build with MUMPS -if test "$MARC_INTEGER_SIZE" = "i4" ; then - #MUMPSSOLVER=NONE - MUMPSSOLVER=MUMPS -else - #MUMPSSOLVER=NONE - MUMPSSOLVER=MUMPS -fi - -# Edit following 2 lines to build MARC dynamic shared library -MARC_DLL=MARC_DLL -MARC_DLL=NONE - -# always set VKISOLVER, CASISOLVER, BCSGPUSOLVER, and MARC_DLL to NONE for MD Nastran -if test "$_OEM_NASTRAN" -ne 0 -then - VKISOLVER=NONE - CASISOLVER=NONE - MF2SOLVER=NONE - INTELSOLVER=NONE - MUMPSSOLVER=NONE - BCSGPUSOLVER=NONE - MARC_DLL=NONE -fi - -# -# define Fortran and C compile syntax -# -if test "$VKISOLVER" = VKI -then - SOLVERFLAGS="$SOLVERFLAGS -DVKI" -fi - -if test "$CASISOLVER" = CASI -then - SOLVERFLAGS="$SOLVERFLAGS -DCASI" -fi - -if test "$MF2SOLVER" = MF2PARALLEL -then - SOLVERFLAGS="$SOLVERFLAGS -DMF2PARALLEL" -fi -if test "$MF2SOLVER" = MF2SERIAL -then - SOLVERFLAGS="$SOLVERFLAGS -DMF2SERIAL" -fi - -if test "$INTELSOLVER" = PARDISO -then - SOLVERFLAGS="$SOLVERFLAGS -DPARDISO" -fi - -if test "$MUMPSSOLVER" = MUMPS -then - SOLVERFLAGS="$SOLVERFLAGS -DMUMPS" -fi - - -if test "$MARC_DLL" = MARC_DLL -then - SOLVERFLAGS="$SOLVERFLAGS -DMARC_DLL" -fi - -LINK_OPT= -DEBUG_OPT= -C_DEBUG_OPT= - -#Uncomment following line to build Marc in debuggable mode -MARCDEBUG= -#MARCDEBUG="ON" - -if test "$MARCDEBUG" = "ON" -then - LINK_OPT="-debug -traceback" - DEBUG_OPT="-debug -traceback" - C_DEBUG_OPT="-debug -traceback" -fi - - -MARCCHECK= -#MARCCHECK="ON" -if test "$MARCCHECK" = "ON" -then - DEBUG_OPT="$DEBUG_OPT -fpe0 -fp-stack-check -check all -ftrapuv " - C_DEBUG_OPT="$C_DEBUG_OPT -fp-stack-check -check-uninit -Wformat -ftrapuv " -fi - -MARCCODECOV= -#MARCCODECOV="ON" - -if test "$MARC_INTEGER_SIZE" = "i4" ; then - I8FFLAGS="-real-size 64 -integer-size 32" - I8DEFINES="-DFLOAT=8 -DINT=4" - I8CDEFINES= - I8CASIDEFS= -else - I8FFLAGS="-i8 -real-size 64 -integer-size 64" - I8DEFINES="-DI64 -DFLOAT=8 -DINT=8" - I8CDEFINES="-U_DOUBLE -D_SINGLE" - I8CASIDEFS="-DCASI_64BIT_INT=1" -fi - -MTHREAD=OPENMP -if test "$MARC_OPENMP" = "NONE" ; then - MTHREAD=NONE -fi -#MTHREAD=NONE -if test "$_OEM_NASTRAN" -ne 0 -then -MTHREAD=NONE -fi - -OMP_COMPAT=NO -OMP_COMPAT=YES -if test "$MTHREAD" = "NONE" -then -OMP_COMPAT=NO -fi - -CDEFINES= -FDEFINES= - -if test "$_OEM_NASTRAN" -ne 0 -then - CDEFINES="$CDEFINES -D_OEM_NASTRAN" - FDEFINES="$FDEFINES -D_OEM_NASTRAN" -fi - -FDEFINES="$FDEFINES -D_IMPLICITNONE" - -if test "$_OEM_NASTRAN" -eq 0 -then - FDEFINES="$FDEFINES -DMKL -DOPENMP" -fi - -if test "$OMP_COMPAT" = "YES" -then - FDEFINES="$FDEFINES -DOMP_COMPAT" -fi - -# -D_MSCMARC -FDEFINES="$FDEFINES -D_MSCMARC $DEBUG_OPT" -CDEFINES="$CDEFINES -D_MSCMARC $C_DEBUG_OPT $I8CDEFINES" - -CINCL="-I$MARC_SOURCE/mdsrc -I$MARC_SOURCE/csource $METIS" -if test "$_OEM_NASTRAN" -ne 0 -then - CINCL="$CINCL -I../../include" -fi - -CC="icc -c -O1 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " -CCLOW="icc -c -O0 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " -CCHIGH="icc -c -O3 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " - -if test "$MARCDEBUG" = "ON" -then - CC="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " - CCLOW="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " - CCHIGH="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " -fi - -LOAD_CC="icc -O1 -DLinux -DLINUX -DLinux_intel" -CCT="$CC" -CCTLOW="$CCLOW" -CCTHIGH="$CCHIGH" - -CC_CASI="$CC -c99 $I8CASIDEFS" -CCLOW_CASI="$CCLOW -c99 $I8CASIDEFS" -CCHIGH_CASI="$CCHIGH -c99 $I8CASIDEFS" - -CCT_CASI="$CCT -c99 $I8CASIDEFS" -CCTLOW_CASI="$CCLOW -c99 $I8CASIDEFS" -CCTHIGH_CASI="$CCHIGH -c99 $I8CASIDEFS" - -#PROFILE="-Mprof=func" -#PROFILE="-Mprof=lines" -#PROFILE="-Mprof=func,mpi" -PROFILE= -if test "$MARCCODECOV" = "ON" -then -PROFILE="-prof-gen=srcpos" -fi - -FORT_OPT="-c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr -mp1 -WB" -if test "$MTHREAD" = "OPENMP" -then - FORT_OPT=" $FORT_OPT -openmp" - if test "$OMP_COMPAT" = "YES" - then - FORT_OPT=" $FORT_OPT -openmp-threadprivate=compat" - fi -else -# FORT_OPT=" $FORT_OPT -auto " - FORT_OPT=" $FORT_OPT -save -zero" -fi - -FORTLOW="$FCOMP $FORT_OPT $PROFILE -O0 $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -FORTRAN="$FCOMP $FORT_OPT $PROFILE -O1 $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -FORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -FORTNA="$FCOMP $FORT_OPT -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" - -# determine DAMASK version -HIT=0 -for arg in "$@" -do - if [ $HIT = 1 ] - then - DAMASKPATH=`dirname $arg` - break - elif [ ${arg:0:2} = -u -o ${arg:0:2} = -U ] - then - HIT=1 - fi -done -read DAMASKVERSION < $DAMASKPATH/../VERSION -DAMASKVERSION="'"$DAMASKVERSION"'" - -# DAMASK compiler calls: additional flags are in line 2 OpenMP flags in line 3 -DFORTLOW="$FCOMP $FORT_OPT $PROFILE -O0 $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013.1 -DDAMASKVERSION=$DAMASKVERSION \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -DFORTLOWMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB -O0 $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013.1 -DDAMASKVERSION=$DAMASKVERSION \ - -openmp -openmp_report2 -openmp-threadprivate=compat\ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -DFORTRAN="$FCOMP $FORT_OPT $PROFILE -O1 $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013.1 -DDAMASKVERSION=$DAMASKVERSION \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -DFORTRANMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB -O1 $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013.1 -DDAMASKVERSION=$DAMASKVERSION \ - -openmp -openmp_report2 -openmp-threadprivate=compat\ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -DFORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias -O2 $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013.1 -DDAMASKVERSION=$DAMASKVERSION \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -DFORTHIGHMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB -fno-alias -O2 $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013.1 -DDAMASKVERSION=$DAMASKVERSION \ - -openmp -openmp_report2 -openmp-threadprivate=compat\ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - -if test "$MARCDEBUG" = "ON" -then - FORTLOW="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - FORTRAN="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - FORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - FORTNA="$FCOMP $FORT_OPT -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" - -# DAMASK compiler calls: additional flags are in line 2 OpenMP flags in line 3 - DFORTLOW="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013.1 -DDAMASKVERSION=$DAMASKVERSION \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - DFORTLOWMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013.1 -DDAMASKVERSION=$DAMASKVERSION \ - -openmp -openmp_report2 -openmp-threadprivate=compat\ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - DFORTRAN="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013.1 -DDAMASKVERSION=$DAMASKVERSION \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - DFORTRANMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013.1 -DDAMASKVERSION=$DAMASKVERSION \ - -openmp -openmp_report2 -openmp-threadprivate=compat\ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - DFORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013.1 -DDAMASKVERSION=$DAMASKVERSION \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - DFORTHIGHMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013.1 -DDAMASKVERSION=$DAMASKVERSION \ - -openmp -openmp_report2 -openmp-threadprivate=compat\ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - -fi - -FORTLOWT="$FORTLOW" -FORTRANT="$FORTRAN" -FORTHIGHT="$FORTHIGH" - -FORTRANMNF="$FCOMP -c $FDEFINES " -CCMNF="icc -c -O1 -DLinux -DLINUX -DLinux_intel -Dport2egcs -I$MARC_SOURCE/marctoadams/mnf/include -D_LARGEFILE64_SOURCE" - -FORTRANMUMPS="$FCOMP -fpp $FORT_OPT $PROFILE -fno-alias -O1 -fp-model precise $FDEFINES -D_IMPLICITNONE $I8FFLAGS $I8DEFINES $DDM -I$MARC_SOURCE/mumpssolver/include -Dintel_ -DALLOW_NON_INIT -Dmetis -nofor_main" -CCMUMPS="icc -c -DAdd_ -Dmetis -I$MARC_SOURCE/mumpssolver/include" - - -BCSCC="icc -c -O3 -DLOWERCASE_ -I${MARC_SOURCE}/${BCS_DIR}/bcslib_csrc $CDEFINES $CINCL" -NVCC="nvcc -c -O3 -arch sm_20 -DLOWERCASE_ -I${MARC_SOURCE}/${BCS_DIR}/bcslib_cuda/include -I${MARC_CUDA}/include -I$MARC_SOURCE/mdsrc $I8DEFINES -Xcompiler -fvisibility=hidden -Xcompiler -fPIC $I8DEFINES " -NVCCLIB="ar rvl" -NVCCLD=icc -BCSFORTLOW="$FORTLOW -I${MARC_SOURCE}/${BCS_DIR}/common" -BCSFORTRAN="$FORTRAN -I${MARC_SOURCE}/${BCS_DIR}/common" -BCSFORTHIGH="$FORTHIGH -I${MARC_SOURCE}/${BCS_DIR}/common" -BCSFORT90HIGH="$BCSFORTHIGH" -if test "$MARCDEBUG" = "ON" -then - BCSFORTRAN=$BCSFORTLOW - BCSFORTHIGH=$BCSFORTLOW - BCSFORT90HIGH=$BCSFORTLOW -fi - -if test $MPITYPE != none -then - if test $MPITYPE = hpmpi - then - LOAD="$MPI_ROOT/bin/$FCOMPMPI ${LOADOPTIONS} -L$MPI_ROOT/lib/$ARCHITECTURE $PROFILE $LINK_OPT -o " - LOADT="$MPI_ROOT/bin/$FCOMPMPI ${LOADOPTIONS} -L$MPI_ROOT/lib/$ARCHITECTURE $PROFILE $LINK_OPT -o " - fi -# Uncomment the following lines to turn on the tracer and commnet out the next 5 lines -# if test $MPITYPE = intelmpi -# then -# INCLUDEMPI="-I$MPI_ROOT/include64 -I$VT_ROOT/include" -# LOAD="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " -# LOADT="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " -# fi - if test $MPITYPE = intelmpi - then - LOAD="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $LINK_OPT -o " - LOADT="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $LINK_OPT -o " - fi -else - LOAD="$FCOMP $LINK_OPT -o " - LOADT="$FCOMP $LINK_OPT -o " -fi - -if test "$MARC_DLL" = MARC_DLL -then - FORTLOW="$FORTLOW -fpp -fPIC" - FORTRAN="$FORTRAN -fpp -fPIC" - FORTHIGH="$FORTHIGH -fpp -fPIC" - FORTRANMNF="$FORTRANMNF -fpp -fPIC" - CC="$CC -fPIC" - CCMNF="$CCMNF -fPIC" - CC_CASI="$CC_CASI -fPIC" - CCLOW_CASI="$CCLOW_CASI -fPIC" - CCHIGH_CASI="$CCHIGH_CASI -fPIC" - LINK_EXE_MARC="-L$MARC_LIB -lmarc -L$MARC_LIB_SHARED -lguide -lpthread" - LINK_MARC_DLL="-shared -fPIC" - LOAD_DLL=$LOAD - LOADT_DLL=$LOADT - EXT_DLL="so" -fi - - -XLIBS="-L/usr/X11/lib -lX11 " - -# -# define archive and ranlib syntax -# - -ARC="ar rvl" -ARD="ar dvl" -ARX="ar xl" -RAN="" - -# -# choose which libraries you want to use ( e.g. blas ) -# - -if test "$VKISOLVER" = VKI -then - VKISOLVERLIBS="$MARC_LIB/vkisolver.a" -else - VKISOLVERLIBS= -fi - -if test "$CASISOLVER" = CASI -then - CASISOLVERLIBS="$MARC_LIB/casilib.a" -else - CASISOLVERLIBS= -fi - -MF2SOLVERLIBS= -if test "$MF2SOLVER" = MF2PARALLEL -then - MF2SOLVERLIBS="$MARC_LIB/mf2parallel/libseq.a \ - $MARC_LIB/mf2parallel/libsym.a \ - $MARC_LIB/mf2parallel/libmet.a \ - $MARC_LIB/mf2parallel/libmf2.a \ - $MARC_LIB/mf2parallel/libgauss.a \ - $MARC_LIB/mf2parallel/libmf2.a \ - $MARC_LIB/mf2parallel/libgauss.a \ - $MARC_LIB/mf2parallel/libnum.a \ - $MARC_LIB/mf2parallel/libutl.a \ - $MARC_LIB/mf2parallel/libr8.a \ - $MARC_LIB/mf2parallel/libz.a " -fi - -if test "$INTELSOLVER" = PARDISO -then - if test "$MARC_INTEGER_SIZE" = "i4" ; then - INTELSOLVERLIBS="$MARC_MKL/libmkl_solver_lp64.a" - else - INTELSOLVERLIBS="$MARC_MKL/libmkl_solver_ilp64.a" - fi -else - INTELSOLVERLIBS= -fi - -if test "$MUMPSSOLVER" = MUMPS -then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - if test $MPITYPE = none - then - MUMPSSOLVERLIBS2= - echo hello > /dev/null - fi - if test $MPITYPE = intelmpi - then - if test "$MARC_INTEGER_SIZE" = "i4" ; then - MUMPSSOLVERLIBS2=" -lmkl_blacs_intelmpi_lp64" - else - MUMPSSOLVERLIBS2=" -lmkl_blacs_intelmpi_ilp64" - fi - fi - if test $MPITYPE = hpmpi - then - if test "$MARC_INTEGER_SIZE" = "i4" ; then - MUMPSSOLVERLIBS2=" -lmkl_blacs_lp64" - else - MUMPSSOLVERLIBS2=" -lmkl_blacs_ilp64" - fi - fi -else - MUMPSSOLVERLIBS= - MUMPSSOLVERLIBS2= -fi - -if test "$BCSGPUSOLVER" = BCSGPU -then - BCSSOLVERLIBS="${MARC_LIB}/bcsgpulib.a " - MARCCUDALIBS1="-L${MARC_LIB}/cuda_dummy -lmarccuda " - MARCCUDALIBS2="-L${MARC_LIB}/cuda -lmarccuda " - MARCCUDALIBS=$MARCCUDALIBS1 - CUDALIBS="-L$MARC_CUDA/lib64 -lcudart -lcublas -L/usr/lib64 -lcuda " -else - BCSSOLVERLIBS="${MARC_LIB}/bcslib.a " -fi - -if test "$MARC_INTEGER_SIZE" = "i4" ; then - MKLLIB="$MARC_MKL/libmkl_blacs_lp64.a -L$MARC_MKL -lmkl_scalapack_lp64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core " -else - MKLLIB="$MARC_MKL/libmkl_blacs_ilp64.a -L$MARC_MKL -lmkl_scalapack_ilp64 -lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core " -fi - -SECLIBS="-L$MARC_LIB -llapi" - -SOLVERLIBS="${BCSSOLVERLIBS} \ - ${INTELSOLVERLIBS} ${MF2SOLVERLIBS} -Wl,--start-group $MKLLIB ${MUMPSSOLVERLIBS2} \ - -liomp5 -Wl,--end-group \ - $MARC_LIB/blas_src.a ${VKISOLVERLIBS} ${CASISOLVERLIBS} " -SOLVERLIBS_DLL=${SOLVERLIBS} - -MRCLIBS="$MARC_LIB/clib.a ${CASISOLVERLIBS}" -MRCLIBSPAR="$MARC_LIB/clib.a" -STUBS="$MARC_LIB/stubs.a " -MNFLIBS="$MARC_LIB/libmnf.a" -MDUSER="$MARC_LIB/md_user.a" - -OPENMP="-openmp" - -SYSLIBS=" $OPENMP -lpthread " - -# Uncomment the following lines to turn on the trace and comment out the next 4 lines -# if test $MPITYPE = intelmpi -# then -# SYSLIBS="-L${VT_ROOT}/lib -lVT -ldwarf -lelf -lm -lpthread \ -# -L${MPI_ROOT}/lib64 -lmpi -lmpiif -lmpigi -lrt" -# fi -if test $MPITYPE = intelmpi -then - SYSLIBS="-L${MPI_ROOT}/lib64 -lmpi -lmpiif -lmpigi -lrt $OPENMP -threads -lpthread" -fi - -SYSLIBSPAR=" " - -MARC_DLL_CODES="runmarc.f" - - -BLAS_SRC="dzero.f icopy.f izero.f" -if test "$_OEM_NASTRAN" -ne 0 -then - if test "$MARC_INTEGER_SIZE" = "i4" ; then - BLAS_SRC="$BLAS_SRC dsctr.f zsctr.f dzasum.f daxpyi.f zaxpyi.f dgthr.f zgthr.f" - else - BLAS_SRC="ALL" - fi -fi - -LOW_OPT_CODES="are163.f contro.f ndext.f omarc.f omarca.f omarcb.f omarcc.f \ - omars.f fixbc.f triang.f bet049.f norst3.f eldata.f \ - elec*.f elct*.f fmeig.f oada00.f ogeig.f updtrbe2.f cycrota.f \ - cordef.f ogpk.f ogtan.f eldam.f formrbe3.f \ - inertie.f em_sso072.f cn_fol3d_qpatch6.f" -if test "$MARC_INTEGER_SIZE" = "i8" ; then - LOW_OPT_CODES="$LOW_OPT_CODES bbcseg.f" -fi -LOW_OPT_CODES_CASI="" - -HIGH_OPT_CODES="dpsmsa1.f dpsmsa2.f dpsmsa3.f dpsmsa4.f dpsmsa5.f dpsmsa6.f \ - dpsmsa7.f dpsmsa8.f dpsmsa9.f dpsmsa10.f dpsmsa11.f dpsmsa12.f \ - dpsmsa13.f dpsmsa14.f dpsmsa15.f dpsmsa16.f " - - -HIGH_OPT_CODES_CASI="arithkernels.c blockedroutines.c blockedroutines_fd.c elemmatgenkernels.c longvecroutines.c sfmultutils.c solvewithbd.c" - -MAXNUM=1000000 diff --git a/installation/mods_MarcMentat/2013.1/Marc_tools/include_linux64.original b/installation/mods_MarcMentat/2013.1/Marc_tools/include_linux64.original deleted file mode 100644 index d76bd3df6..000000000 --- a/installation/mods_MarcMentat/2013.1/Marc_tools/include_linux64.original +++ /dev/null @@ -1,679 +0,0 @@ -# -# General definitions for the Marc 2011 version -# -# EM64T -# ( LP64 - i4 version) -# (ILP64 - i8 version) -# -# Linux RedHat 5.4 -# -# 64 bit MPI version -# -# Intel(R) Fortran Compiler -# Version 12.0.4 -# -# Intel(R) C Compiler -# Version 12.0.4 -# -# DATE -# -# To check the O/S level, type: -# uname -a -# -# Distributed parallel MPI libraries: -# 1) HP MPI 2.3 -# To check the mpi version, type: -# mpirun -version -# 2) Intel MPI 4.0.1.007 -# To check the mpi version, type: -# mpirun -version -# -# MKL Libraries: -# Intel(R) MKL 10.3.0.084 -# -# To check the Compiler level, type using the compiler -# installation path: -# ifort -V -# icc -V -# -# REMARKS : This file contains the definitions of variables used during -# compilation loading and use of the MARC programmes . The -# current machine type is identified by means of the variable -# MACHINE , defined below. -# -# -# MPI_ROOT: root directory in which mpi shared libraries, etc. are located -# DIRJOB : directory in which spawned jobs should look for Marc input -# MPI_ARCH: system architecture -# MPI_EPATH: path where executable resides -# - -REVISION="VERSION, BUILD" -HOSTNAME=`hostname` - -# find available memory in Mbyte on the machine -# can be set explicitly -MEMLIMIT=`free -m | awk '/Mem:/ {print $2}'` - -# set _OEM_NASTRAN to 1 for MD Nastran build -# override _OEM_NASTRAN setting with MARC_MD_NASTRAN environment variable -_OEM_NASTRAN="${MARC_MD_NASTRAN:-0}" - -# uncomment the following line for an autoforge build -#AUTOFORGE=1 -AUTOFORGE=0 -export AUTOFORGE - -# integer size -if test "$MARC_INTEGER_SIZE" = "" ; then - INTEGER_PATH= -else - INTEGER_PATH=/$MARC_INTEGER_SIZE -fi - -FCOMP=ifort - -# -# settings for Metis -# -METIS="-I$METIS_SOURCE" -METISLIBS="$MARC_LIB/metis.a " - -# -# settings for MPI -# -# RCP and RSH are used for parallel network runs -# replace with similar commands like rsh if needed -RCP=/usr/bin/scp -RSH=/usr/bin/ssh -# - - -MPI_DEFAULT=intelmpi -MPI_OTHER=hpmpi - -MPITYPE=$MPI_DEFAULT - -if test $AUTOFORGE -then - if test $AUTOFORGE = 1 - then - MPITYPE=none - fi -fi - - -# overrule MPITYPE setting with environmental variable MARC_MPITYPE -if test $MARC_MPITYPE -then - MPITYPE=$MARC_MPITYPE -fi - -# always set MPITYPE to none for MD Nastran -if test "$_OEM_NASTRAN" -ne 0 -then - MPITYPE=none -fi - -# Edit following lines to build with GPGPU version of BCS Solver for -# NVIDIA platforms -#BCSGPUSOLVER=NONE -BCSGPUSOLVER=BCSGPU - -SOLVERFLAGS= -if test "$BCSGPUSOLVER" = BCSGPU -then - SOLVERFLAGS="$SOLVERFLAGS -DBCSGPU -DCUDA" - BCS_DIR=bcsgpusolver - export PATH=$MARC_CUDA/bin:$MARC_CUDA/nvvm:$PATH - export LD_LIBRARY_PATH=$MARC_CUDA/lib64:$LD_LIBRARY_PATH -else - BCS_DIR=bcssolver -fi -# -# settings for MPI -# -DDM= -if test $MPITYPE != none -then - if test $MPITYPE = hpmpi - then - FCOMPMPI=mpif90 - export MPI_ROOT=$MARC_HPMPI - export MPI_REMSH=$RSH - export MPI_F77=$FCOMP - ARCHITECTURE=linux_amd64 - DDM="-I$MPI_ROOT/include/64 -DDDM -DHPMPI" - MPI_CLEAN= - export MPI_EPATH=$MARC_BIN - export LD_LIBRARY_PATH=$MPI_ROOT/lib/$ARCHITECTURE:$MARC_LIB:$MARC_LIB_SHARED:$LD_LIBRARY_PATH - export MPIHPSPECIAL="-e MPI_FLAGS=E,T,y1" -# Below line is moved in run_marc file -# export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - export MPIHPSPECIAL="$MPIHPSPECIAL -e BINDIR=$MARC_BIN" - if test -n "$MSC_LICENSE_FILE" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e MSC_LICENSE_FILE=$MSC_LICENSE_FILE" - fi - if test -n "$LM_LICENSE_FILE" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LM_LICENSE_FILE=$LM_LICENSE_FILE" - fi - export MPIHPSPECIAL="$MPIHPSPECIAL -e MPI_LIC_CHECKER=$MPI_ROOT/bin/licensing/amd64_s8/lichk.x" - RUN_JOB2="$MPI_ROOT/bin/mpirun ${MPIRUNOPTIONS} -prot -f " - RUN_JOB1="$MPI_ROOT/bin/mpirun ${MPIRUNOPTIONS} -prot -w $MPIHPSPECIAL -np " - RUN_JOB0= - fi - if test $MPITYPE = intelmpi - then - INTELMPI_VERSION=HYDRA - FCOMPMPI=mpiifort - MPI_ROOT=$MARC_INTELMPI - DDM="-I${MPI_ROOT}/include64 -DDDM" - PATH=$MPI_ROOT/bin64:$PATH - export PATH - LD_LIBRARY_PATH=$MPI_ROOT/lib64:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - if test $INTELMPI_VERSION = HYDRA - then - RUN_JOB1="${MPI_ROOT}/bin64/mpiexec.hydra -genvall -n " - RUN_JOB2="${MPI_ROOT}/bin64/mpiexec.hydra -genvall" - else - RUN_JOB1="${MPI_ROOT}/bin64/mpiexec -n " - RUN_JOB2="${MPI_ROOT}/bin64/mpiexec -configfile " - fi - RUN_JOB0= - MPI_CLEAN= - MPI_EPATH=$MARC_BIN - MPIR_HOME=$MPI_ROOT - MPICH_F77=$FCOMP - MPICH_F77LINKER=$FCOMP - export MPI_ROOT MPI_EPATH MPIR_HOME MPICH_F77 MPICH_F77LINKER - I_MPI_PIN_DOMAIN=node - export I_MPI_PIN_DOMAIN - fi -else - MPI_ROOT=$MARC_DUMMYMPI - export MPI_ROOT=$MARC_DUMMYMPI - DDM="-I$MPI_ROOT/include" -fi - -# -# variables for the "maintain" script -# - -MACHINENAME=LINUX -MACHINE64BIT=yes -MACHINE=Linux_EM64T -DEV=/dev/tape -GETLOG="whoami" -CLEAR="clear" -MY_UNAME=`uname -a` - -# Edit following 2 lines to build with VKI Solver -#VKISOLVER=VKI -VKISOLVER=NONE - -# Edit following 2 lines to build with CASI Solver -CASISOLVER=CASI -#CASISOLVER=NONE - -# Edit following 2 lines to build with MF2 Solver -MF2SOLVER=NONE -#MF2SOLVER=SERIAL -#MF2SOLVER=MF2PARALLEL - -# Edit following lines to build with Intel(c) Multithreaded solver (PARDISO) -#INTELSOLVER=NONE -INTELSOLVER=PARDISO - -# Edit following lines to build with MUMPS -if test "$MARC_INTEGER_SIZE" = "i4" ; then - #MUMPSSOLVER=NONE - MUMPSSOLVER=MUMPS -else - #MUMPSSOLVER=NONE - MUMPSSOLVER=MUMPS -fi - -# Edit following 2 lines to build MARC dynamic shared library -MARC_DLL=MARC_DLL -MARC_DLL=NONE - -# always set VKISOLVER, CASISOLVER, BCSGPUSOLVER, and MARC_DLL to NONE for MD Nastran -if test "$_OEM_NASTRAN" -ne 0 -then - VKISOLVER=NONE - CASISOLVER=NONE - MF2SOLVER=NONE - INTELSOLVER=NONE - MUMPSSOLVER=NONE - BCSGPUSOLVER=NONE - MARC_DLL=NONE -fi - -# -# define Fortran and C compile syntax -# -if test "$VKISOLVER" = VKI -then - SOLVERFLAGS="$SOLVERFLAGS -DVKI" -fi - -if test "$CASISOLVER" = CASI -then - SOLVERFLAGS="$SOLVERFLAGS -DCASI" -fi - -if test "$MF2SOLVER" = MF2PARALLEL -then - SOLVERFLAGS="$SOLVERFLAGS -DMF2PARALLEL" -fi -if test "$MF2SOLVER" = MF2SERIAL -then - SOLVERFLAGS="$SOLVERFLAGS -DMF2SERIAL" -fi - -if test "$INTELSOLVER" = PARDISO -then - SOLVERFLAGS="$SOLVERFLAGS -DPARDISO" -fi - -if test "$MUMPSSOLVER" = MUMPS -then - SOLVERFLAGS="$SOLVERFLAGS -DMUMPS" -fi - - -if test "$MARC_DLL" = MARC_DLL -then - SOLVERFLAGS="$SOLVERFLAGS -DMARC_DLL" -fi - -LINK_OPT= -DEBUG_OPT= -C_DEBUG_OPT= - -#Uncomment following line to build Marc in debuggable mode -MARCDEBUG= -#MARCDEBUG="ON" - -if test "$MARCDEBUG" = "ON" -then - LINK_OPT="-debug -traceback" - DEBUG_OPT="-debug -traceback" - C_DEBUG_OPT="-debug -traceback" -fi - - -MARCCHECK= -#MARCCHECK="ON" -if test "$MARCCHECK" = "ON" -then - DEBUG_OPT="$DEBUG_OPT -fpe0 -fp-stack-check -check all -ftrapuv " - C_DEBUG_OPT="$C_DEBUG_OPT -fp-stack-check -check-uninit -Wformat -ftrapuv " -fi - -MARCCODECOV= -#MARCCODECOV="ON" - -if test "$MARC_INTEGER_SIZE" = "i4" ; then - I8FFLAGS= - I8DEFINES= - I8CDEFINES= - I8CASIDEFS= -else - I8FFLAGS="-i8" - I8DEFINES="-DI64" - I8CDEFINES="-U_DOUBLE -D_SINGLE" - I8CASIDEFS="-DCASI_64BIT_INT=1" -fi - -MTHREAD=OPENMP -if test "$MARC_OPENMP" = "NONE" ; then - MTHREAD=NONE -fi -#MTHREAD=NONE -if test "$_OEM_NASTRAN" -ne 0 -then -MTHREAD=NONE -fi - -OMP_COMPAT=NO -OMP_COMPAT=YES -if test "$MTHREAD" = "NONE" -then -OMP_COMPAT=NO -fi - -CDEFINES= -FDEFINES= - -if test "$_OEM_NASTRAN" -ne 0 -then - CDEFINES="$CDEFINES -D_OEM_NASTRAN" - FDEFINES="$FDEFINES -D_OEM_NASTRAN" -fi - -FDEFINES="$FDEFINES -D_IMPLICITNONE" - -if test "$_OEM_NASTRAN" -eq 0 -then - FDEFINES="$FDEFINES -DMKL -DOPENMP" -fi - -if test "$OMP_COMPAT" = "YES" -then - FDEFINES="$FDEFINES -DOMP_COMPAT" -fi - -# -D_MSCMARC -FDEFINES="$FDEFINES -D_MSCMARC $DEBUG_OPT" -CDEFINES="$CDEFINES -D_MSCMARC $C_DEBUG_OPT $I8CDEFINES" - -CINCL="-I$MARC_SOURCE/mdsrc -I$MARC_SOURCE/csource $METIS" -if test "$_OEM_NASTRAN" -ne 0 -then - CINCL="$CINCL -I../../include" -fi - -CC="icc -c -O1 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " -CCLOW="icc -c -O0 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " -CCHIGH="icc -c -O3 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " - -if test "$MARCDEBUG" = "ON" -then - CC="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " - CCLOW="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " - CCHIGH="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " -fi - -LOAD_CC="icc -O1 -DLinux -DLINUX -DLinux_intel" -CCT="$CC" -CCTLOW="$CCLOW" -CCTHIGH="$CCHIGH" - -CC_CASI="$CC -c99 $I8CASIDEFS" -CCLOW_CASI="$CCLOW -c99 $I8CASIDEFS" -CCHIGH_CASI="$CCHIGH -c99 $I8CASIDEFS" - -CCT_CASI="$CCT -c99 $I8CASIDEFS" -CCTLOW_CASI="$CCLOW -c99 $I8CASIDEFS" -CCTHIGH_CASI="$CCHIGH -c99 $I8CASIDEFS" - -#PROFILE="-Mprof=func" -#PROFILE="-Mprof=lines" -#PROFILE="-Mprof=func,mpi" -PROFILE= -if test "$MARCCODECOV" = "ON" -then -PROFILE="-prof-gen=srcpos" -fi - -FORT_OPT="-c -assume byterecl -safe_cray_ptr -mp1 -WB" -if test "$MTHREAD" = "OPENMP" -then - FORT_OPT=" $FORT_OPT -openmp" - if test "$OMP_COMPAT" = "YES" - then - FORT_OPT=" $FORT_OPT -openmp-threadprivate=compat" - fi -else -# FORT_OPT=" $FORT_OPT -auto " - FORT_OPT=" $FORT_OPT -save -zero" -fi - -FORTLOW="$FCOMP $FORT_OPT $PROFILE -O0 $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -FORTRAN="$FCOMP $FORT_OPT $PROFILE -O1 $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -FORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -FORTNA="$FCOMP $FORT_OPT -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" - -if test "$MARCDEBUG" = "ON" -then - FORTLOW="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - FORTRAN="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - FORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - FORTNA="$FCOMP $FORT_OPT -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" -fi - -FORTLOWT="$FORTLOW" -FORTRANT="$FORTRAN" -FORTHIGHT="$FORTHIGH" - -FORTRANMNF="$FCOMP -c $FDEFINES " -CCMNF="icc -c -O1 -DLinux -DLINUX -DLinux_intel -Dport2egcs -I$MARC_SOURCE/marctoadams/mnf/include -D_LARGEFILE64_SOURCE" - -FORTRANMUMPS="$FCOMP -fpp $FORT_OPT $PROFILE -fno-alias -O1 -fp-model precise $FDEFINES -D_IMPLICITNONE $I8FFLAGS $I8DEFINES $DDM -I$MARC_SOURCE/mumpssolver/include -Dintel_ -DALLOW_NON_INIT -Dmetis -nofor_main" -CCMUMPS="icc -c -DAdd_ -Dmetis -I$MARC_SOURCE/mumpssolver/include" - - -BCSCC="icc -c -O3 -DLOWERCASE_ -I${MARC_SOURCE}/${BCS_DIR}/bcslib_csrc $CDEFINES $CINCL" -NVCC="nvcc -c -O3 -arch sm_20 -DLOWERCASE_ -I${MARC_SOURCE}/${BCS_DIR}/bcslib_cuda/include -I${MARC_CUDA}/include -I$MARC_SOURCE/mdsrc $I8DEFINES -Xcompiler -fvisibility=hidden -Xcompiler -fPIC $I8DEFINES " -NVCCLIB="ar rvl" -NVCCLD=icc -BCSFORTLOW="$FORTLOW -I${MARC_SOURCE}/${BCS_DIR}/common" -BCSFORTRAN="$FORTRAN -I${MARC_SOURCE}/${BCS_DIR}/common" -BCSFORTHIGH="$FORTHIGH -I${MARC_SOURCE}/${BCS_DIR}/common" -BCSFORT90HIGH="$BCSFORTHIGH" -if test "$MARCDEBUG" = "ON" -then - BCSFORTRAN=$BCSFORTLOW - BCSFORTHIGH=$BCSFORTLOW - BCSFORT90HIGH=$BCSFORTLOW -fi - -if test $MPITYPE != none -then - if test $MPITYPE = hpmpi - then - LOAD="$MPI_ROOT/bin/$FCOMPMPI ${LOADOPTIONS} -L$MPI_ROOT/lib/$ARCHITECTURE $PROFILE $LINK_OPT -o " - LOADT="$MPI_ROOT/bin/$FCOMPMPI ${LOADOPTIONS} -L$MPI_ROOT/lib/$ARCHITECTURE $PROFILE $LINK_OPT -o " - fi -# Uncomment the following lines to turn on the tracer and commnet out the next 5 lines -# if test $MPITYPE = intelmpi -# then -# INCLUDEMPI="-I$MPI_ROOT/include64 -I$VT_ROOT/include" -# LOAD="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " -# LOADT="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " -# fi - if test $MPITYPE = intelmpi - then - LOAD="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $LINK_OPT -o " - LOADT="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $LINK_OPT -o " - fi -else - LOAD="$FCOMP $LINK_OPT -o " - LOADT="$FCOMP $LINK_OPT -o " -fi - -if test "$MARC_DLL" = MARC_DLL -then - FORTLOW="$FORTLOW -fpp -fPIC" - FORTRAN="$FORTRAN -fpp -fPIC" - FORTHIGH="$FORTHIGH -fpp -fPIC" - FORTRANMNF="$FORTRANMNF -fpp -fPIC" - CC="$CC -fPIC" - CCMNF="$CCMNF -fPIC" - CC_CASI="$CC_CASI -fPIC" - CCLOW_CASI="$CCLOW_CASI -fPIC" - CCHIGH_CASI="$CCHIGH_CASI -fPIC" - LINK_EXE_MARC="-L$MARC_LIB -lmarc -L$MARC_LIB_SHARED -lguide -lpthread" - LINK_MARC_DLL="-shared -fPIC" - LOAD_DLL=$LOAD - LOADT_DLL=$LOADT - EXT_DLL="so" -fi - - -XLIBS="-L/usr/X11/lib -lX11 " - -# -# define archive and ranlib syntax -# - -ARC="ar rvl" -ARD="ar dvl" -ARX="ar xl" -RAN="" - -# -# choose which libraries you want to use ( e.g. blas ) -# - -if test "$VKISOLVER" = VKI -then - VKISOLVERLIBS="$MARC_LIB/vkisolver.a" -else - VKISOLVERLIBS= -fi - -if test "$CASISOLVER" = CASI -then - CASISOLVERLIBS="$MARC_LIB/casilib.a" -else - CASISOLVERLIBS= -fi - -MF2SOLVERLIBS= -if test "$MF2SOLVER" = MF2PARALLEL -then - MF2SOLVERLIBS="$MARC_LIB/mf2parallel/libseq.a \ - $MARC_LIB/mf2parallel/libsym.a \ - $MARC_LIB/mf2parallel/libmet.a \ - $MARC_LIB/mf2parallel/libmf2.a \ - $MARC_LIB/mf2parallel/libgauss.a \ - $MARC_LIB/mf2parallel/libmf2.a \ - $MARC_LIB/mf2parallel/libgauss.a \ - $MARC_LIB/mf2parallel/libnum.a \ - $MARC_LIB/mf2parallel/libutl.a \ - $MARC_LIB/mf2parallel/libr8.a \ - $MARC_LIB/mf2parallel/libz.a " -fi - -if test "$INTELSOLVER" = PARDISO -then - if test "$MARC_INTEGER_SIZE" = "i4" ; then - INTELSOLVERLIBS="$MARC_MKL/libmkl_solver_lp64.a" - else - INTELSOLVERLIBS="$MARC_MKL/libmkl_solver_ilp64.a" - fi -else - INTELSOLVERLIBS= -fi - -if test "$MUMPSSOLVER" = MUMPS -then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - if test $MPITYPE = none - then - MUMPSSOLVERLIBS2= - echo hello > /dev/null - fi - if test $MPITYPE = intelmpi - then - if test "$MARC_INTEGER_SIZE" = "i4" ; then - MUMPSSOLVERLIBS2=" -lmkl_blacs_intelmpi_lp64" - else - MUMPSSOLVERLIBS2=" -lmkl_blacs_intelmpi_ilp64" - fi - fi - if test $MPITYPE = hpmpi - then - if test "$MARC_INTEGER_SIZE" = "i4" ; then - MUMPSSOLVERLIBS2=" -lmkl_blacs_lp64" - else - MUMPSSOLVERLIBS2=" -lmkl_blacs_ilp64" - fi - fi -else - MUMPSSOLVERLIBS= - MUMPSSOLVERLIBS2= -fi - -if test "$BCSGPUSOLVER" = BCSGPU -then - BCSSOLVERLIBS="${MARC_LIB}/bcsgpulib.a " - MARCCUDALIBS1="-L${MARC_LIB}/cuda_dummy -lmarccuda " - MARCCUDALIBS2="-L${MARC_LIB}/cuda -lmarccuda " - MARCCUDALIBS=$MARCCUDALIBS1 - CUDALIBS="-L$MARC_CUDA/lib64 -lcudart -lcublas -L/usr/lib64 -lcuda " -else - BCSSOLVERLIBS="${MARC_LIB}/bcslib.a " -fi - -if test "$MARC_INTEGER_SIZE" = "i4" ; then - MKLLIB="$MARC_MKL/libmkl_blacs_lp64.a -L$MARC_MKL -lmkl_scalapack_lp64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core " -else - MKLLIB="$MARC_MKL/libmkl_blacs_ilp64.a -L$MARC_MKL -lmkl_scalapack_ilp64 -lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core " -fi - -SECLIBS="-L$MARC_LIB -llapi" - -SOLVERLIBS="${BCSSOLVERLIBS} \ - ${INTELSOLVERLIBS} ${MF2SOLVERLIBS} -Wl,--start-group $MKLLIB ${MUMPSSOLVERLIBS2} \ - -liomp5 -Wl,--end-group \ - $MARC_LIB/blas_src.a ${VKISOLVERLIBS} ${CASISOLVERLIBS} " -SOLVERLIBS_DLL=${SOLVERLIBS} - -MRCLIBS="$MARC_LIB/clib.a ${CASISOLVERLIBS}" -MRCLIBSPAR="$MARC_LIB/clib.a" -STUBS="$MARC_LIB/stubs.a " -MNFLIBS="$MARC_LIB/libmnf.a" -MDUSER="$MARC_LIB/md_user.a" - -OPENMP="-openmp" - -SYSLIBS=" $OPENMP -lpthread " - -# Uncomment the following lines to turn on the trace and comment out the next 4 lines -# if test $MPITYPE = intelmpi -# then -# SYSLIBS="-L${VT_ROOT}/lib -lVT -ldwarf -lelf -lm -lpthread \ -# -L${MPI_ROOT}/lib64 -lmpi -lmpiif -lmpigi -lrt" -# fi -if test $MPITYPE = intelmpi -then - SYSLIBS="-L${MPI_ROOT}/lib64 -lmpi -lmpiif -lmpigi -lrt $OPENMP -threads -lpthread" -fi - -SYSLIBSPAR=" " - -MARC_DLL_CODES="runmarc.f" - - -BLAS_SRC="dzero.f icopy.f izero.f" -if test "$_OEM_NASTRAN" -ne 0 -then - if test "$MARC_INTEGER_SIZE" = "i4" ; then - BLAS_SRC="$BLAS_SRC dsctr.f zsctr.f dzasum.f daxpyi.f zaxpyi.f dgthr.f zgthr.f" - else - BLAS_SRC="ALL" - fi -fi - -LOW_OPT_CODES="are163.f contro.f ndext.f omarc.f omarca.f omarcb.f omarcc.f \ - omars.f fixbc.f triang.f bet049.f norst3.f eldata.f \ - elec*.f elct*.f fmeig.f oada00.f ogeig.f updtrbe2.f cycrota.f \ - cordef.f ogpk.f ogtan.f eldam.f formrbe3.f \ - inertie.f em_sso072.f cn_fol3d_qpatch6.f" -if test "$MARC_INTEGER_SIZE" = "i8" ; then - LOW_OPT_CODES="$LOW_OPT_CODES bbcseg.f" -fi -LOW_OPT_CODES_CASI="" - -HIGH_OPT_CODES="dpsmsa1.f dpsmsa2.f dpsmsa3.f dpsmsa4.f dpsmsa5.f dpsmsa6.f \ - dpsmsa7.f dpsmsa8.f dpsmsa9.f dpsmsa10.f dpsmsa11.f dpsmsa12.f \ - dpsmsa13.f dpsmsa14.f dpsmsa15.f dpsmsa16.f " - - -HIGH_OPT_CODES_CASI="arithkernels.c blockedroutines.c blockedroutines_fd.c elemmatgenkernels.c longvecroutines.c sfmultutils.c solvewithbd.c" - -MAXNUM=1000000 diff --git a/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask b/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask deleted file mode 100644 index 2f1948048..000000000 --- a/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask +++ /dev/null @@ -1,4053 +0,0 @@ -#!/bin/ksh -############################################################################## -# # -# run_marc - run a marc job # -# ------------------------- # -# # -# usage: run_marc -j jid { options } # -# # -# where standard options are: required: defaults: # -# -------------------------- # -# # -# -j* jid job id number. ** YES ** . # -# -pr* prog program name. . marc # -# -v* y|n do or do not verify inputs. . yes # -# -q* s|l|v|b|f batch queue name or background, . short # -# foreground. # -# -b* as alternative to option -q* # -# # -# ( batch queues only : # -# -pq* intra queue priority. . . # -# -at DATE/TIME delay start of job. . . # -# format : January,1,1990,12:31 # -# or : today,5pm # -# -cpu* secs job CPU limit . . ) # -# # -# -r* rid restart file job id. . . # -# -si* sid substructure file id. . . # -# -pi* post post file job id. . . # -# -de* did defaults file . no # -# -vf vid viewfactor . no # -# # -# -u* user user subroutine. . . # -# -obj obj user objects or libraries. . . # -# -sa* y|n do or do not save load module. . no # -# -autorst auto restart flag for auto forge . no # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo selects i4 or i8 version # -# default: i4 or via defaults file run_marc_defaults # -# the -mo option will override # -# -mpi selects MPI version # -# each platform has a default MPI version and some # -# have an alternative version. see the include file # -# for the respective platform # -# MPI_DEFAULT defines the default MPI version # -# MPI_OTHER defines versions one can switch to # -# -dcoup for contact decoupling # -# currently not supported # -# -dir directory where the job i/o should take place. # -# defaults to current directory. # -# -sdir directory where scratch files are created # -# defaults to current directory. # -# # -# -alloc only perform memory allocation test, no analysis # -# -list y only list options in the input file, no analysis # -# -fe num set feature number "num" for the run. only one allowed # -# -dytran flag to switch from Dytran to Marc # -# dytran = 0, program will run w/o Marc-Dytran Switch # -# = 1, program will restart Marc after Dytran run # -# >= 2, Not supported yet. # -# currently not supported # -# -ou force analysis to use out-of-core control # -# =0, not used # -# =1, element storage out-of-core # -# -dll run marc using shared library libmarc.so and exe_marc # -# =1, used # -# =2, do not free streaming input memory # -# =3, run with marc input deck # -# -trk run marc for post-tracking # -# -gpuid run marc using GPGPU capability # -# specify gpuid on to be used in the analysis. Multiple # -# IDs may be assigned for DDM runs. # -# Separate a list of IDs with a colon. Each DMP # -# process will be assigned a GPU ID in round robin fastion# -# = 0 # -# = 0:1 etc... # -# # -# where parallel options are: # -# -------------------------- # -# # -# itree, host, and comp options are available for the domain # -# decomposition only. # -# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # -# # -# # -# -nprocd number of domains. # -# defaults to single domain solution. # -# -nprocds number of domains if single input file. # -# defaults to single domain solution. # -# -nps same as -nprocds. # -# -nsolver number of solver tasks for solver types 12 and 13 # -# these are distributed tasks operating via MPI # -# -nthread_elem number of threads for element assembly and recovery # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by element assembly # -# recovery. # -# Also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. # -# if both specified, -nthread_elem option will be used. # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor -nthread_elem specified. # -# -nthread_solver number of threads for solver types 6, 8, and 11 # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by 6, 8, and 11 # -# Also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. # -# if both specified, -nthread_solver option will be used. # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor -nthread_solver specified. # -# -nthread Same as -nthread_solver. # -# -itree message passing tree type for domain decomposition. # -# for debugging purposes; should not normally be used. # -# -host hostfile name for distributed execution on network. # -# defaults to no hostfile, unless jobid.defhost exists. # -# if jobid.defhost exists, only -np(s) necessary # -# -comp* y|n to be used with user routines on a network of # -# incompatible machines. # -# if set to no, a separate executable will be created # -# for each machine on the network. # -# if set to yes, the executable located on the machine # -# from which marc is started will be used on all machines.# -# defaults to no if O/S versions different on machines. # -# # -# -ci y|n copy input files to remote hosts (default: yes) # -# if "yes", input files are automatically copied to # -# remote hosts for a network run if necessary. # -# -cr y|n copy post files from remote hosts (default: yes) # -# if "yes", post files are automatically copied back from # -# remote hosts for a network run if necessary. # -############################################################################## -# set DIR to the directory in which this script is -REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" -DIR=`dirname $REALCOM` -# make sure DIR has an absolute path -case $DIR in - \/*) - ;; - *) - DIR=`pwd`/$DIR - ;; -esac -DIRSCRIPT=$DIR -AWK=awk -ARCH=`uname -a | cut -f 1 -d " "` -# Sun has a bad awk, use nawk instead -if test $ARCH = "SunOS" -then - AWK=nawk -fi -BASENAME=basename -# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists -if test $ARCH = "SunOS" -then - if test -x /usr/ucb/basename - then - BASENAME=/usr/ucb/basename - fi -fi - -# echo command line in the case of ECHO_COMMAND is true -if test "$ECHO_COMMAND" = true ; then - echo command "$0" "$@" -fi - -# -# "mode" selects version, i4 or i8 -# default is i4 -# this can be changed by a file run_marc_defaults -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MODE i8 -# it can also be set by the environmental variable MARC_INTEGER_SIZE -# and by the command line option "-mo" -# -mode= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -f $HOME/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -n "$MARC_INTEGER_SIZE" ; then - mode=$MARC_INTEGER_SIZE -fi -if test -z "$mode" ; then - mode=i8 -fi -case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "error, version mode must be i4 or i8" - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i4 or i8" - echo " " - echo " use -mo i4 or -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - setmode=true - fi - if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - fi - if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -done - -# set to i4 version for 32 bit Linux -if test "`uname -s`" = "Linux"; then - if test "`uname -m`" = "i686"; then - mode=i4 - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -fi - - -. "$DIR/getarch" - -. $MARC_INCLUDE -# - -# -# Dynamically determine the echo syntax -# - -case "`echo '\c'`" in - '\c') - ECHO='echo -n' - ECHOTXT=' ' - ;; - *) - ECHO='echo' - ECHOTXT=' \c' - ;; -esac - -# -# Variables for the MARC environment -# - -PRODUCT="Marc" -EXITMSG=$MARC_TOOLS/MESSAGES -export EXITMSG -FLEXDIR=$DIR/../flexlm/licenses -export FLEXDIR -TIMCHK=3600 -export TIMCHK -BINDIR=$MARC_BIN -export BINDIR -AFMATDAT=$MARC_RUNTIME/AF_flowmat/ -export AFMATDAT -# -# define directory path to global unified material database -# -MATFILE= -export MATFILE - -# -# define memory limit -# first set to MEMLIMIT from include -# -ml option overrules if specified -memlimit=$MEMLIMIT -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -# -if test $MACHINENAME = "HP" -then - SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH - export SHLIB_PATH -fi -# the one for IBM is defined futher down - -LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH -LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH -export LD_LIBRARY_PATH -export LD_LIBRARY64_PATH -export LD_LIBRARYN32_PATH - -atexit() { -kill -15 $$ -# -if test $MPITYPE = "myrinet" -then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi -fi -} - -trap "atexit" 2 - -# -# defaults -# - -prog=marc -exefile=marc -jid= -rid= -pid= -sid= -did= -vid= -user= -usernoext= -objs= -qid=background -cpu= -priority= -att= -trk= -verify=yes -prgsav=no -rmdll=no -cpdll=no -progdll= -pathdll= -error= -nprocd=0 -nprocdddm=1 -nprocdddmprint= -icreated=0 -nprocdarg= -nsolver=0 -nsolverarg=-ns -if test $nprocds -then - if test $nprocds -gt 1 - then - nprocdddm=$nprocds - nprocdddmprint=$nprocds - icreated=1 - nprocdarg=-nprocds - fi -fi -ntprint=0 -nt=-1 -nte=-1 -nts=-1 -ntarg=-nt -ntearg=-nte -ntsarg=-nts -nteprint= -ntsprint= -gpuids= -nauto=0 -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -itree=0 -iam= -link= -trkrun=0 -DIRJOB=`pwd` -DIRSCR=$DIRJOB -DIRSCRSET= -autoforge=0 -dotdat=.dat -dotdefhost=.defhost -host= -numhost= -mfile= -userhost= -makebdf= -cpinput=yes -cpresults=yes -marcdll=libmarc.$EXT_DLL -# define hostname and strip off extensions (alpha.aaa.com) -thishost=`hostname` -thishost=${thishost%%.*} -compatible=unknown -numfield=1 -justlist= -feature= -mpioption=false -MDSRCLIB=$MARC_LIB/mdsrc.a -# -# check run_marc_defaults file for default MPI setting -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MPI -# -value= -file= -if test -f $DIRSCRIPT/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$DIRSCRIPT/run_marc_defaults - fi -fi -if test -f $HOME/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$HOME/run_marc_defaults - fi -fi -if test -n "$value"; then - MARC_MPITYPE=$value - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - echo " " - echo " error, incorrect option for MARC_MPI" - echo " defined in $file: $MARC_MPITYPE" - echo " valid options: $MPI_DEFAULT $MPI_OTHER" - echo " " - exit - fi - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - fi -fi -# -# -# allow scratch directory to be specified with environmental variable -# MARCSCRATCH -if test $MARCSCRATCH -then - if test -d $MARCSCRATCH - then - DIRSCR=$MARCSCRATCH - else - echo "error, scratch directory '$MARCSCRATCH'" - echo " specified via environmental variable MARCSCRATCH does not exist" - exit - fi -fi -# -############################################################################## -# parse input - arguments always come in pairs # -############################################################################## - -arg=$1 -if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - shift - arg=$1 -fi -while [ -n "$arg" ] -do - shift - value=$1 - case $arg in - -al* | -AL*) - LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - $MARC_BIN/marc -alloc 1 - exit - ;; - -li* | -LI*) - justlist=yes - ;; - -fe* | -FE*) - feature=$value - ;; - -pr* | -PR*) - if test `dirname $value` = '.' - then - prog=`$BASENAME $value .marc` - progdll=`$BASENAME $value` - else - prog=`dirname $value`/`$BASENAME $value .marc` - progdll=`dirname $value`/`$BASENAME $value` - fi - prdir=`dirname $value` - case $prdir in - \/*) - ;; - *) - prog=`pwd`/$prdir/$prog - ;; - esac - ;; - -j* | -J*) - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - ;; - -r* | -R*) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - -si* | -SI*) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - -pi* | -PI*) - if test -f $value.t19 - then - pid=`$BASENAME $value .t19` - else - pid=`$BASENAME $value .t16` - fi - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - -bdf | -BDF) - makebdf=1 - ;; - -de* | -DE*) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - -vf | -VF) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - -u* | -U*) - user=$value - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - -obj | -OBJ) - objs="$value" - ;; - -q* | -Q*) - qid=$value - ;; - -b* | -B*) - case $value in - y* | Y*) - qid=background - ;; - n* | N*) - qid=foreground - ;; - *) - ;; - esac - ;; - -at | -AT) - att=$value - ;; - -cpu* | -CPU*) - cpu=$value - ;; - -pq | -PQ*) - priority=$value - ;; - -v* | -V*) - verify=$value - ;; - -sa* | -SA*) - prgsav=$value - ;; - -np* | -NP*) - nprocdddm=$value - nprocdddmprint=$value - case $arg in - -nps* | -NPS* | -nprocds* | -NPROCDS*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - case $arg in - -np | -NP | -nprocd | -NPROCD) - icreated=0 - nprocdarg=-nprocd - ;; - esac - ;; - -ns* | -NS*) - nsolver=$value - ;; - -nt* | -NT*) - case $arg in - -nte | -NTE | -nthread_e* | -NTHREAD_E*) - nte=$value - ;; - esac - case $arg in - -nts | -NTS | -nthread_s* | -NTHREAD_S*) - nts=$value - ;; - esac - case $arg in - -nt | -NT | -nth* | -NTH* | -nthread* | -NTHREAD*) - nt=$value - ;; - esac - ;; - -gp* | -GP*) - gpuids=$value - ;; - -it* | -IT*) - itree=$value - ;; - -iam | -IAM) - iam=$value - ;; - -au* | -AU*) - nauto=$value - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -me | -ME ) - mesh=$value - ;; - -ml | -ML ) - memlimit=$value - ;; - -mo | -MO ) - ;; - -mpi | -MPI ) - mpioption=true - MARC_MPITYPE=$value - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - fi - fi - ;; - -dir* | -DIR*) - DIRJOB=$value - case $DIRJOB in - \/*) - ;; - *) - DIRJOB=`pwd`/$DIRJOB - ;; - esac - if test -z "$DIRSCRSET" - then - DIRSCR=$DIRJOB - fi - ;; - -sd* | -SD*) - DIRSCR=$value - DIRSCRSET=yes - case $DIRSCR in - \/*) - ;; - *) - DIRSCR=`pwd`/$DIRSCR - ;; - esac - ;; - -ho* | -HO*) - host=$value - ;; - -co* | -CO*) - compatible=$value - ;; - -ci* | -CI*) - cpinput=$value - ;; - -cr* | -CR*) - cpresults=$value - ;; - *) - error="$error -$arg: invalid option" - break - ;; - esac - case $value in - -*) - error="$error -$arg: invalid name $value" - break - ;; - esac - shift - arg=$1 - if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - shift - arg=$1 - fi -done -argc=`expr $# % 2` -if test $argc -eq 1 -then -# -# odd number of arguments -# - error="$error -argument list incomplete" -fi - -if test $nprocdddm -gt 0 -then -nprocd=$nprocdddm -fi - -if test $nsolver -gt 0 -then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi -fi -# Set defaults -if test $nt -eq -1 -then -nt=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nt -lt 0 -then -nt=0 -fi -if test $nte -eq -1 -then -nte=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nte -lt 0 -then -nte=0 -fi -if test $nts -eq -1 -then -nts=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nts -lt 0 -then -nts=0 -fi -# -# set number of element loop threads -# -ntprint=$nt -nteprint=$nte -# copy from -nprocd[s] -if test $nprocdddm -gt 1 -then - nteprint=$nprocdddm -fi -# override with -nthread_elem option -if test $nte -ne 0 -then -nteprint=$nte -fi -# check for minimum 1 threads per processes for DDM -if test $nprocdddm -gt 1 -then - if test $nteprint -lt $nprocdddm - then - nteprint=$nprocdddm - fi -fi -nte=$nteprint -# -# set number of Solver threads -# -ntsprint=$nts -# copy from -nthread or -nprocd[s] -if test $ntprint -ne 0 -then - ntsprint=$ntprint -else - if test $nprocdddm -gt 1 - then - ntsprint=$nprocdddm - fi -fi -# override with -nthread_solver option -if test $nts -ne 0 -then - ntsprint=$nts -fi -# check for minimum 1 threads per solver process. -if test $nsolver -lt $nprocdddm -then - if test $ntsprint -lt $nsolver - then - ntsprint=$nsolver - fi -else - if test $ntsprint -lt $nprocdddm - then - ntsprint=$nprocdddm - fi -fi -if test $ntsprint -eq 1 -then - set ntsprint=0 -fi -nts=$ntsprint - -# set stack size for multi-threading. -export KMP_MONITOR_STACKSIZE=7M -export OMP_STACKSIZE=7M - -# -# deprecate -nthread option at arugment of marc -nt=0 -# Reset nprocdddmm, nsolver and threads if not given. -if test $nprocdddm -eq 0 -then - nprocdarg= -fi -if test $nprocdddm -eq 0 -then - nprocdddmprint= -fi -if test $nprocdddm -eq 0 -then - nprocdddm= -fi - -if test $nsolver -eq 0 -then - nsolverprint= -fi -# end of threads setting. -gpuoption= -if test "$gpuids" = "" ; then - gpuoption= -else - gpuoption="-gp $gpuids" -fi - -if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH -else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH -fi -# Linux 64 + HPMPI, Below code is taken from include_linux64 -if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" -then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" -fi - -if test $nprocd -gt 1; then - if test -f $jid$dotdefhost; then - if test "$host" = ""; then - host=$jid$dotdefhost - fi - fi - if test -f hostfile_qa_$nprocd; then - if test "$host" = ""; then - host=hostfile_qa_$nprocd - fi - fi -fi - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then - dotdat=.inp - fi - - if test "$progdll"; then - /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll - rmdll=yes - pathdll=yes - progdll=${progdll}_$marcdll - else - progdll=$marcdll - fi - - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - pathdll=yes - fi -fi - -############################################################################## -# check parameter validity # -############################################################################## - -while test forever; do - -# -# check for input file existence -# -if test $nprocdddm -gt 1 -a $icreated -eq 0; then - if test ! -f $DIRJID/1$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/1$jid$dotdat not accessible" - fi - fi -else - if test ! -f $DIRJID/$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/$jid$dotdat not accessible" - fi - fi -fi - if test $nprocd -gt 1; then - if test "$host" ; then - if test ! -f $host; then - error="$error -host name file $host not accessible" - fi - fi - fi - -# -# check if the job is already running in the background -# -if test -f $DIRJOB/$jid.pid; then - error="$error -job is already running (the file $jid.pid exists)" -fi - -# -# if the program name is other than marc, then -# assume that this is a program in the users local directory -# - -bd=$MARC_BIN/ - -case $prog in - marc | MARC | $exefile) - program=$exefile - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - if test ! -f $user - then - error="$error -user subroutine file $user not accessible" - fi - fi - if test "$objs" - then - missingobjs= - for o in $objs - do - if test ! -f "$o" - then - if test -z "$missingobjs" - then - missingobjs="$o" - else - missingobjs="$missingobjs $o" - fi - fi - done - if test -n "$missingobjs" - then - error="$error -user object/library file(s) $missingobjs not accessible" - fi - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$vid" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRVID/1$vid.vfs - then - error="$error -view factor file $DIRVID/1$vid.vfs not accessible" - fi - else - if test ! -f $DIRVID/$vid.vfs - then - error="$error -view factor file $DIRVID/$vid.vfs not accessible" - fi - fi - fi - if $mpioption - then - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" - fi - fi - ;; - *) - program=$prog.marc - case $prog in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - error="$error -program option may not be used with user subroutine" - fi - if test "$objs" - then - error="$error -program option may not be used with user objects or libraries" - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$nauto" - then - if test $nauto -gt 2 - then - error="$error -incorrect option for auto restart " - fi - fi - if test "$ndcoup" - then - if test $ndcoup -gt 3 - then - error="$error -incorrect option for contact decoupling " - fi - fi - if test "$ndytran" - then - if test $ndytran -gt 1 - then - error="$error -incorrect option for Marc-Dytran Switch " - fi - fi - if $mpioption - then - if test ! -x $MARC_BIN/$exefile - then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE " - fi - fi - ;; -esac - -############################################################################## -# check argument integrity # -############################################################################## - -if test "$jid" -then - : -else - error="$error -job id required" -fi - -if test $nprocd -gt 1 -then - if test $nauto -gt 0 - then - error="$error -cannot run DDM job with auto restart (-au) option " - fi -fi -case $qid in - S* | s*) - qid=short - ;; - L* | l*) - qid=long - ;; - V* | v*) - qid=verylong - ;; - B* | b*) - qid=background - ;; - F* | f*) - qid=foreground - ;; - A* | a*) - qid=at - ;; - *) - error="$error -bad value for queue_id option" - ;; -esac - -case $prgsav in - N* | n*) - prgsav=no - ;; - Y* | y*) - prgsav=yes - ;; - *) - error="$error -bad value for save option" - ;; -esac - -case $verify in - N* | n*) - verify=no - ;; - Y* | y*) - verify=yes - ;; - *) - error="$error -bad value for verify option" - ;; -esac - -case $nprocdddm in - -* ) - error="$error -bad value for nprocd option" - ;; -esac - -case $nt in - -* ) - error="$error -bad value for nt option" - ;; -esac - -case $itree in - -* ) - error="$error -bad value for itree option" - ;; -esac -case $iam in - -* ) - error="$error -bad value for iam option" - ;; -esac -case $compatible in - N* | n*) - compatible=no - ;; - Y* | y*) - compatible=yes - ;; - unknown) - ;; - *) - error="$error -bad value for comp option" - ;; -esac -case $cpinput in - N* | n*) - cpinput=no - ;; - Y* | y*) - cpinput=yes - ;; - *) - error="$error -bad value for copy input option" - ;; -esac -case $cpresults in - N* | n*) - cpresults=no - ;; - Y* | y*) - cpresults=yes - ;; - *) - error="$error -bad value for copy results option" - ;; -esac - -# -# check for external file to run -# -if test -f $MARC_TOOLS/run_marc_check -then - . $MARC_TOOLS/run_marc_check -fi - -# -# pick up version data from bin/VERSION if it exists -# -if test -f $MARC_BIN/VERSION; then - ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` - if test -n "$ppp" ;then - PRODUCT=$ppp - fi - ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` - if test -n "$ppp" ;then - REVISION=", Build $ppp" - fi -fi -############################################################################## -# interact with the user to get the required information to run marc or # -# other marc system program # -############################################################################## - -deletelog=yes -if test $qid = background -a $verify = no -then -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Element loop threads : $nteprint -Solver processes : $nsolverprint -Solver threads : $ntsprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto " > $jid.log -deletelog=no -fi -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Element loop threads : $nteprint -Solver processes : $nsolverprint -Solver threads : $ntsprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto" - - -case $qid in - s* | S* | l* | L* | v* | V* ) - echo \ -"Queue priority : $priority -Queue CPU limit : $cpu -Queue start time : $att" - ;; -# * ) -# echo \ -#" " -# ;; -esac - -if test "$error" -then - if test $verify = yes - then - $ECHO "$error - -Please correct or quit(correct,quit,): $ECHOTXT" - error= - read answer - case $answer in - q* | Q*) - answer=quit - ;; - *) - answer=correct - ;; - esac - else - $ECHO "$error - $ECHOTXT" - echo " " - if test "$deletelog" = no - then - $ECHO "$error - $ECHOTXT" >> $jid.log - echo " " >> $jid.log - fi - answer=quit - fi -else - if test $verify = yes - then - $ECHO " -Are these parameters correct (yes,no,quit,)? $ECHOTXT" - read answer - case $answer in - q* | Q*) - answer=quit - ;; - y* | Y*) - answer=yes - ;; - *) - answer=no - ;; - esac - else - answer=yes - fi -fi - -case $answer in - no | correct) - -############################################################################## -# prompt for each value # -############################################################################## - - $ECHO " -Program name ($prog)? $ECHOTXT" - read value - if test "$value" - then - prog=$value - fi - $ECHO "Job ID ($jid)? $ECHOTXT" - read value - if test "$value" - then - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - fi - $ECHO "User subroutine name ($user)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - user= - ;; - *) - user=$value - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - esac - fi - $ECHO "User objects or libraries ($objs)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - objs= - ;; - *) - objs="$value" - ;; - esac - fi - $ECHO "Restart File Job ID ($rid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - rid= - ;; - *) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - esac - fi - $ECHO "Substructure File ID ($sid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - sid= - ;; - *) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - esac - fi - $ECHO "Post File Job ID ($pid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - pid= - ;; - *) - pid=$value - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - esac - fi - $ECHO "Defaults File ID ($did)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - did= - ;; - *) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - esac - fi - $ECHO "View Factor File ID ($vid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - vid= - ;; - *) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - esac - fi - $ECHO "Save generated module ($prgsav)? $ECHOTXT" - read value - if test "$value" - then - prgsav=$value - fi - $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" - read value - if test "$value" - then - nprocdddm=$value - nprocdddmprint=$value - fi - $ECHO "Run on ($nte) Element loop threads ? $ECHOTXT" - read value - if test "$value" - then - nte=$value - fi - $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" - read value - if test "$value" - then - nsolver=$value - fi - $ECHO "Run on ($nts) Solver threads ? $ECHOTXT" - read value - if test "$value" - then - nts=$value - fi -# - if test $nprocdddm -gt 0 - then - nprocd=$nprocdddm - fi - if test $nsolver -gt 0 - then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi - fi -# Element loop threads. - if test $nte -eq -1 - then - nte=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nte -lt 0 - then - nte=0 - fi - nteprint=$nte -# Copy from ddm - if test $nprocdddm -gt 1 - then - nteprint=$nprocdddm - fi -# override with -nthread_elem option - if test $nte -ne 0 - then - nteprint=$nte - fi -# check for minimum 1 threads per processes for DDM - if test $nprocdddm -ne 0 - then - if test $nteprint -lt $nprocdddm - then - nteprint=$nprocdddm - fi - fi - nte=$nteprint -# Solver threads. - if test $nts -eq -1 - then - nts=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nts -lt 0 - then - nts=0 - fi - ntsprint=$nts -# Copy from ddm - if test $nprocdddm -gt 1 - then - ntsprint=$nprocdddm - fi -# override with -nthread_solver option - if test $nts -ne 0 - then - ntsprint=$nts - fi -# check for minimum 1 threads per solver process. - if test $nsolver -lt $nprocdddm - then - if test $ntsprint -lt $nsolver - then - ntsprint=$nsolver - fi - else - if test $ntsprint -lt $nprocdddm - then - ntsprint=$nprocdddm - fi - fi - if test $ntsprint -eq 1 - then - set ntsprint=0 - fi - nts=$ntsprint - $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" - read value - if test "$value" - then - gpuids=$value - fi - if test "$gpuids" = "" ; then - gpuoption= - else - gpuoption="-gp $gpuids" - fi - if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH - fi - if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - fi -# - if test $nprocd -gt 1 - then - $ECHO "Message passing type ($itree)? $ECHOTXT" - read value - if test "$value" - then - itree=$value - fi - $ECHO "Host file name ($host)? $ECHOTXT" - read value - if test "$value" - then - host=$value - fi - if test $nprocdddm -gt 1 - then - $ECHO "Single input file? $ECHOTXT" - read value - case $value in - y* | Y*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" - read value - if test "$value" - then - compatible=$value - fi - $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" - read value - if test "$value" - then - cpinput=$value - fi - $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" - read value - if test "$value" - then - cpresults=$value - fi - fi - fi - $ECHO "Run the job in the queue ($qid)? $ECHOTXT" - read value - if test "$value" - then - qid=$value - fi - case $qid in - s* | S* | l* | L* | v* | V* ) - $ECHO "Queue priority ($priority)? $ECHOTXT" - read value - if test "$value" - then - priority=$value - fi - $ECHO "Job starts at ($att)? $ECHOTXT" - read value - if test "$value" - then - att=$value - fi - $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" - read value - if test "$value" - then - cpu=$value - fi - ;; - * ) - ;; - esac - $ECHO "Auto Restart option ($nauto)? $ECHOTXT" - read value - if test "$value" - then - nauto=$value - fi - $ECHO "Run directory ($DIRJOB)? $ECHOTXT" - read value - if test "$value" - then - DIRJOB=$value - DIRSCR=$DIRJOB - fi - $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" - read value - if test "$value" - then - DIRSCR=$value - fi - ;; - quit) - exit 1 - ;; - *) - break - ;; - -esac - - if test $nt -eq -1 - then - nt=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nt -lt 0 - then - nt=0 - fi - -done -# -if test $nt -eq 0 -then - ntarg= -fi -if test $nt -eq 0 -then - ntprint= -fi -if test $nt -eq 0 -then - nt= -fi - -if test $nte -eq 0 -then - ntearg= -fi -if test $nte -eq 0 -then - nteprint= -fi -if test $nte -eq 0 -then - nte= -fi - -if test $nts -eq 0 -then - ntsarg= -fi -if test $nts -eq 0 -then - ntsprint= -fi -if test $nts -eq 0 -then - nts= -fi -# -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - pathdll=yes - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - fi - - if test "$pathdll"; then -# -# reset share lib path -# - if test $MACHINENAME = "HP" - then - SHLIB_PATH=$DIRJOB:$SHLIB_PATH - export SHLIB_PATH - fi - if test $MACHINENAME = "IBM" - then - LIBPATH=$DIRJOB:$LIBPATH - export LIBPATH - fi -# - LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH - LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH - LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH - export LD_LIBRARY_PATH - export LD_LIBRARY64_PATH - export LD_LIBRARYN32_PATH - fi -fi -# end of dllrun>0 - - -if test $program = $exefile -o $program = $prog.marc -then - -# delete the old .log file unless we run in the background -if test "$deletelog" = yes -then - /bin/rm $jid.log 2>/dev/null -else - echo - echo running the job in the background, see $jid.log - echo -fi - -# -# check if this is an autoforge or rezoning or radiation job -# -if test $nprocd -eq 1 -then - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` - if test "$line" - then - autoforge=1 - fi -fi -# -# check that jobname for restarted run is not the same -# as restart file basename -# -if test "$rid" -then - if test "$jid" = "$rid" - then - echo " " - echo "ERROR: job name of current run is the same as job name" - echo " of the restarted job" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "ERROR: job name of current run is the same as job name" >> $jid.log - echo " of the restarted job" >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi -fi - -# -# user objects/libraries used -# - - if test "$objs" - then - program="$DIRJOB/$jid.marc" - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# user subroutine used -# -# add DAMASK options for linking - DAMASK="" - - if test "$user" - then - program=$usernoext.marc - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# Special case for IBM using POE but not an SP machine -# in this case we always need a host file, also for serial jobs. -# -if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP -then - MP_HOSTFILE=${jid}.host - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $nprocd -gt 1 - then - numdom=$nprocd - while test $numdom -gt 0 - do - hostname -s >> $MP_HOSTFILE - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - else - hostname -s > $MP_HOSTFILE - fi -fi -# -# check ssh for all hosts in host file -# -if test $nprocd -gt 1 -then -if test $MPITYPE = "intelmpi" -a "$INTELMPI_VERSION" = "HYDRA" - then -# get host list - if test "$host" - then - line=`grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' | uniq` -# count failing hosts - counter=0 - for i in $line - do - $RSH -o BatchMode=yes -o ConnectTimeout=10 $i uname -n - status=$? - if [[ $status != 0 ]] ; then - counter=$((counter+1)) - if [ "$counter" = "1" ]; then - echo " " - echo " error - connection test failed... " - echo " " - fi - echo " " - echo " connection test with ssh failed on host $i" - echo " check the following command: ssh $i uname -n " - echo " " - fi - done -# echo error message and quit - if test $counter -ne 0 - then - echo " " - echo " A parallel job using IntelMPI cannot be started. " - echo " The ssh command must be working correctly between " - echo " the computers used in the analysis. Furthermore, " - echo " it must be set up such that it does not prompt the " - echo " user for a password. Note that this is the case " - echo " also for running on a single machine. " - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo " A parallel job using IntelMPI cannot be started. ">> $jid.log - echo " The ssh command must be working correctly between ">> $jid.log - echo " the computers used in the analysis. Furthermore, ">> $jid.log - echo " it must be set up such that it does not prompt the ">> $jid.log - echo " user for a password. Note that this is the case ">> $jid.log - echo " also for running on a single machine. ">> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - else - counter=1 -# test ssh `hostname` - if test $counter -ne 0 - then - line=`hostname` - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi -# test ssh `hostname` - if test $counter -ne 0 - then - line=`hostname -s` - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi -# test ssh localhost - if test $counter -ne 0 - then - line=localhost - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi - if test $counter -ne 0 - then - echo " error - connection test failed... " - echo " " - echo " ssh needs to work on the machine without asking for a password." - echo " check the following command: ssh localhost uname -n" - echo " " - echo " A parallel job using IntelMPI cannot be started. " - echo " The ssh command must be working correctly between " - echo " the computers used in the analysis. Furthermore, " - echo " it must be set up such that it does not prompt the " - echo " user for a password. Note that this is the case " - echo " also for running on a single machine. " - echo " " - if test "$deletelog" = no - then - echo " error - connection test failed... " >> $jid.log - echo " " >> $jid.log - echo " ssh needs to work on the machine without asking for a password." >> $jid.log - echo " check the following command: ssh localhost uname -n" >> $jid.log - echo " " >> $jid.log - echo " A parallel job using IntelMPI cannot be started. " >> $jid.log - echo " The ssh command must be working correctly between " >> $jid.log - echo " the computers used in the analysis. Furthermore, " >> $jid.log - echo " it must be set up such that it does not prompt the " >> $jid.log - echo " user for a password. Note that this is the case " >> $jid.log - echo " also for running on a single machine. " >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - echo $line $nprocd > $jid.hosts - host=$jid.hosts - fi - fi -fi -fi -# -# check correctness of host file; fix for user sub -# - if test $nprocd -gt 1 - then - -# construct the path name to the executable (execpath) - execpath=$MARC_BIN/$exefile - usersub=0 - if test $program = $prog.marc - then - execpath=$prog.marc - usersub=1 - fi - if test "$objs" - then - execpath="$DIRJOB/$jid.marc" - usersub=1 - fi - if test "$user" - then - execpath=$usernoext.marc - usersub=1 - fi - export execpath - execname=`$BASENAME $execpath` - - if test "$host" - then - userhost=$host - case $userhost in - \/* | \.\/*) - ;; - *) - userhost=`pwd`/$userhost - ;; - esac - -# check that the number of processes specified in the hostfile is -# equal to nprocd specified by -nprocd. - numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` - if test $nprocd -ne $numproc - then - echo " " - echo "error, the number of processes specified in the host file" - echo "must be equal to the number of processes given by -nprocd/-nsolver" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, the number of processes specified in the host file" >> $jid.log - echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - -# check for Myrinet that the number of processes per host is -# less than number of available user ports, 5 -# .gmpi directory must exist in user's home directory -# and must have write permission from remote hosts - if test $MPITYPE = "myrinet" - then - numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` - if test $numproc -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes specified " - echo "in the hostfile must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes specified " >> $jid.log - echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - if test ! -d ~/.gmpi - then - echo " " - echo "error, for Myrinet a .gmpi directory must exist " - echo "under the user's home directory" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log - echo "under the user's home directory" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - homedir=`echo ~` - for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - echo " " - echo "error, for Myrinet a shared .gmpi directory must exist " - echo "under the user's home directory " - echo "with remote write permission" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log - echo "under the user's home directory " >> $jid.log - echo "with remote write permission" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - /bin/rm tmp.$$ - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - fi - fi - done - fi - fi - -# construct the host file $jid.host which is used by mpirun -# skip lines starting with # and only consider lines with more than -# one word in them. Note that the hostfile given to this script -# has two columns: the host name and the number of shared processes -# to run on this host. mpirun wants the number of _other_ -# processes to run in addition to the one being run on the machine -# on which the job is started. hence the $2-1 for fnr == 1. - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then -# HPMPI or HP hardware MPI - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ - -v mpihpspecial="$MPIHPSPECIAL" \ -'{if ( NF > 0) {\ - fnr++ ; \ - printf("-h %s -np %s",$1,$2); \ - printf(" %s",mpihpspecial); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ - if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ - }\ - }' > $jid.host -# end HPMPI or HP hardware MPI - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then -# IBM using hardware MPI (POE) - MP_HOSTFILE=$jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host -# end IBM using hardware MPI (POE) -# for Intel MPI, need to create a machinefile for DMP - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then -# Intel MPI - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - /bin/cp $host $jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Intel MPI for DMP -# for Solaris HPC 7.1, need to create a machinefile for DMP - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then -# Solaris HPC 7.1 - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Solaris HPC 7.1 for DMP -# for Myrinet, construct a configuration file in ~/.gmpi -# this must be readable by each process -# format is (hostname) (port number) for each process - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - grep -v '^#' $host | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ -{if ( NF > 0 ) \ - for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ -}' >> ~/.gmpi/$jid.host - else -# this is for mpich-1.2.5 and later, using the -pg option -# format: host nproc executable user arguments -# the arguments are added later - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s %s\n",path,user);\ - if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ - }\ - }' > $jid.host - fi -# end Myrinet - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then -# Compaq MPI via Memory Channel - grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host -# end Compaq MPI - else -# MPICH - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ - }\ - }' > $jid.host - fi -# define the variable host and host_filt -# host_filt is used for loops over hosts -# for Myrinet we need to use a filtered variant of userhost -# for others we can use $host - if test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - host=~/.gmpi/$jid.host - host_filt=$jid.host_tMp - grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt - else - host=$jid.host - host_filt=$host - fi - else - host=$jid.host - host_filt=$host - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - host_filt=$jid.mfile - fi - fi -# figure out if the machines in the hostfile are nfs mounted -# or distributed and set the variable "dirstatus" accordingly. -# only perform the check if user subroutine is used -# or a user subroutine executable is used - - numfield=1 - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - numfield=2 - fi - DIR1=$DIRJOB - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - counter=0 - echo " " - echo "checking if local or shared directories for host" - if test "$deletelog" = no - then - echo "checking if local or shared directories for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - dirstatus[$counter]="shared" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - dirstatus[$counter]="local" - /bin/rm tmp.$$ - else - if test ! -f $jid.$$ - then - dirstatus[$counter]="local" - $RSH $i /bin/rm $DIR1/$jid.$$ - else - /bin/rm $jid.$$ - fi - fi - if test -f tmp.$$ - then - /bin/rm tmp.$$ - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - echo " ${dirstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${dirstatus[$counter]}" >> $jid.log - fi - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - fi - -# figure out if this is a compatible set of machines -# unless explicitly specified with flag -comp -# only perform the check if user subroutine is used -# or a user subroutine executable is used -# Myrinet does not support heterogeneous - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - if test $compatible = "unknown" - then - thisname=$ARCH - compatible=yes - counter=0 - echo "checking if machines are compatible for host" - if test "$deletelog" = no - then - echo "checking if machines are compatible for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]="yes" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - othername=`$RSH $i uname -a | cut -f 1 -d " "` - if test $thisname != $othername - then - compatible=no - compstatus[$counter]="no" - fi - fi - echo " ${compstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${compstatus[$counter]}" >> $jid.log - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - else - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]=$compatible - fi - done - if test $compatible = "no" - then - echo "all machines assumed incompatible" - if test "$deletelog" = no - then - echo "all machines assumed incompatible" >> $jid.log - fi - else - echo "all machines compatible" - if test "$deletelog" = no - then - echo "all machines compatible" >> $jid.log - fi - fi - fi -# error out if user objects or libraries are used on incompatible machines - if test "$compatible" = "no" -a -n "$objs" - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" - if test "$deletelog" = no - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log - fi - exit 1 - fi -# modify new host file if NFS mounted heterogeneous machine - doit= - if test $program = $prog.marc - then - doit=yes - fi - if test "$user" - then - doit=yes - fi - if test "$doit" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - $AWK -v hst=$i '{fnr++ ; \ -if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ -printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} - /bin/mv $jid.host{$$} $jid.host - host=$jid.host - fi - fi - done - fi - fi # if test $program = $prog.marc -o $user -o $obj - - else # if test $host - # assume shared memory machine if no hostfile given and - # MPITYPE is set to mpich or Myrinet - # check for Myrinet that the total number of processes is - # less than number of available user ports, 5 - if test $MPITYPE = "mpich" -o $MPITYPE = "scali" - then - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - host=$jid.host - elif test $MPITYPE = "myrinet" - then - if test $nprocd -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes " - echo "must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes " >> $jid.log - echo "must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - echo `hostname` $nprocd | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ - {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ -' >> ~/.gmpi/$jid.host - host=~/.gmpi/$jid.host - else - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - - fi - fi # if test myrinet - - fi # if test $host - - fi # if test $nprocd -gt 1 - -fi # if test $program = $exefile -o $program = $prog.marc - -############################################################################## -# construct run stream (Marc only) # -############################################################################## - -# set maximum message length for ddm to a large number -# for vendor provided mpi -if test $itree -eq 0 -a $MPITYPE = hardware -then - itree=100000000 - if test $MACHINENAME = SGI - then - itree=100000001 - fi -fi -if test $itree -eq 0 -a $MPITYPE = hpmpi -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = myrinet -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = nec -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = scali -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = intelmpi -then - itree=100000000 -fi -if test $nprocdddm -lt 2 -then - nprocdarg= -else - nprocdarg="$nprocdarg $nprocdddm" -fi -if test $nsolver -eq 0 -then - nsolverarg= -else - nsolverarg="$nsolverarg $nsolver" -fi -if test $nprocdddm -lt 2 -a $nsolver -eq 0 -then -nprocd=0 -fi -if test $nprocd -gt 0 -then - if test "$host" - then - if test -z "$RUN_JOB2" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then - RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - else - RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" - RUN_JOB=" -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - numhost=`uniq $jid.mfile | wc -l` - if test "$INTELMPI_VERSION" = "HYDRA" - then - RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n $numhost -r $RSH -f $jid.mfile - RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" - fi - -# intelmpi uses configfile. format: -# -host host1 -n n1 executable marcargs -# one such line per host -# collect the marcargs in RUN_JOB and construct the config file later -# collect the run stream in RUN_JOB_TMP - RUN_JOB="-jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - - - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then - RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi - if test "$userhost" - then - RUN_JOB="$RUN_JOB -mhost $userhost" - fi - if test $MPITYPE = "scali" - then -# set default working directory to /tmp to allow -# different directory names - SCAMPI_WORKING_DIRECTORY=/tmp - export SCAMPI_WORKING_DIRECTORY - fi - else - if test -z "$RUN_JOB1" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - RUNNPROCD=$nprocd - if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" - then - RUNNPROCD= - MP_PROCS=$nprocd - export MP_PROCS - fi - if test $MPITYPE = "myrinet" - then - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n 1 -f $jid.hosts - fi - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi - fi -else - if test $nauto -gt 0 -o $ndcoup -gt 0 - then - RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ - $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - else -# this is for a serial job without auto restart: - RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi -fi -if test "$rid" -then - RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" -fi -if test "$pid" -then - RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" -fi -if test "$sid" -then - RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" -fi -if test "$did" -then - RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" -fi -if test "$vid" -then - RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" -fi -if test $nauto -gt 0 -then - RUN_JOB="$RUN_JOB -autorst $nauto " -fi -if test $ndcoup -gt 0 -then - RUN_JOB="$RUN_JOB -dcoup $ndcoup " -fi -if test $ndytran -gt 0 -then - RUN_JOB="$RUN_JOB -dytran $ndytran " -fi -if test $mesh -gt 0 -then - RUN_JOB="$RUN_JOB -me $mesh " -fi -if test $noutcore -gt 0 -then - RUN_JOB="$RUN_JOB -outcore $noutcore " -fi -if test "$dllrun" -gt 0 -then - RUN_JOB="$RUN_JOB -dll $dllrun " -fi -if test "$trkrun" -gt 0 -then - RUN_JOB="$RUN_JOB -trk $trkrun " -fi -if test "$iam" -then - RUN_JOB="$RUN_JOB -iam $iam " -fi -if test "$justlist" -then - RUN_JOB="$RUN_JOB -list 1 " -fi -if test "$feature" -then - RUN_JOB="$RUN_JOB -feature $feature " -fi -if test "$memlimit" -ne 0 -then - RUN_JOB="$RUN_JOB -ml $memlimit " -fi -if test "$cpinput" -then - RUN_JOB="$RUN_JOB -ci $cpinput " -fi -if test "$cpresults" -then - RUN_JOB="$RUN_JOB -cr $cpresults " -fi -if test "$DIRSCR" != "$DIRJOB" -then - RUN_JOB="$RUN_JOB -dirscr $DIRSCR" -else - DIRSCR=$DIRJOB -fi -if test "$makebdf" -then - RUN_JOB="$RUN_JOB -bdf $makebdf " -fi -if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" -then - # append $RUN_JOB to all lines of the host file - # and set RUN_JOB - $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ - /bin/mv $host.$$ $host - RUN_JOB=$RUN_JOB_TMP -fi -if test $MPITYPE = "intelmpi" -a "$host" -then - # construct config file, append $RUN_JOB to all lines of the config file - # and set RUN_JOB - if test "$INTELMPI_VERSION" = "HYDRA" - then - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - else - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-host %s -n %s",$1,$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - fi - RUN_JOB=$RUN_JOB_TMP -fi -echo " " -echo "Final run stream value" -echo " RUNJOB="$RUN_JOB -if test "$deletelog" = no -then -echo " " >> $jid.log -echo "Final run stream value" >> $jid.log -echo " RUNJOB="$RUN_JOB >> $jid.log -fi - - -############################################################################## -# run marc using valgrind # -############################################################################## -#RUN_JOB="valgrind $RUN_JOB" -#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" -############################################################################## - - -############################################################################## -# run the requested program in a queue # -############################################################################## - -if test "$deletelog" = yes -then - echo - date -else - echo >> $jid.log - date >> $jid.log -fi -if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] -then - -/bin/rm -f $jid.runmarcscript - - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - userobj=$usermoext.o - fi - cat > $jid.runmarcscript << END4 - if test "$user" - then - if test $MACHINENAME = "CRAY" - then - $DFORTRAN $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTRAN $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $MARCCUDALIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } -END4 -else - prgsav=yes -fi -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# - -cat >> $jid.runmarcscript << END5 - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -# first remove all .out files and incremental restart files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null - /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null -fi - -if test $nprocdddm -gt 1 -then - $RUN_JOB 2>>$jid.log -else - $RUN_JOB 2>>$jid.log -fi - -if test $dllrun -eq 0; then - if test $prgsav = no - then - /bin/rm -f $bd$program 2>/dev/null - fi -else - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes - then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -END5 - - -# Submit to marc batch queue -# -if [ $qid = at ] -then -QUENAME=at -SUBMCMD= -else -# -# Submit to qsub queue -# -QUENAME=qsub -SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" -if test "$priority" -then - SUBMCMD=$SUBMCMD" -p $priority" -fi -if test "$att" -then - SUBMCMD=$SUBMCMD" -a $att" -fi -if test "$cpu" -then - SUBMCMD=$SUBMCMD" -lt $cpu" -fi - -fi -echo $QUENAME $SUBMCMD -#cat $jid.runmarcscript -$QUENAME $SUBMCMD < $jid.runmarcscript - -/bin/rm -f $jid.runmarcscript - -############################################################################## -# run the requested program in the background # -############################################################################## - -else -if test $qid = background -then - -# -# first remove all old .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi -# -# compile user subroutine if present -# -( -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - echo " $PRODUCT Exit number 3" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTRAN $user || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTRAN $user -o $userobj || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - echo " $PRODUCT Exit number 3" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc - -# - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -$RUN_JOB & - -marcpid=$! -echo $marcpid > $DIRJOB/$jid.pid -wait $marcpid - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - if test "$host" - then - /bin/rm $jid.mfile 2> /dev/null - /bin/rm $jid.hosts 2> /dev/null - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.cfile 2> /dev/null - fi - fi - fi -fi - - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -) 1>>$jid.log 2>&1 & - - -############################################################################## -# run the requested program in the foreground # -############################################################################## - -else - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTRAN $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTRAN $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi -# first remove all .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi - -$RUN_JOB - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - if test "$host" - then - /bin/rm $jid.mfile 2> /dev/null - /bin/rm $jid.hosts 2> /dev/null - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.cfile 2> /dev/null - else - echo " " > /dev/null - fi - else - if test "$host" - then - mpdcleanup -a -f $jid.mfile - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.mfile 2> /dev/null - else - mpdcleanup -a -f $jid.hosts - /bin/rm $jid.hosts 2> /dev/null - fi - fi - fi -fi - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi - - -fi -fi diff --git a/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_h b/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_h deleted file mode 100644 index 4aee42fa0..000000000 --- a/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_h +++ /dev/null @@ -1,4053 +0,0 @@ -#!/bin/ksh -############################################################################## -# # -# run_marc - run a marc job # -# ------------------------- # -# # -# usage: run_marc -j jid { options } # -# # -# where standard options are: required: defaults: # -# -------------------------- # -# # -# -j* jid job id number. ** YES ** . # -# -pr* prog program name. . marc # -# -v* y|n do or do not verify inputs. . yes # -# -q* s|l|v|b|f batch queue name or background, . short # -# foreground. # -# -b* as alternative to option -q* # -# # -# ( batch queues only : # -# -pq* intra queue priority. . . # -# -at DATE/TIME delay start of job. . . # -# format : January,1,1990,12:31 # -# or : today,5pm # -# -cpu* secs job CPU limit . . ) # -# # -# -r* rid restart file job id. . . # -# -si* sid substructure file id. . . # -# -pi* post post file job id. . . # -# -de* did defaults file . no # -# -vf vid viewfactor . no # -# # -# -u* user user subroutine. . . # -# -obj obj user objects or libraries. . . # -# -sa* y|n do or do not save load module. . no # -# -autorst auto restart flag for auto forge . no # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo selects i4 or i8 version # -# default: i4 or via defaults file run_marc_defaults # -# the -mo option will override # -# -mpi selects MPI version # -# each platform has a default MPI version and some # -# have an alternative version. see the include file # -# for the respective platform # -# MPI_DEFAULT defines the default MPI version # -# MPI_OTHER defines versions one can switch to # -# -dcoup for contact decoupling # -# currently not supported # -# -dir directory where the job i/o should take place. # -# defaults to current directory. # -# -sdir directory where scratch files are created # -# defaults to current directory. # -# # -# -alloc only perform memory allocation test, no analysis # -# -list y only list options in the input file, no analysis # -# -fe num set feature number "num" for the run. only one allowed # -# -dytran flag to switch from Dytran to Marc # -# dytran = 0, program will run w/o Marc-Dytran Switch # -# = 1, program will restart Marc after Dytran run # -# >= 2, Not supported yet. # -# currently not supported # -# -ou force analysis to use out-of-core control # -# =0, not used # -# =1, element storage out-of-core # -# -dll run marc using shared library libmarc.so and exe_marc # -# =1, used # -# =2, do not free streaming input memory # -# =3, run with marc input deck # -# -trk run marc for post-tracking # -# -gpuid run marc using GPGPU capability # -# specify gpuid on to be used in the analysis. Multiple # -# IDs may be assigned for DDM runs. # -# Separate a list of IDs with a colon. Each DMP # -# process will be assigned a GPU ID in round robin fastion# -# = 0 # -# = 0:1 etc... # -# # -# where parallel options are: # -# -------------------------- # -# # -# itree, host, and comp options are available for the domain # -# decomposition only. # -# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # -# # -# # -# -nprocd number of domains. # -# defaults to single domain solution. # -# -nprocds number of domains if single input file. # -# defaults to single domain solution. # -# -nps same as -nprocds. # -# -nsolver number of solver tasks for solver types 12 and 13 # -# these are distributed tasks operating via MPI # -# -nthread_elem number of threads for element assembly and recovery # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by element assembly # -# recovery. # -# Also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. # -# if both specified, -nthread_elem option will be used. # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor -nthread_elem specified. # -# -nthread_solver number of threads for solver types 6, 8, and 11 # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by 6, 8, and 11 # -# Also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. # -# if both specified, -nthread_solver option will be used. # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor -nthread_solver specified. # -# -nthread Same as -nthread_solver. # -# -itree message passing tree type for domain decomposition. # -# for debugging purposes; should not normally be used. # -# -host hostfile name for distributed execution on network. # -# defaults to no hostfile, unless jobid.defhost exists. # -# if jobid.defhost exists, only -np(s) necessary # -# -comp* y|n to be used with user routines on a network of # -# incompatible machines. # -# if set to no, a separate executable will be created # -# for each machine on the network. # -# if set to yes, the executable located on the machine # -# from which marc is started will be used on all machines.# -# defaults to no if O/S versions different on machines. # -# # -# -ci y|n copy input files to remote hosts (default: yes) # -# if "yes", input files are automatically copied to # -# remote hosts for a network run if necessary. # -# -cr y|n copy post files from remote hosts (default: yes) # -# if "yes", post files are automatically copied back from # -# remote hosts for a network run if necessary. # -############################################################################## -# set DIR to the directory in which this script is -REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" -DIR=`dirname $REALCOM` -# make sure DIR has an absolute path -case $DIR in - \/*) - ;; - *) - DIR=`pwd`/$DIR - ;; -esac -DIRSCRIPT=$DIR -AWK=awk -ARCH=`uname -a | cut -f 1 -d " "` -# Sun has a bad awk, use nawk instead -if test $ARCH = "SunOS" -then - AWK=nawk -fi -BASENAME=basename -# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists -if test $ARCH = "SunOS" -then - if test -x /usr/ucb/basename - then - BASENAME=/usr/ucb/basename - fi -fi - -# echo command line in the case of ECHO_COMMAND is true -if test "$ECHO_COMMAND" = true ; then - echo command "$0" "$@" -fi - -# -# "mode" selects version, i4 or i8 -# default is i4 -# this can be changed by a file run_marc_defaults -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MODE i8 -# it can also be set by the environmental variable MARC_INTEGER_SIZE -# and by the command line option "-mo" -# -mode= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -f $HOME/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -n "$MARC_INTEGER_SIZE" ; then - mode=$MARC_INTEGER_SIZE -fi -if test -z "$mode" ; then - mode=i8 -fi -case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "error, version mode must be i4 or i8" - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i4 or i8" - echo " " - echo " use -mo i4 or -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - setmode=true - fi - if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - fi - if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -done - -# set to i4 version for 32 bit Linux -if test "`uname -s`" = "Linux"; then - if test "`uname -m`" = "i686"; then - mode=i4 - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -fi - - -. "$DIR/getarch" - -. $MARC_INCLUDE -# - -# -# Dynamically determine the echo syntax -# - -case "`echo '\c'`" in - '\c') - ECHO='echo -n' - ECHOTXT=' ' - ;; - *) - ECHO='echo' - ECHOTXT=' \c' - ;; -esac - -# -# Variables for the MARC environment -# - -PRODUCT="Marc" -EXITMSG=$MARC_TOOLS/MESSAGES -export EXITMSG -FLEXDIR=$DIR/../flexlm/licenses -export FLEXDIR -TIMCHK=3600 -export TIMCHK -BINDIR=$MARC_BIN -export BINDIR -AFMATDAT=$MARC_RUNTIME/AF_flowmat/ -export AFMATDAT -# -# define directory path to global unified material database -# -MATFILE= -export MATFILE - -# -# define memory limit -# first set to MEMLIMIT from include -# -ml option overrules if specified -memlimit=$MEMLIMIT -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -# -if test $MACHINENAME = "HP" -then - SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH - export SHLIB_PATH -fi -# the one for IBM is defined futher down - -LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH -LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH -export LD_LIBRARY_PATH -export LD_LIBRARY64_PATH -export LD_LIBRARYN32_PATH - -atexit() { -kill -15 $$ -# -if test $MPITYPE = "myrinet" -then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi -fi -} - -trap "atexit" 2 - -# -# defaults -# - -prog=marc -exefile=marc -jid= -rid= -pid= -sid= -did= -vid= -user= -usernoext= -objs= -qid=background -cpu= -priority= -att= -trk= -verify=yes -prgsav=no -rmdll=no -cpdll=no -progdll= -pathdll= -error= -nprocd=0 -nprocdddm=1 -nprocdddmprint= -icreated=0 -nprocdarg= -nsolver=0 -nsolverarg=-ns -if test $nprocds -then - if test $nprocds -gt 1 - then - nprocdddm=$nprocds - nprocdddmprint=$nprocds - icreated=1 - nprocdarg=-nprocds - fi -fi -ntprint=0 -nt=-1 -nte=-1 -nts=-1 -ntarg=-nt -ntearg=-nte -ntsarg=-nts -nteprint= -ntsprint= -gpuids= -nauto=0 -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -itree=0 -iam= -link= -trkrun=0 -DIRJOB=`pwd` -DIRSCR=$DIRJOB -DIRSCRSET= -autoforge=0 -dotdat=.dat -dotdefhost=.defhost -host= -numhost= -mfile= -userhost= -makebdf= -cpinput=yes -cpresults=yes -marcdll=libmarc.$EXT_DLL -# define hostname and strip off extensions (alpha.aaa.com) -thishost=`hostname` -thishost=${thishost%%.*} -compatible=unknown -numfield=1 -justlist= -feature= -mpioption=false -MDSRCLIB=$MARC_LIB/mdsrc.a -# -# check run_marc_defaults file for default MPI setting -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MPI -# -value= -file= -if test -f $DIRSCRIPT/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$DIRSCRIPT/run_marc_defaults - fi -fi -if test -f $HOME/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$HOME/run_marc_defaults - fi -fi -if test -n "$value"; then - MARC_MPITYPE=$value - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - echo " " - echo " error, incorrect option for MARC_MPI" - echo " defined in $file: $MARC_MPITYPE" - echo " valid options: $MPI_DEFAULT $MPI_OTHER" - echo " " - exit - fi - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - fi -fi -# -# -# allow scratch directory to be specified with environmental variable -# MARCSCRATCH -if test $MARCSCRATCH -then - if test -d $MARCSCRATCH - then - DIRSCR=$MARCSCRATCH - else - echo "error, scratch directory '$MARCSCRATCH'" - echo " specified via environmental variable MARCSCRATCH does not exist" - exit - fi -fi -# -############################################################################## -# parse input - arguments always come in pairs # -############################################################################## - -arg=$1 -if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - shift - arg=$1 -fi -while [ -n "$arg" ] -do - shift - value=$1 - case $arg in - -al* | -AL*) - LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - $MARC_BIN/marc -alloc 1 - exit - ;; - -li* | -LI*) - justlist=yes - ;; - -fe* | -FE*) - feature=$value - ;; - -pr* | -PR*) - if test `dirname $value` = '.' - then - prog=`$BASENAME $value .marc` - progdll=`$BASENAME $value` - else - prog=`dirname $value`/`$BASENAME $value .marc` - progdll=`dirname $value`/`$BASENAME $value` - fi - prdir=`dirname $value` - case $prdir in - \/*) - ;; - *) - prog=`pwd`/$prdir/$prog - ;; - esac - ;; - -j* | -J*) - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - ;; - -r* | -R*) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - -si* | -SI*) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - -pi* | -PI*) - if test -f $value.t19 - then - pid=`$BASENAME $value .t19` - else - pid=`$BASENAME $value .t16` - fi - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - -bdf | -BDF) - makebdf=1 - ;; - -de* | -DE*) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - -vf | -VF) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - -u* | -U*) - user=$value - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - -obj | -OBJ) - objs="$value" - ;; - -q* | -Q*) - qid=$value - ;; - -b* | -B*) - case $value in - y* | Y*) - qid=background - ;; - n* | N*) - qid=foreground - ;; - *) - ;; - esac - ;; - -at | -AT) - att=$value - ;; - -cpu* | -CPU*) - cpu=$value - ;; - -pq | -PQ*) - priority=$value - ;; - -v* | -V*) - verify=$value - ;; - -sa* | -SA*) - prgsav=$value - ;; - -np* | -NP*) - nprocdddm=$value - nprocdddmprint=$value - case $arg in - -nps* | -NPS* | -nprocds* | -NPROCDS*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - case $arg in - -np | -NP | -nprocd | -NPROCD) - icreated=0 - nprocdarg=-nprocd - ;; - esac - ;; - -ns* | -NS*) - nsolver=$value - ;; - -nt* | -NT*) - case $arg in - -nte | -NTE | -nthread_e* | -NTHREAD_E*) - nte=$value - ;; - esac - case $arg in - -nts | -NTS | -nthread_s* | -NTHREAD_S*) - nts=$value - ;; - esac - case $arg in - -nt | -NT | -nth* | -NTH* | -nthread* | -NTHREAD*) - nt=$value - ;; - esac - ;; - -gp* | -GP*) - gpuids=$value - ;; - -it* | -IT*) - itree=$value - ;; - -iam | -IAM) - iam=$value - ;; - -au* | -AU*) - nauto=$value - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -me | -ME ) - mesh=$value - ;; - -ml | -ML ) - memlimit=$value - ;; - -mo | -MO ) - ;; - -mpi | -MPI ) - mpioption=true - MARC_MPITYPE=$value - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - fi - fi - ;; - -dir* | -DIR*) - DIRJOB=$value - case $DIRJOB in - \/*) - ;; - *) - DIRJOB=`pwd`/$DIRJOB - ;; - esac - if test -z "$DIRSCRSET" - then - DIRSCR=$DIRJOB - fi - ;; - -sd* | -SD*) - DIRSCR=$value - DIRSCRSET=yes - case $DIRSCR in - \/*) - ;; - *) - DIRSCR=`pwd`/$DIRSCR - ;; - esac - ;; - -ho* | -HO*) - host=$value - ;; - -co* | -CO*) - compatible=$value - ;; - -ci* | -CI*) - cpinput=$value - ;; - -cr* | -CR*) - cpresults=$value - ;; - *) - error="$error -$arg: invalid option" - break - ;; - esac - case $value in - -*) - error="$error -$arg: invalid name $value" - break - ;; - esac - shift - arg=$1 - if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - shift - arg=$1 - fi -done -argc=`expr $# % 2` -if test $argc -eq 1 -then -# -# odd number of arguments -# - error="$error -argument list incomplete" -fi - -if test $nprocdddm -gt 0 -then -nprocd=$nprocdddm -fi - -if test $nsolver -gt 0 -then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi -fi -# Set defaults -if test $nt -eq -1 -then -nt=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nt -lt 0 -then -nt=0 -fi -if test $nte -eq -1 -then -nte=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nte -lt 0 -then -nte=0 -fi -if test $nts -eq -1 -then -nts=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nts -lt 0 -then -nts=0 -fi -# -# set number of element loop threads -# -ntprint=$nt -nteprint=$nte -# copy from -nprocd[s] -if test $nprocdddm -gt 1 -then - nteprint=$nprocdddm -fi -# override with -nthread_elem option -if test $nte -ne 0 -then -nteprint=$nte -fi -# check for minimum 1 threads per processes for DDM -if test $nprocdddm -gt 1 -then - if test $nteprint -lt $nprocdddm - then - nteprint=$nprocdddm - fi -fi -nte=$nteprint -# -# set number of Solver threads -# -ntsprint=$nts -# copy from -nthread or -nprocd[s] -if test $ntprint -ne 0 -then - ntsprint=$ntprint -else - if test $nprocdddm -gt 1 - then - ntsprint=$nprocdddm - fi -fi -# override with -nthread_solver option -if test $nts -ne 0 -then - ntsprint=$nts -fi -# check for minimum 1 threads per solver process. -if test $nsolver -lt $nprocdddm -then - if test $ntsprint -lt $nsolver - then - ntsprint=$nsolver - fi -else - if test $ntsprint -lt $nprocdddm - then - ntsprint=$nprocdddm - fi -fi -if test $ntsprint -eq 1 -then - set ntsprint=0 -fi -nts=$ntsprint - -# set stack size for multi-threading. -export KMP_MONITOR_STACKSIZE=7M -export OMP_STACKSIZE=7M - -# -# deprecate -nthread option at arugment of marc -nt=0 -# Reset nprocdddmm, nsolver and threads if not given. -if test $nprocdddm -eq 0 -then - nprocdarg= -fi -if test $nprocdddm -eq 0 -then - nprocdddmprint= -fi -if test $nprocdddm -eq 0 -then - nprocdddm= -fi - -if test $nsolver -eq 0 -then - nsolverprint= -fi -# end of threads setting. -gpuoption= -if test "$gpuids" = "" ; then - gpuoption= -else - gpuoption="-gp $gpuids" -fi - -if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH -else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH -fi -# Linux 64 + HPMPI, Below code is taken from include_linux64 -if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" -then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" -fi - -if test $nprocd -gt 1; then - if test -f $jid$dotdefhost; then - if test "$host" = ""; then - host=$jid$dotdefhost - fi - fi - if test -f hostfile_qa_$nprocd; then - if test "$host" = ""; then - host=hostfile_qa_$nprocd - fi - fi -fi - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then - dotdat=.inp - fi - - if test "$progdll"; then - /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll - rmdll=yes - pathdll=yes - progdll=${progdll}_$marcdll - else - progdll=$marcdll - fi - - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - pathdll=yes - fi -fi - -############################################################################## -# check parameter validity # -############################################################################## - -while test forever; do - -# -# check for input file existence -# -if test $nprocdddm -gt 1 -a $icreated -eq 0; then - if test ! -f $DIRJID/1$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/1$jid$dotdat not accessible" - fi - fi -else - if test ! -f $DIRJID/$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/$jid$dotdat not accessible" - fi - fi -fi - if test $nprocd -gt 1; then - if test "$host" ; then - if test ! -f $host; then - error="$error -host name file $host not accessible" - fi - fi - fi - -# -# check if the job is already running in the background -# -if test -f $DIRJOB/$jid.pid; then - error="$error -job is already running (the file $jid.pid exists)" -fi - -# -# if the program name is other than marc, then -# assume that this is a program in the users local directory -# - -bd=$MARC_BIN/ - -case $prog in - marc | MARC | $exefile) - program=$exefile - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - if test ! -f $user - then - error="$error -user subroutine file $user not accessible" - fi - fi - if test "$objs" - then - missingobjs= - for o in $objs - do - if test ! -f "$o" - then - if test -z "$missingobjs" - then - missingobjs="$o" - else - missingobjs="$missingobjs $o" - fi - fi - done - if test -n "$missingobjs" - then - error="$error -user object/library file(s) $missingobjs not accessible" - fi - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$vid" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRVID/1$vid.vfs - then - error="$error -view factor file $DIRVID/1$vid.vfs not accessible" - fi - else - if test ! -f $DIRVID/$vid.vfs - then - error="$error -view factor file $DIRVID/$vid.vfs not accessible" - fi - fi - fi - if $mpioption - then - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" - fi - fi - ;; - *) - program=$prog.marc - case $prog in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - error="$error -program option may not be used with user subroutine" - fi - if test "$objs" - then - error="$error -program option may not be used with user objects or libraries" - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$nauto" - then - if test $nauto -gt 2 - then - error="$error -incorrect option for auto restart " - fi - fi - if test "$ndcoup" - then - if test $ndcoup -gt 3 - then - error="$error -incorrect option for contact decoupling " - fi - fi - if test "$ndytran" - then - if test $ndytran -gt 1 - then - error="$error -incorrect option for Marc-Dytran Switch " - fi - fi - if $mpioption - then - if test ! -x $MARC_BIN/$exefile - then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE " - fi - fi - ;; -esac - -############################################################################## -# check argument integrity # -############################################################################## - -if test "$jid" -then - : -else - error="$error -job id required" -fi - -if test $nprocd -gt 1 -then - if test $nauto -gt 0 - then - error="$error -cannot run DDM job with auto restart (-au) option " - fi -fi -case $qid in - S* | s*) - qid=short - ;; - L* | l*) - qid=long - ;; - V* | v*) - qid=verylong - ;; - B* | b*) - qid=background - ;; - F* | f*) - qid=foreground - ;; - A* | a*) - qid=at - ;; - *) - error="$error -bad value for queue_id option" - ;; -esac - -case $prgsav in - N* | n*) - prgsav=no - ;; - Y* | y*) - prgsav=yes - ;; - *) - error="$error -bad value for save option" - ;; -esac - -case $verify in - N* | n*) - verify=no - ;; - Y* | y*) - verify=yes - ;; - *) - error="$error -bad value for verify option" - ;; -esac - -case $nprocdddm in - -* ) - error="$error -bad value for nprocd option" - ;; -esac - -case $nt in - -* ) - error="$error -bad value for nt option" - ;; -esac - -case $itree in - -* ) - error="$error -bad value for itree option" - ;; -esac -case $iam in - -* ) - error="$error -bad value for iam option" - ;; -esac -case $compatible in - N* | n*) - compatible=no - ;; - Y* | y*) - compatible=yes - ;; - unknown) - ;; - *) - error="$error -bad value for comp option" - ;; -esac -case $cpinput in - N* | n*) - cpinput=no - ;; - Y* | y*) - cpinput=yes - ;; - *) - error="$error -bad value for copy input option" - ;; -esac -case $cpresults in - N* | n*) - cpresults=no - ;; - Y* | y*) - cpresults=yes - ;; - *) - error="$error -bad value for copy results option" - ;; -esac - -# -# check for external file to run -# -if test -f $MARC_TOOLS/run_marc_check -then - . $MARC_TOOLS/run_marc_check -fi - -# -# pick up version data from bin/VERSION if it exists -# -if test -f $MARC_BIN/VERSION; then - ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` - if test -n "$ppp" ;then - PRODUCT=$ppp - fi - ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` - if test -n "$ppp" ;then - REVISION=", Build $ppp" - fi -fi -############################################################################## -# interact with the user to get the required information to run marc or # -# other marc system program # -############################################################################## - -deletelog=yes -if test $qid = background -a $verify = no -then -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Element loop threads : $nteprint -Solver processes : $nsolverprint -Solver threads : $ntsprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto " > $jid.log -deletelog=no -fi -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Element loop threads : $nteprint -Solver processes : $nsolverprint -Solver threads : $ntsprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto" - - -case $qid in - s* | S* | l* | L* | v* | V* ) - echo \ -"Queue priority : $priority -Queue CPU limit : $cpu -Queue start time : $att" - ;; -# * ) -# echo \ -#" " -# ;; -esac - -if test "$error" -then - if test $verify = yes - then - $ECHO "$error - -Please correct or quit(correct,quit,): $ECHOTXT" - error= - read answer - case $answer in - q* | Q*) - answer=quit - ;; - *) - answer=correct - ;; - esac - else - $ECHO "$error - $ECHOTXT" - echo " " - if test "$deletelog" = no - then - $ECHO "$error - $ECHOTXT" >> $jid.log - echo " " >> $jid.log - fi - answer=quit - fi -else - if test $verify = yes - then - $ECHO " -Are these parameters correct (yes,no,quit,)? $ECHOTXT" - read answer - case $answer in - q* | Q*) - answer=quit - ;; - y* | Y*) - answer=yes - ;; - *) - answer=no - ;; - esac - else - answer=yes - fi -fi - -case $answer in - no | correct) - -############################################################################## -# prompt for each value # -############################################################################## - - $ECHO " -Program name ($prog)? $ECHOTXT" - read value - if test "$value" - then - prog=$value - fi - $ECHO "Job ID ($jid)? $ECHOTXT" - read value - if test "$value" - then - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - fi - $ECHO "User subroutine name ($user)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - user= - ;; - *) - user=$value - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - esac - fi - $ECHO "User objects or libraries ($objs)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - objs= - ;; - *) - objs="$value" - ;; - esac - fi - $ECHO "Restart File Job ID ($rid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - rid= - ;; - *) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - esac - fi - $ECHO "Substructure File ID ($sid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - sid= - ;; - *) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - esac - fi - $ECHO "Post File Job ID ($pid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - pid= - ;; - *) - pid=$value - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - esac - fi - $ECHO "Defaults File ID ($did)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - did= - ;; - *) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - esac - fi - $ECHO "View Factor File ID ($vid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - vid= - ;; - *) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - esac - fi - $ECHO "Save generated module ($prgsav)? $ECHOTXT" - read value - if test "$value" - then - prgsav=$value - fi - $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" - read value - if test "$value" - then - nprocdddm=$value - nprocdddmprint=$value - fi - $ECHO "Run on ($nte) Element loop threads ? $ECHOTXT" - read value - if test "$value" - then - nte=$value - fi - $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" - read value - if test "$value" - then - nsolver=$value - fi - $ECHO "Run on ($nts) Solver threads ? $ECHOTXT" - read value - if test "$value" - then - nts=$value - fi -# - if test $nprocdddm -gt 0 - then - nprocd=$nprocdddm - fi - if test $nsolver -gt 0 - then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi - fi -# Element loop threads. - if test $nte -eq -1 - then - nte=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nte -lt 0 - then - nte=0 - fi - nteprint=$nte -# Copy from ddm - if test $nprocdddm -gt 1 - then - nteprint=$nprocdddm - fi -# override with -nthread_elem option - if test $nte -ne 0 - then - nteprint=$nte - fi -# check for minimum 1 threads per processes for DDM - if test $nprocdddm -ne 0 - then - if test $nteprint -lt $nprocdddm - then - nteprint=$nprocdddm - fi - fi - nte=$nteprint -# Solver threads. - if test $nts -eq -1 - then - nts=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nts -lt 0 - then - nts=0 - fi - ntsprint=$nts -# Copy from ddm - if test $nprocdddm -gt 1 - then - ntsprint=$nprocdddm - fi -# override with -nthread_solver option - if test $nts -ne 0 - then - ntsprint=$nts - fi -# check for minimum 1 threads per solver process. - if test $nsolver -lt $nprocdddm - then - if test $ntsprint -lt $nsolver - then - ntsprint=$nsolver - fi - else - if test $ntsprint -lt $nprocdddm - then - ntsprint=$nprocdddm - fi - fi - if test $ntsprint -eq 1 - then - set ntsprint=0 - fi - nts=$ntsprint - $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" - read value - if test "$value" - then - gpuids=$value - fi - if test "$gpuids" = "" ; then - gpuoption= - else - gpuoption="-gp $gpuids" - fi - if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH - fi - if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - fi -# - if test $nprocd -gt 1 - then - $ECHO "Message passing type ($itree)? $ECHOTXT" - read value - if test "$value" - then - itree=$value - fi - $ECHO "Host file name ($host)? $ECHOTXT" - read value - if test "$value" - then - host=$value - fi - if test $nprocdddm -gt 1 - then - $ECHO "Single input file? $ECHOTXT" - read value - case $value in - y* | Y*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" - read value - if test "$value" - then - compatible=$value - fi - $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" - read value - if test "$value" - then - cpinput=$value - fi - $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" - read value - if test "$value" - then - cpresults=$value - fi - fi - fi - $ECHO "Run the job in the queue ($qid)? $ECHOTXT" - read value - if test "$value" - then - qid=$value - fi - case $qid in - s* | S* | l* | L* | v* | V* ) - $ECHO "Queue priority ($priority)? $ECHOTXT" - read value - if test "$value" - then - priority=$value - fi - $ECHO "Job starts at ($att)? $ECHOTXT" - read value - if test "$value" - then - att=$value - fi - $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" - read value - if test "$value" - then - cpu=$value - fi - ;; - * ) - ;; - esac - $ECHO "Auto Restart option ($nauto)? $ECHOTXT" - read value - if test "$value" - then - nauto=$value - fi - $ECHO "Run directory ($DIRJOB)? $ECHOTXT" - read value - if test "$value" - then - DIRJOB=$value - DIRSCR=$DIRJOB - fi - $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" - read value - if test "$value" - then - DIRSCR=$value - fi - ;; - quit) - exit 1 - ;; - *) - break - ;; - -esac - - if test $nt -eq -1 - then - nt=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nt -lt 0 - then - nt=0 - fi - -done -# -if test $nt -eq 0 -then - ntarg= -fi -if test $nt -eq 0 -then - ntprint= -fi -if test $nt -eq 0 -then - nt= -fi - -if test $nte -eq 0 -then - ntearg= -fi -if test $nte -eq 0 -then - nteprint= -fi -if test $nte -eq 0 -then - nte= -fi - -if test $nts -eq 0 -then - ntsarg= -fi -if test $nts -eq 0 -then - ntsprint= -fi -if test $nts -eq 0 -then - nts= -fi -# -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - pathdll=yes - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - fi - - if test "$pathdll"; then -# -# reset share lib path -# - if test $MACHINENAME = "HP" - then - SHLIB_PATH=$DIRJOB:$SHLIB_PATH - export SHLIB_PATH - fi - if test $MACHINENAME = "IBM" - then - LIBPATH=$DIRJOB:$LIBPATH - export LIBPATH - fi -# - LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH - LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH - LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH - export LD_LIBRARY_PATH - export LD_LIBRARY64_PATH - export LD_LIBRARYN32_PATH - fi -fi -# end of dllrun>0 - - -if test $program = $exefile -o $program = $prog.marc -then - -# delete the old .log file unless we run in the background -if test "$deletelog" = yes -then - /bin/rm $jid.log 2>/dev/null -else - echo - echo running the job in the background, see $jid.log - echo -fi - -# -# check if this is an autoforge or rezoning or radiation job -# -if test $nprocd -eq 1 -then - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` - if test "$line" - then - autoforge=1 - fi -fi -# -# check that jobname for restarted run is not the same -# as restart file basename -# -if test "$rid" -then - if test "$jid" = "$rid" - then - echo " " - echo "ERROR: job name of current run is the same as job name" - echo " of the restarted job" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "ERROR: job name of current run is the same as job name" >> $jid.log - echo " of the restarted job" >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi -fi - -# -# user objects/libraries used -# - - if test "$objs" - then - program="$DIRJOB/$jid.marc" - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# user subroutine used -# -# add DAMASK options for linking - DAMASK="" - - if test "$user" - then - program=$usernoext.marc - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# Special case for IBM using POE but not an SP machine -# in this case we always need a host file, also for serial jobs. -# -if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP -then - MP_HOSTFILE=${jid}.host - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $nprocd -gt 1 - then - numdom=$nprocd - while test $numdom -gt 0 - do - hostname -s >> $MP_HOSTFILE - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - else - hostname -s > $MP_HOSTFILE - fi -fi -# -# check ssh for all hosts in host file -# -if test $nprocd -gt 1 -then -if test $MPITYPE = "intelmpi" -a "$INTELMPI_VERSION" = "HYDRA" - then -# get host list - if test "$host" - then - line=`grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' | uniq` -# count failing hosts - counter=0 - for i in $line - do - $RSH -o BatchMode=yes -o ConnectTimeout=10 $i uname -n - status=$? - if [[ $status != 0 ]] ; then - counter=$((counter+1)) - if [ "$counter" = "1" ]; then - echo " " - echo " error - connection test failed... " - echo " " - fi - echo " " - echo " connection test with ssh failed on host $i" - echo " check the following command: ssh $i uname -n " - echo " " - fi - done -# echo error message and quit - if test $counter -ne 0 - then - echo " " - echo " A parallel job using IntelMPI cannot be started. " - echo " The ssh command must be working correctly between " - echo " the computers used in the analysis. Furthermore, " - echo " it must be set up such that it does not prompt the " - echo " user for a password. Note that this is the case " - echo " also for running on a single machine. " - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo " A parallel job using IntelMPI cannot be started. ">> $jid.log - echo " The ssh command must be working correctly between ">> $jid.log - echo " the computers used in the analysis. Furthermore, ">> $jid.log - echo " it must be set up such that it does not prompt the ">> $jid.log - echo " user for a password. Note that this is the case ">> $jid.log - echo " also for running on a single machine. ">> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - else - counter=1 -# test ssh `hostname` - if test $counter -ne 0 - then - line=`hostname` - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi -# test ssh `hostname` - if test $counter -ne 0 - then - line=`hostname -s` - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi -# test ssh localhost - if test $counter -ne 0 - then - line=localhost - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi - if test $counter -ne 0 - then - echo " error - connection test failed... " - echo " " - echo " ssh needs to work on the machine without asking for a password." - echo " check the following command: ssh localhost uname -n" - echo " " - echo " A parallel job using IntelMPI cannot be started. " - echo " The ssh command must be working correctly between " - echo " the computers used in the analysis. Furthermore, " - echo " it must be set up such that it does not prompt the " - echo " user for a password. Note that this is the case " - echo " also for running on a single machine. " - echo " " - if test "$deletelog" = no - then - echo " error - connection test failed... " >> $jid.log - echo " " >> $jid.log - echo " ssh needs to work on the machine without asking for a password." >> $jid.log - echo " check the following command: ssh localhost uname -n" >> $jid.log - echo " " >> $jid.log - echo " A parallel job using IntelMPI cannot be started. " >> $jid.log - echo " The ssh command must be working correctly between " >> $jid.log - echo " the computers used in the analysis. Furthermore, " >> $jid.log - echo " it must be set up such that it does not prompt the " >> $jid.log - echo " user for a password. Note that this is the case " >> $jid.log - echo " also for running on a single machine. " >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - echo $line $nprocd > $jid.hosts - host=$jid.hosts - fi - fi -fi -fi -# -# check correctness of host file; fix for user sub -# - if test $nprocd -gt 1 - then - -# construct the path name to the executable (execpath) - execpath=$MARC_BIN/$exefile - usersub=0 - if test $program = $prog.marc - then - execpath=$prog.marc - usersub=1 - fi - if test "$objs" - then - execpath="$DIRJOB/$jid.marc" - usersub=1 - fi - if test "$user" - then - execpath=$usernoext.marc - usersub=1 - fi - export execpath - execname=`$BASENAME $execpath` - - if test "$host" - then - userhost=$host - case $userhost in - \/* | \.\/*) - ;; - *) - userhost=`pwd`/$userhost - ;; - esac - -# check that the number of processes specified in the hostfile is -# equal to nprocd specified by -nprocd. - numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` - if test $nprocd -ne $numproc - then - echo " " - echo "error, the number of processes specified in the host file" - echo "must be equal to the number of processes given by -nprocd/-nsolver" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, the number of processes specified in the host file" >> $jid.log - echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - -# check for Myrinet that the number of processes per host is -# less than number of available user ports, 5 -# .gmpi directory must exist in user's home directory -# and must have write permission from remote hosts - if test $MPITYPE = "myrinet" - then - numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` - if test $numproc -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes specified " - echo "in the hostfile must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes specified " >> $jid.log - echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - if test ! -d ~/.gmpi - then - echo " " - echo "error, for Myrinet a .gmpi directory must exist " - echo "under the user's home directory" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log - echo "under the user's home directory" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - homedir=`echo ~` - for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - echo " " - echo "error, for Myrinet a shared .gmpi directory must exist " - echo "under the user's home directory " - echo "with remote write permission" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log - echo "under the user's home directory " >> $jid.log - echo "with remote write permission" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - /bin/rm tmp.$$ - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - fi - fi - done - fi - fi - -# construct the host file $jid.host which is used by mpirun -# skip lines starting with # and only consider lines with more than -# one word in them. Note that the hostfile given to this script -# has two columns: the host name and the number of shared processes -# to run on this host. mpirun wants the number of _other_ -# processes to run in addition to the one being run on the machine -# on which the job is started. hence the $2-1 for fnr == 1. - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then -# HPMPI or HP hardware MPI - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ - -v mpihpspecial="$MPIHPSPECIAL" \ -'{if ( NF > 0) {\ - fnr++ ; \ - printf("-h %s -np %s",$1,$2); \ - printf(" %s",mpihpspecial); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ - if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ - }\ - }' > $jid.host -# end HPMPI or HP hardware MPI - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then -# IBM using hardware MPI (POE) - MP_HOSTFILE=$jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host -# end IBM using hardware MPI (POE) -# for Intel MPI, need to create a machinefile for DMP - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then -# Intel MPI - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - /bin/cp $host $jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Intel MPI for DMP -# for Solaris HPC 7.1, need to create a machinefile for DMP - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then -# Solaris HPC 7.1 - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Solaris HPC 7.1 for DMP -# for Myrinet, construct a configuration file in ~/.gmpi -# this must be readable by each process -# format is (hostname) (port number) for each process - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - grep -v '^#' $host | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ -{if ( NF > 0 ) \ - for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ -}' >> ~/.gmpi/$jid.host - else -# this is for mpich-1.2.5 and later, using the -pg option -# format: host nproc executable user arguments -# the arguments are added later - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s %s\n",path,user);\ - if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ - }\ - }' > $jid.host - fi -# end Myrinet - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then -# Compaq MPI via Memory Channel - grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host -# end Compaq MPI - else -# MPICH - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ - }\ - }' > $jid.host - fi -# define the variable host and host_filt -# host_filt is used for loops over hosts -# for Myrinet we need to use a filtered variant of userhost -# for others we can use $host - if test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - host=~/.gmpi/$jid.host - host_filt=$jid.host_tMp - grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt - else - host=$jid.host - host_filt=$host - fi - else - host=$jid.host - host_filt=$host - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - host_filt=$jid.mfile - fi - fi -# figure out if the machines in the hostfile are nfs mounted -# or distributed and set the variable "dirstatus" accordingly. -# only perform the check if user subroutine is used -# or a user subroutine executable is used - - numfield=1 - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - numfield=2 - fi - DIR1=$DIRJOB - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - counter=0 - echo " " - echo "checking if local or shared directories for host" - if test "$deletelog" = no - then - echo "checking if local or shared directories for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - dirstatus[$counter]="shared" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - dirstatus[$counter]="local" - /bin/rm tmp.$$ - else - if test ! -f $jid.$$ - then - dirstatus[$counter]="local" - $RSH $i /bin/rm $DIR1/$jid.$$ - else - /bin/rm $jid.$$ - fi - fi - if test -f tmp.$$ - then - /bin/rm tmp.$$ - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - echo " ${dirstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${dirstatus[$counter]}" >> $jid.log - fi - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - fi - -# figure out if this is a compatible set of machines -# unless explicitly specified with flag -comp -# only perform the check if user subroutine is used -# or a user subroutine executable is used -# Myrinet does not support heterogeneous - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - if test $compatible = "unknown" - then - thisname=$ARCH - compatible=yes - counter=0 - echo "checking if machines are compatible for host" - if test "$deletelog" = no - then - echo "checking if machines are compatible for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]="yes" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - othername=`$RSH $i uname -a | cut -f 1 -d " "` - if test $thisname != $othername - then - compatible=no - compstatus[$counter]="no" - fi - fi - echo " ${compstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${compstatus[$counter]}" >> $jid.log - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - else - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]=$compatible - fi - done - if test $compatible = "no" - then - echo "all machines assumed incompatible" - if test "$deletelog" = no - then - echo "all machines assumed incompatible" >> $jid.log - fi - else - echo "all machines compatible" - if test "$deletelog" = no - then - echo "all machines compatible" >> $jid.log - fi - fi - fi -# error out if user objects or libraries are used on incompatible machines - if test "$compatible" = "no" -a -n "$objs" - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" - if test "$deletelog" = no - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log - fi - exit 1 - fi -# modify new host file if NFS mounted heterogeneous machine - doit= - if test $program = $prog.marc - then - doit=yes - fi - if test "$user" - then - doit=yes - fi - if test "$doit" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - $AWK -v hst=$i '{fnr++ ; \ -if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ -printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} - /bin/mv $jid.host{$$} $jid.host - host=$jid.host - fi - fi - done - fi - fi # if test $program = $prog.marc -o $user -o $obj - - else # if test $host - # assume shared memory machine if no hostfile given and - # MPITYPE is set to mpich or Myrinet - # check for Myrinet that the total number of processes is - # less than number of available user ports, 5 - if test $MPITYPE = "mpich" -o $MPITYPE = "scali" - then - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - host=$jid.host - elif test $MPITYPE = "myrinet" - then - if test $nprocd -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes " - echo "must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes " >> $jid.log - echo "must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - echo `hostname` $nprocd | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ - {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ -' >> ~/.gmpi/$jid.host - host=~/.gmpi/$jid.host - else - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - - fi - fi # if test myrinet - - fi # if test $host - - fi # if test $nprocd -gt 1 - -fi # if test $program = $exefile -o $program = $prog.marc - -############################################################################## -# construct run stream (Marc only) # -############################################################################## - -# set maximum message length for ddm to a large number -# for vendor provided mpi -if test $itree -eq 0 -a $MPITYPE = hardware -then - itree=100000000 - if test $MACHINENAME = SGI - then - itree=100000001 - fi -fi -if test $itree -eq 0 -a $MPITYPE = hpmpi -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = myrinet -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = nec -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = scali -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = intelmpi -then - itree=100000000 -fi -if test $nprocdddm -lt 2 -then - nprocdarg= -else - nprocdarg="$nprocdarg $nprocdddm" -fi -if test $nsolver -eq 0 -then - nsolverarg= -else - nsolverarg="$nsolverarg $nsolver" -fi -if test $nprocdddm -lt 2 -a $nsolver -eq 0 -then -nprocd=0 -fi -if test $nprocd -gt 0 -then - if test "$host" - then - if test -z "$RUN_JOB2" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then - RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - else - RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" - RUN_JOB=" -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - numhost=`uniq $jid.mfile | wc -l` - if test "$INTELMPI_VERSION" = "HYDRA" - then - RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n $numhost -r $RSH -f $jid.mfile - RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" - fi - -# intelmpi uses configfile. format: -# -host host1 -n n1 executable marcargs -# one such line per host -# collect the marcargs in RUN_JOB and construct the config file later -# collect the run stream in RUN_JOB_TMP - RUN_JOB="-jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - - - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then - RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi - if test "$userhost" - then - RUN_JOB="$RUN_JOB -mhost $userhost" - fi - if test $MPITYPE = "scali" - then -# set default working directory to /tmp to allow -# different directory names - SCAMPI_WORKING_DIRECTORY=/tmp - export SCAMPI_WORKING_DIRECTORY - fi - else - if test -z "$RUN_JOB1" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - RUNNPROCD=$nprocd - if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" - then - RUNNPROCD= - MP_PROCS=$nprocd - export MP_PROCS - fi - if test $MPITYPE = "myrinet" - then - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n 1 -f $jid.hosts - fi - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi - fi -else - if test $nauto -gt 0 -o $ndcoup -gt 0 - then - RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ - $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - else -# this is for a serial job without auto restart: - RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi -fi -if test "$rid" -then - RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" -fi -if test "$pid" -then - RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" -fi -if test "$sid" -then - RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" -fi -if test "$did" -then - RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" -fi -if test "$vid" -then - RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" -fi -if test $nauto -gt 0 -then - RUN_JOB="$RUN_JOB -autorst $nauto " -fi -if test $ndcoup -gt 0 -then - RUN_JOB="$RUN_JOB -dcoup $ndcoup " -fi -if test $ndytran -gt 0 -then - RUN_JOB="$RUN_JOB -dytran $ndytran " -fi -if test $mesh -gt 0 -then - RUN_JOB="$RUN_JOB -me $mesh " -fi -if test $noutcore -gt 0 -then - RUN_JOB="$RUN_JOB -outcore $noutcore " -fi -if test "$dllrun" -gt 0 -then - RUN_JOB="$RUN_JOB -dll $dllrun " -fi -if test "$trkrun" -gt 0 -then - RUN_JOB="$RUN_JOB -trk $trkrun " -fi -if test "$iam" -then - RUN_JOB="$RUN_JOB -iam $iam " -fi -if test "$justlist" -then - RUN_JOB="$RUN_JOB -list 1 " -fi -if test "$feature" -then - RUN_JOB="$RUN_JOB -feature $feature " -fi -if test "$memlimit" -ne 0 -then - RUN_JOB="$RUN_JOB -ml $memlimit " -fi -if test "$cpinput" -then - RUN_JOB="$RUN_JOB -ci $cpinput " -fi -if test "$cpresults" -then - RUN_JOB="$RUN_JOB -cr $cpresults " -fi -if test "$DIRSCR" != "$DIRJOB" -then - RUN_JOB="$RUN_JOB -dirscr $DIRSCR" -else - DIRSCR=$DIRJOB -fi -if test "$makebdf" -then - RUN_JOB="$RUN_JOB -bdf $makebdf " -fi -if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" -then - # append $RUN_JOB to all lines of the host file - # and set RUN_JOB - $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ - /bin/mv $host.$$ $host - RUN_JOB=$RUN_JOB_TMP -fi -if test $MPITYPE = "intelmpi" -a "$host" -then - # construct config file, append $RUN_JOB to all lines of the config file - # and set RUN_JOB - if test "$INTELMPI_VERSION" = "HYDRA" - then - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - else - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-host %s -n %s",$1,$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - fi - RUN_JOB=$RUN_JOB_TMP -fi -echo " " -echo "Final run stream value" -echo " RUNJOB="$RUN_JOB -if test "$deletelog" = no -then -echo " " >> $jid.log -echo "Final run stream value" >> $jid.log -echo " RUNJOB="$RUN_JOB >> $jid.log -fi - - -############################################################################## -# run marc using valgrind # -############################################################################## -#RUN_JOB="valgrind $RUN_JOB" -#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" -############################################################################## - - -############################################################################## -# run the requested program in a queue # -############################################################################## - -if test "$deletelog" = yes -then - echo - date -else - echo >> $jid.log - date >> $jid.log -fi -if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] -then - -/bin/rm -f $jid.runmarcscript - - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - userobj=$usermoext.o - fi - cat > $jid.runmarcscript << END4 - if test "$user" - then - if test $MACHINENAME = "CRAY" - then - $DFORTHIGH $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTHIGH $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $MARCCUDALIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } -END4 -else - prgsav=yes -fi -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# - -cat >> $jid.runmarcscript << END5 - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -# first remove all .out files and incremental restart files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null - /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null -fi - -if test $nprocdddm -gt 1 -then - $RUN_JOB 2>>$jid.log -else - $RUN_JOB 2>>$jid.log -fi - -if test $dllrun -eq 0; then - if test $prgsav = no - then - /bin/rm -f $bd$program 2>/dev/null - fi -else - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes - then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -END5 - - -# Submit to marc batch queue -# -if [ $qid = at ] -then -QUENAME=at -SUBMCMD= -else -# -# Submit to qsub queue -# -QUENAME=qsub -SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" -if test "$priority" -then - SUBMCMD=$SUBMCMD" -p $priority" -fi -if test "$att" -then - SUBMCMD=$SUBMCMD" -a $att" -fi -if test "$cpu" -then - SUBMCMD=$SUBMCMD" -lt $cpu" -fi - -fi -echo $QUENAME $SUBMCMD -#cat $jid.runmarcscript -$QUENAME $SUBMCMD < $jid.runmarcscript - -/bin/rm -f $jid.runmarcscript - -############################################################################## -# run the requested program in the background # -############################################################################## - -else -if test $qid = background -then - -# -# first remove all old .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi -# -# compile user subroutine if present -# -( -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_h $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - echo " $PRODUCT Exit number 3" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTHIGH $user || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTHIGH $user -o $userobj || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - echo " $PRODUCT Exit number 3" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc - -# - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -$RUN_JOB & - -marcpid=$! -echo $marcpid > $DIRJOB/$jid.pid -wait $marcpid - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - if test "$host" - then - /bin/rm $jid.mfile 2> /dev/null - /bin/rm $jid.hosts 2> /dev/null - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.cfile 2> /dev/null - fi - fi - fi -fi - - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -) 1>>$jid.log 2>&1 & - - -############################################################################## -# run the requested program in the foreground # -############################################################################## - -else - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_h $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTHIGH $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTHIGH $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi -# first remove all .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi - -$RUN_JOB - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - if test "$host" - then - /bin/rm $jid.mfile 2> /dev/null - /bin/rm $jid.hosts 2> /dev/null - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.cfile 2> /dev/null - else - echo " " > /dev/null - fi - else - if test "$host" - then - mpdcleanup -a -f $jid.mfile - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.mfile 2> /dev/null - else - mpdcleanup -a -f $jid.hosts - /bin/rm $jid.hosts 2> /dev/null - fi - fi - fi -fi - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi - - -fi -fi diff --git a/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_hmp b/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_hmp deleted file mode 100644 index 9460819a0..000000000 --- a/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_hmp +++ /dev/null @@ -1,4053 +0,0 @@ -#!/bin/ksh -############################################################################## -# # -# run_marc - run a marc job # -# ------------------------- # -# # -# usage: run_marc -j jid { options } # -# # -# where standard options are: required: defaults: # -# -------------------------- # -# # -# -j* jid job id number. ** YES ** . # -# -pr* prog program name. . marc # -# -v* y|n do or do not verify inputs. . yes # -# -q* s|l|v|b|f batch queue name or background, . short # -# foreground. # -# -b* as alternative to option -q* # -# # -# ( batch queues only : # -# -pq* intra queue priority. . . # -# -at DATE/TIME delay start of job. . . # -# format : January,1,1990,12:31 # -# or : today,5pm # -# -cpu* secs job CPU limit . . ) # -# # -# -r* rid restart file job id. . . # -# -si* sid substructure file id. . . # -# -pi* post post file job id. . . # -# -de* did defaults file . no # -# -vf vid viewfactor . no # -# # -# -u* user user subroutine. . . # -# -obj obj user objects or libraries. . . # -# -sa* y|n do or do not save load module. . no # -# -autorst auto restart flag for auto forge . no # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo selects i4 or i8 version # -# default: i4 or via defaults file run_marc_defaults # -# the -mo option will override # -# -mpi selects MPI version # -# each platform has a default MPI version and some # -# have an alternative version. see the include file # -# for the respective platform # -# MPI_DEFAULT defines the default MPI version # -# MPI_OTHER defines versions one can switch to # -# -dcoup for contact decoupling # -# currently not supported # -# -dir directory where the job i/o should take place. # -# defaults to current directory. # -# -sdir directory where scratch files are created # -# defaults to current directory. # -# # -# -alloc only perform memory allocation test, no analysis # -# -list y only list options in the input file, no analysis # -# -fe num set feature number "num" for the run. only one allowed # -# -dytran flag to switch from Dytran to Marc # -# dytran = 0, program will run w/o Marc-Dytran Switch # -# = 1, program will restart Marc after Dytran run # -# >= 2, Not supported yet. # -# currently not supported # -# -ou force analysis to use out-of-core control # -# =0, not used # -# =1, element storage out-of-core # -# -dll run marc using shared library libmarc.so and exe_marc # -# =1, used # -# =2, do not free streaming input memory # -# =3, run with marc input deck # -# -trk run marc for post-tracking # -# -gpuid run marc using GPGPU capability # -# specify gpuid on to be used in the analysis. Multiple # -# IDs may be assigned for DDM runs. # -# Separate a list of IDs with a colon. Each DMP # -# process will be assigned a GPU ID in round robin fastion# -# = 0 # -# = 0:1 etc... # -# # -# where parallel options are: # -# -------------------------- # -# # -# itree, host, and comp options are available for the domain # -# decomposition only. # -# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # -# # -# # -# -nprocd number of domains. # -# defaults to single domain solution. # -# -nprocds number of domains if single input file. # -# defaults to single domain solution. # -# -nps same as -nprocds. # -# -nsolver number of solver tasks for solver types 12 and 13 # -# these are distributed tasks operating via MPI # -# -nthread_elem number of threads for element assembly and recovery # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by element assembly # -# recovery. # -# Also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. # -# if both specified, -nthread_elem option will be used. # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor -nthread_elem specified. # -# -nthread_solver number of threads for solver types 6, 8, and 11 # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by 6, 8, and 11 # -# Also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. # -# if both specified, -nthread_solver option will be used. # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor -nthread_solver specified. # -# -nthread Same as -nthread_solver. # -# -itree message passing tree type for domain decomposition. # -# for debugging purposes; should not normally be used. # -# -host hostfile name for distributed execution on network. # -# defaults to no hostfile, unless jobid.defhost exists. # -# if jobid.defhost exists, only -np(s) necessary # -# -comp* y|n to be used with user routines on a network of # -# incompatible machines. # -# if set to no, a separate executable will be created # -# for each machine on the network. # -# if set to yes, the executable located on the machine # -# from which marc is started will be used on all machines.# -# defaults to no if O/S versions different on machines. # -# # -# -ci y|n copy input files to remote hosts (default: yes) # -# if "yes", input files are automatically copied to # -# remote hosts for a network run if necessary. # -# -cr y|n copy post files from remote hosts (default: yes) # -# if "yes", post files are automatically copied back from # -# remote hosts for a network run if necessary. # -############################################################################## -# set DIR to the directory in which this script is -REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" -DIR=`dirname $REALCOM` -# make sure DIR has an absolute path -case $DIR in - \/*) - ;; - *) - DIR=`pwd`/$DIR - ;; -esac -DIRSCRIPT=$DIR -AWK=awk -ARCH=`uname -a | cut -f 1 -d " "` -# Sun has a bad awk, use nawk instead -if test $ARCH = "SunOS" -then - AWK=nawk -fi -BASENAME=basename -# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists -if test $ARCH = "SunOS" -then - if test -x /usr/ucb/basename - then - BASENAME=/usr/ucb/basename - fi -fi - -# echo command line in the case of ECHO_COMMAND is true -if test "$ECHO_COMMAND" = true ; then - echo command "$0" "$@" -fi - -# -# "mode" selects version, i4 or i8 -# default is i4 -# this can be changed by a file run_marc_defaults -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MODE i8 -# it can also be set by the environmental variable MARC_INTEGER_SIZE -# and by the command line option "-mo" -# -mode= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -f $HOME/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -n "$MARC_INTEGER_SIZE" ; then - mode=$MARC_INTEGER_SIZE -fi -if test -z "$mode" ; then - mode=i8 -fi -case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "error, version mode must be i4 or i8" - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i4 or i8" - echo " " - echo " use -mo i4 or -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - setmode=true - fi - if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - fi - if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -done - -# set to i4 version for 32 bit Linux -if test "`uname -s`" = "Linux"; then - if test "`uname -m`" = "i686"; then - mode=i4 - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -fi - - -. "$DIR/getarch" - -. $MARC_INCLUDE -# - -# -# Dynamically determine the echo syntax -# - -case "`echo '\c'`" in - '\c') - ECHO='echo -n' - ECHOTXT=' ' - ;; - *) - ECHO='echo' - ECHOTXT=' \c' - ;; -esac - -# -# Variables for the MARC environment -# - -PRODUCT="Marc" -EXITMSG=$MARC_TOOLS/MESSAGES -export EXITMSG -FLEXDIR=$DIR/../flexlm/licenses -export FLEXDIR -TIMCHK=3600 -export TIMCHK -BINDIR=$MARC_BIN -export BINDIR -AFMATDAT=$MARC_RUNTIME/AF_flowmat/ -export AFMATDAT -# -# define directory path to global unified material database -# -MATFILE= -export MATFILE - -# -# define memory limit -# first set to MEMLIMIT from include -# -ml option overrules if specified -memlimit=$MEMLIMIT -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -# -if test $MACHINENAME = "HP" -then - SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH - export SHLIB_PATH -fi -# the one for IBM is defined futher down - -LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH -LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH -export LD_LIBRARY_PATH -export LD_LIBRARY64_PATH -export LD_LIBRARYN32_PATH - -atexit() { -kill -15 $$ -# -if test $MPITYPE = "myrinet" -then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi -fi -} - -trap "atexit" 2 - -# -# defaults -# - -prog=marc -exefile=marc -jid= -rid= -pid= -sid= -did= -vid= -user= -usernoext= -objs= -qid=background -cpu= -priority= -att= -trk= -verify=yes -prgsav=no -rmdll=no -cpdll=no -progdll= -pathdll= -error= -nprocd=0 -nprocdddm=1 -nprocdddmprint= -icreated=0 -nprocdarg= -nsolver=0 -nsolverarg=-ns -if test $nprocds -then - if test $nprocds -gt 1 - then - nprocdddm=$nprocds - nprocdddmprint=$nprocds - icreated=1 - nprocdarg=-nprocds - fi -fi -ntprint=0 -nt=-1 -nte=-1 -nts=-1 -ntarg=-nt -ntearg=-nte -ntsarg=-nts -nteprint= -ntsprint= -gpuids= -nauto=0 -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -itree=0 -iam= -link= -trkrun=0 -DIRJOB=`pwd` -DIRSCR=$DIRJOB -DIRSCRSET= -autoforge=0 -dotdat=.dat -dotdefhost=.defhost -host= -numhost= -mfile= -userhost= -makebdf= -cpinput=yes -cpresults=yes -marcdll=libmarc.$EXT_DLL -# define hostname and strip off extensions (alpha.aaa.com) -thishost=`hostname` -thishost=${thishost%%.*} -compatible=unknown -numfield=1 -justlist= -feature= -mpioption=false -MDSRCLIB=$MARC_LIB/mdsrc.a -# -# check run_marc_defaults file for default MPI setting -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MPI -# -value= -file= -if test -f $DIRSCRIPT/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$DIRSCRIPT/run_marc_defaults - fi -fi -if test -f $HOME/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$HOME/run_marc_defaults - fi -fi -if test -n "$value"; then - MARC_MPITYPE=$value - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - echo " " - echo " error, incorrect option for MARC_MPI" - echo " defined in $file: $MARC_MPITYPE" - echo " valid options: $MPI_DEFAULT $MPI_OTHER" - echo " " - exit - fi - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - fi -fi -# -# -# allow scratch directory to be specified with environmental variable -# MARCSCRATCH -if test $MARCSCRATCH -then - if test -d $MARCSCRATCH - then - DIRSCR=$MARCSCRATCH - else - echo "error, scratch directory '$MARCSCRATCH'" - echo " specified via environmental variable MARCSCRATCH does not exist" - exit - fi -fi -# -############################################################################## -# parse input - arguments always come in pairs # -############################################################################## - -arg=$1 -if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - shift - arg=$1 -fi -while [ -n "$arg" ] -do - shift - value=$1 - case $arg in - -al* | -AL*) - LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - $MARC_BIN/marc -alloc 1 - exit - ;; - -li* | -LI*) - justlist=yes - ;; - -fe* | -FE*) - feature=$value - ;; - -pr* | -PR*) - if test `dirname $value` = '.' - then - prog=`$BASENAME $value .marc` - progdll=`$BASENAME $value` - else - prog=`dirname $value`/`$BASENAME $value .marc` - progdll=`dirname $value`/`$BASENAME $value` - fi - prdir=`dirname $value` - case $prdir in - \/*) - ;; - *) - prog=`pwd`/$prdir/$prog - ;; - esac - ;; - -j* | -J*) - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - ;; - -r* | -R*) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - -si* | -SI*) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - -pi* | -PI*) - if test -f $value.t19 - then - pid=`$BASENAME $value .t19` - else - pid=`$BASENAME $value .t16` - fi - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - -bdf | -BDF) - makebdf=1 - ;; - -de* | -DE*) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - -vf | -VF) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - -u* | -U*) - user=$value - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - -obj | -OBJ) - objs="$value" - ;; - -q* | -Q*) - qid=$value - ;; - -b* | -B*) - case $value in - y* | Y*) - qid=background - ;; - n* | N*) - qid=foreground - ;; - *) - ;; - esac - ;; - -at | -AT) - att=$value - ;; - -cpu* | -CPU*) - cpu=$value - ;; - -pq | -PQ*) - priority=$value - ;; - -v* | -V*) - verify=$value - ;; - -sa* | -SA*) - prgsav=$value - ;; - -np* | -NP*) - nprocdddm=$value - nprocdddmprint=$value - case $arg in - -nps* | -NPS* | -nprocds* | -NPROCDS*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - case $arg in - -np | -NP | -nprocd | -NPROCD) - icreated=0 - nprocdarg=-nprocd - ;; - esac - ;; - -ns* | -NS*) - nsolver=$value - ;; - -nt* | -NT*) - case $arg in - -nte | -NTE | -nthread_e* | -NTHREAD_E*) - nte=$value - ;; - esac - case $arg in - -nts | -NTS | -nthread_s* | -NTHREAD_S*) - nts=$value - ;; - esac - case $arg in - -nt | -NT | -nth* | -NTH* | -nthread* | -NTHREAD*) - nt=$value - ;; - esac - ;; - -gp* | -GP*) - gpuids=$value - ;; - -it* | -IT*) - itree=$value - ;; - -iam | -IAM) - iam=$value - ;; - -au* | -AU*) - nauto=$value - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -me | -ME ) - mesh=$value - ;; - -ml | -ML ) - memlimit=$value - ;; - -mo | -MO ) - ;; - -mpi | -MPI ) - mpioption=true - MARC_MPITYPE=$value - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - fi - fi - ;; - -dir* | -DIR*) - DIRJOB=$value - case $DIRJOB in - \/*) - ;; - *) - DIRJOB=`pwd`/$DIRJOB - ;; - esac - if test -z "$DIRSCRSET" - then - DIRSCR=$DIRJOB - fi - ;; - -sd* | -SD*) - DIRSCR=$value - DIRSCRSET=yes - case $DIRSCR in - \/*) - ;; - *) - DIRSCR=`pwd`/$DIRSCR - ;; - esac - ;; - -ho* | -HO*) - host=$value - ;; - -co* | -CO*) - compatible=$value - ;; - -ci* | -CI*) - cpinput=$value - ;; - -cr* | -CR*) - cpresults=$value - ;; - *) - error="$error -$arg: invalid option" - break - ;; - esac - case $value in - -*) - error="$error -$arg: invalid name $value" - break - ;; - esac - shift - arg=$1 - if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - shift - arg=$1 - fi -done -argc=`expr $# % 2` -if test $argc -eq 1 -then -# -# odd number of arguments -# - error="$error -argument list incomplete" -fi - -if test $nprocdddm -gt 0 -then -nprocd=$nprocdddm -fi - -if test $nsolver -gt 0 -then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi -fi -# Set defaults -if test $nt -eq -1 -then -nt=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nt -lt 0 -then -nt=0 -fi -if test $nte -eq -1 -then -nte=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nte -lt 0 -then -nte=0 -fi -if test $nts -eq -1 -then -nts=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nts -lt 0 -then -nts=0 -fi -# -# set number of element loop threads -# -ntprint=$nt -nteprint=$nte -# copy from -nprocd[s] -if test $nprocdddm -gt 1 -then - nteprint=$nprocdddm -fi -# override with -nthread_elem option -if test $nte -ne 0 -then -nteprint=$nte -fi -# check for minimum 1 threads per processes for DDM -if test $nprocdddm -gt 1 -then - if test $nteprint -lt $nprocdddm - then - nteprint=$nprocdddm - fi -fi -nte=$nteprint -# -# set number of Solver threads -# -ntsprint=$nts -# copy from -nthread or -nprocd[s] -if test $ntprint -ne 0 -then - ntsprint=$ntprint -else - if test $nprocdddm -gt 1 - then - ntsprint=$nprocdddm - fi -fi -# override with -nthread_solver option -if test $nts -ne 0 -then - ntsprint=$nts -fi -# check for minimum 1 threads per solver process. -if test $nsolver -lt $nprocdddm -then - if test $ntsprint -lt $nsolver - then - ntsprint=$nsolver - fi -else - if test $ntsprint -lt $nprocdddm - then - ntsprint=$nprocdddm - fi -fi -if test $ntsprint -eq 1 -then - set ntsprint=0 -fi -nts=$ntsprint - -# set stack size for multi-threading. -export KMP_MONITOR_STACKSIZE=7M -export OMP_STACKSIZE=7M - -# -# deprecate -nthread option at arugment of marc -nt=0 -# Reset nprocdddmm, nsolver and threads if not given. -if test $nprocdddm -eq 0 -then - nprocdarg= -fi -if test $nprocdddm -eq 0 -then - nprocdddmprint= -fi -if test $nprocdddm -eq 0 -then - nprocdddm= -fi - -if test $nsolver -eq 0 -then - nsolverprint= -fi -# end of threads setting. -gpuoption= -if test "$gpuids" = "" ; then - gpuoption= -else - gpuoption="-gp $gpuids" -fi - -if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH -else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH -fi -# Linux 64 + HPMPI, Below code is taken from include_linux64 -if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" -then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" -fi - -if test $nprocd -gt 1; then - if test -f $jid$dotdefhost; then - if test "$host" = ""; then - host=$jid$dotdefhost - fi - fi - if test -f hostfile_qa_$nprocd; then - if test "$host" = ""; then - host=hostfile_qa_$nprocd - fi - fi -fi - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then - dotdat=.inp - fi - - if test "$progdll"; then - /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll - rmdll=yes - pathdll=yes - progdll=${progdll}_$marcdll - else - progdll=$marcdll - fi - - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - pathdll=yes - fi -fi - -############################################################################## -# check parameter validity # -############################################################################## - -while test forever; do - -# -# check for input file existence -# -if test $nprocdddm -gt 1 -a $icreated -eq 0; then - if test ! -f $DIRJID/1$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/1$jid$dotdat not accessible" - fi - fi -else - if test ! -f $DIRJID/$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/$jid$dotdat not accessible" - fi - fi -fi - if test $nprocd -gt 1; then - if test "$host" ; then - if test ! -f $host; then - error="$error -host name file $host not accessible" - fi - fi - fi - -# -# check if the job is already running in the background -# -if test -f $DIRJOB/$jid.pid; then - error="$error -job is already running (the file $jid.pid exists)" -fi - -# -# if the program name is other than marc, then -# assume that this is a program in the users local directory -# - -bd=$MARC_BIN/ - -case $prog in - marc | MARC | $exefile) - program=$exefile - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - if test ! -f $user - then - error="$error -user subroutine file $user not accessible" - fi - fi - if test "$objs" - then - missingobjs= - for o in $objs - do - if test ! -f "$o" - then - if test -z "$missingobjs" - then - missingobjs="$o" - else - missingobjs="$missingobjs $o" - fi - fi - done - if test -n "$missingobjs" - then - error="$error -user object/library file(s) $missingobjs not accessible" - fi - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$vid" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRVID/1$vid.vfs - then - error="$error -view factor file $DIRVID/1$vid.vfs not accessible" - fi - else - if test ! -f $DIRVID/$vid.vfs - then - error="$error -view factor file $DIRVID/$vid.vfs not accessible" - fi - fi - fi - if $mpioption - then - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" - fi - fi - ;; - *) - program=$prog.marc - case $prog in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - error="$error -program option may not be used with user subroutine" - fi - if test "$objs" - then - error="$error -program option may not be used with user objects or libraries" - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$nauto" - then - if test $nauto -gt 2 - then - error="$error -incorrect option for auto restart " - fi - fi - if test "$ndcoup" - then - if test $ndcoup -gt 3 - then - error="$error -incorrect option for contact decoupling " - fi - fi - if test "$ndytran" - then - if test $ndytran -gt 1 - then - error="$error -incorrect option for Marc-Dytran Switch " - fi - fi - if $mpioption - then - if test ! -x $MARC_BIN/$exefile - then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE " - fi - fi - ;; -esac - -############################################################################## -# check argument integrity # -############################################################################## - -if test "$jid" -then - : -else - error="$error -job id required" -fi - -if test $nprocd -gt 1 -then - if test $nauto -gt 0 - then - error="$error -cannot run DDM job with auto restart (-au) option " - fi -fi -case $qid in - S* | s*) - qid=short - ;; - L* | l*) - qid=long - ;; - V* | v*) - qid=verylong - ;; - B* | b*) - qid=background - ;; - F* | f*) - qid=foreground - ;; - A* | a*) - qid=at - ;; - *) - error="$error -bad value for queue_id option" - ;; -esac - -case $prgsav in - N* | n*) - prgsav=no - ;; - Y* | y*) - prgsav=yes - ;; - *) - error="$error -bad value for save option" - ;; -esac - -case $verify in - N* | n*) - verify=no - ;; - Y* | y*) - verify=yes - ;; - *) - error="$error -bad value for verify option" - ;; -esac - -case $nprocdddm in - -* ) - error="$error -bad value for nprocd option" - ;; -esac - -case $nt in - -* ) - error="$error -bad value for nt option" - ;; -esac - -case $itree in - -* ) - error="$error -bad value for itree option" - ;; -esac -case $iam in - -* ) - error="$error -bad value for iam option" - ;; -esac -case $compatible in - N* | n*) - compatible=no - ;; - Y* | y*) - compatible=yes - ;; - unknown) - ;; - *) - error="$error -bad value for comp option" - ;; -esac -case $cpinput in - N* | n*) - cpinput=no - ;; - Y* | y*) - cpinput=yes - ;; - *) - error="$error -bad value for copy input option" - ;; -esac -case $cpresults in - N* | n*) - cpresults=no - ;; - Y* | y*) - cpresults=yes - ;; - *) - error="$error -bad value for copy results option" - ;; -esac - -# -# check for external file to run -# -if test -f $MARC_TOOLS/run_marc_check -then - . $MARC_TOOLS/run_marc_check -fi - -# -# pick up version data from bin/VERSION if it exists -# -if test -f $MARC_BIN/VERSION; then - ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` - if test -n "$ppp" ;then - PRODUCT=$ppp - fi - ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` - if test -n "$ppp" ;then - REVISION=", Build $ppp" - fi -fi -############################################################################## -# interact with the user to get the required information to run marc or # -# other marc system program # -############################################################################## - -deletelog=yes -if test $qid = background -a $verify = no -then -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Element loop threads : $nteprint -Solver processes : $nsolverprint -Solver threads : $ntsprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto " > $jid.log -deletelog=no -fi -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Element loop threads : $nteprint -Solver processes : $nsolverprint -Solver threads : $ntsprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto" - - -case $qid in - s* | S* | l* | L* | v* | V* ) - echo \ -"Queue priority : $priority -Queue CPU limit : $cpu -Queue start time : $att" - ;; -# * ) -# echo \ -#" " -# ;; -esac - -if test "$error" -then - if test $verify = yes - then - $ECHO "$error - -Please correct or quit(correct,quit,): $ECHOTXT" - error= - read answer - case $answer in - q* | Q*) - answer=quit - ;; - *) - answer=correct - ;; - esac - else - $ECHO "$error - $ECHOTXT" - echo " " - if test "$deletelog" = no - then - $ECHO "$error - $ECHOTXT" >> $jid.log - echo " " >> $jid.log - fi - answer=quit - fi -else - if test $verify = yes - then - $ECHO " -Are these parameters correct (yes,no,quit,)? $ECHOTXT" - read answer - case $answer in - q* | Q*) - answer=quit - ;; - y* | Y*) - answer=yes - ;; - *) - answer=no - ;; - esac - else - answer=yes - fi -fi - -case $answer in - no | correct) - -############################################################################## -# prompt for each value # -############################################################################## - - $ECHO " -Program name ($prog)? $ECHOTXT" - read value - if test "$value" - then - prog=$value - fi - $ECHO "Job ID ($jid)? $ECHOTXT" - read value - if test "$value" - then - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - fi - $ECHO "User subroutine name ($user)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - user= - ;; - *) - user=$value - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - esac - fi - $ECHO "User objects or libraries ($objs)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - objs= - ;; - *) - objs="$value" - ;; - esac - fi - $ECHO "Restart File Job ID ($rid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - rid= - ;; - *) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - esac - fi - $ECHO "Substructure File ID ($sid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - sid= - ;; - *) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - esac - fi - $ECHO "Post File Job ID ($pid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - pid= - ;; - *) - pid=$value - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - esac - fi - $ECHO "Defaults File ID ($did)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - did= - ;; - *) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - esac - fi - $ECHO "View Factor File ID ($vid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - vid= - ;; - *) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - esac - fi - $ECHO "Save generated module ($prgsav)? $ECHOTXT" - read value - if test "$value" - then - prgsav=$value - fi - $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" - read value - if test "$value" - then - nprocdddm=$value - nprocdddmprint=$value - fi - $ECHO "Run on ($nte) Element loop threads ? $ECHOTXT" - read value - if test "$value" - then - nte=$value - fi - $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" - read value - if test "$value" - then - nsolver=$value - fi - $ECHO "Run on ($nts) Solver threads ? $ECHOTXT" - read value - if test "$value" - then - nts=$value - fi -# - if test $nprocdddm -gt 0 - then - nprocd=$nprocdddm - fi - if test $nsolver -gt 0 - then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi - fi -# Element loop threads. - if test $nte -eq -1 - then - nte=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nte -lt 0 - then - nte=0 - fi - nteprint=$nte -# Copy from ddm - if test $nprocdddm -gt 1 - then - nteprint=$nprocdddm - fi -# override with -nthread_elem option - if test $nte -ne 0 - then - nteprint=$nte - fi -# check for minimum 1 threads per processes for DDM - if test $nprocdddm -ne 0 - then - if test $nteprint -lt $nprocdddm - then - nteprint=$nprocdddm - fi - fi - nte=$nteprint -# Solver threads. - if test $nts -eq -1 - then - nts=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nts -lt 0 - then - nts=0 - fi - ntsprint=$nts -# Copy from ddm - if test $nprocdddm -gt 1 - then - ntsprint=$nprocdddm - fi -# override with -nthread_solver option - if test $nts -ne 0 - then - ntsprint=$nts - fi -# check for minimum 1 threads per solver process. - if test $nsolver -lt $nprocdddm - then - if test $ntsprint -lt $nsolver - then - ntsprint=$nsolver - fi - else - if test $ntsprint -lt $nprocdddm - then - ntsprint=$nprocdddm - fi - fi - if test $ntsprint -eq 1 - then - set ntsprint=0 - fi - nts=$ntsprint - $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" - read value - if test "$value" - then - gpuids=$value - fi - if test "$gpuids" = "" ; then - gpuoption= - else - gpuoption="-gp $gpuids" - fi - if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH - fi - if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - fi -# - if test $nprocd -gt 1 - then - $ECHO "Message passing type ($itree)? $ECHOTXT" - read value - if test "$value" - then - itree=$value - fi - $ECHO "Host file name ($host)? $ECHOTXT" - read value - if test "$value" - then - host=$value - fi - if test $nprocdddm -gt 1 - then - $ECHO "Single input file? $ECHOTXT" - read value - case $value in - y* | Y*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" - read value - if test "$value" - then - compatible=$value - fi - $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" - read value - if test "$value" - then - cpinput=$value - fi - $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" - read value - if test "$value" - then - cpresults=$value - fi - fi - fi - $ECHO "Run the job in the queue ($qid)? $ECHOTXT" - read value - if test "$value" - then - qid=$value - fi - case $qid in - s* | S* | l* | L* | v* | V* ) - $ECHO "Queue priority ($priority)? $ECHOTXT" - read value - if test "$value" - then - priority=$value - fi - $ECHO "Job starts at ($att)? $ECHOTXT" - read value - if test "$value" - then - att=$value - fi - $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" - read value - if test "$value" - then - cpu=$value - fi - ;; - * ) - ;; - esac - $ECHO "Auto Restart option ($nauto)? $ECHOTXT" - read value - if test "$value" - then - nauto=$value - fi - $ECHO "Run directory ($DIRJOB)? $ECHOTXT" - read value - if test "$value" - then - DIRJOB=$value - DIRSCR=$DIRJOB - fi - $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" - read value - if test "$value" - then - DIRSCR=$value - fi - ;; - quit) - exit 1 - ;; - *) - break - ;; - -esac - - if test $nt -eq -1 - then - nt=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nt -lt 0 - then - nt=0 - fi - -done -# -if test $nt -eq 0 -then - ntarg= -fi -if test $nt -eq 0 -then - ntprint= -fi -if test $nt -eq 0 -then - nt= -fi - -if test $nte -eq 0 -then - ntearg= -fi -if test $nte -eq 0 -then - nteprint= -fi -if test $nte -eq 0 -then - nte= -fi - -if test $nts -eq 0 -then - ntsarg= -fi -if test $nts -eq 0 -then - ntsprint= -fi -if test $nts -eq 0 -then - nts= -fi -# -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - pathdll=yes - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - fi - - if test "$pathdll"; then -# -# reset share lib path -# - if test $MACHINENAME = "HP" - then - SHLIB_PATH=$DIRJOB:$SHLIB_PATH - export SHLIB_PATH - fi - if test $MACHINENAME = "IBM" - then - LIBPATH=$DIRJOB:$LIBPATH - export LIBPATH - fi -# - LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH - LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH - LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH - export LD_LIBRARY_PATH - export LD_LIBRARY64_PATH - export LD_LIBRARYN32_PATH - fi -fi -# end of dllrun>0 - - -if test $program = $exefile -o $program = $prog.marc -then - -# delete the old .log file unless we run in the background -if test "$deletelog" = yes -then - /bin/rm $jid.log 2>/dev/null -else - echo - echo running the job in the background, see $jid.log - echo -fi - -# -# check if this is an autoforge or rezoning or radiation job -# -if test $nprocd -eq 1 -then - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` - if test "$line" - then - autoforge=1 - fi -fi -# -# check that jobname for restarted run is not the same -# as restart file basename -# -if test "$rid" -then - if test "$jid" = "$rid" - then - echo " " - echo "ERROR: job name of current run is the same as job name" - echo " of the restarted job" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "ERROR: job name of current run is the same as job name" >> $jid.log - echo " of the restarted job" >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi -fi - -# -# user objects/libraries used -# - - if test "$objs" - then - program="$DIRJOB/$jid.marc" - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# user subroutine used -# -# add DAMASK options for linking - DAMASK="" - - if test "$user" - then - program=$usernoext.marc - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# Special case for IBM using POE but not an SP machine -# in this case we always need a host file, also for serial jobs. -# -if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP -then - MP_HOSTFILE=${jid}.host - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $nprocd -gt 1 - then - numdom=$nprocd - while test $numdom -gt 0 - do - hostname -s >> $MP_HOSTFILE - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - else - hostname -s > $MP_HOSTFILE - fi -fi -# -# check ssh for all hosts in host file -# -if test $nprocd -gt 1 -then -if test $MPITYPE = "intelmpi" -a "$INTELMPI_VERSION" = "HYDRA" - then -# get host list - if test "$host" - then - line=`grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' | uniq` -# count failing hosts - counter=0 - for i in $line - do - $RSH -o BatchMode=yes -o ConnectTimeout=10 $i uname -n - status=$? - if [[ $status != 0 ]] ; then - counter=$((counter+1)) - if [ "$counter" = "1" ]; then - echo " " - echo " error - connection test failed... " - echo " " - fi - echo " " - echo " connection test with ssh failed on host $i" - echo " check the following command: ssh $i uname -n " - echo " " - fi - done -# echo error message and quit - if test $counter -ne 0 - then - echo " " - echo " A parallel job using IntelMPI cannot be started. " - echo " The ssh command must be working correctly between " - echo " the computers used in the analysis. Furthermore, " - echo " it must be set up such that it does not prompt the " - echo " user for a password. Note that this is the case " - echo " also for running on a single machine. " - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo " A parallel job using IntelMPI cannot be started. ">> $jid.log - echo " The ssh command must be working correctly between ">> $jid.log - echo " the computers used in the analysis. Furthermore, ">> $jid.log - echo " it must be set up such that it does not prompt the ">> $jid.log - echo " user for a password. Note that this is the case ">> $jid.log - echo " also for running on a single machine. ">> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - else - counter=1 -# test ssh `hostname` - if test $counter -ne 0 - then - line=`hostname` - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi -# test ssh `hostname` - if test $counter -ne 0 - then - line=`hostname -s` - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi -# test ssh localhost - if test $counter -ne 0 - then - line=localhost - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi - if test $counter -ne 0 - then - echo " error - connection test failed... " - echo " " - echo " ssh needs to work on the machine without asking for a password." - echo " check the following command: ssh localhost uname -n" - echo " " - echo " A parallel job using IntelMPI cannot be started. " - echo " The ssh command must be working correctly between " - echo " the computers used in the analysis. Furthermore, " - echo " it must be set up such that it does not prompt the " - echo " user for a password. Note that this is the case " - echo " also for running on a single machine. " - echo " " - if test "$deletelog" = no - then - echo " error - connection test failed... " >> $jid.log - echo " " >> $jid.log - echo " ssh needs to work on the machine without asking for a password." >> $jid.log - echo " check the following command: ssh localhost uname -n" >> $jid.log - echo " " >> $jid.log - echo " A parallel job using IntelMPI cannot be started. " >> $jid.log - echo " The ssh command must be working correctly between " >> $jid.log - echo " the computers used in the analysis. Furthermore, " >> $jid.log - echo " it must be set up such that it does not prompt the " >> $jid.log - echo " user for a password. Note that this is the case " >> $jid.log - echo " also for running on a single machine. " >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - echo $line $nprocd > $jid.hosts - host=$jid.hosts - fi - fi -fi -fi -# -# check correctness of host file; fix for user sub -# - if test $nprocd -gt 1 - then - -# construct the path name to the executable (execpath) - execpath=$MARC_BIN/$exefile - usersub=0 - if test $program = $prog.marc - then - execpath=$prog.marc - usersub=1 - fi - if test "$objs" - then - execpath="$DIRJOB/$jid.marc" - usersub=1 - fi - if test "$user" - then - execpath=$usernoext.marc - usersub=1 - fi - export execpath - execname=`$BASENAME $execpath` - - if test "$host" - then - userhost=$host - case $userhost in - \/* | \.\/*) - ;; - *) - userhost=`pwd`/$userhost - ;; - esac - -# check that the number of processes specified in the hostfile is -# equal to nprocd specified by -nprocd. - numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` - if test $nprocd -ne $numproc - then - echo " " - echo "error, the number of processes specified in the host file" - echo "must be equal to the number of processes given by -nprocd/-nsolver" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, the number of processes specified in the host file" >> $jid.log - echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - -# check for Myrinet that the number of processes per host is -# less than number of available user ports, 5 -# .gmpi directory must exist in user's home directory -# and must have write permission from remote hosts - if test $MPITYPE = "myrinet" - then - numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` - if test $numproc -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes specified " - echo "in the hostfile must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes specified " >> $jid.log - echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - if test ! -d ~/.gmpi - then - echo " " - echo "error, for Myrinet a .gmpi directory must exist " - echo "under the user's home directory" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log - echo "under the user's home directory" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - homedir=`echo ~` - for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - echo " " - echo "error, for Myrinet a shared .gmpi directory must exist " - echo "under the user's home directory " - echo "with remote write permission" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log - echo "under the user's home directory " >> $jid.log - echo "with remote write permission" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - /bin/rm tmp.$$ - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - fi - fi - done - fi - fi - -# construct the host file $jid.host which is used by mpirun -# skip lines starting with # and only consider lines with more than -# one word in them. Note that the hostfile given to this script -# has two columns: the host name and the number of shared processes -# to run on this host. mpirun wants the number of _other_ -# processes to run in addition to the one being run on the machine -# on which the job is started. hence the $2-1 for fnr == 1. - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then -# HPMPI or HP hardware MPI - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ - -v mpihpspecial="$MPIHPSPECIAL" \ -'{if ( NF > 0) {\ - fnr++ ; \ - printf("-h %s -np %s",$1,$2); \ - printf(" %s",mpihpspecial); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ - if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ - }\ - }' > $jid.host -# end HPMPI or HP hardware MPI - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then -# IBM using hardware MPI (POE) - MP_HOSTFILE=$jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host -# end IBM using hardware MPI (POE) -# for Intel MPI, need to create a machinefile for DMP - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then -# Intel MPI - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - /bin/cp $host $jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Intel MPI for DMP -# for Solaris HPC 7.1, need to create a machinefile for DMP - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then -# Solaris HPC 7.1 - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Solaris HPC 7.1 for DMP -# for Myrinet, construct a configuration file in ~/.gmpi -# this must be readable by each process -# format is (hostname) (port number) for each process - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - grep -v '^#' $host | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ -{if ( NF > 0 ) \ - for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ -}' >> ~/.gmpi/$jid.host - else -# this is for mpich-1.2.5 and later, using the -pg option -# format: host nproc executable user arguments -# the arguments are added later - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s %s\n",path,user);\ - if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ - }\ - }' > $jid.host - fi -# end Myrinet - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then -# Compaq MPI via Memory Channel - grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host -# end Compaq MPI - else -# MPICH - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ - }\ - }' > $jid.host - fi -# define the variable host and host_filt -# host_filt is used for loops over hosts -# for Myrinet we need to use a filtered variant of userhost -# for others we can use $host - if test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - host=~/.gmpi/$jid.host - host_filt=$jid.host_tMp - grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt - else - host=$jid.host - host_filt=$host - fi - else - host=$jid.host - host_filt=$host - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - host_filt=$jid.mfile - fi - fi -# figure out if the machines in the hostfile are nfs mounted -# or distributed and set the variable "dirstatus" accordingly. -# only perform the check if user subroutine is used -# or a user subroutine executable is used - - numfield=1 - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - numfield=2 - fi - DIR1=$DIRJOB - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - counter=0 - echo " " - echo "checking if local or shared directories for host" - if test "$deletelog" = no - then - echo "checking if local or shared directories for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - dirstatus[$counter]="shared" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - dirstatus[$counter]="local" - /bin/rm tmp.$$ - else - if test ! -f $jid.$$ - then - dirstatus[$counter]="local" - $RSH $i /bin/rm $DIR1/$jid.$$ - else - /bin/rm $jid.$$ - fi - fi - if test -f tmp.$$ - then - /bin/rm tmp.$$ - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - echo " ${dirstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${dirstatus[$counter]}" >> $jid.log - fi - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - fi - -# figure out if this is a compatible set of machines -# unless explicitly specified with flag -comp -# only perform the check if user subroutine is used -# or a user subroutine executable is used -# Myrinet does not support heterogeneous - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - if test $compatible = "unknown" - then - thisname=$ARCH - compatible=yes - counter=0 - echo "checking if machines are compatible for host" - if test "$deletelog" = no - then - echo "checking if machines are compatible for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]="yes" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - othername=`$RSH $i uname -a | cut -f 1 -d " "` - if test $thisname != $othername - then - compatible=no - compstatus[$counter]="no" - fi - fi - echo " ${compstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${compstatus[$counter]}" >> $jid.log - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - else - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]=$compatible - fi - done - if test $compatible = "no" - then - echo "all machines assumed incompatible" - if test "$deletelog" = no - then - echo "all machines assumed incompatible" >> $jid.log - fi - else - echo "all machines compatible" - if test "$deletelog" = no - then - echo "all machines compatible" >> $jid.log - fi - fi - fi -# error out if user objects or libraries are used on incompatible machines - if test "$compatible" = "no" -a -n "$objs" - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" - if test "$deletelog" = no - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log - fi - exit 1 - fi -# modify new host file if NFS mounted heterogeneous machine - doit= - if test $program = $prog.marc - then - doit=yes - fi - if test "$user" - then - doit=yes - fi - if test "$doit" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - $AWK -v hst=$i '{fnr++ ; \ -if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ -printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} - /bin/mv $jid.host{$$} $jid.host - host=$jid.host - fi - fi - done - fi - fi # if test $program = $prog.marc -o $user -o $obj - - else # if test $host - # assume shared memory machine if no hostfile given and - # MPITYPE is set to mpich or Myrinet - # check for Myrinet that the total number of processes is - # less than number of available user ports, 5 - if test $MPITYPE = "mpich" -o $MPITYPE = "scali" - then - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - host=$jid.host - elif test $MPITYPE = "myrinet" - then - if test $nprocd -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes " - echo "must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes " >> $jid.log - echo "must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - echo `hostname` $nprocd | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ - {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ -' >> ~/.gmpi/$jid.host - host=~/.gmpi/$jid.host - else - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - - fi - fi # if test myrinet - - fi # if test $host - - fi # if test $nprocd -gt 1 - -fi # if test $program = $exefile -o $program = $prog.marc - -############################################################################## -# construct run stream (Marc only) # -############################################################################## - -# set maximum message length for ddm to a large number -# for vendor provided mpi -if test $itree -eq 0 -a $MPITYPE = hardware -then - itree=100000000 - if test $MACHINENAME = SGI - then - itree=100000001 - fi -fi -if test $itree -eq 0 -a $MPITYPE = hpmpi -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = myrinet -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = nec -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = scali -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = intelmpi -then - itree=100000000 -fi -if test $nprocdddm -lt 2 -then - nprocdarg= -else - nprocdarg="$nprocdarg $nprocdddm" -fi -if test $nsolver -eq 0 -then - nsolverarg= -else - nsolverarg="$nsolverarg $nsolver" -fi -if test $nprocdddm -lt 2 -a $nsolver -eq 0 -then -nprocd=0 -fi -if test $nprocd -gt 0 -then - if test "$host" - then - if test -z "$RUN_JOB2" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then - RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - else - RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" - RUN_JOB=" -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - numhost=`uniq $jid.mfile | wc -l` - if test "$INTELMPI_VERSION" = "HYDRA" - then - RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n $numhost -r $RSH -f $jid.mfile - RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" - fi - -# intelmpi uses configfile. format: -# -host host1 -n n1 executable marcargs -# one such line per host -# collect the marcargs in RUN_JOB and construct the config file later -# collect the run stream in RUN_JOB_TMP - RUN_JOB="-jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - - - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then - RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi - if test "$userhost" - then - RUN_JOB="$RUN_JOB -mhost $userhost" - fi - if test $MPITYPE = "scali" - then -# set default working directory to /tmp to allow -# different directory names - SCAMPI_WORKING_DIRECTORY=/tmp - export SCAMPI_WORKING_DIRECTORY - fi - else - if test -z "$RUN_JOB1" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - RUNNPROCD=$nprocd - if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" - then - RUNNPROCD= - MP_PROCS=$nprocd - export MP_PROCS - fi - if test $MPITYPE = "myrinet" - then - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n 1 -f $jid.hosts - fi - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi - fi -else - if test $nauto -gt 0 -o $ndcoup -gt 0 - then - RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ - $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - else -# this is for a serial job without auto restart: - RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi -fi -if test "$rid" -then - RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" -fi -if test "$pid" -then - RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" -fi -if test "$sid" -then - RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" -fi -if test "$did" -then - RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" -fi -if test "$vid" -then - RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" -fi -if test $nauto -gt 0 -then - RUN_JOB="$RUN_JOB -autorst $nauto " -fi -if test $ndcoup -gt 0 -then - RUN_JOB="$RUN_JOB -dcoup $ndcoup " -fi -if test $ndytran -gt 0 -then - RUN_JOB="$RUN_JOB -dytran $ndytran " -fi -if test $mesh -gt 0 -then - RUN_JOB="$RUN_JOB -me $mesh " -fi -if test $noutcore -gt 0 -then - RUN_JOB="$RUN_JOB -outcore $noutcore " -fi -if test "$dllrun" -gt 0 -then - RUN_JOB="$RUN_JOB -dll $dllrun " -fi -if test "$trkrun" -gt 0 -then - RUN_JOB="$RUN_JOB -trk $trkrun " -fi -if test "$iam" -then - RUN_JOB="$RUN_JOB -iam $iam " -fi -if test "$justlist" -then - RUN_JOB="$RUN_JOB -list 1 " -fi -if test "$feature" -then - RUN_JOB="$RUN_JOB -feature $feature " -fi -if test "$memlimit" -ne 0 -then - RUN_JOB="$RUN_JOB -ml $memlimit " -fi -if test "$cpinput" -then - RUN_JOB="$RUN_JOB -ci $cpinput " -fi -if test "$cpresults" -then - RUN_JOB="$RUN_JOB -cr $cpresults " -fi -if test "$DIRSCR" != "$DIRJOB" -then - RUN_JOB="$RUN_JOB -dirscr $DIRSCR" -else - DIRSCR=$DIRJOB -fi -if test "$makebdf" -then - RUN_JOB="$RUN_JOB -bdf $makebdf " -fi -if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" -then - # append $RUN_JOB to all lines of the host file - # and set RUN_JOB - $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ - /bin/mv $host.$$ $host - RUN_JOB=$RUN_JOB_TMP -fi -if test $MPITYPE = "intelmpi" -a "$host" -then - # construct config file, append $RUN_JOB to all lines of the config file - # and set RUN_JOB - if test "$INTELMPI_VERSION" = "HYDRA" - then - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - else - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-host %s -n %s",$1,$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - fi - RUN_JOB=$RUN_JOB_TMP -fi -echo " " -echo "Final run stream value" -echo " RUNJOB="$RUN_JOB -if test "$deletelog" = no -then -echo " " >> $jid.log -echo "Final run stream value" >> $jid.log -echo " RUNJOB="$RUN_JOB >> $jid.log -fi - - -############################################################################## -# run marc using valgrind # -############################################################################## -#RUN_JOB="valgrind $RUN_JOB" -#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" -############################################################################## - - -############################################################################## -# run the requested program in a queue # -############################################################################## - -if test "$deletelog" = yes -then - echo - date -else - echo >> $jid.log - date >> $jid.log -fi -if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] -then - -/bin/rm -f $jid.runmarcscript - - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - userobj=$usermoext.o - fi - cat > $jid.runmarcscript << END4 - if test "$user" - then - if test $MACHINENAME = "CRAY" - then - $DFORTHIGHMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTHIGHMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $MARCCUDALIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } -END4 -else - prgsav=yes -fi -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# - -cat >> $jid.runmarcscript << END5 - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -# first remove all .out files and incremental restart files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null - /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null -fi - -if test $nprocdddm -gt 1 -then - $RUN_JOB 2>>$jid.log -else - $RUN_JOB 2>>$jid.log -fi - -if test $dllrun -eq 0; then - if test $prgsav = no - then - /bin/rm -f $bd$program 2>/dev/null - fi -else - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes - then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -END5 - - -# Submit to marc batch queue -# -if [ $qid = at ] -then -QUENAME=at -SUBMCMD= -else -# -# Submit to qsub queue -# -QUENAME=qsub -SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" -if test "$priority" -then - SUBMCMD=$SUBMCMD" -p $priority" -fi -if test "$att" -then - SUBMCMD=$SUBMCMD" -a $att" -fi -if test "$cpu" -then - SUBMCMD=$SUBMCMD" -lt $cpu" -fi - -fi -echo $QUENAME $SUBMCMD -#cat $jid.runmarcscript -$QUENAME $SUBMCMD < $jid.runmarcscript - -/bin/rm -f $jid.runmarcscript - -############################################################################## -# run the requested program in the background # -############################################################################## - -else -if test $qid = background -then - -# -# first remove all old .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi -# -# compile user subroutine if present -# -( -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_hmp $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - echo " $PRODUCT Exit number 3" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTHIGHMP $user || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTHIGHMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - echo " $PRODUCT Exit number 3" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc - -# - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -$RUN_JOB & - -marcpid=$! -echo $marcpid > $DIRJOB/$jid.pid -wait $marcpid - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - if test "$host" - then - /bin/rm $jid.mfile 2> /dev/null - /bin/rm $jid.hosts 2> /dev/null - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.cfile 2> /dev/null - fi - fi - fi -fi - - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -) 1>>$jid.log 2>&1 & - - -############################################################################## -# run the requested program in the foreground # -############################################################################## - -else - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_hmp $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTHIGHMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTHIGHMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi -# first remove all .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi - -$RUN_JOB - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - if test "$host" - then - /bin/rm $jid.mfile 2> /dev/null - /bin/rm $jid.hosts 2> /dev/null - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.cfile 2> /dev/null - else - echo " " > /dev/null - fi - else - if test "$host" - then - mpdcleanup -a -f $jid.mfile - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.mfile 2> /dev/null - else - mpdcleanup -a -f $jid.hosts - /bin/rm $jid.hosts 2> /dev/null - fi - fi - fi -fi - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi - - -fi -fi diff --git a/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_l b/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_l deleted file mode 100644 index 31ef667c8..000000000 --- a/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_l +++ /dev/null @@ -1,4053 +0,0 @@ -#!/bin/ksh -############################################################################## -# # -# run_marc - run a marc job # -# ------------------------- # -# # -# usage: run_marc -j jid { options } # -# # -# where standard options are: required: defaults: # -# -------------------------- # -# # -# -j* jid job id number. ** YES ** . # -# -pr* prog program name. . marc # -# -v* y|n do or do not verify inputs. . yes # -# -q* s|l|v|b|f batch queue name or background, . short # -# foreground. # -# -b* as alternative to option -q* # -# # -# ( batch queues only : # -# -pq* intra queue priority. . . # -# -at DATE/TIME delay start of job. . . # -# format : January,1,1990,12:31 # -# or : today,5pm # -# -cpu* secs job CPU limit . . ) # -# # -# -r* rid restart file job id. . . # -# -si* sid substructure file id. . . # -# -pi* post post file job id. . . # -# -de* did defaults file . no # -# -vf vid viewfactor . no # -# # -# -u* user user subroutine. . . # -# -obj obj user objects or libraries. . . # -# -sa* y|n do or do not save load module. . no # -# -autorst auto restart flag for auto forge . no # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo selects i4 or i8 version # -# default: i4 or via defaults file run_marc_defaults # -# the -mo option will override # -# -mpi selects MPI version # -# each platform has a default MPI version and some # -# have an alternative version. see the include file # -# for the respective platform # -# MPI_DEFAULT defines the default MPI version # -# MPI_OTHER defines versions one can switch to # -# -dcoup for contact decoupling # -# currently not supported # -# -dir directory where the job i/o should take place. # -# defaults to current directory. # -# -sdir directory where scratch files are created # -# defaults to current directory. # -# # -# -alloc only perform memory allocation test, no analysis # -# -list y only list options in the input file, no analysis # -# -fe num set feature number "num" for the run. only one allowed # -# -dytran flag to switch from Dytran to Marc # -# dytran = 0, program will run w/o Marc-Dytran Switch # -# = 1, program will restart Marc after Dytran run # -# >= 2, Not supported yet. # -# currently not supported # -# -ou force analysis to use out-of-core control # -# =0, not used # -# =1, element storage out-of-core # -# -dll run marc using shared library libmarc.so and exe_marc # -# =1, used # -# =2, do not free streaming input memory # -# =3, run with marc input deck # -# -trk run marc for post-tracking # -# -gpuid run marc using GPGPU capability # -# specify gpuid on to be used in the analysis. Multiple # -# IDs may be assigned for DDM runs. # -# Separate a list of IDs with a colon. Each DMP # -# process will be assigned a GPU ID in round robin fastion# -# = 0 # -# = 0:1 etc... # -# # -# where parallel options are: # -# -------------------------- # -# # -# itree, host, and comp options are available for the domain # -# decomposition only. # -# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # -# # -# # -# -nprocd number of domains. # -# defaults to single domain solution. # -# -nprocds number of domains if single input file. # -# defaults to single domain solution. # -# -nps same as -nprocds. # -# -nsolver number of solver tasks for solver types 12 and 13 # -# these are distributed tasks operating via MPI # -# -nthread_elem number of threads for element assembly and recovery # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by element assembly # -# recovery. # -# Also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. # -# if both specified, -nthread_elem option will be used. # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor -nthread_elem specified. # -# -nthread_solver number of threads for solver types 6, 8, and 11 # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by 6, 8, and 11 # -# Also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. # -# if both specified, -nthread_solver option will be used. # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor -nthread_solver specified. # -# -nthread Same as -nthread_solver. # -# -itree message passing tree type for domain decomposition. # -# for debugging purposes; should not normally be used. # -# -host hostfile name for distributed execution on network. # -# defaults to no hostfile, unless jobid.defhost exists. # -# if jobid.defhost exists, only -np(s) necessary # -# -comp* y|n to be used with user routines on a network of # -# incompatible machines. # -# if set to no, a separate executable will be created # -# for each machine on the network. # -# if set to yes, the executable located on the machine # -# from which marc is started will be used on all machines.# -# defaults to no if O/S versions different on machines. # -# # -# -ci y|n copy input files to remote hosts (default: yes) # -# if "yes", input files are automatically copied to # -# remote hosts for a network run if necessary. # -# -cr y|n copy post files from remote hosts (default: yes) # -# if "yes", post files are automatically copied back from # -# remote hosts for a network run if necessary. # -############################################################################## -# set DIR to the directory in which this script is -REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" -DIR=`dirname $REALCOM` -# make sure DIR has an absolute path -case $DIR in - \/*) - ;; - *) - DIR=`pwd`/$DIR - ;; -esac -DIRSCRIPT=$DIR -AWK=awk -ARCH=`uname -a | cut -f 1 -d " "` -# Sun has a bad awk, use nawk instead -if test $ARCH = "SunOS" -then - AWK=nawk -fi -BASENAME=basename -# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists -if test $ARCH = "SunOS" -then - if test -x /usr/ucb/basename - then - BASENAME=/usr/ucb/basename - fi -fi - -# echo command line in the case of ECHO_COMMAND is true -if test "$ECHO_COMMAND" = true ; then - echo command "$0" "$@" -fi - -# -# "mode" selects version, i4 or i8 -# default is i4 -# this can be changed by a file run_marc_defaults -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MODE i8 -# it can also be set by the environmental variable MARC_INTEGER_SIZE -# and by the command line option "-mo" -# -mode= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -f $HOME/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -n "$MARC_INTEGER_SIZE" ; then - mode=$MARC_INTEGER_SIZE -fi -if test -z "$mode" ; then - mode=i8 -fi -case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "error, version mode must be i4 or i8" - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i4 or i8" - echo " " - echo " use -mo i4 or -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - setmode=true - fi - if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - fi - if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -done - -# set to i4 version for 32 bit Linux -if test "`uname -s`" = "Linux"; then - if test "`uname -m`" = "i686"; then - mode=i4 - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -fi - - -. "$DIR/getarch" - -. $MARC_INCLUDE -# - -# -# Dynamically determine the echo syntax -# - -case "`echo '\c'`" in - '\c') - ECHO='echo -n' - ECHOTXT=' ' - ;; - *) - ECHO='echo' - ECHOTXT=' \c' - ;; -esac - -# -# Variables for the MARC environment -# - -PRODUCT="Marc" -EXITMSG=$MARC_TOOLS/MESSAGES -export EXITMSG -FLEXDIR=$DIR/../flexlm/licenses -export FLEXDIR -TIMCHK=3600 -export TIMCHK -BINDIR=$MARC_BIN -export BINDIR -AFMATDAT=$MARC_RUNTIME/AF_flowmat/ -export AFMATDAT -# -# define directory path to global unified material database -# -MATFILE= -export MATFILE - -# -# define memory limit -# first set to MEMLIMIT from include -# -ml option overrules if specified -memlimit=$MEMLIMIT -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -# -if test $MACHINENAME = "HP" -then - SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH - export SHLIB_PATH -fi -# the one for IBM is defined futher down - -LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH -LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH -export LD_LIBRARY_PATH -export LD_LIBRARY64_PATH -export LD_LIBRARYN32_PATH - -atexit() { -kill -15 $$ -# -if test $MPITYPE = "myrinet" -then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi -fi -} - -trap "atexit" 2 - -# -# defaults -# - -prog=marc -exefile=marc -jid= -rid= -pid= -sid= -did= -vid= -user= -usernoext= -objs= -qid=background -cpu= -priority= -att= -trk= -verify=yes -prgsav=no -rmdll=no -cpdll=no -progdll= -pathdll= -error= -nprocd=0 -nprocdddm=1 -nprocdddmprint= -icreated=0 -nprocdarg= -nsolver=0 -nsolverarg=-ns -if test $nprocds -then - if test $nprocds -gt 1 - then - nprocdddm=$nprocds - nprocdddmprint=$nprocds - icreated=1 - nprocdarg=-nprocds - fi -fi -ntprint=0 -nt=-1 -nte=-1 -nts=-1 -ntarg=-nt -ntearg=-nte -ntsarg=-nts -nteprint= -ntsprint= -gpuids= -nauto=0 -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -itree=0 -iam= -link= -trkrun=0 -DIRJOB=`pwd` -DIRSCR=$DIRJOB -DIRSCRSET= -autoforge=0 -dotdat=.dat -dotdefhost=.defhost -host= -numhost= -mfile= -userhost= -makebdf= -cpinput=yes -cpresults=yes -marcdll=libmarc.$EXT_DLL -# define hostname and strip off extensions (alpha.aaa.com) -thishost=`hostname` -thishost=${thishost%%.*} -compatible=unknown -numfield=1 -justlist= -feature= -mpioption=false -MDSRCLIB=$MARC_LIB/mdsrc.a -# -# check run_marc_defaults file for default MPI setting -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MPI -# -value= -file= -if test -f $DIRSCRIPT/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$DIRSCRIPT/run_marc_defaults - fi -fi -if test -f $HOME/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$HOME/run_marc_defaults - fi -fi -if test -n "$value"; then - MARC_MPITYPE=$value - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - echo " " - echo " error, incorrect option for MARC_MPI" - echo " defined in $file: $MARC_MPITYPE" - echo " valid options: $MPI_DEFAULT $MPI_OTHER" - echo " " - exit - fi - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - fi -fi -# -# -# allow scratch directory to be specified with environmental variable -# MARCSCRATCH -if test $MARCSCRATCH -then - if test -d $MARCSCRATCH - then - DIRSCR=$MARCSCRATCH - else - echo "error, scratch directory '$MARCSCRATCH'" - echo " specified via environmental variable MARCSCRATCH does not exist" - exit - fi -fi -# -############################################################################## -# parse input - arguments always come in pairs # -############################################################################## - -arg=$1 -if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - shift - arg=$1 -fi -while [ -n "$arg" ] -do - shift - value=$1 - case $arg in - -al* | -AL*) - LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - $MARC_BIN/marc -alloc 1 - exit - ;; - -li* | -LI*) - justlist=yes - ;; - -fe* | -FE*) - feature=$value - ;; - -pr* | -PR*) - if test `dirname $value` = '.' - then - prog=`$BASENAME $value .marc` - progdll=`$BASENAME $value` - else - prog=`dirname $value`/`$BASENAME $value .marc` - progdll=`dirname $value`/`$BASENAME $value` - fi - prdir=`dirname $value` - case $prdir in - \/*) - ;; - *) - prog=`pwd`/$prdir/$prog - ;; - esac - ;; - -j* | -J*) - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - ;; - -r* | -R*) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - -si* | -SI*) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - -pi* | -PI*) - if test -f $value.t19 - then - pid=`$BASENAME $value .t19` - else - pid=`$BASENAME $value .t16` - fi - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - -bdf | -BDF) - makebdf=1 - ;; - -de* | -DE*) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - -vf | -VF) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - -u* | -U*) - user=$value - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - -obj | -OBJ) - objs="$value" - ;; - -q* | -Q*) - qid=$value - ;; - -b* | -B*) - case $value in - y* | Y*) - qid=background - ;; - n* | N*) - qid=foreground - ;; - *) - ;; - esac - ;; - -at | -AT) - att=$value - ;; - -cpu* | -CPU*) - cpu=$value - ;; - -pq | -PQ*) - priority=$value - ;; - -v* | -V*) - verify=$value - ;; - -sa* | -SA*) - prgsav=$value - ;; - -np* | -NP*) - nprocdddm=$value - nprocdddmprint=$value - case $arg in - -nps* | -NPS* | -nprocds* | -NPROCDS*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - case $arg in - -np | -NP | -nprocd | -NPROCD) - icreated=0 - nprocdarg=-nprocd - ;; - esac - ;; - -ns* | -NS*) - nsolver=$value - ;; - -nt* | -NT*) - case $arg in - -nte | -NTE | -nthread_e* | -NTHREAD_E*) - nte=$value - ;; - esac - case $arg in - -nts | -NTS | -nthread_s* | -NTHREAD_S*) - nts=$value - ;; - esac - case $arg in - -nt | -NT | -nth* | -NTH* | -nthread* | -NTHREAD*) - nt=$value - ;; - esac - ;; - -gp* | -GP*) - gpuids=$value - ;; - -it* | -IT*) - itree=$value - ;; - -iam | -IAM) - iam=$value - ;; - -au* | -AU*) - nauto=$value - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -me | -ME ) - mesh=$value - ;; - -ml | -ML ) - memlimit=$value - ;; - -mo | -MO ) - ;; - -mpi | -MPI ) - mpioption=true - MARC_MPITYPE=$value - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - fi - fi - ;; - -dir* | -DIR*) - DIRJOB=$value - case $DIRJOB in - \/*) - ;; - *) - DIRJOB=`pwd`/$DIRJOB - ;; - esac - if test -z "$DIRSCRSET" - then - DIRSCR=$DIRJOB - fi - ;; - -sd* | -SD*) - DIRSCR=$value - DIRSCRSET=yes - case $DIRSCR in - \/*) - ;; - *) - DIRSCR=`pwd`/$DIRSCR - ;; - esac - ;; - -ho* | -HO*) - host=$value - ;; - -co* | -CO*) - compatible=$value - ;; - -ci* | -CI*) - cpinput=$value - ;; - -cr* | -CR*) - cpresults=$value - ;; - *) - error="$error -$arg: invalid option" - break - ;; - esac - case $value in - -*) - error="$error -$arg: invalid name $value" - break - ;; - esac - shift - arg=$1 - if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - shift - arg=$1 - fi -done -argc=`expr $# % 2` -if test $argc -eq 1 -then -# -# odd number of arguments -# - error="$error -argument list incomplete" -fi - -if test $nprocdddm -gt 0 -then -nprocd=$nprocdddm -fi - -if test $nsolver -gt 0 -then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi -fi -# Set defaults -if test $nt -eq -1 -then -nt=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nt -lt 0 -then -nt=0 -fi -if test $nte -eq -1 -then -nte=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nte -lt 0 -then -nte=0 -fi -if test $nts -eq -1 -then -nts=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nts -lt 0 -then -nts=0 -fi -# -# set number of element loop threads -# -ntprint=$nt -nteprint=$nte -# copy from -nprocd[s] -if test $nprocdddm -gt 1 -then - nteprint=$nprocdddm -fi -# override with -nthread_elem option -if test $nte -ne 0 -then -nteprint=$nte -fi -# check for minimum 1 threads per processes for DDM -if test $nprocdddm -gt 1 -then - if test $nteprint -lt $nprocdddm - then - nteprint=$nprocdddm - fi -fi -nte=$nteprint -# -# set number of Solver threads -# -ntsprint=$nts -# copy from -nthread or -nprocd[s] -if test $ntprint -ne 0 -then - ntsprint=$ntprint -else - if test $nprocdddm -gt 1 - then - ntsprint=$nprocdddm - fi -fi -# override with -nthread_solver option -if test $nts -ne 0 -then - ntsprint=$nts -fi -# check for minimum 1 threads per solver process. -if test $nsolver -lt $nprocdddm -then - if test $ntsprint -lt $nsolver - then - ntsprint=$nsolver - fi -else - if test $ntsprint -lt $nprocdddm - then - ntsprint=$nprocdddm - fi -fi -if test $ntsprint -eq 1 -then - set ntsprint=0 -fi -nts=$ntsprint - -# set stack size for multi-threading. -export KMP_MONITOR_STACKSIZE=7M -export OMP_STACKSIZE=7M - -# -# deprecate -nthread option at arugment of marc -nt=0 -# Reset nprocdddmm, nsolver and threads if not given. -if test $nprocdddm -eq 0 -then - nprocdarg= -fi -if test $nprocdddm -eq 0 -then - nprocdddmprint= -fi -if test $nprocdddm -eq 0 -then - nprocdddm= -fi - -if test $nsolver -eq 0 -then - nsolverprint= -fi -# end of threads setting. -gpuoption= -if test "$gpuids" = "" ; then - gpuoption= -else - gpuoption="-gp $gpuids" -fi - -if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH -else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH -fi -# Linux 64 + HPMPI, Below code is taken from include_linux64 -if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" -then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" -fi - -if test $nprocd -gt 1; then - if test -f $jid$dotdefhost; then - if test "$host" = ""; then - host=$jid$dotdefhost - fi - fi - if test -f hostfile_qa_$nprocd; then - if test "$host" = ""; then - host=hostfile_qa_$nprocd - fi - fi -fi - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then - dotdat=.inp - fi - - if test "$progdll"; then - /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll - rmdll=yes - pathdll=yes - progdll=${progdll}_$marcdll - else - progdll=$marcdll - fi - - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - pathdll=yes - fi -fi - -############################################################################## -# check parameter validity # -############################################################################## - -while test forever; do - -# -# check for input file existence -# -if test $nprocdddm -gt 1 -a $icreated -eq 0; then - if test ! -f $DIRJID/1$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/1$jid$dotdat not accessible" - fi - fi -else - if test ! -f $DIRJID/$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/$jid$dotdat not accessible" - fi - fi -fi - if test $nprocd -gt 1; then - if test "$host" ; then - if test ! -f $host; then - error="$error -host name file $host not accessible" - fi - fi - fi - -# -# check if the job is already running in the background -# -if test -f $DIRJOB/$jid.pid; then - error="$error -job is already running (the file $jid.pid exists)" -fi - -# -# if the program name is other than marc, then -# assume that this is a program in the users local directory -# - -bd=$MARC_BIN/ - -case $prog in - marc | MARC | $exefile) - program=$exefile - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - if test ! -f $user - then - error="$error -user subroutine file $user not accessible" - fi - fi - if test "$objs" - then - missingobjs= - for o in $objs - do - if test ! -f "$o" - then - if test -z "$missingobjs" - then - missingobjs="$o" - else - missingobjs="$missingobjs $o" - fi - fi - done - if test -n "$missingobjs" - then - error="$error -user object/library file(s) $missingobjs not accessible" - fi - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$vid" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRVID/1$vid.vfs - then - error="$error -view factor file $DIRVID/1$vid.vfs not accessible" - fi - else - if test ! -f $DIRVID/$vid.vfs - then - error="$error -view factor file $DIRVID/$vid.vfs not accessible" - fi - fi - fi - if $mpioption - then - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" - fi - fi - ;; - *) - program=$prog.marc - case $prog in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - error="$error -program option may not be used with user subroutine" - fi - if test "$objs" - then - error="$error -program option may not be used with user objects or libraries" - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$nauto" - then - if test $nauto -gt 2 - then - error="$error -incorrect option for auto restart " - fi - fi - if test "$ndcoup" - then - if test $ndcoup -gt 3 - then - error="$error -incorrect option for contact decoupling " - fi - fi - if test "$ndytran" - then - if test $ndytran -gt 1 - then - error="$error -incorrect option for Marc-Dytran Switch " - fi - fi - if $mpioption - then - if test ! -x $MARC_BIN/$exefile - then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE " - fi - fi - ;; -esac - -############################################################################## -# check argument integrity # -############################################################################## - -if test "$jid" -then - : -else - error="$error -job id required" -fi - -if test $nprocd -gt 1 -then - if test $nauto -gt 0 - then - error="$error -cannot run DDM job with auto restart (-au) option " - fi -fi -case $qid in - S* | s*) - qid=short - ;; - L* | l*) - qid=long - ;; - V* | v*) - qid=verylong - ;; - B* | b*) - qid=background - ;; - F* | f*) - qid=foreground - ;; - A* | a*) - qid=at - ;; - *) - error="$error -bad value for queue_id option" - ;; -esac - -case $prgsav in - N* | n*) - prgsav=no - ;; - Y* | y*) - prgsav=yes - ;; - *) - error="$error -bad value for save option" - ;; -esac - -case $verify in - N* | n*) - verify=no - ;; - Y* | y*) - verify=yes - ;; - *) - error="$error -bad value for verify option" - ;; -esac - -case $nprocdddm in - -* ) - error="$error -bad value for nprocd option" - ;; -esac - -case $nt in - -* ) - error="$error -bad value for nt option" - ;; -esac - -case $itree in - -* ) - error="$error -bad value for itree option" - ;; -esac -case $iam in - -* ) - error="$error -bad value for iam option" - ;; -esac -case $compatible in - N* | n*) - compatible=no - ;; - Y* | y*) - compatible=yes - ;; - unknown) - ;; - *) - error="$error -bad value for comp option" - ;; -esac -case $cpinput in - N* | n*) - cpinput=no - ;; - Y* | y*) - cpinput=yes - ;; - *) - error="$error -bad value for copy input option" - ;; -esac -case $cpresults in - N* | n*) - cpresults=no - ;; - Y* | y*) - cpresults=yes - ;; - *) - error="$error -bad value for copy results option" - ;; -esac - -# -# check for external file to run -# -if test -f $MARC_TOOLS/run_marc_check -then - . $MARC_TOOLS/run_marc_check -fi - -# -# pick up version data from bin/VERSION if it exists -# -if test -f $MARC_BIN/VERSION; then - ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` - if test -n "$ppp" ;then - PRODUCT=$ppp - fi - ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` - if test -n "$ppp" ;then - REVISION=", Build $ppp" - fi -fi -############################################################################## -# interact with the user to get the required information to run marc or # -# other marc system program # -############################################################################## - -deletelog=yes -if test $qid = background -a $verify = no -then -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Element loop threads : $nteprint -Solver processes : $nsolverprint -Solver threads : $ntsprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto " > $jid.log -deletelog=no -fi -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Element loop threads : $nteprint -Solver processes : $nsolverprint -Solver threads : $ntsprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto" - - -case $qid in - s* | S* | l* | L* | v* | V* ) - echo \ -"Queue priority : $priority -Queue CPU limit : $cpu -Queue start time : $att" - ;; -# * ) -# echo \ -#" " -# ;; -esac - -if test "$error" -then - if test $verify = yes - then - $ECHO "$error - -Please correct or quit(correct,quit,): $ECHOTXT" - error= - read answer - case $answer in - q* | Q*) - answer=quit - ;; - *) - answer=correct - ;; - esac - else - $ECHO "$error - $ECHOTXT" - echo " " - if test "$deletelog" = no - then - $ECHO "$error - $ECHOTXT" >> $jid.log - echo " " >> $jid.log - fi - answer=quit - fi -else - if test $verify = yes - then - $ECHO " -Are these parameters correct (yes,no,quit,)? $ECHOTXT" - read answer - case $answer in - q* | Q*) - answer=quit - ;; - y* | Y*) - answer=yes - ;; - *) - answer=no - ;; - esac - else - answer=yes - fi -fi - -case $answer in - no | correct) - -############################################################################## -# prompt for each value # -############################################################################## - - $ECHO " -Program name ($prog)? $ECHOTXT" - read value - if test "$value" - then - prog=$value - fi - $ECHO "Job ID ($jid)? $ECHOTXT" - read value - if test "$value" - then - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - fi - $ECHO "User subroutine name ($user)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - user= - ;; - *) - user=$value - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - esac - fi - $ECHO "User objects or libraries ($objs)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - objs= - ;; - *) - objs="$value" - ;; - esac - fi - $ECHO "Restart File Job ID ($rid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - rid= - ;; - *) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - esac - fi - $ECHO "Substructure File ID ($sid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - sid= - ;; - *) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - esac - fi - $ECHO "Post File Job ID ($pid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - pid= - ;; - *) - pid=$value - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - esac - fi - $ECHO "Defaults File ID ($did)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - did= - ;; - *) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - esac - fi - $ECHO "View Factor File ID ($vid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - vid= - ;; - *) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - esac - fi - $ECHO "Save generated module ($prgsav)? $ECHOTXT" - read value - if test "$value" - then - prgsav=$value - fi - $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" - read value - if test "$value" - then - nprocdddm=$value - nprocdddmprint=$value - fi - $ECHO "Run on ($nte) Element loop threads ? $ECHOTXT" - read value - if test "$value" - then - nte=$value - fi - $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" - read value - if test "$value" - then - nsolver=$value - fi - $ECHO "Run on ($nts) Solver threads ? $ECHOTXT" - read value - if test "$value" - then - nts=$value - fi -# - if test $nprocdddm -gt 0 - then - nprocd=$nprocdddm - fi - if test $nsolver -gt 0 - then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi - fi -# Element loop threads. - if test $nte -eq -1 - then - nte=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nte -lt 0 - then - nte=0 - fi - nteprint=$nte -# Copy from ddm - if test $nprocdddm -gt 1 - then - nteprint=$nprocdddm - fi -# override with -nthread_elem option - if test $nte -ne 0 - then - nteprint=$nte - fi -# check for minimum 1 threads per processes for DDM - if test $nprocdddm -ne 0 - then - if test $nteprint -lt $nprocdddm - then - nteprint=$nprocdddm - fi - fi - nte=$nteprint -# Solver threads. - if test $nts -eq -1 - then - nts=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nts -lt 0 - then - nts=0 - fi - ntsprint=$nts -# Copy from ddm - if test $nprocdddm -gt 1 - then - ntsprint=$nprocdddm - fi -# override with -nthread_solver option - if test $nts -ne 0 - then - ntsprint=$nts - fi -# check for minimum 1 threads per solver process. - if test $nsolver -lt $nprocdddm - then - if test $ntsprint -lt $nsolver - then - ntsprint=$nsolver - fi - else - if test $ntsprint -lt $nprocdddm - then - ntsprint=$nprocdddm - fi - fi - if test $ntsprint -eq 1 - then - set ntsprint=0 - fi - nts=$ntsprint - $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" - read value - if test "$value" - then - gpuids=$value - fi - if test "$gpuids" = "" ; then - gpuoption= - else - gpuoption="-gp $gpuids" - fi - if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH - fi - if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - fi -# - if test $nprocd -gt 1 - then - $ECHO "Message passing type ($itree)? $ECHOTXT" - read value - if test "$value" - then - itree=$value - fi - $ECHO "Host file name ($host)? $ECHOTXT" - read value - if test "$value" - then - host=$value - fi - if test $nprocdddm -gt 1 - then - $ECHO "Single input file? $ECHOTXT" - read value - case $value in - y* | Y*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" - read value - if test "$value" - then - compatible=$value - fi - $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" - read value - if test "$value" - then - cpinput=$value - fi - $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" - read value - if test "$value" - then - cpresults=$value - fi - fi - fi - $ECHO "Run the job in the queue ($qid)? $ECHOTXT" - read value - if test "$value" - then - qid=$value - fi - case $qid in - s* | S* | l* | L* | v* | V* ) - $ECHO "Queue priority ($priority)? $ECHOTXT" - read value - if test "$value" - then - priority=$value - fi - $ECHO "Job starts at ($att)? $ECHOTXT" - read value - if test "$value" - then - att=$value - fi - $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" - read value - if test "$value" - then - cpu=$value - fi - ;; - * ) - ;; - esac - $ECHO "Auto Restart option ($nauto)? $ECHOTXT" - read value - if test "$value" - then - nauto=$value - fi - $ECHO "Run directory ($DIRJOB)? $ECHOTXT" - read value - if test "$value" - then - DIRJOB=$value - DIRSCR=$DIRJOB - fi - $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" - read value - if test "$value" - then - DIRSCR=$value - fi - ;; - quit) - exit 1 - ;; - *) - break - ;; - -esac - - if test $nt -eq -1 - then - nt=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nt -lt 0 - then - nt=0 - fi - -done -# -if test $nt -eq 0 -then - ntarg= -fi -if test $nt -eq 0 -then - ntprint= -fi -if test $nt -eq 0 -then - nt= -fi - -if test $nte -eq 0 -then - ntearg= -fi -if test $nte -eq 0 -then - nteprint= -fi -if test $nte -eq 0 -then - nte= -fi - -if test $nts -eq 0 -then - ntsarg= -fi -if test $nts -eq 0 -then - ntsprint= -fi -if test $nts -eq 0 -then - nts= -fi -# -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - pathdll=yes - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - fi - - if test "$pathdll"; then -# -# reset share lib path -# - if test $MACHINENAME = "HP" - then - SHLIB_PATH=$DIRJOB:$SHLIB_PATH - export SHLIB_PATH - fi - if test $MACHINENAME = "IBM" - then - LIBPATH=$DIRJOB:$LIBPATH - export LIBPATH - fi -# - LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH - LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH - LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH - export LD_LIBRARY_PATH - export LD_LIBRARY64_PATH - export LD_LIBRARYN32_PATH - fi -fi -# end of dllrun>0 - - -if test $program = $exefile -o $program = $prog.marc -then - -# delete the old .log file unless we run in the background -if test "$deletelog" = yes -then - /bin/rm $jid.log 2>/dev/null -else - echo - echo running the job in the background, see $jid.log - echo -fi - -# -# check if this is an autoforge or rezoning or radiation job -# -if test $nprocd -eq 1 -then - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` - if test "$line" - then - autoforge=1 - fi -fi -# -# check that jobname for restarted run is not the same -# as restart file basename -# -if test "$rid" -then - if test "$jid" = "$rid" - then - echo " " - echo "ERROR: job name of current run is the same as job name" - echo " of the restarted job" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "ERROR: job name of current run is the same as job name" >> $jid.log - echo " of the restarted job" >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi -fi - -# -# user objects/libraries used -# - - if test "$objs" - then - program="$DIRJOB/$jid.marc" - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# user subroutine used -# -# add DAMASK options for linking - DAMASK="" - - if test "$user" - then - program=$usernoext.marc - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# Special case for IBM using POE but not an SP machine -# in this case we always need a host file, also for serial jobs. -# -if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP -then - MP_HOSTFILE=${jid}.host - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $nprocd -gt 1 - then - numdom=$nprocd - while test $numdom -gt 0 - do - hostname -s >> $MP_HOSTFILE - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - else - hostname -s > $MP_HOSTFILE - fi -fi -# -# check ssh for all hosts in host file -# -if test $nprocd -gt 1 -then -if test $MPITYPE = "intelmpi" -a "$INTELMPI_VERSION" = "HYDRA" - then -# get host list - if test "$host" - then - line=`grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' | uniq` -# count failing hosts - counter=0 - for i in $line - do - $RSH -o BatchMode=yes -o ConnectTimeout=10 $i uname -n - status=$? - if [[ $status != 0 ]] ; then - counter=$((counter+1)) - if [ "$counter" = "1" ]; then - echo " " - echo " error - connection test failed... " - echo " " - fi - echo " " - echo " connection test with ssh failed on host $i" - echo " check the following command: ssh $i uname -n " - echo " " - fi - done -# echo error message and quit - if test $counter -ne 0 - then - echo " " - echo " A parallel job using IntelMPI cannot be started. " - echo " The ssh command must be working correctly between " - echo " the computers used in the analysis. Furthermore, " - echo " it must be set up such that it does not prompt the " - echo " user for a password. Note that this is the case " - echo " also for running on a single machine. " - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo " A parallel job using IntelMPI cannot be started. ">> $jid.log - echo " The ssh command must be working correctly between ">> $jid.log - echo " the computers used in the analysis. Furthermore, ">> $jid.log - echo " it must be set up such that it does not prompt the ">> $jid.log - echo " user for a password. Note that this is the case ">> $jid.log - echo " also for running on a single machine. ">> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - else - counter=1 -# test ssh `hostname` - if test $counter -ne 0 - then - line=`hostname` - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi -# test ssh `hostname` - if test $counter -ne 0 - then - line=`hostname -s` - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi -# test ssh localhost - if test $counter -ne 0 - then - line=localhost - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi - if test $counter -ne 0 - then - echo " error - connection test failed... " - echo " " - echo " ssh needs to work on the machine without asking for a password." - echo " check the following command: ssh localhost uname -n" - echo " " - echo " A parallel job using IntelMPI cannot be started. " - echo " The ssh command must be working correctly between " - echo " the computers used in the analysis. Furthermore, " - echo " it must be set up such that it does not prompt the " - echo " user for a password. Note that this is the case " - echo " also for running on a single machine. " - echo " " - if test "$deletelog" = no - then - echo " error - connection test failed... " >> $jid.log - echo " " >> $jid.log - echo " ssh needs to work on the machine without asking for a password." >> $jid.log - echo " check the following command: ssh localhost uname -n" >> $jid.log - echo " " >> $jid.log - echo " A parallel job using IntelMPI cannot be started. " >> $jid.log - echo " The ssh command must be working correctly between " >> $jid.log - echo " the computers used in the analysis. Furthermore, " >> $jid.log - echo " it must be set up such that it does not prompt the " >> $jid.log - echo " user for a password. Note that this is the case " >> $jid.log - echo " also for running on a single machine. " >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - echo $line $nprocd > $jid.hosts - host=$jid.hosts - fi - fi -fi -fi -# -# check correctness of host file; fix for user sub -# - if test $nprocd -gt 1 - then - -# construct the path name to the executable (execpath) - execpath=$MARC_BIN/$exefile - usersub=0 - if test $program = $prog.marc - then - execpath=$prog.marc - usersub=1 - fi - if test "$objs" - then - execpath="$DIRJOB/$jid.marc" - usersub=1 - fi - if test "$user" - then - execpath=$usernoext.marc - usersub=1 - fi - export execpath - execname=`$BASENAME $execpath` - - if test "$host" - then - userhost=$host - case $userhost in - \/* | \.\/*) - ;; - *) - userhost=`pwd`/$userhost - ;; - esac - -# check that the number of processes specified in the hostfile is -# equal to nprocd specified by -nprocd. - numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` - if test $nprocd -ne $numproc - then - echo " " - echo "error, the number of processes specified in the host file" - echo "must be equal to the number of processes given by -nprocd/-nsolver" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, the number of processes specified in the host file" >> $jid.log - echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - -# check for Myrinet that the number of processes per host is -# less than number of available user ports, 5 -# .gmpi directory must exist in user's home directory -# and must have write permission from remote hosts - if test $MPITYPE = "myrinet" - then - numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` - if test $numproc -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes specified " - echo "in the hostfile must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes specified " >> $jid.log - echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - if test ! -d ~/.gmpi - then - echo " " - echo "error, for Myrinet a .gmpi directory must exist " - echo "under the user's home directory" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log - echo "under the user's home directory" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - homedir=`echo ~` - for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - echo " " - echo "error, for Myrinet a shared .gmpi directory must exist " - echo "under the user's home directory " - echo "with remote write permission" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log - echo "under the user's home directory " >> $jid.log - echo "with remote write permission" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - /bin/rm tmp.$$ - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - fi - fi - done - fi - fi - -# construct the host file $jid.host which is used by mpirun -# skip lines starting with # and only consider lines with more than -# one word in them. Note that the hostfile given to this script -# has two columns: the host name and the number of shared processes -# to run on this host. mpirun wants the number of _other_ -# processes to run in addition to the one being run on the machine -# on which the job is started. hence the $2-1 for fnr == 1. - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then -# HPMPI or HP hardware MPI - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ - -v mpihpspecial="$MPIHPSPECIAL" \ -'{if ( NF > 0) {\ - fnr++ ; \ - printf("-h %s -np %s",$1,$2); \ - printf(" %s",mpihpspecial); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ - if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ - }\ - }' > $jid.host -# end HPMPI or HP hardware MPI - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then -# IBM using hardware MPI (POE) - MP_HOSTFILE=$jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host -# end IBM using hardware MPI (POE) -# for Intel MPI, need to create a machinefile for DMP - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then -# Intel MPI - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - /bin/cp $host $jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Intel MPI for DMP -# for Solaris HPC 7.1, need to create a machinefile for DMP - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then -# Solaris HPC 7.1 - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Solaris HPC 7.1 for DMP -# for Myrinet, construct a configuration file in ~/.gmpi -# this must be readable by each process -# format is (hostname) (port number) for each process - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - grep -v '^#' $host | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ -{if ( NF > 0 ) \ - for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ -}' >> ~/.gmpi/$jid.host - else -# this is for mpich-1.2.5 and later, using the -pg option -# format: host nproc executable user arguments -# the arguments are added later - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s %s\n",path,user);\ - if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ - }\ - }' > $jid.host - fi -# end Myrinet - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then -# Compaq MPI via Memory Channel - grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host -# end Compaq MPI - else -# MPICH - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ - }\ - }' > $jid.host - fi -# define the variable host and host_filt -# host_filt is used for loops over hosts -# for Myrinet we need to use a filtered variant of userhost -# for others we can use $host - if test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - host=~/.gmpi/$jid.host - host_filt=$jid.host_tMp - grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt - else - host=$jid.host - host_filt=$host - fi - else - host=$jid.host - host_filt=$host - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - host_filt=$jid.mfile - fi - fi -# figure out if the machines in the hostfile are nfs mounted -# or distributed and set the variable "dirstatus" accordingly. -# only perform the check if user subroutine is used -# or a user subroutine executable is used - - numfield=1 - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - numfield=2 - fi - DIR1=$DIRJOB - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - counter=0 - echo " " - echo "checking if local or shared directories for host" - if test "$deletelog" = no - then - echo "checking if local or shared directories for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - dirstatus[$counter]="shared" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - dirstatus[$counter]="local" - /bin/rm tmp.$$ - else - if test ! -f $jid.$$ - then - dirstatus[$counter]="local" - $RSH $i /bin/rm $DIR1/$jid.$$ - else - /bin/rm $jid.$$ - fi - fi - if test -f tmp.$$ - then - /bin/rm tmp.$$ - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - echo " ${dirstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${dirstatus[$counter]}" >> $jid.log - fi - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - fi - -# figure out if this is a compatible set of machines -# unless explicitly specified with flag -comp -# only perform the check if user subroutine is used -# or a user subroutine executable is used -# Myrinet does not support heterogeneous - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - if test $compatible = "unknown" - then - thisname=$ARCH - compatible=yes - counter=0 - echo "checking if machines are compatible for host" - if test "$deletelog" = no - then - echo "checking if machines are compatible for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]="yes" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - othername=`$RSH $i uname -a | cut -f 1 -d " "` - if test $thisname != $othername - then - compatible=no - compstatus[$counter]="no" - fi - fi - echo " ${compstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${compstatus[$counter]}" >> $jid.log - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - else - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]=$compatible - fi - done - if test $compatible = "no" - then - echo "all machines assumed incompatible" - if test "$deletelog" = no - then - echo "all machines assumed incompatible" >> $jid.log - fi - else - echo "all machines compatible" - if test "$deletelog" = no - then - echo "all machines compatible" >> $jid.log - fi - fi - fi -# error out if user objects or libraries are used on incompatible machines - if test "$compatible" = "no" -a -n "$objs" - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" - if test "$deletelog" = no - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log - fi - exit 1 - fi -# modify new host file if NFS mounted heterogeneous machine - doit= - if test $program = $prog.marc - then - doit=yes - fi - if test "$user" - then - doit=yes - fi - if test "$doit" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - $AWK -v hst=$i '{fnr++ ; \ -if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ -printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} - /bin/mv $jid.host{$$} $jid.host - host=$jid.host - fi - fi - done - fi - fi # if test $program = $prog.marc -o $user -o $obj - - else # if test $host - # assume shared memory machine if no hostfile given and - # MPITYPE is set to mpich or Myrinet - # check for Myrinet that the total number of processes is - # less than number of available user ports, 5 - if test $MPITYPE = "mpich" -o $MPITYPE = "scali" - then - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - host=$jid.host - elif test $MPITYPE = "myrinet" - then - if test $nprocd -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes " - echo "must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes " >> $jid.log - echo "must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - echo `hostname` $nprocd | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ - {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ -' >> ~/.gmpi/$jid.host - host=~/.gmpi/$jid.host - else - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - - fi - fi # if test myrinet - - fi # if test $host - - fi # if test $nprocd -gt 1 - -fi # if test $program = $exefile -o $program = $prog.marc - -############################################################################## -# construct run stream (Marc only) # -############################################################################## - -# set maximum message length for ddm to a large number -# for vendor provided mpi -if test $itree -eq 0 -a $MPITYPE = hardware -then - itree=100000000 - if test $MACHINENAME = SGI - then - itree=100000001 - fi -fi -if test $itree -eq 0 -a $MPITYPE = hpmpi -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = myrinet -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = nec -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = scali -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = intelmpi -then - itree=100000000 -fi -if test $nprocdddm -lt 2 -then - nprocdarg= -else - nprocdarg="$nprocdarg $nprocdddm" -fi -if test $nsolver -eq 0 -then - nsolverarg= -else - nsolverarg="$nsolverarg $nsolver" -fi -if test $nprocdddm -lt 2 -a $nsolver -eq 0 -then -nprocd=0 -fi -if test $nprocd -gt 0 -then - if test "$host" - then - if test -z "$RUN_JOB2" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then - RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - else - RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" - RUN_JOB=" -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - numhost=`uniq $jid.mfile | wc -l` - if test "$INTELMPI_VERSION" = "HYDRA" - then - RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n $numhost -r $RSH -f $jid.mfile - RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" - fi - -# intelmpi uses configfile. format: -# -host host1 -n n1 executable marcargs -# one such line per host -# collect the marcargs in RUN_JOB and construct the config file later -# collect the run stream in RUN_JOB_TMP - RUN_JOB="-jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - - - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then - RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi - if test "$userhost" - then - RUN_JOB="$RUN_JOB -mhost $userhost" - fi - if test $MPITYPE = "scali" - then -# set default working directory to /tmp to allow -# different directory names - SCAMPI_WORKING_DIRECTORY=/tmp - export SCAMPI_WORKING_DIRECTORY - fi - else - if test -z "$RUN_JOB1" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - RUNNPROCD=$nprocd - if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" - then - RUNNPROCD= - MP_PROCS=$nprocd - export MP_PROCS - fi - if test $MPITYPE = "myrinet" - then - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n 1 -f $jid.hosts - fi - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi - fi -else - if test $nauto -gt 0 -o $ndcoup -gt 0 - then - RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ - $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - else -# this is for a serial job without auto restart: - RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi -fi -if test "$rid" -then - RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" -fi -if test "$pid" -then - RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" -fi -if test "$sid" -then - RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" -fi -if test "$did" -then - RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" -fi -if test "$vid" -then - RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" -fi -if test $nauto -gt 0 -then - RUN_JOB="$RUN_JOB -autorst $nauto " -fi -if test $ndcoup -gt 0 -then - RUN_JOB="$RUN_JOB -dcoup $ndcoup " -fi -if test $ndytran -gt 0 -then - RUN_JOB="$RUN_JOB -dytran $ndytran " -fi -if test $mesh -gt 0 -then - RUN_JOB="$RUN_JOB -me $mesh " -fi -if test $noutcore -gt 0 -then - RUN_JOB="$RUN_JOB -outcore $noutcore " -fi -if test "$dllrun" -gt 0 -then - RUN_JOB="$RUN_JOB -dll $dllrun " -fi -if test "$trkrun" -gt 0 -then - RUN_JOB="$RUN_JOB -trk $trkrun " -fi -if test "$iam" -then - RUN_JOB="$RUN_JOB -iam $iam " -fi -if test "$justlist" -then - RUN_JOB="$RUN_JOB -list 1 " -fi -if test "$feature" -then - RUN_JOB="$RUN_JOB -feature $feature " -fi -if test "$memlimit" -ne 0 -then - RUN_JOB="$RUN_JOB -ml $memlimit " -fi -if test "$cpinput" -then - RUN_JOB="$RUN_JOB -ci $cpinput " -fi -if test "$cpresults" -then - RUN_JOB="$RUN_JOB -cr $cpresults " -fi -if test "$DIRSCR" != "$DIRJOB" -then - RUN_JOB="$RUN_JOB -dirscr $DIRSCR" -else - DIRSCR=$DIRJOB -fi -if test "$makebdf" -then - RUN_JOB="$RUN_JOB -bdf $makebdf " -fi -if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" -then - # append $RUN_JOB to all lines of the host file - # and set RUN_JOB - $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ - /bin/mv $host.$$ $host - RUN_JOB=$RUN_JOB_TMP -fi -if test $MPITYPE = "intelmpi" -a "$host" -then - # construct config file, append $RUN_JOB to all lines of the config file - # and set RUN_JOB - if test "$INTELMPI_VERSION" = "HYDRA" - then - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - else - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-host %s -n %s",$1,$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - fi - RUN_JOB=$RUN_JOB_TMP -fi -echo " " -echo "Final run stream value" -echo " RUNJOB="$RUN_JOB -if test "$deletelog" = no -then -echo " " >> $jid.log -echo "Final run stream value" >> $jid.log -echo " RUNJOB="$RUN_JOB >> $jid.log -fi - - -############################################################################## -# run marc using valgrind # -############################################################################## -#RUN_JOB="valgrind $RUN_JOB" -#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" -############################################################################## - - -############################################################################## -# run the requested program in a queue # -############################################################################## - -if test "$deletelog" = yes -then - echo - date -else - echo >> $jid.log - date >> $jid.log -fi -if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] -then - -/bin/rm -f $jid.runmarcscript - - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - userobj=$usermoext.o - fi - cat > $jid.runmarcscript << END4 - if test "$user" - then - if test $MACHINENAME = "CRAY" - then - $DFORTLOW $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTLOW $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $MARCCUDALIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } -END4 -else - prgsav=yes -fi -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# - -cat >> $jid.runmarcscript << END5 - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -# first remove all .out files and incremental restart files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null - /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null -fi - -if test $nprocdddm -gt 1 -then - $RUN_JOB 2>>$jid.log -else - $RUN_JOB 2>>$jid.log -fi - -if test $dllrun -eq 0; then - if test $prgsav = no - then - /bin/rm -f $bd$program 2>/dev/null - fi -else - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes - then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -END5 - - -# Submit to marc batch queue -# -if [ $qid = at ] -then -QUENAME=at -SUBMCMD= -else -# -# Submit to qsub queue -# -QUENAME=qsub -SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" -if test "$priority" -then - SUBMCMD=$SUBMCMD" -p $priority" -fi -if test "$att" -then - SUBMCMD=$SUBMCMD" -a $att" -fi -if test "$cpu" -then - SUBMCMD=$SUBMCMD" -lt $cpu" -fi - -fi -echo $QUENAME $SUBMCMD -#cat $jid.runmarcscript -$QUENAME $SUBMCMD < $jid.runmarcscript - -/bin/rm -f $jid.runmarcscript - -############################################################################## -# run the requested program in the background # -############################################################################## - -else -if test $qid = background -then - -# -# first remove all old .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi -# -# compile user subroutine if present -# -( -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_l $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - echo " $PRODUCT Exit number 3" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTLOW $user || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTLOW $user -o $userobj || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - echo " $PRODUCT Exit number 3" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc - -# - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -$RUN_JOB & - -marcpid=$! -echo $marcpid > $DIRJOB/$jid.pid -wait $marcpid - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - if test "$host" - then - /bin/rm $jid.mfile 2> /dev/null - /bin/rm $jid.hosts 2> /dev/null - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.cfile 2> /dev/null - fi - fi - fi -fi - - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -) 1>>$jid.log 2>&1 & - - -############################################################################## -# run the requested program in the foreground # -############################################################################## - -else - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_l $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTLOW $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTLOW $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi -# first remove all .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi - -$RUN_JOB - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - if test "$host" - then - /bin/rm $jid.mfile 2> /dev/null - /bin/rm $jid.hosts 2> /dev/null - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.cfile 2> /dev/null - else - echo " " > /dev/null - fi - else - if test "$host" - then - mpdcleanup -a -f $jid.mfile - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.mfile 2> /dev/null - else - mpdcleanup -a -f $jid.hosts - /bin/rm $jid.hosts 2> /dev/null - fi - fi - fi -fi - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi - - -fi -fi diff --git a/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_lmp b/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_lmp deleted file mode 100644 index bd111d6ba..000000000 --- a/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_lmp +++ /dev/null @@ -1,4053 +0,0 @@ -#!/bin/ksh -############################################################################## -# # -# run_marc - run a marc job # -# ------------------------- # -# # -# usage: run_marc -j jid { options } # -# # -# where standard options are: required: defaults: # -# -------------------------- # -# # -# -j* jid job id number. ** YES ** . # -# -pr* prog program name. . marc # -# -v* y|n do or do not verify inputs. . yes # -# -q* s|l|v|b|f batch queue name or background, . short # -# foreground. # -# -b* as alternative to option -q* # -# # -# ( batch queues only : # -# -pq* intra queue priority. . . # -# -at DATE/TIME delay start of job. . . # -# format : January,1,1990,12:31 # -# or : today,5pm # -# -cpu* secs job CPU limit . . ) # -# # -# -r* rid restart file job id. . . # -# -si* sid substructure file id. . . # -# -pi* post post file job id. . . # -# -de* did defaults file . no # -# -vf vid viewfactor . no # -# # -# -u* user user subroutine. . . # -# -obj obj user objects or libraries. . . # -# -sa* y|n do or do not save load module. . no # -# -autorst auto restart flag for auto forge . no # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo selects i4 or i8 version # -# default: i4 or via defaults file run_marc_defaults # -# the -mo option will override # -# -mpi selects MPI version # -# each platform has a default MPI version and some # -# have an alternative version. see the include file # -# for the respective platform # -# MPI_DEFAULT defines the default MPI version # -# MPI_OTHER defines versions one can switch to # -# -dcoup for contact decoupling # -# currently not supported # -# -dir directory where the job i/o should take place. # -# defaults to current directory. # -# -sdir directory where scratch files are created # -# defaults to current directory. # -# # -# -alloc only perform memory allocation test, no analysis # -# -list y only list options in the input file, no analysis # -# -fe num set feature number "num" for the run. only one allowed # -# -dytran flag to switch from Dytran to Marc # -# dytran = 0, program will run w/o Marc-Dytran Switch # -# = 1, program will restart Marc after Dytran run # -# >= 2, Not supported yet. # -# currently not supported # -# -ou force analysis to use out-of-core control # -# =0, not used # -# =1, element storage out-of-core # -# -dll run marc using shared library libmarc.so and exe_marc # -# =1, used # -# =2, do not free streaming input memory # -# =3, run with marc input deck # -# -trk run marc for post-tracking # -# -gpuid run marc using GPGPU capability # -# specify gpuid on to be used in the analysis. Multiple # -# IDs may be assigned for DDM runs. # -# Separate a list of IDs with a colon. Each DMP # -# process will be assigned a GPU ID in round robin fastion# -# = 0 # -# = 0:1 etc... # -# # -# where parallel options are: # -# -------------------------- # -# # -# itree, host, and comp options are available for the domain # -# decomposition only. # -# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # -# # -# # -# -nprocd number of domains. # -# defaults to single domain solution. # -# -nprocds number of domains if single input file. # -# defaults to single domain solution. # -# -nps same as -nprocds. # -# -nsolver number of solver tasks for solver types 12 and 13 # -# these are distributed tasks operating via MPI # -# -nthread_elem number of threads for element assembly and recovery # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by element assembly # -# recovery. # -# Also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. # -# if both specified, -nthread_elem option will be used. # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor -nthread_elem specified. # -# -nthread_solver number of threads for solver types 6, 8, and 11 # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by 6, 8, and 11 # -# Also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. # -# if both specified, -nthread_solver option will be used. # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor -nthread_solver specified. # -# -nthread Same as -nthread_solver. # -# -itree message passing tree type for domain decomposition. # -# for debugging purposes; should not normally be used. # -# -host hostfile name for distributed execution on network. # -# defaults to no hostfile, unless jobid.defhost exists. # -# if jobid.defhost exists, only -np(s) necessary # -# -comp* y|n to be used with user routines on a network of # -# incompatible machines. # -# if set to no, a separate executable will be created # -# for each machine on the network. # -# if set to yes, the executable located on the machine # -# from which marc is started will be used on all machines.# -# defaults to no if O/S versions different on machines. # -# # -# -ci y|n copy input files to remote hosts (default: yes) # -# if "yes", input files are automatically copied to # -# remote hosts for a network run if necessary. # -# -cr y|n copy post files from remote hosts (default: yes) # -# if "yes", post files are automatically copied back from # -# remote hosts for a network run if necessary. # -############################################################################## -# set DIR to the directory in which this script is -REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" -DIR=`dirname $REALCOM` -# make sure DIR has an absolute path -case $DIR in - \/*) - ;; - *) - DIR=`pwd`/$DIR - ;; -esac -DIRSCRIPT=$DIR -AWK=awk -ARCH=`uname -a | cut -f 1 -d " "` -# Sun has a bad awk, use nawk instead -if test $ARCH = "SunOS" -then - AWK=nawk -fi -BASENAME=basename -# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists -if test $ARCH = "SunOS" -then - if test -x /usr/ucb/basename - then - BASENAME=/usr/ucb/basename - fi -fi - -# echo command line in the case of ECHO_COMMAND is true -if test "$ECHO_COMMAND" = true ; then - echo command "$0" "$@" -fi - -# -# "mode" selects version, i4 or i8 -# default is i4 -# this can be changed by a file run_marc_defaults -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MODE i8 -# it can also be set by the environmental variable MARC_INTEGER_SIZE -# and by the command line option "-mo" -# -mode= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -f $HOME/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -n "$MARC_INTEGER_SIZE" ; then - mode=$MARC_INTEGER_SIZE -fi -if test -z "$mode" ; then - mode=i8 -fi -case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "error, version mode must be i4 or i8" - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i4 or i8" - echo " " - echo " use -mo i4 or -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - setmode=true - fi - if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - fi - if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -done - -# set to i4 version for 32 bit Linux -if test "`uname -s`" = "Linux"; then - if test "`uname -m`" = "i686"; then - mode=i4 - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -fi - - -. "$DIR/getarch" - -. $MARC_INCLUDE -# - -# -# Dynamically determine the echo syntax -# - -case "`echo '\c'`" in - '\c') - ECHO='echo -n' - ECHOTXT=' ' - ;; - *) - ECHO='echo' - ECHOTXT=' \c' - ;; -esac - -# -# Variables for the MARC environment -# - -PRODUCT="Marc" -EXITMSG=$MARC_TOOLS/MESSAGES -export EXITMSG -FLEXDIR=$DIR/../flexlm/licenses -export FLEXDIR -TIMCHK=3600 -export TIMCHK -BINDIR=$MARC_BIN -export BINDIR -AFMATDAT=$MARC_RUNTIME/AF_flowmat/ -export AFMATDAT -# -# define directory path to global unified material database -# -MATFILE= -export MATFILE - -# -# define memory limit -# first set to MEMLIMIT from include -# -ml option overrules if specified -memlimit=$MEMLIMIT -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -# -if test $MACHINENAME = "HP" -then - SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH - export SHLIB_PATH -fi -# the one for IBM is defined futher down - -LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH -LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH -export LD_LIBRARY_PATH -export LD_LIBRARY64_PATH -export LD_LIBRARYN32_PATH - -atexit() { -kill -15 $$ -# -if test $MPITYPE = "myrinet" -then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi -fi -} - -trap "atexit" 2 - -# -# defaults -# - -prog=marc -exefile=marc -jid= -rid= -pid= -sid= -did= -vid= -user= -usernoext= -objs= -qid=background -cpu= -priority= -att= -trk= -verify=yes -prgsav=no -rmdll=no -cpdll=no -progdll= -pathdll= -error= -nprocd=0 -nprocdddm=1 -nprocdddmprint= -icreated=0 -nprocdarg= -nsolver=0 -nsolverarg=-ns -if test $nprocds -then - if test $nprocds -gt 1 - then - nprocdddm=$nprocds - nprocdddmprint=$nprocds - icreated=1 - nprocdarg=-nprocds - fi -fi -ntprint=0 -nt=-1 -nte=-1 -nts=-1 -ntarg=-nt -ntearg=-nte -ntsarg=-nts -nteprint= -ntsprint= -gpuids= -nauto=0 -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -itree=0 -iam= -link= -trkrun=0 -DIRJOB=`pwd` -DIRSCR=$DIRJOB -DIRSCRSET= -autoforge=0 -dotdat=.dat -dotdefhost=.defhost -host= -numhost= -mfile= -userhost= -makebdf= -cpinput=yes -cpresults=yes -marcdll=libmarc.$EXT_DLL -# define hostname and strip off extensions (alpha.aaa.com) -thishost=`hostname` -thishost=${thishost%%.*} -compatible=unknown -numfield=1 -justlist= -feature= -mpioption=false -MDSRCLIB=$MARC_LIB/mdsrc.a -# -# check run_marc_defaults file for default MPI setting -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MPI -# -value= -file= -if test -f $DIRSCRIPT/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$DIRSCRIPT/run_marc_defaults - fi -fi -if test -f $HOME/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$HOME/run_marc_defaults - fi -fi -if test -n "$value"; then - MARC_MPITYPE=$value - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - echo " " - echo " error, incorrect option for MARC_MPI" - echo " defined in $file: $MARC_MPITYPE" - echo " valid options: $MPI_DEFAULT $MPI_OTHER" - echo " " - exit - fi - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - fi -fi -# -# -# allow scratch directory to be specified with environmental variable -# MARCSCRATCH -if test $MARCSCRATCH -then - if test -d $MARCSCRATCH - then - DIRSCR=$MARCSCRATCH - else - echo "error, scratch directory '$MARCSCRATCH'" - echo " specified via environmental variable MARCSCRATCH does not exist" - exit - fi -fi -# -############################################################################## -# parse input - arguments always come in pairs # -############################################################################## - -arg=$1 -if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - shift - arg=$1 -fi -while [ -n "$arg" ] -do - shift - value=$1 - case $arg in - -al* | -AL*) - LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - $MARC_BIN/marc -alloc 1 - exit - ;; - -li* | -LI*) - justlist=yes - ;; - -fe* | -FE*) - feature=$value - ;; - -pr* | -PR*) - if test `dirname $value` = '.' - then - prog=`$BASENAME $value .marc` - progdll=`$BASENAME $value` - else - prog=`dirname $value`/`$BASENAME $value .marc` - progdll=`dirname $value`/`$BASENAME $value` - fi - prdir=`dirname $value` - case $prdir in - \/*) - ;; - *) - prog=`pwd`/$prdir/$prog - ;; - esac - ;; - -j* | -J*) - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - ;; - -r* | -R*) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - -si* | -SI*) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - -pi* | -PI*) - if test -f $value.t19 - then - pid=`$BASENAME $value .t19` - else - pid=`$BASENAME $value .t16` - fi - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - -bdf | -BDF) - makebdf=1 - ;; - -de* | -DE*) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - -vf | -VF) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - -u* | -U*) - user=$value - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - -obj | -OBJ) - objs="$value" - ;; - -q* | -Q*) - qid=$value - ;; - -b* | -B*) - case $value in - y* | Y*) - qid=background - ;; - n* | N*) - qid=foreground - ;; - *) - ;; - esac - ;; - -at | -AT) - att=$value - ;; - -cpu* | -CPU*) - cpu=$value - ;; - -pq | -PQ*) - priority=$value - ;; - -v* | -V*) - verify=$value - ;; - -sa* | -SA*) - prgsav=$value - ;; - -np* | -NP*) - nprocdddm=$value - nprocdddmprint=$value - case $arg in - -nps* | -NPS* | -nprocds* | -NPROCDS*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - case $arg in - -np | -NP | -nprocd | -NPROCD) - icreated=0 - nprocdarg=-nprocd - ;; - esac - ;; - -ns* | -NS*) - nsolver=$value - ;; - -nt* | -NT*) - case $arg in - -nte | -NTE | -nthread_e* | -NTHREAD_E*) - nte=$value - ;; - esac - case $arg in - -nts | -NTS | -nthread_s* | -NTHREAD_S*) - nts=$value - ;; - esac - case $arg in - -nt | -NT | -nth* | -NTH* | -nthread* | -NTHREAD*) - nt=$value - ;; - esac - ;; - -gp* | -GP*) - gpuids=$value - ;; - -it* | -IT*) - itree=$value - ;; - -iam | -IAM) - iam=$value - ;; - -au* | -AU*) - nauto=$value - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -me | -ME ) - mesh=$value - ;; - -ml | -ML ) - memlimit=$value - ;; - -mo | -MO ) - ;; - -mpi | -MPI ) - mpioption=true - MARC_MPITYPE=$value - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - fi - fi - ;; - -dir* | -DIR*) - DIRJOB=$value - case $DIRJOB in - \/*) - ;; - *) - DIRJOB=`pwd`/$DIRJOB - ;; - esac - if test -z "$DIRSCRSET" - then - DIRSCR=$DIRJOB - fi - ;; - -sd* | -SD*) - DIRSCR=$value - DIRSCRSET=yes - case $DIRSCR in - \/*) - ;; - *) - DIRSCR=`pwd`/$DIRSCR - ;; - esac - ;; - -ho* | -HO*) - host=$value - ;; - -co* | -CO*) - compatible=$value - ;; - -ci* | -CI*) - cpinput=$value - ;; - -cr* | -CR*) - cpresults=$value - ;; - *) - error="$error -$arg: invalid option" - break - ;; - esac - case $value in - -*) - error="$error -$arg: invalid name $value" - break - ;; - esac - shift - arg=$1 - if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - shift - arg=$1 - fi -done -argc=`expr $# % 2` -if test $argc -eq 1 -then -# -# odd number of arguments -# - error="$error -argument list incomplete" -fi - -if test $nprocdddm -gt 0 -then -nprocd=$nprocdddm -fi - -if test $nsolver -gt 0 -then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi -fi -# Set defaults -if test $nt -eq -1 -then -nt=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nt -lt 0 -then -nt=0 -fi -if test $nte -eq -1 -then -nte=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nte -lt 0 -then -nte=0 -fi -if test $nts -eq -1 -then -nts=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nts -lt 0 -then -nts=0 -fi -# -# set number of element loop threads -# -ntprint=$nt -nteprint=$nte -# copy from -nprocd[s] -if test $nprocdddm -gt 1 -then - nteprint=$nprocdddm -fi -# override with -nthread_elem option -if test $nte -ne 0 -then -nteprint=$nte -fi -# check for minimum 1 threads per processes for DDM -if test $nprocdddm -gt 1 -then - if test $nteprint -lt $nprocdddm - then - nteprint=$nprocdddm - fi -fi -nte=$nteprint -# -# set number of Solver threads -# -ntsprint=$nts -# copy from -nthread or -nprocd[s] -if test $ntprint -ne 0 -then - ntsprint=$ntprint -else - if test $nprocdddm -gt 1 - then - ntsprint=$nprocdddm - fi -fi -# override with -nthread_solver option -if test $nts -ne 0 -then - ntsprint=$nts -fi -# check for minimum 1 threads per solver process. -if test $nsolver -lt $nprocdddm -then - if test $ntsprint -lt $nsolver - then - ntsprint=$nsolver - fi -else - if test $ntsprint -lt $nprocdddm - then - ntsprint=$nprocdddm - fi -fi -if test $ntsprint -eq 1 -then - set ntsprint=0 -fi -nts=$ntsprint - -# set stack size for multi-threading. -export KMP_MONITOR_STACKSIZE=7M -export OMP_STACKSIZE=7M - -# -# deprecate -nthread option at arugment of marc -nt=0 -# Reset nprocdddmm, nsolver and threads if not given. -if test $nprocdddm -eq 0 -then - nprocdarg= -fi -if test $nprocdddm -eq 0 -then - nprocdddmprint= -fi -if test $nprocdddm -eq 0 -then - nprocdddm= -fi - -if test $nsolver -eq 0 -then - nsolverprint= -fi -# end of threads setting. -gpuoption= -if test "$gpuids" = "" ; then - gpuoption= -else - gpuoption="-gp $gpuids" -fi - -if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH -else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH -fi -# Linux 64 + HPMPI, Below code is taken from include_linux64 -if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" -then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" -fi - -if test $nprocd -gt 1; then - if test -f $jid$dotdefhost; then - if test "$host" = ""; then - host=$jid$dotdefhost - fi - fi - if test -f hostfile_qa_$nprocd; then - if test "$host" = ""; then - host=hostfile_qa_$nprocd - fi - fi -fi - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then - dotdat=.inp - fi - - if test "$progdll"; then - /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll - rmdll=yes - pathdll=yes - progdll=${progdll}_$marcdll - else - progdll=$marcdll - fi - - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - pathdll=yes - fi -fi - -############################################################################## -# check parameter validity # -############################################################################## - -while test forever; do - -# -# check for input file existence -# -if test $nprocdddm -gt 1 -a $icreated -eq 0; then - if test ! -f $DIRJID/1$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/1$jid$dotdat not accessible" - fi - fi -else - if test ! -f $DIRJID/$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/$jid$dotdat not accessible" - fi - fi -fi - if test $nprocd -gt 1; then - if test "$host" ; then - if test ! -f $host; then - error="$error -host name file $host not accessible" - fi - fi - fi - -# -# check if the job is already running in the background -# -if test -f $DIRJOB/$jid.pid; then - error="$error -job is already running (the file $jid.pid exists)" -fi - -# -# if the program name is other than marc, then -# assume that this is a program in the users local directory -# - -bd=$MARC_BIN/ - -case $prog in - marc | MARC | $exefile) - program=$exefile - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - if test ! -f $user - then - error="$error -user subroutine file $user not accessible" - fi - fi - if test "$objs" - then - missingobjs= - for o in $objs - do - if test ! -f "$o" - then - if test -z "$missingobjs" - then - missingobjs="$o" - else - missingobjs="$missingobjs $o" - fi - fi - done - if test -n "$missingobjs" - then - error="$error -user object/library file(s) $missingobjs not accessible" - fi - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$vid" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRVID/1$vid.vfs - then - error="$error -view factor file $DIRVID/1$vid.vfs not accessible" - fi - else - if test ! -f $DIRVID/$vid.vfs - then - error="$error -view factor file $DIRVID/$vid.vfs not accessible" - fi - fi - fi - if $mpioption - then - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" - fi - fi - ;; - *) - program=$prog.marc - case $prog in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - error="$error -program option may not be used with user subroutine" - fi - if test "$objs" - then - error="$error -program option may not be used with user objects or libraries" - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$nauto" - then - if test $nauto -gt 2 - then - error="$error -incorrect option for auto restart " - fi - fi - if test "$ndcoup" - then - if test $ndcoup -gt 3 - then - error="$error -incorrect option for contact decoupling " - fi - fi - if test "$ndytran" - then - if test $ndytran -gt 1 - then - error="$error -incorrect option for Marc-Dytran Switch " - fi - fi - if $mpioption - then - if test ! -x $MARC_BIN/$exefile - then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE " - fi - fi - ;; -esac - -############################################################################## -# check argument integrity # -############################################################################## - -if test "$jid" -then - : -else - error="$error -job id required" -fi - -if test $nprocd -gt 1 -then - if test $nauto -gt 0 - then - error="$error -cannot run DDM job with auto restart (-au) option " - fi -fi -case $qid in - S* | s*) - qid=short - ;; - L* | l*) - qid=long - ;; - V* | v*) - qid=verylong - ;; - B* | b*) - qid=background - ;; - F* | f*) - qid=foreground - ;; - A* | a*) - qid=at - ;; - *) - error="$error -bad value for queue_id option" - ;; -esac - -case $prgsav in - N* | n*) - prgsav=no - ;; - Y* | y*) - prgsav=yes - ;; - *) - error="$error -bad value for save option" - ;; -esac - -case $verify in - N* | n*) - verify=no - ;; - Y* | y*) - verify=yes - ;; - *) - error="$error -bad value for verify option" - ;; -esac - -case $nprocdddm in - -* ) - error="$error -bad value for nprocd option" - ;; -esac - -case $nt in - -* ) - error="$error -bad value for nt option" - ;; -esac - -case $itree in - -* ) - error="$error -bad value for itree option" - ;; -esac -case $iam in - -* ) - error="$error -bad value for iam option" - ;; -esac -case $compatible in - N* | n*) - compatible=no - ;; - Y* | y*) - compatible=yes - ;; - unknown) - ;; - *) - error="$error -bad value for comp option" - ;; -esac -case $cpinput in - N* | n*) - cpinput=no - ;; - Y* | y*) - cpinput=yes - ;; - *) - error="$error -bad value for copy input option" - ;; -esac -case $cpresults in - N* | n*) - cpresults=no - ;; - Y* | y*) - cpresults=yes - ;; - *) - error="$error -bad value for copy results option" - ;; -esac - -# -# check for external file to run -# -if test -f $MARC_TOOLS/run_marc_check -then - . $MARC_TOOLS/run_marc_check -fi - -# -# pick up version data from bin/VERSION if it exists -# -if test -f $MARC_BIN/VERSION; then - ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` - if test -n "$ppp" ;then - PRODUCT=$ppp - fi - ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` - if test -n "$ppp" ;then - REVISION=", Build $ppp" - fi -fi -############################################################################## -# interact with the user to get the required information to run marc or # -# other marc system program # -############################################################################## - -deletelog=yes -if test $qid = background -a $verify = no -then -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Element loop threads : $nteprint -Solver processes : $nsolverprint -Solver threads : $ntsprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto " > $jid.log -deletelog=no -fi -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Element loop threads : $nteprint -Solver processes : $nsolverprint -Solver threads : $ntsprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto" - - -case $qid in - s* | S* | l* | L* | v* | V* ) - echo \ -"Queue priority : $priority -Queue CPU limit : $cpu -Queue start time : $att" - ;; -# * ) -# echo \ -#" " -# ;; -esac - -if test "$error" -then - if test $verify = yes - then - $ECHO "$error - -Please correct or quit(correct,quit,): $ECHOTXT" - error= - read answer - case $answer in - q* | Q*) - answer=quit - ;; - *) - answer=correct - ;; - esac - else - $ECHO "$error - $ECHOTXT" - echo " " - if test "$deletelog" = no - then - $ECHO "$error - $ECHOTXT" >> $jid.log - echo " " >> $jid.log - fi - answer=quit - fi -else - if test $verify = yes - then - $ECHO " -Are these parameters correct (yes,no,quit,)? $ECHOTXT" - read answer - case $answer in - q* | Q*) - answer=quit - ;; - y* | Y*) - answer=yes - ;; - *) - answer=no - ;; - esac - else - answer=yes - fi -fi - -case $answer in - no | correct) - -############################################################################## -# prompt for each value # -############################################################################## - - $ECHO " -Program name ($prog)? $ECHOTXT" - read value - if test "$value" - then - prog=$value - fi - $ECHO "Job ID ($jid)? $ECHOTXT" - read value - if test "$value" - then - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - fi - $ECHO "User subroutine name ($user)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - user= - ;; - *) - user=$value - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - esac - fi - $ECHO "User objects or libraries ($objs)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - objs= - ;; - *) - objs="$value" - ;; - esac - fi - $ECHO "Restart File Job ID ($rid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - rid= - ;; - *) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - esac - fi - $ECHO "Substructure File ID ($sid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - sid= - ;; - *) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - esac - fi - $ECHO "Post File Job ID ($pid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - pid= - ;; - *) - pid=$value - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - esac - fi - $ECHO "Defaults File ID ($did)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - did= - ;; - *) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - esac - fi - $ECHO "View Factor File ID ($vid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - vid= - ;; - *) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - esac - fi - $ECHO "Save generated module ($prgsav)? $ECHOTXT" - read value - if test "$value" - then - prgsav=$value - fi - $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" - read value - if test "$value" - then - nprocdddm=$value - nprocdddmprint=$value - fi - $ECHO "Run on ($nte) Element loop threads ? $ECHOTXT" - read value - if test "$value" - then - nte=$value - fi - $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" - read value - if test "$value" - then - nsolver=$value - fi - $ECHO "Run on ($nts) Solver threads ? $ECHOTXT" - read value - if test "$value" - then - nts=$value - fi -# - if test $nprocdddm -gt 0 - then - nprocd=$nprocdddm - fi - if test $nsolver -gt 0 - then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi - fi -# Element loop threads. - if test $nte -eq -1 - then - nte=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nte -lt 0 - then - nte=0 - fi - nteprint=$nte -# Copy from ddm - if test $nprocdddm -gt 1 - then - nteprint=$nprocdddm - fi -# override with -nthread_elem option - if test $nte -ne 0 - then - nteprint=$nte - fi -# check for minimum 1 threads per processes for DDM - if test $nprocdddm -ne 0 - then - if test $nteprint -lt $nprocdddm - then - nteprint=$nprocdddm - fi - fi - nte=$nteprint -# Solver threads. - if test $nts -eq -1 - then - nts=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nts -lt 0 - then - nts=0 - fi - ntsprint=$nts -# Copy from ddm - if test $nprocdddm -gt 1 - then - ntsprint=$nprocdddm - fi -# override with -nthread_solver option - if test $nts -ne 0 - then - ntsprint=$nts - fi -# check for minimum 1 threads per solver process. - if test $nsolver -lt $nprocdddm - then - if test $ntsprint -lt $nsolver - then - ntsprint=$nsolver - fi - else - if test $ntsprint -lt $nprocdddm - then - ntsprint=$nprocdddm - fi - fi - if test $ntsprint -eq 1 - then - set ntsprint=0 - fi - nts=$ntsprint - $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" - read value - if test "$value" - then - gpuids=$value - fi - if test "$gpuids" = "" ; then - gpuoption= - else - gpuoption="-gp $gpuids" - fi - if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH - fi - if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - fi -# - if test $nprocd -gt 1 - then - $ECHO "Message passing type ($itree)? $ECHOTXT" - read value - if test "$value" - then - itree=$value - fi - $ECHO "Host file name ($host)? $ECHOTXT" - read value - if test "$value" - then - host=$value - fi - if test $nprocdddm -gt 1 - then - $ECHO "Single input file? $ECHOTXT" - read value - case $value in - y* | Y*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" - read value - if test "$value" - then - compatible=$value - fi - $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" - read value - if test "$value" - then - cpinput=$value - fi - $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" - read value - if test "$value" - then - cpresults=$value - fi - fi - fi - $ECHO "Run the job in the queue ($qid)? $ECHOTXT" - read value - if test "$value" - then - qid=$value - fi - case $qid in - s* | S* | l* | L* | v* | V* ) - $ECHO "Queue priority ($priority)? $ECHOTXT" - read value - if test "$value" - then - priority=$value - fi - $ECHO "Job starts at ($att)? $ECHOTXT" - read value - if test "$value" - then - att=$value - fi - $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" - read value - if test "$value" - then - cpu=$value - fi - ;; - * ) - ;; - esac - $ECHO "Auto Restart option ($nauto)? $ECHOTXT" - read value - if test "$value" - then - nauto=$value - fi - $ECHO "Run directory ($DIRJOB)? $ECHOTXT" - read value - if test "$value" - then - DIRJOB=$value - DIRSCR=$DIRJOB - fi - $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" - read value - if test "$value" - then - DIRSCR=$value - fi - ;; - quit) - exit 1 - ;; - *) - break - ;; - -esac - - if test $nt -eq -1 - then - nt=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nt -lt 0 - then - nt=0 - fi - -done -# -if test $nt -eq 0 -then - ntarg= -fi -if test $nt -eq 0 -then - ntprint= -fi -if test $nt -eq 0 -then - nt= -fi - -if test $nte -eq 0 -then - ntearg= -fi -if test $nte -eq 0 -then - nteprint= -fi -if test $nte -eq 0 -then - nte= -fi - -if test $nts -eq 0 -then - ntsarg= -fi -if test $nts -eq 0 -then - ntsprint= -fi -if test $nts -eq 0 -then - nts= -fi -# -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - pathdll=yes - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - fi - - if test "$pathdll"; then -# -# reset share lib path -# - if test $MACHINENAME = "HP" - then - SHLIB_PATH=$DIRJOB:$SHLIB_PATH - export SHLIB_PATH - fi - if test $MACHINENAME = "IBM" - then - LIBPATH=$DIRJOB:$LIBPATH - export LIBPATH - fi -# - LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH - LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH - LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH - export LD_LIBRARY_PATH - export LD_LIBRARY64_PATH - export LD_LIBRARYN32_PATH - fi -fi -# end of dllrun>0 - - -if test $program = $exefile -o $program = $prog.marc -then - -# delete the old .log file unless we run in the background -if test "$deletelog" = yes -then - /bin/rm $jid.log 2>/dev/null -else - echo - echo running the job in the background, see $jid.log - echo -fi - -# -# check if this is an autoforge or rezoning or radiation job -# -if test $nprocd -eq 1 -then - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` - if test "$line" - then - autoforge=1 - fi -fi -# -# check that jobname for restarted run is not the same -# as restart file basename -# -if test "$rid" -then - if test "$jid" = "$rid" - then - echo " " - echo "ERROR: job name of current run is the same as job name" - echo " of the restarted job" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "ERROR: job name of current run is the same as job name" >> $jid.log - echo " of the restarted job" >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi -fi - -# -# user objects/libraries used -# - - if test "$objs" - then - program="$DIRJOB/$jid.marc" - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# user subroutine used -# -# add DAMASK options for linking - DAMASK="" - - if test "$user" - then - program=$usernoext.marc - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# Special case for IBM using POE but not an SP machine -# in this case we always need a host file, also for serial jobs. -# -if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP -then - MP_HOSTFILE=${jid}.host - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $nprocd -gt 1 - then - numdom=$nprocd - while test $numdom -gt 0 - do - hostname -s >> $MP_HOSTFILE - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - else - hostname -s > $MP_HOSTFILE - fi -fi -# -# check ssh for all hosts in host file -# -if test $nprocd -gt 1 -then -if test $MPITYPE = "intelmpi" -a "$INTELMPI_VERSION" = "HYDRA" - then -# get host list - if test "$host" - then - line=`grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' | uniq` -# count failing hosts - counter=0 - for i in $line - do - $RSH -o BatchMode=yes -o ConnectTimeout=10 $i uname -n - status=$? - if [[ $status != 0 ]] ; then - counter=$((counter+1)) - if [ "$counter" = "1" ]; then - echo " " - echo " error - connection test failed... " - echo " " - fi - echo " " - echo " connection test with ssh failed on host $i" - echo " check the following command: ssh $i uname -n " - echo " " - fi - done -# echo error message and quit - if test $counter -ne 0 - then - echo " " - echo " A parallel job using IntelMPI cannot be started. " - echo " The ssh command must be working correctly between " - echo " the computers used in the analysis. Furthermore, " - echo " it must be set up such that it does not prompt the " - echo " user for a password. Note that this is the case " - echo " also for running on a single machine. " - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo " A parallel job using IntelMPI cannot be started. ">> $jid.log - echo " The ssh command must be working correctly between ">> $jid.log - echo " the computers used in the analysis. Furthermore, ">> $jid.log - echo " it must be set up such that it does not prompt the ">> $jid.log - echo " user for a password. Note that this is the case ">> $jid.log - echo " also for running on a single machine. ">> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - else - counter=1 -# test ssh `hostname` - if test $counter -ne 0 - then - line=`hostname` - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi -# test ssh `hostname` - if test $counter -ne 0 - then - line=`hostname -s` - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi -# test ssh localhost - if test $counter -ne 0 - then - line=localhost - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi - if test $counter -ne 0 - then - echo " error - connection test failed... " - echo " " - echo " ssh needs to work on the machine without asking for a password." - echo " check the following command: ssh localhost uname -n" - echo " " - echo " A parallel job using IntelMPI cannot be started. " - echo " The ssh command must be working correctly between " - echo " the computers used in the analysis. Furthermore, " - echo " it must be set up such that it does not prompt the " - echo " user for a password. Note that this is the case " - echo " also for running on a single machine. " - echo " " - if test "$deletelog" = no - then - echo " error - connection test failed... " >> $jid.log - echo " " >> $jid.log - echo " ssh needs to work on the machine without asking for a password." >> $jid.log - echo " check the following command: ssh localhost uname -n" >> $jid.log - echo " " >> $jid.log - echo " A parallel job using IntelMPI cannot be started. " >> $jid.log - echo " The ssh command must be working correctly between " >> $jid.log - echo " the computers used in the analysis. Furthermore, " >> $jid.log - echo " it must be set up such that it does not prompt the " >> $jid.log - echo " user for a password. Note that this is the case " >> $jid.log - echo " also for running on a single machine. " >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - echo $line $nprocd > $jid.hosts - host=$jid.hosts - fi - fi -fi -fi -# -# check correctness of host file; fix for user sub -# - if test $nprocd -gt 1 - then - -# construct the path name to the executable (execpath) - execpath=$MARC_BIN/$exefile - usersub=0 - if test $program = $prog.marc - then - execpath=$prog.marc - usersub=1 - fi - if test "$objs" - then - execpath="$DIRJOB/$jid.marc" - usersub=1 - fi - if test "$user" - then - execpath=$usernoext.marc - usersub=1 - fi - export execpath - execname=`$BASENAME $execpath` - - if test "$host" - then - userhost=$host - case $userhost in - \/* | \.\/*) - ;; - *) - userhost=`pwd`/$userhost - ;; - esac - -# check that the number of processes specified in the hostfile is -# equal to nprocd specified by -nprocd. - numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` - if test $nprocd -ne $numproc - then - echo " " - echo "error, the number of processes specified in the host file" - echo "must be equal to the number of processes given by -nprocd/-nsolver" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, the number of processes specified in the host file" >> $jid.log - echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - -# check for Myrinet that the number of processes per host is -# less than number of available user ports, 5 -# .gmpi directory must exist in user's home directory -# and must have write permission from remote hosts - if test $MPITYPE = "myrinet" - then - numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` - if test $numproc -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes specified " - echo "in the hostfile must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes specified " >> $jid.log - echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - if test ! -d ~/.gmpi - then - echo " " - echo "error, for Myrinet a .gmpi directory must exist " - echo "under the user's home directory" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log - echo "under the user's home directory" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - homedir=`echo ~` - for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - echo " " - echo "error, for Myrinet a shared .gmpi directory must exist " - echo "under the user's home directory " - echo "with remote write permission" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log - echo "under the user's home directory " >> $jid.log - echo "with remote write permission" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - /bin/rm tmp.$$ - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - fi - fi - done - fi - fi - -# construct the host file $jid.host which is used by mpirun -# skip lines starting with # and only consider lines with more than -# one word in them. Note that the hostfile given to this script -# has two columns: the host name and the number of shared processes -# to run on this host. mpirun wants the number of _other_ -# processes to run in addition to the one being run on the machine -# on which the job is started. hence the $2-1 for fnr == 1. - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then -# HPMPI or HP hardware MPI - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ - -v mpihpspecial="$MPIHPSPECIAL" \ -'{if ( NF > 0) {\ - fnr++ ; \ - printf("-h %s -np %s",$1,$2); \ - printf(" %s",mpihpspecial); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ - if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ - }\ - }' > $jid.host -# end HPMPI or HP hardware MPI - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then -# IBM using hardware MPI (POE) - MP_HOSTFILE=$jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host -# end IBM using hardware MPI (POE) -# for Intel MPI, need to create a machinefile for DMP - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then -# Intel MPI - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - /bin/cp $host $jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Intel MPI for DMP -# for Solaris HPC 7.1, need to create a machinefile for DMP - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then -# Solaris HPC 7.1 - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Solaris HPC 7.1 for DMP -# for Myrinet, construct a configuration file in ~/.gmpi -# this must be readable by each process -# format is (hostname) (port number) for each process - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - grep -v '^#' $host | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ -{if ( NF > 0 ) \ - for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ -}' >> ~/.gmpi/$jid.host - else -# this is for mpich-1.2.5 and later, using the -pg option -# format: host nproc executable user arguments -# the arguments are added later - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s %s\n",path,user);\ - if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ - }\ - }' > $jid.host - fi -# end Myrinet - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then -# Compaq MPI via Memory Channel - grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host -# end Compaq MPI - else -# MPICH - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ - }\ - }' > $jid.host - fi -# define the variable host and host_filt -# host_filt is used for loops over hosts -# for Myrinet we need to use a filtered variant of userhost -# for others we can use $host - if test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - host=~/.gmpi/$jid.host - host_filt=$jid.host_tMp - grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt - else - host=$jid.host - host_filt=$host - fi - else - host=$jid.host - host_filt=$host - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - host_filt=$jid.mfile - fi - fi -# figure out if the machines in the hostfile are nfs mounted -# or distributed and set the variable "dirstatus" accordingly. -# only perform the check if user subroutine is used -# or a user subroutine executable is used - - numfield=1 - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - numfield=2 - fi - DIR1=$DIRJOB - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - counter=0 - echo " " - echo "checking if local or shared directories for host" - if test "$deletelog" = no - then - echo "checking if local or shared directories for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - dirstatus[$counter]="shared" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - dirstatus[$counter]="local" - /bin/rm tmp.$$ - else - if test ! -f $jid.$$ - then - dirstatus[$counter]="local" - $RSH $i /bin/rm $DIR1/$jid.$$ - else - /bin/rm $jid.$$ - fi - fi - if test -f tmp.$$ - then - /bin/rm tmp.$$ - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - echo " ${dirstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${dirstatus[$counter]}" >> $jid.log - fi - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - fi - -# figure out if this is a compatible set of machines -# unless explicitly specified with flag -comp -# only perform the check if user subroutine is used -# or a user subroutine executable is used -# Myrinet does not support heterogeneous - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - if test $compatible = "unknown" - then - thisname=$ARCH - compatible=yes - counter=0 - echo "checking if machines are compatible for host" - if test "$deletelog" = no - then - echo "checking if machines are compatible for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]="yes" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - othername=`$RSH $i uname -a | cut -f 1 -d " "` - if test $thisname != $othername - then - compatible=no - compstatus[$counter]="no" - fi - fi - echo " ${compstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${compstatus[$counter]}" >> $jid.log - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - else - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]=$compatible - fi - done - if test $compatible = "no" - then - echo "all machines assumed incompatible" - if test "$deletelog" = no - then - echo "all machines assumed incompatible" >> $jid.log - fi - else - echo "all machines compatible" - if test "$deletelog" = no - then - echo "all machines compatible" >> $jid.log - fi - fi - fi -# error out if user objects or libraries are used on incompatible machines - if test "$compatible" = "no" -a -n "$objs" - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" - if test "$deletelog" = no - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log - fi - exit 1 - fi -# modify new host file if NFS mounted heterogeneous machine - doit= - if test $program = $prog.marc - then - doit=yes - fi - if test "$user" - then - doit=yes - fi - if test "$doit" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - $AWK -v hst=$i '{fnr++ ; \ -if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ -printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} - /bin/mv $jid.host{$$} $jid.host - host=$jid.host - fi - fi - done - fi - fi # if test $program = $prog.marc -o $user -o $obj - - else # if test $host - # assume shared memory machine if no hostfile given and - # MPITYPE is set to mpich or Myrinet - # check for Myrinet that the total number of processes is - # less than number of available user ports, 5 - if test $MPITYPE = "mpich" -o $MPITYPE = "scali" - then - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - host=$jid.host - elif test $MPITYPE = "myrinet" - then - if test $nprocd -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes " - echo "must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes " >> $jid.log - echo "must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - echo `hostname` $nprocd | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ - {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ -' >> ~/.gmpi/$jid.host - host=~/.gmpi/$jid.host - else - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - - fi - fi # if test myrinet - - fi # if test $host - - fi # if test $nprocd -gt 1 - -fi # if test $program = $exefile -o $program = $prog.marc - -############################################################################## -# construct run stream (Marc only) # -############################################################################## - -# set maximum message length for ddm to a large number -# for vendor provided mpi -if test $itree -eq 0 -a $MPITYPE = hardware -then - itree=100000000 - if test $MACHINENAME = SGI - then - itree=100000001 - fi -fi -if test $itree -eq 0 -a $MPITYPE = hpmpi -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = myrinet -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = nec -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = scali -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = intelmpi -then - itree=100000000 -fi -if test $nprocdddm -lt 2 -then - nprocdarg= -else - nprocdarg="$nprocdarg $nprocdddm" -fi -if test $nsolver -eq 0 -then - nsolverarg= -else - nsolverarg="$nsolverarg $nsolver" -fi -if test $nprocdddm -lt 2 -a $nsolver -eq 0 -then -nprocd=0 -fi -if test $nprocd -gt 0 -then - if test "$host" - then - if test -z "$RUN_JOB2" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then - RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - else - RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" - RUN_JOB=" -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - numhost=`uniq $jid.mfile | wc -l` - if test "$INTELMPI_VERSION" = "HYDRA" - then - RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n $numhost -r $RSH -f $jid.mfile - RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" - fi - -# intelmpi uses configfile. format: -# -host host1 -n n1 executable marcargs -# one such line per host -# collect the marcargs in RUN_JOB and construct the config file later -# collect the run stream in RUN_JOB_TMP - RUN_JOB="-jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - - - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then - RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi - if test "$userhost" - then - RUN_JOB="$RUN_JOB -mhost $userhost" - fi - if test $MPITYPE = "scali" - then -# set default working directory to /tmp to allow -# different directory names - SCAMPI_WORKING_DIRECTORY=/tmp - export SCAMPI_WORKING_DIRECTORY - fi - else - if test -z "$RUN_JOB1" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - RUNNPROCD=$nprocd - if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" - then - RUNNPROCD= - MP_PROCS=$nprocd - export MP_PROCS - fi - if test $MPITYPE = "myrinet" - then - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n 1 -f $jid.hosts - fi - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi - fi -else - if test $nauto -gt 0 -o $ndcoup -gt 0 - then - RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ - $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - else -# this is for a serial job without auto restart: - RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi -fi -if test "$rid" -then - RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" -fi -if test "$pid" -then - RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" -fi -if test "$sid" -then - RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" -fi -if test "$did" -then - RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" -fi -if test "$vid" -then - RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" -fi -if test $nauto -gt 0 -then - RUN_JOB="$RUN_JOB -autorst $nauto " -fi -if test $ndcoup -gt 0 -then - RUN_JOB="$RUN_JOB -dcoup $ndcoup " -fi -if test $ndytran -gt 0 -then - RUN_JOB="$RUN_JOB -dytran $ndytran " -fi -if test $mesh -gt 0 -then - RUN_JOB="$RUN_JOB -me $mesh " -fi -if test $noutcore -gt 0 -then - RUN_JOB="$RUN_JOB -outcore $noutcore " -fi -if test "$dllrun" -gt 0 -then - RUN_JOB="$RUN_JOB -dll $dllrun " -fi -if test "$trkrun" -gt 0 -then - RUN_JOB="$RUN_JOB -trk $trkrun " -fi -if test "$iam" -then - RUN_JOB="$RUN_JOB -iam $iam " -fi -if test "$justlist" -then - RUN_JOB="$RUN_JOB -list 1 " -fi -if test "$feature" -then - RUN_JOB="$RUN_JOB -feature $feature " -fi -if test "$memlimit" -ne 0 -then - RUN_JOB="$RUN_JOB -ml $memlimit " -fi -if test "$cpinput" -then - RUN_JOB="$RUN_JOB -ci $cpinput " -fi -if test "$cpresults" -then - RUN_JOB="$RUN_JOB -cr $cpresults " -fi -if test "$DIRSCR" != "$DIRJOB" -then - RUN_JOB="$RUN_JOB -dirscr $DIRSCR" -else - DIRSCR=$DIRJOB -fi -if test "$makebdf" -then - RUN_JOB="$RUN_JOB -bdf $makebdf " -fi -if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" -then - # append $RUN_JOB to all lines of the host file - # and set RUN_JOB - $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ - /bin/mv $host.$$ $host - RUN_JOB=$RUN_JOB_TMP -fi -if test $MPITYPE = "intelmpi" -a "$host" -then - # construct config file, append $RUN_JOB to all lines of the config file - # and set RUN_JOB - if test "$INTELMPI_VERSION" = "HYDRA" - then - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - else - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-host %s -n %s",$1,$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - fi - RUN_JOB=$RUN_JOB_TMP -fi -echo " " -echo "Final run stream value" -echo " RUNJOB="$RUN_JOB -if test "$deletelog" = no -then -echo " " >> $jid.log -echo "Final run stream value" >> $jid.log -echo " RUNJOB="$RUN_JOB >> $jid.log -fi - - -############################################################################## -# run marc using valgrind # -############################################################################## -#RUN_JOB="valgrind $RUN_JOB" -#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" -############################################################################## - - -############################################################################## -# run the requested program in a queue # -############################################################################## - -if test "$deletelog" = yes -then - echo - date -else - echo >> $jid.log - date >> $jid.log -fi -if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] -then - -/bin/rm -f $jid.runmarcscript - - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - userobj=$usermoext.o - fi - cat > $jid.runmarcscript << END4 - if test "$user" - then - if test $MACHINENAME = "CRAY" - then - $DFORTLOWMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTLOWMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $MARCCUDALIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } -END4 -else - prgsav=yes -fi -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# - -cat >> $jid.runmarcscript << END5 - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -# first remove all .out files and incremental restart files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null - /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null -fi - -if test $nprocdddm -gt 1 -then - $RUN_JOB 2>>$jid.log -else - $RUN_JOB 2>>$jid.log -fi - -if test $dllrun -eq 0; then - if test $prgsav = no - then - /bin/rm -f $bd$program 2>/dev/null - fi -else - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes - then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -END5 - - -# Submit to marc batch queue -# -if [ $qid = at ] -then -QUENAME=at -SUBMCMD= -else -# -# Submit to qsub queue -# -QUENAME=qsub -SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" -if test "$priority" -then - SUBMCMD=$SUBMCMD" -p $priority" -fi -if test "$att" -then - SUBMCMD=$SUBMCMD" -a $att" -fi -if test "$cpu" -then - SUBMCMD=$SUBMCMD" -lt $cpu" -fi - -fi -echo $QUENAME $SUBMCMD -#cat $jid.runmarcscript -$QUENAME $SUBMCMD < $jid.runmarcscript - -/bin/rm -f $jid.runmarcscript - -############################################################################## -# run the requested program in the background # -############################################################################## - -else -if test $qid = background -then - -# -# first remove all old .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi -# -# compile user subroutine if present -# -( -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_lmp $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - echo " $PRODUCT Exit number 3" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTLOWMP $user || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTLOWMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - echo " $PRODUCT Exit number 3" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc - -# - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -$RUN_JOB & - -marcpid=$! -echo $marcpid > $DIRJOB/$jid.pid -wait $marcpid - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - if test "$host" - then - /bin/rm $jid.mfile 2> /dev/null - /bin/rm $jid.hosts 2> /dev/null - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.cfile 2> /dev/null - fi - fi - fi -fi - - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -) 1>>$jid.log 2>&1 & - - -############################################################################## -# run the requested program in the foreground # -############################################################################## - -else - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_lmp $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTLOWMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTLOWMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi -# first remove all .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi - -$RUN_JOB - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - if test "$host" - then - /bin/rm $jid.mfile 2> /dev/null - /bin/rm $jid.hosts 2> /dev/null - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.cfile 2> /dev/null - else - echo " " > /dev/null - fi - else - if test "$host" - then - mpdcleanup -a -f $jid.mfile - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.mfile 2> /dev/null - else - mpdcleanup -a -f $jid.hosts - /bin/rm $jid.hosts 2> /dev/null - fi - fi - fi -fi - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi - - -fi -fi diff --git a/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_mp b/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_mp deleted file mode 100644 index eaa8c253e..000000000 --- a/installation/mods_MarcMentat/2013.1/Marc_tools/run_damask_mp +++ /dev/null @@ -1,4053 +0,0 @@ -#!/bin/ksh -############################################################################## -# # -# run_marc - run a marc job # -# ------------------------- # -# # -# usage: run_marc -j jid { options } # -# # -# where standard options are: required: defaults: # -# -------------------------- # -# # -# -j* jid job id number. ** YES ** . # -# -pr* prog program name. . marc # -# -v* y|n do or do not verify inputs. . yes # -# -q* s|l|v|b|f batch queue name or background, . short # -# foreground. # -# -b* as alternative to option -q* # -# # -# ( batch queues only : # -# -pq* intra queue priority. . . # -# -at DATE/TIME delay start of job. . . # -# format : January,1,1990,12:31 # -# or : today,5pm # -# -cpu* secs job CPU limit . . ) # -# # -# -r* rid restart file job id. . . # -# -si* sid substructure file id. . . # -# -pi* post post file job id. . . # -# -de* did defaults file . no # -# -vf vid viewfactor . no # -# # -# -u* user user subroutine. . . # -# -obj obj user objects or libraries. . . # -# -sa* y|n do or do not save load module. . no # -# -autorst auto restart flag for auto forge . no # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo selects i4 or i8 version # -# default: i4 or via defaults file run_marc_defaults # -# the -mo option will override # -# -mpi selects MPI version # -# each platform has a default MPI version and some # -# have an alternative version. see the include file # -# for the respective platform # -# MPI_DEFAULT defines the default MPI version # -# MPI_OTHER defines versions one can switch to # -# -dcoup for contact decoupling # -# currently not supported # -# -dir directory where the job i/o should take place. # -# defaults to current directory. # -# -sdir directory where scratch files are created # -# defaults to current directory. # -# # -# -alloc only perform memory allocation test, no analysis # -# -list y only list options in the input file, no analysis # -# -fe num set feature number "num" for the run. only one allowed # -# -dytran flag to switch from Dytran to Marc # -# dytran = 0, program will run w/o Marc-Dytran Switch # -# = 1, program will restart Marc after Dytran run # -# >= 2, Not supported yet. # -# currently not supported # -# -ou force analysis to use out-of-core control # -# =0, not used # -# =1, element storage out-of-core # -# -dll run marc using shared library libmarc.so and exe_marc # -# =1, used # -# =2, do not free streaming input memory # -# =3, run with marc input deck # -# -trk run marc for post-tracking # -# -gpuid run marc using GPGPU capability # -# specify gpuid on to be used in the analysis. Multiple # -# IDs may be assigned for DDM runs. # -# Separate a list of IDs with a colon. Each DMP # -# process will be assigned a GPU ID in round robin fastion# -# = 0 # -# = 0:1 etc... # -# # -# where parallel options are: # -# -------------------------- # -# # -# itree, host, and comp options are available for the domain # -# decomposition only. # -# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # -# # -# # -# -nprocd number of domains. # -# defaults to single domain solution. # -# -nprocds number of domains if single input file. # -# defaults to single domain solution. # -# -nps same as -nprocds. # -# -nsolver number of solver tasks for solver types 12 and 13 # -# these are distributed tasks operating via MPI # -# -nthread_elem number of threads for element assembly and recovery # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by element assembly # -# recovery. # -# Also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. # -# if both specified, -nthread_elem option will be used. # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor -nthread_elem specified. # -# -nthread_solver number of threads for solver types 6, 8, and 11 # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by 6, 8, and 11 # -# Also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. # -# if both specified, -nthread_solver option will be used. # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor -nthread_solver specified. # -# -nthread Same as -nthread_solver. # -# -itree message passing tree type for domain decomposition. # -# for debugging purposes; should not normally be used. # -# -host hostfile name for distributed execution on network. # -# defaults to no hostfile, unless jobid.defhost exists. # -# if jobid.defhost exists, only -np(s) necessary # -# -comp* y|n to be used with user routines on a network of # -# incompatible machines. # -# if set to no, a separate executable will be created # -# for each machine on the network. # -# if set to yes, the executable located on the machine # -# from which marc is started will be used on all machines.# -# defaults to no if O/S versions different on machines. # -# # -# -ci y|n copy input files to remote hosts (default: yes) # -# if "yes", input files are automatically copied to # -# remote hosts for a network run if necessary. # -# -cr y|n copy post files from remote hosts (default: yes) # -# if "yes", post files are automatically copied back from # -# remote hosts for a network run if necessary. # -############################################################################## -# set DIR to the directory in which this script is -REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" -DIR=`dirname $REALCOM` -# make sure DIR has an absolute path -case $DIR in - \/*) - ;; - *) - DIR=`pwd`/$DIR - ;; -esac -DIRSCRIPT=$DIR -AWK=awk -ARCH=`uname -a | cut -f 1 -d " "` -# Sun has a bad awk, use nawk instead -if test $ARCH = "SunOS" -then - AWK=nawk -fi -BASENAME=basename -# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists -if test $ARCH = "SunOS" -then - if test -x /usr/ucb/basename - then - BASENAME=/usr/ucb/basename - fi -fi - -# echo command line in the case of ECHO_COMMAND is true -if test "$ECHO_COMMAND" = true ; then - echo command "$0" "$@" -fi - -# -# "mode" selects version, i4 or i8 -# default is i4 -# this can be changed by a file run_marc_defaults -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MODE i8 -# it can also be set by the environmental variable MARC_INTEGER_SIZE -# and by the command line option "-mo" -# -mode= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -f $HOME/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -n "$MARC_INTEGER_SIZE" ; then - mode=$MARC_INTEGER_SIZE -fi -if test -z "$mode" ; then - mode=i8 -fi -case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "error, version mode must be i4 or i8" - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i4 or i8" - echo " " - echo " use -mo i4 or -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - setmode=true - fi - if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - fi - if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -done - -# set to i4 version for 32 bit Linux -if test "`uname -s`" = "Linux"; then - if test "`uname -m`" = "i686"; then - mode=i4 - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -fi - - -. "$DIR/getarch" - -. $MARC_INCLUDE -# - -# -# Dynamically determine the echo syntax -# - -case "`echo '\c'`" in - '\c') - ECHO='echo -n' - ECHOTXT=' ' - ;; - *) - ECHO='echo' - ECHOTXT=' \c' - ;; -esac - -# -# Variables for the MARC environment -# - -PRODUCT="Marc" -EXITMSG=$MARC_TOOLS/MESSAGES -export EXITMSG -FLEXDIR=$DIR/../flexlm/licenses -export FLEXDIR -TIMCHK=3600 -export TIMCHK -BINDIR=$MARC_BIN -export BINDIR -AFMATDAT=$MARC_RUNTIME/AF_flowmat/ -export AFMATDAT -# -# define directory path to global unified material database -# -MATFILE= -export MATFILE - -# -# define memory limit -# first set to MEMLIMIT from include -# -ml option overrules if specified -memlimit=$MEMLIMIT -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -# -if test $MACHINENAME = "HP" -then - SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH - export SHLIB_PATH -fi -# the one for IBM is defined futher down - -LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH -LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH -export LD_LIBRARY_PATH -export LD_LIBRARY64_PATH -export LD_LIBRARYN32_PATH - -atexit() { -kill -15 $$ -# -if test $MPITYPE = "myrinet" -then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi -fi -} - -trap "atexit" 2 - -# -# defaults -# - -prog=marc -exefile=marc -jid= -rid= -pid= -sid= -did= -vid= -user= -usernoext= -objs= -qid=background -cpu= -priority= -att= -trk= -verify=yes -prgsav=no -rmdll=no -cpdll=no -progdll= -pathdll= -error= -nprocd=0 -nprocdddm=1 -nprocdddmprint= -icreated=0 -nprocdarg= -nsolver=0 -nsolverarg=-ns -if test $nprocds -then - if test $nprocds -gt 1 - then - nprocdddm=$nprocds - nprocdddmprint=$nprocds - icreated=1 - nprocdarg=-nprocds - fi -fi -ntprint=0 -nt=-1 -nte=-1 -nts=-1 -ntarg=-nt -ntearg=-nte -ntsarg=-nts -nteprint= -ntsprint= -gpuids= -nauto=0 -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -itree=0 -iam= -link= -trkrun=0 -DIRJOB=`pwd` -DIRSCR=$DIRJOB -DIRSCRSET= -autoforge=0 -dotdat=.dat -dotdefhost=.defhost -host= -numhost= -mfile= -userhost= -makebdf= -cpinput=yes -cpresults=yes -marcdll=libmarc.$EXT_DLL -# define hostname and strip off extensions (alpha.aaa.com) -thishost=`hostname` -thishost=${thishost%%.*} -compatible=unknown -numfield=1 -justlist= -feature= -mpioption=false -MDSRCLIB=$MARC_LIB/mdsrc.a -# -# check run_marc_defaults file for default MPI setting -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MPI -# -value= -file= -if test -f $DIRSCRIPT/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$DIRSCRIPT/run_marc_defaults - fi -fi -if test -f $HOME/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$HOME/run_marc_defaults - fi -fi -if test -n "$value"; then - MARC_MPITYPE=$value - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - echo " " - echo " error, incorrect option for MARC_MPI" - echo " defined in $file: $MARC_MPITYPE" - echo " valid options: $MPI_DEFAULT $MPI_OTHER" - echo " " - exit - fi - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - fi -fi -# -# -# allow scratch directory to be specified with environmental variable -# MARCSCRATCH -if test $MARCSCRATCH -then - if test -d $MARCSCRATCH - then - DIRSCR=$MARCSCRATCH - else - echo "error, scratch directory '$MARCSCRATCH'" - echo " specified via environmental variable MARCSCRATCH does not exist" - exit - fi -fi -# -############################################################################## -# parse input - arguments always come in pairs # -############################################################################## - -arg=$1 -if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - shift - arg=$1 -fi -while [ -n "$arg" ] -do - shift - value=$1 - case $arg in - -al* | -AL*) - LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - $MARC_BIN/marc -alloc 1 - exit - ;; - -li* | -LI*) - justlist=yes - ;; - -fe* | -FE*) - feature=$value - ;; - -pr* | -PR*) - if test `dirname $value` = '.' - then - prog=`$BASENAME $value .marc` - progdll=`$BASENAME $value` - else - prog=`dirname $value`/`$BASENAME $value .marc` - progdll=`dirname $value`/`$BASENAME $value` - fi - prdir=`dirname $value` - case $prdir in - \/*) - ;; - *) - prog=`pwd`/$prdir/$prog - ;; - esac - ;; - -j* | -J*) - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - ;; - -r* | -R*) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - -si* | -SI*) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - -pi* | -PI*) - if test -f $value.t19 - then - pid=`$BASENAME $value .t19` - else - pid=`$BASENAME $value .t16` - fi - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - -bdf | -BDF) - makebdf=1 - ;; - -de* | -DE*) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - -vf | -VF) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - -u* | -U*) - user=$value - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - -obj | -OBJ) - objs="$value" - ;; - -q* | -Q*) - qid=$value - ;; - -b* | -B*) - case $value in - y* | Y*) - qid=background - ;; - n* | N*) - qid=foreground - ;; - *) - ;; - esac - ;; - -at | -AT) - att=$value - ;; - -cpu* | -CPU*) - cpu=$value - ;; - -pq | -PQ*) - priority=$value - ;; - -v* | -V*) - verify=$value - ;; - -sa* | -SA*) - prgsav=$value - ;; - -np* | -NP*) - nprocdddm=$value - nprocdddmprint=$value - case $arg in - -nps* | -NPS* | -nprocds* | -NPROCDS*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - case $arg in - -np | -NP | -nprocd | -NPROCD) - icreated=0 - nprocdarg=-nprocd - ;; - esac - ;; - -ns* | -NS*) - nsolver=$value - ;; - -nt* | -NT*) - case $arg in - -nte | -NTE | -nthread_e* | -NTHREAD_E*) - nte=$value - ;; - esac - case $arg in - -nts | -NTS | -nthread_s* | -NTHREAD_S*) - nts=$value - ;; - esac - case $arg in - -nt | -NT | -nth* | -NTH* | -nthread* | -NTHREAD*) - nt=$value - ;; - esac - ;; - -gp* | -GP*) - gpuids=$value - ;; - -it* | -IT*) - itree=$value - ;; - -iam | -IAM) - iam=$value - ;; - -au* | -AU*) - nauto=$value - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -me | -ME ) - mesh=$value - ;; - -ml | -ML ) - memlimit=$value - ;; - -mo | -MO ) - ;; - -mpi | -MPI ) - mpioption=true - MARC_MPITYPE=$value - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - fi - fi - ;; - -dir* | -DIR*) - DIRJOB=$value - case $DIRJOB in - \/*) - ;; - *) - DIRJOB=`pwd`/$DIRJOB - ;; - esac - if test -z "$DIRSCRSET" - then - DIRSCR=$DIRJOB - fi - ;; - -sd* | -SD*) - DIRSCR=$value - DIRSCRSET=yes - case $DIRSCR in - \/*) - ;; - *) - DIRSCR=`pwd`/$DIRSCR - ;; - esac - ;; - -ho* | -HO*) - host=$value - ;; - -co* | -CO*) - compatible=$value - ;; - -ci* | -CI*) - cpinput=$value - ;; - -cr* | -CR*) - cpresults=$value - ;; - *) - error="$error -$arg: invalid option" - break - ;; - esac - case $value in - -*) - error="$error -$arg: invalid name $value" - break - ;; - esac - shift - arg=$1 - if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - shift - arg=$1 - fi -done -argc=`expr $# % 2` -if test $argc -eq 1 -then -# -# odd number of arguments -# - error="$error -argument list incomplete" -fi - -if test $nprocdddm -gt 0 -then -nprocd=$nprocdddm -fi - -if test $nsolver -gt 0 -then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi -fi -# Set defaults -if test $nt -eq -1 -then -nt=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nt -lt 0 -then -nt=0 -fi -if test $nte -eq -1 -then -nte=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nte -lt 0 -then -nte=0 -fi -if test $nts -eq -1 -then -nts=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nts -lt 0 -then -nts=0 -fi -# -# set number of element loop threads -# -ntprint=$nt -nteprint=$nte -# copy from -nprocd[s] -if test $nprocdddm -gt 1 -then - nteprint=$nprocdddm -fi -# override with -nthread_elem option -if test $nte -ne 0 -then -nteprint=$nte -fi -# check for minimum 1 threads per processes for DDM -if test $nprocdddm -gt 1 -then - if test $nteprint -lt $nprocdddm - then - nteprint=$nprocdddm - fi -fi -nte=$nteprint -# -# set number of Solver threads -# -ntsprint=$nts -# copy from -nthread or -nprocd[s] -if test $ntprint -ne 0 -then - ntsprint=$ntprint -else - if test $nprocdddm -gt 1 - then - ntsprint=$nprocdddm - fi -fi -# override with -nthread_solver option -if test $nts -ne 0 -then - ntsprint=$nts -fi -# check for minimum 1 threads per solver process. -if test $nsolver -lt $nprocdddm -then - if test $ntsprint -lt $nsolver - then - ntsprint=$nsolver - fi -else - if test $ntsprint -lt $nprocdddm - then - ntsprint=$nprocdddm - fi -fi -if test $ntsprint -eq 1 -then - set ntsprint=0 -fi -nts=$ntsprint - -# set stack size for multi-threading. -export KMP_MONITOR_STACKSIZE=7M -export OMP_STACKSIZE=7M - -# -# deprecate -nthread option at arugment of marc -nt=0 -# Reset nprocdddmm, nsolver and threads if not given. -if test $nprocdddm -eq 0 -then - nprocdarg= -fi -if test $nprocdddm -eq 0 -then - nprocdddmprint= -fi -if test $nprocdddm -eq 0 -then - nprocdddm= -fi - -if test $nsolver -eq 0 -then - nsolverprint= -fi -# end of threads setting. -gpuoption= -if test "$gpuids" = "" ; then - gpuoption= -else - gpuoption="-gp $gpuids" -fi - -if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH -else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH -fi -# Linux 64 + HPMPI, Below code is taken from include_linux64 -if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" -then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" -fi - -if test $nprocd -gt 1; then - if test -f $jid$dotdefhost; then - if test "$host" = ""; then - host=$jid$dotdefhost - fi - fi - if test -f hostfile_qa_$nprocd; then - if test "$host" = ""; then - host=hostfile_qa_$nprocd - fi - fi -fi - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then - dotdat=.inp - fi - - if test "$progdll"; then - /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll - rmdll=yes - pathdll=yes - progdll=${progdll}_$marcdll - else - progdll=$marcdll - fi - - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - pathdll=yes - fi -fi - -############################################################################## -# check parameter validity # -############################################################################## - -while test forever; do - -# -# check for input file existence -# -if test $nprocdddm -gt 1 -a $icreated -eq 0; then - if test ! -f $DIRJID/1$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/1$jid$dotdat not accessible" - fi - fi -else - if test ! -f $DIRJID/$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/$jid$dotdat not accessible" - fi - fi -fi - if test $nprocd -gt 1; then - if test "$host" ; then - if test ! -f $host; then - error="$error -host name file $host not accessible" - fi - fi - fi - -# -# check if the job is already running in the background -# -if test -f $DIRJOB/$jid.pid; then - error="$error -job is already running (the file $jid.pid exists)" -fi - -# -# if the program name is other than marc, then -# assume that this is a program in the users local directory -# - -bd=$MARC_BIN/ - -case $prog in - marc | MARC | $exefile) - program=$exefile - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - if test ! -f $user - then - error="$error -user subroutine file $user not accessible" - fi - fi - if test "$objs" - then - missingobjs= - for o in $objs - do - if test ! -f "$o" - then - if test -z "$missingobjs" - then - missingobjs="$o" - else - missingobjs="$missingobjs $o" - fi - fi - done - if test -n "$missingobjs" - then - error="$error -user object/library file(s) $missingobjs not accessible" - fi - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$vid" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRVID/1$vid.vfs - then - error="$error -view factor file $DIRVID/1$vid.vfs not accessible" - fi - else - if test ! -f $DIRVID/$vid.vfs - then - error="$error -view factor file $DIRVID/$vid.vfs not accessible" - fi - fi - fi - if $mpioption - then - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" - fi - fi - ;; - *) - program=$prog.marc - case $prog in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - error="$error -program option may not be used with user subroutine" - fi - if test "$objs" - then - error="$error -program option may not be used with user objects or libraries" - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$nauto" - then - if test $nauto -gt 2 - then - error="$error -incorrect option for auto restart " - fi - fi - if test "$ndcoup" - then - if test $ndcoup -gt 3 - then - error="$error -incorrect option for contact decoupling " - fi - fi - if test "$ndytran" - then - if test $ndytran -gt 1 - then - error="$error -incorrect option for Marc-Dytran Switch " - fi - fi - if $mpioption - then - if test ! -x $MARC_BIN/$exefile - then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE " - fi - fi - ;; -esac - -############################################################################## -# check argument integrity # -############################################################################## - -if test "$jid" -then - : -else - error="$error -job id required" -fi - -if test $nprocd -gt 1 -then - if test $nauto -gt 0 - then - error="$error -cannot run DDM job with auto restart (-au) option " - fi -fi -case $qid in - S* | s*) - qid=short - ;; - L* | l*) - qid=long - ;; - V* | v*) - qid=verylong - ;; - B* | b*) - qid=background - ;; - F* | f*) - qid=foreground - ;; - A* | a*) - qid=at - ;; - *) - error="$error -bad value for queue_id option" - ;; -esac - -case $prgsav in - N* | n*) - prgsav=no - ;; - Y* | y*) - prgsav=yes - ;; - *) - error="$error -bad value for save option" - ;; -esac - -case $verify in - N* | n*) - verify=no - ;; - Y* | y*) - verify=yes - ;; - *) - error="$error -bad value for verify option" - ;; -esac - -case $nprocdddm in - -* ) - error="$error -bad value for nprocd option" - ;; -esac - -case $nt in - -* ) - error="$error -bad value for nt option" - ;; -esac - -case $itree in - -* ) - error="$error -bad value for itree option" - ;; -esac -case $iam in - -* ) - error="$error -bad value for iam option" - ;; -esac -case $compatible in - N* | n*) - compatible=no - ;; - Y* | y*) - compatible=yes - ;; - unknown) - ;; - *) - error="$error -bad value for comp option" - ;; -esac -case $cpinput in - N* | n*) - cpinput=no - ;; - Y* | y*) - cpinput=yes - ;; - *) - error="$error -bad value for copy input option" - ;; -esac -case $cpresults in - N* | n*) - cpresults=no - ;; - Y* | y*) - cpresults=yes - ;; - *) - error="$error -bad value for copy results option" - ;; -esac - -# -# check for external file to run -# -if test -f $MARC_TOOLS/run_marc_check -then - . $MARC_TOOLS/run_marc_check -fi - -# -# pick up version data from bin/VERSION if it exists -# -if test -f $MARC_BIN/VERSION; then - ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` - if test -n "$ppp" ;then - PRODUCT=$ppp - fi - ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` - if test -n "$ppp" ;then - REVISION=", Build $ppp" - fi -fi -############################################################################## -# interact with the user to get the required information to run marc or # -# other marc system program # -############################################################################## - -deletelog=yes -if test $qid = background -a $verify = no -then -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Element loop threads : $nteprint -Solver processes : $nsolverprint -Solver threads : $ntsprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto " > $jid.log -deletelog=no -fi -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Element loop threads : $nteprint -Solver processes : $nsolverprint -Solver threads : $ntsprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto" - - -case $qid in - s* | S* | l* | L* | v* | V* ) - echo \ -"Queue priority : $priority -Queue CPU limit : $cpu -Queue start time : $att" - ;; -# * ) -# echo \ -#" " -# ;; -esac - -if test "$error" -then - if test $verify = yes - then - $ECHO "$error - -Please correct or quit(correct,quit,): $ECHOTXT" - error= - read answer - case $answer in - q* | Q*) - answer=quit - ;; - *) - answer=correct - ;; - esac - else - $ECHO "$error - $ECHOTXT" - echo " " - if test "$deletelog" = no - then - $ECHO "$error - $ECHOTXT" >> $jid.log - echo " " >> $jid.log - fi - answer=quit - fi -else - if test $verify = yes - then - $ECHO " -Are these parameters correct (yes,no,quit,)? $ECHOTXT" - read answer - case $answer in - q* | Q*) - answer=quit - ;; - y* | Y*) - answer=yes - ;; - *) - answer=no - ;; - esac - else - answer=yes - fi -fi - -case $answer in - no | correct) - -############################################################################## -# prompt for each value # -############################################################################## - - $ECHO " -Program name ($prog)? $ECHOTXT" - read value - if test "$value" - then - prog=$value - fi - $ECHO "Job ID ($jid)? $ECHOTXT" - read value - if test "$value" - then - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - fi - $ECHO "User subroutine name ($user)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - user= - ;; - *) - user=$value - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - esac - fi - $ECHO "User objects or libraries ($objs)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - objs= - ;; - *) - objs="$value" - ;; - esac - fi - $ECHO "Restart File Job ID ($rid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - rid= - ;; - *) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - esac - fi - $ECHO "Substructure File ID ($sid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - sid= - ;; - *) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - esac - fi - $ECHO "Post File Job ID ($pid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - pid= - ;; - *) - pid=$value - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - esac - fi - $ECHO "Defaults File ID ($did)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - did= - ;; - *) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - esac - fi - $ECHO "View Factor File ID ($vid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - vid= - ;; - *) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - esac - fi - $ECHO "Save generated module ($prgsav)? $ECHOTXT" - read value - if test "$value" - then - prgsav=$value - fi - $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" - read value - if test "$value" - then - nprocdddm=$value - nprocdddmprint=$value - fi - $ECHO "Run on ($nte) Element loop threads ? $ECHOTXT" - read value - if test "$value" - then - nte=$value - fi - $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" - read value - if test "$value" - then - nsolver=$value - fi - $ECHO "Run on ($nts) Solver threads ? $ECHOTXT" - read value - if test "$value" - then - nts=$value - fi -# - if test $nprocdddm -gt 0 - then - nprocd=$nprocdddm - fi - if test $nsolver -gt 0 - then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi - fi -# Element loop threads. - if test $nte -eq -1 - then - nte=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nte -lt 0 - then - nte=0 - fi - nteprint=$nte -# Copy from ddm - if test $nprocdddm -gt 1 - then - nteprint=$nprocdddm - fi -# override with -nthread_elem option - if test $nte -ne 0 - then - nteprint=$nte - fi -# check for minimum 1 threads per processes for DDM - if test $nprocdddm -ne 0 - then - if test $nteprint -lt $nprocdddm - then - nteprint=$nprocdddm - fi - fi - nte=$nteprint -# Solver threads. - if test $nts -eq -1 - then - nts=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nts -lt 0 - then - nts=0 - fi - ntsprint=$nts -# Copy from ddm - if test $nprocdddm -gt 1 - then - ntsprint=$nprocdddm - fi -# override with -nthread_solver option - if test $nts -ne 0 - then - ntsprint=$nts - fi -# check for minimum 1 threads per solver process. - if test $nsolver -lt $nprocdddm - then - if test $ntsprint -lt $nsolver - then - ntsprint=$nsolver - fi - else - if test $ntsprint -lt $nprocdddm - then - ntsprint=$nprocdddm - fi - fi - if test $ntsprint -eq 1 - then - set ntsprint=0 - fi - nts=$ntsprint - $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" - read value - if test "$value" - then - gpuids=$value - fi - if test "$gpuids" = "" ; then - gpuoption= - else - gpuoption="-gp $gpuids" - fi - if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH - fi - if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - fi -# - if test $nprocd -gt 1 - then - $ECHO "Message passing type ($itree)? $ECHOTXT" - read value - if test "$value" - then - itree=$value - fi - $ECHO "Host file name ($host)? $ECHOTXT" - read value - if test "$value" - then - host=$value - fi - if test $nprocdddm -gt 1 - then - $ECHO "Single input file? $ECHOTXT" - read value - case $value in - y* | Y*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" - read value - if test "$value" - then - compatible=$value - fi - $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" - read value - if test "$value" - then - cpinput=$value - fi - $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" - read value - if test "$value" - then - cpresults=$value - fi - fi - fi - $ECHO "Run the job in the queue ($qid)? $ECHOTXT" - read value - if test "$value" - then - qid=$value - fi - case $qid in - s* | S* | l* | L* | v* | V* ) - $ECHO "Queue priority ($priority)? $ECHOTXT" - read value - if test "$value" - then - priority=$value - fi - $ECHO "Job starts at ($att)? $ECHOTXT" - read value - if test "$value" - then - att=$value - fi - $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" - read value - if test "$value" - then - cpu=$value - fi - ;; - * ) - ;; - esac - $ECHO "Auto Restart option ($nauto)? $ECHOTXT" - read value - if test "$value" - then - nauto=$value - fi - $ECHO "Run directory ($DIRJOB)? $ECHOTXT" - read value - if test "$value" - then - DIRJOB=$value - DIRSCR=$DIRJOB - fi - $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" - read value - if test "$value" - then - DIRSCR=$value - fi - ;; - quit) - exit 1 - ;; - *) - break - ;; - -esac - - if test $nt -eq -1 - then - nt=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nt -lt 0 - then - nt=0 - fi - -done -# -if test $nt -eq 0 -then - ntarg= -fi -if test $nt -eq 0 -then - ntprint= -fi -if test $nt -eq 0 -then - nt= -fi - -if test $nte -eq 0 -then - ntearg= -fi -if test $nte -eq 0 -then - nteprint= -fi -if test $nte -eq 0 -then - nte= -fi - -if test $nts -eq 0 -then - ntsarg= -fi -if test $nts -eq 0 -then - ntsprint= -fi -if test $nts -eq 0 -then - nts= -fi -# -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - pathdll=yes - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - fi - - if test "$pathdll"; then -# -# reset share lib path -# - if test $MACHINENAME = "HP" - then - SHLIB_PATH=$DIRJOB:$SHLIB_PATH - export SHLIB_PATH - fi - if test $MACHINENAME = "IBM" - then - LIBPATH=$DIRJOB:$LIBPATH - export LIBPATH - fi -# - LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH - LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH - LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH - export LD_LIBRARY_PATH - export LD_LIBRARY64_PATH - export LD_LIBRARYN32_PATH - fi -fi -# end of dllrun>0 - - -if test $program = $exefile -o $program = $prog.marc -then - -# delete the old .log file unless we run in the background -if test "$deletelog" = yes -then - /bin/rm $jid.log 2>/dev/null -else - echo - echo running the job in the background, see $jid.log - echo -fi - -# -# check if this is an autoforge or rezoning or radiation job -# -if test $nprocd -eq 1 -then - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` - if test "$line" - then - autoforge=1 - fi -fi -# -# check that jobname for restarted run is not the same -# as restart file basename -# -if test "$rid" -then - if test "$jid" = "$rid" - then - echo " " - echo "ERROR: job name of current run is the same as job name" - echo " of the restarted job" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "ERROR: job name of current run is the same as job name" >> $jid.log - echo " of the restarted job" >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi -fi - -# -# user objects/libraries used -# - - if test "$objs" - then - program="$DIRJOB/$jid.marc" - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# user subroutine used -# -# add DAMASK options for linking - DAMASK="" - - if test "$user" - then - program=$usernoext.marc - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# Special case for IBM using POE but not an SP machine -# in this case we always need a host file, also for serial jobs. -# -if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP -then - MP_HOSTFILE=${jid}.host - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $nprocd -gt 1 - then - numdom=$nprocd - while test $numdom -gt 0 - do - hostname -s >> $MP_HOSTFILE - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - else - hostname -s > $MP_HOSTFILE - fi -fi -# -# check ssh for all hosts in host file -# -if test $nprocd -gt 1 -then -if test $MPITYPE = "intelmpi" -a "$INTELMPI_VERSION" = "HYDRA" - then -# get host list - if test "$host" - then - line=`grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' | uniq` -# count failing hosts - counter=0 - for i in $line - do - $RSH -o BatchMode=yes -o ConnectTimeout=10 $i uname -n - status=$? - if [[ $status != 0 ]] ; then - counter=$((counter+1)) - if [ "$counter" = "1" ]; then - echo " " - echo " error - connection test failed... " - echo " " - fi - echo " " - echo " connection test with ssh failed on host $i" - echo " check the following command: ssh $i uname -n " - echo " " - fi - done -# echo error message and quit - if test $counter -ne 0 - then - echo " " - echo " A parallel job using IntelMPI cannot be started. " - echo " The ssh command must be working correctly between " - echo " the computers used in the analysis. Furthermore, " - echo " it must be set up such that it does not prompt the " - echo " user for a password. Note that this is the case " - echo " also for running on a single machine. " - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo " A parallel job using IntelMPI cannot be started. ">> $jid.log - echo " The ssh command must be working correctly between ">> $jid.log - echo " the computers used in the analysis. Furthermore, ">> $jid.log - echo " it must be set up such that it does not prompt the ">> $jid.log - echo " user for a password. Note that this is the case ">> $jid.log - echo " also for running on a single machine. ">> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - else - counter=1 -# test ssh `hostname` - if test $counter -ne 0 - then - line=`hostname` - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi -# test ssh `hostname` - if test $counter -ne 0 - then - line=`hostname -s` - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi -# test ssh localhost - if test $counter -ne 0 - then - line=localhost - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi - if test $counter -ne 0 - then - echo " error - connection test failed... " - echo " " - echo " ssh needs to work on the machine without asking for a password." - echo " check the following command: ssh localhost uname -n" - echo " " - echo " A parallel job using IntelMPI cannot be started. " - echo " The ssh command must be working correctly between " - echo " the computers used in the analysis. Furthermore, " - echo " it must be set up such that it does not prompt the " - echo " user for a password. Note that this is the case " - echo " also for running on a single machine. " - echo " " - if test "$deletelog" = no - then - echo " error - connection test failed... " >> $jid.log - echo " " >> $jid.log - echo " ssh needs to work on the machine without asking for a password." >> $jid.log - echo " check the following command: ssh localhost uname -n" >> $jid.log - echo " " >> $jid.log - echo " A parallel job using IntelMPI cannot be started. " >> $jid.log - echo " The ssh command must be working correctly between " >> $jid.log - echo " the computers used in the analysis. Furthermore, " >> $jid.log - echo " it must be set up such that it does not prompt the " >> $jid.log - echo " user for a password. Note that this is the case " >> $jid.log - echo " also for running on a single machine. " >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - echo $line $nprocd > $jid.hosts - host=$jid.hosts - fi - fi -fi -fi -# -# check correctness of host file; fix for user sub -# - if test $nprocd -gt 1 - then - -# construct the path name to the executable (execpath) - execpath=$MARC_BIN/$exefile - usersub=0 - if test $program = $prog.marc - then - execpath=$prog.marc - usersub=1 - fi - if test "$objs" - then - execpath="$DIRJOB/$jid.marc" - usersub=1 - fi - if test "$user" - then - execpath=$usernoext.marc - usersub=1 - fi - export execpath - execname=`$BASENAME $execpath` - - if test "$host" - then - userhost=$host - case $userhost in - \/* | \.\/*) - ;; - *) - userhost=`pwd`/$userhost - ;; - esac - -# check that the number of processes specified in the hostfile is -# equal to nprocd specified by -nprocd. - numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` - if test $nprocd -ne $numproc - then - echo " " - echo "error, the number of processes specified in the host file" - echo "must be equal to the number of processes given by -nprocd/-nsolver" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, the number of processes specified in the host file" >> $jid.log - echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - -# check for Myrinet that the number of processes per host is -# less than number of available user ports, 5 -# .gmpi directory must exist in user's home directory -# and must have write permission from remote hosts - if test $MPITYPE = "myrinet" - then - numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` - if test $numproc -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes specified " - echo "in the hostfile must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes specified " >> $jid.log - echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - if test ! -d ~/.gmpi - then - echo " " - echo "error, for Myrinet a .gmpi directory must exist " - echo "under the user's home directory" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log - echo "under the user's home directory" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - homedir=`echo ~` - for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - echo " " - echo "error, for Myrinet a shared .gmpi directory must exist " - echo "under the user's home directory " - echo "with remote write permission" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log - echo "under the user's home directory " >> $jid.log - echo "with remote write permission" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - /bin/rm tmp.$$ - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - fi - fi - done - fi - fi - -# construct the host file $jid.host which is used by mpirun -# skip lines starting with # and only consider lines with more than -# one word in them. Note that the hostfile given to this script -# has two columns: the host name and the number of shared processes -# to run on this host. mpirun wants the number of _other_ -# processes to run in addition to the one being run on the machine -# on which the job is started. hence the $2-1 for fnr == 1. - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then -# HPMPI or HP hardware MPI - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ - -v mpihpspecial="$MPIHPSPECIAL" \ -'{if ( NF > 0) {\ - fnr++ ; \ - printf("-h %s -np %s",$1,$2); \ - printf(" %s",mpihpspecial); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ - if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ - }\ - }' > $jid.host -# end HPMPI or HP hardware MPI - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then -# IBM using hardware MPI (POE) - MP_HOSTFILE=$jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host -# end IBM using hardware MPI (POE) -# for Intel MPI, need to create a machinefile for DMP - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then -# Intel MPI - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - /bin/cp $host $jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Intel MPI for DMP -# for Solaris HPC 7.1, need to create a machinefile for DMP - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then -# Solaris HPC 7.1 - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Solaris HPC 7.1 for DMP -# for Myrinet, construct a configuration file in ~/.gmpi -# this must be readable by each process -# format is (hostname) (port number) for each process - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - grep -v '^#' $host | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ -{if ( NF > 0 ) \ - for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ -}' >> ~/.gmpi/$jid.host - else -# this is for mpich-1.2.5 and later, using the -pg option -# format: host nproc executable user arguments -# the arguments are added later - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s %s\n",path,user);\ - if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ - }\ - }' > $jid.host - fi -# end Myrinet - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then -# Compaq MPI via Memory Channel - grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host -# end Compaq MPI - else -# MPICH - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ - }\ - }' > $jid.host - fi -# define the variable host and host_filt -# host_filt is used for loops over hosts -# for Myrinet we need to use a filtered variant of userhost -# for others we can use $host - if test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - host=~/.gmpi/$jid.host - host_filt=$jid.host_tMp - grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt - else - host=$jid.host - host_filt=$host - fi - else - host=$jid.host - host_filt=$host - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - host_filt=$jid.mfile - fi - fi -# figure out if the machines in the hostfile are nfs mounted -# or distributed and set the variable "dirstatus" accordingly. -# only perform the check if user subroutine is used -# or a user subroutine executable is used - - numfield=1 - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - numfield=2 - fi - DIR1=$DIRJOB - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - counter=0 - echo " " - echo "checking if local or shared directories for host" - if test "$deletelog" = no - then - echo "checking if local or shared directories for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - dirstatus[$counter]="shared" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - dirstatus[$counter]="local" - /bin/rm tmp.$$ - else - if test ! -f $jid.$$ - then - dirstatus[$counter]="local" - $RSH $i /bin/rm $DIR1/$jid.$$ - else - /bin/rm $jid.$$ - fi - fi - if test -f tmp.$$ - then - /bin/rm tmp.$$ - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - echo " ${dirstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${dirstatus[$counter]}" >> $jid.log - fi - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - fi - -# figure out if this is a compatible set of machines -# unless explicitly specified with flag -comp -# only perform the check if user subroutine is used -# or a user subroutine executable is used -# Myrinet does not support heterogeneous - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - if test $compatible = "unknown" - then - thisname=$ARCH - compatible=yes - counter=0 - echo "checking if machines are compatible for host" - if test "$deletelog" = no - then - echo "checking if machines are compatible for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]="yes" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - othername=`$RSH $i uname -a | cut -f 1 -d " "` - if test $thisname != $othername - then - compatible=no - compstatus[$counter]="no" - fi - fi - echo " ${compstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${compstatus[$counter]}" >> $jid.log - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - else - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]=$compatible - fi - done - if test $compatible = "no" - then - echo "all machines assumed incompatible" - if test "$deletelog" = no - then - echo "all machines assumed incompatible" >> $jid.log - fi - else - echo "all machines compatible" - if test "$deletelog" = no - then - echo "all machines compatible" >> $jid.log - fi - fi - fi -# error out if user objects or libraries are used on incompatible machines - if test "$compatible" = "no" -a -n "$objs" - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" - if test "$deletelog" = no - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log - fi - exit 1 - fi -# modify new host file if NFS mounted heterogeneous machine - doit= - if test $program = $prog.marc - then - doit=yes - fi - if test "$user" - then - doit=yes - fi - if test "$doit" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - $AWK -v hst=$i '{fnr++ ; \ -if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ -printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} - /bin/mv $jid.host{$$} $jid.host - host=$jid.host - fi - fi - done - fi - fi # if test $program = $prog.marc -o $user -o $obj - - else # if test $host - # assume shared memory machine if no hostfile given and - # MPITYPE is set to mpich or Myrinet - # check for Myrinet that the total number of processes is - # less than number of available user ports, 5 - if test $MPITYPE = "mpich" -o $MPITYPE = "scali" - then - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - host=$jid.host - elif test $MPITYPE = "myrinet" - then - if test $nprocd -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes " - echo "must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes " >> $jid.log - echo "must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - echo `hostname` $nprocd | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ - {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ -' >> ~/.gmpi/$jid.host - host=~/.gmpi/$jid.host - else - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - - fi - fi # if test myrinet - - fi # if test $host - - fi # if test $nprocd -gt 1 - -fi # if test $program = $exefile -o $program = $prog.marc - -############################################################################## -# construct run stream (Marc only) # -############################################################################## - -# set maximum message length for ddm to a large number -# for vendor provided mpi -if test $itree -eq 0 -a $MPITYPE = hardware -then - itree=100000000 - if test $MACHINENAME = SGI - then - itree=100000001 - fi -fi -if test $itree -eq 0 -a $MPITYPE = hpmpi -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = myrinet -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = nec -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = scali -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = intelmpi -then - itree=100000000 -fi -if test $nprocdddm -lt 2 -then - nprocdarg= -else - nprocdarg="$nprocdarg $nprocdddm" -fi -if test $nsolver -eq 0 -then - nsolverarg= -else - nsolverarg="$nsolverarg $nsolver" -fi -if test $nprocdddm -lt 2 -a $nsolver -eq 0 -then -nprocd=0 -fi -if test $nprocd -gt 0 -then - if test "$host" - then - if test -z "$RUN_JOB2" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then - RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - else - RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" - RUN_JOB=" -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - numhost=`uniq $jid.mfile | wc -l` - if test "$INTELMPI_VERSION" = "HYDRA" - then - RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n $numhost -r $RSH -f $jid.mfile - RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" - fi - -# intelmpi uses configfile. format: -# -host host1 -n n1 executable marcargs -# one such line per host -# collect the marcargs in RUN_JOB and construct the config file later -# collect the run stream in RUN_JOB_TMP - RUN_JOB="-jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - - - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then - RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi - if test "$userhost" - then - RUN_JOB="$RUN_JOB -mhost $userhost" - fi - if test $MPITYPE = "scali" - then -# set default working directory to /tmp to allow -# different directory names - SCAMPI_WORKING_DIRECTORY=/tmp - export SCAMPI_WORKING_DIRECTORY - fi - else - if test -z "$RUN_JOB1" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - RUNNPROCD=$nprocd - if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" - then - RUNNPROCD= - MP_PROCS=$nprocd - export MP_PROCS - fi - if test $MPITYPE = "myrinet" - then - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n 1 -f $jid.hosts - fi - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi - fi -else - if test $nauto -gt 0 -o $ndcoup -gt 0 - then - RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ - $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - else -# this is for a serial job without auto restart: - RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi -fi -if test "$rid" -then - RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" -fi -if test "$pid" -then - RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" -fi -if test "$sid" -then - RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" -fi -if test "$did" -then - RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" -fi -if test "$vid" -then - RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" -fi -if test $nauto -gt 0 -then - RUN_JOB="$RUN_JOB -autorst $nauto " -fi -if test $ndcoup -gt 0 -then - RUN_JOB="$RUN_JOB -dcoup $ndcoup " -fi -if test $ndytran -gt 0 -then - RUN_JOB="$RUN_JOB -dytran $ndytran " -fi -if test $mesh -gt 0 -then - RUN_JOB="$RUN_JOB -me $mesh " -fi -if test $noutcore -gt 0 -then - RUN_JOB="$RUN_JOB -outcore $noutcore " -fi -if test "$dllrun" -gt 0 -then - RUN_JOB="$RUN_JOB -dll $dllrun " -fi -if test "$trkrun" -gt 0 -then - RUN_JOB="$RUN_JOB -trk $trkrun " -fi -if test "$iam" -then - RUN_JOB="$RUN_JOB -iam $iam " -fi -if test "$justlist" -then - RUN_JOB="$RUN_JOB -list 1 " -fi -if test "$feature" -then - RUN_JOB="$RUN_JOB -feature $feature " -fi -if test "$memlimit" -ne 0 -then - RUN_JOB="$RUN_JOB -ml $memlimit " -fi -if test "$cpinput" -then - RUN_JOB="$RUN_JOB -ci $cpinput " -fi -if test "$cpresults" -then - RUN_JOB="$RUN_JOB -cr $cpresults " -fi -if test "$DIRSCR" != "$DIRJOB" -then - RUN_JOB="$RUN_JOB -dirscr $DIRSCR" -else - DIRSCR=$DIRJOB -fi -if test "$makebdf" -then - RUN_JOB="$RUN_JOB -bdf $makebdf " -fi -if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" -then - # append $RUN_JOB to all lines of the host file - # and set RUN_JOB - $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ - /bin/mv $host.$$ $host - RUN_JOB=$RUN_JOB_TMP -fi -if test $MPITYPE = "intelmpi" -a "$host" -then - # construct config file, append $RUN_JOB to all lines of the config file - # and set RUN_JOB - if test "$INTELMPI_VERSION" = "HYDRA" - then - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - else - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-host %s -n %s",$1,$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - fi - RUN_JOB=$RUN_JOB_TMP -fi -echo " " -echo "Final run stream value" -echo " RUNJOB="$RUN_JOB -if test "$deletelog" = no -then -echo " " >> $jid.log -echo "Final run stream value" >> $jid.log -echo " RUNJOB="$RUN_JOB >> $jid.log -fi - - -############################################################################## -# run marc using valgrind # -############################################################################## -#RUN_JOB="valgrind $RUN_JOB" -#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" -############################################################################## - - -############################################################################## -# run the requested program in a queue # -############################################################################## - -if test "$deletelog" = yes -then - echo - date -else - echo >> $jid.log - date >> $jid.log -fi -if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] -then - -/bin/rm -f $jid.runmarcscript - - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - userobj=$usermoext.o - fi - cat > $jid.runmarcscript << END4 - if test "$user" - then - if test $MACHINENAME = "CRAY" - then - $DFORTRANMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTRANMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $MARCCUDALIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } -END4 -else - prgsav=yes -fi -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# - -cat >> $jid.runmarcscript << END5 - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -# first remove all .out files and incremental restart files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null - /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null -fi - -if test $nprocdddm -gt 1 -then - $RUN_JOB 2>>$jid.log -else - $RUN_JOB 2>>$jid.log -fi - -if test $dllrun -eq 0; then - if test $prgsav = no - then - /bin/rm -f $bd$program 2>/dev/null - fi -else - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes - then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -END5 - - -# Submit to marc batch queue -# -if [ $qid = at ] -then -QUENAME=at -SUBMCMD= -else -# -# Submit to qsub queue -# -QUENAME=qsub -SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" -if test "$priority" -then - SUBMCMD=$SUBMCMD" -p $priority" -fi -if test "$att" -then - SUBMCMD=$SUBMCMD" -a $att" -fi -if test "$cpu" -then - SUBMCMD=$SUBMCMD" -lt $cpu" -fi - -fi -echo $QUENAME $SUBMCMD -#cat $jid.runmarcscript -$QUENAME $SUBMCMD < $jid.runmarcscript - -/bin/rm -f $jid.runmarcscript - -############################################################################## -# run the requested program in the background # -############################################################################## - -else -if test $qid = background -then - -# -# first remove all old .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi -# -# compile user subroutine if present -# -( -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_mp $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - echo " $PRODUCT Exit number 3" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTRANMP $user || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTRANMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - echo " $PRODUCT Exit number 3" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc - -# - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -$RUN_JOB & - -marcpid=$! -echo $marcpid > $DIRJOB/$jid.pid -wait $marcpid - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - if test "$host" - then - /bin/rm $jid.mfile 2> /dev/null - /bin/rm $jid.hosts 2> /dev/null - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.cfile 2> /dev/null - fi - fi - fi -fi - - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -) 1>>$jid.log 2>&1 & - - -############################################################################## -# run the requested program in the foreground # -############################################################################## - -else - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_mp $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTRANMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTRANMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi -# first remove all .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi - -$RUN_JOB - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - if test "$host" - then - /bin/rm $jid.mfile 2> /dev/null - /bin/rm $jid.hosts 2> /dev/null - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.cfile 2> /dev/null - else - echo " " > /dev/null - fi - else - if test "$host" - then - mpdcleanup -a -f $jid.mfile - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.mfile 2> /dev/null - else - mpdcleanup -a -f $jid.hosts - /bin/rm $jid.hosts 2> /dev/null - fi - fi - fi -fi - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi - - -fi -fi diff --git a/installation/mods_MarcMentat/2013.1/Marc_tools/run_marc.original b/installation/mods_MarcMentat/2013.1/Marc_tools/run_marc.original deleted file mode 100644 index f7cd7def5..000000000 --- a/installation/mods_MarcMentat/2013.1/Marc_tools/run_marc.original +++ /dev/null @@ -1,4105 +0,0 @@ -#!/bin/ksh -############################################################################## -# # -# run_marc - run a marc job # -# ------------------------- # -# # -# usage: run_marc -j jid { options } # -# # -# where standard options are: required: defaults: # -# -------------------------- # -# # -# -j* jid job id number. ** YES ** . # -# -pr* prog program name. . marc # -# -v* y|n do or do not verify inputs. . yes # -# -q* s|l|v|b|f batch queue name or background, . short # -# foreground. # -# -b* as alternative to option -q* # -# # -# ( batch queues only : # -# -pq* intra queue priority. . . # -# -at DATE/TIME delay start of job. . . # -# format : January,1,1990,12:31 # -# or : today,5pm # -# -cpu* secs job CPU limit . . ) # -# # -# -r* rid restart file job id. . . # -# -si* sid substructure file id. . . # -# -pi* post post file job id. . . # -# -de* did defaults file . no # -# -vf vid viewfactor . no # -# # -# -u* user user subroutine. . . # -# -obj obj user objects or libraries. . . # -# -sa* y|n do or do not save load module. . no # -# -autorst auto restart flag for auto forge . no # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo selects i4 or i8 version # -# default: i4 or via defaults file run_marc_defaults # -# the -mo option will override # -# -mpi selects MPI version # -# each platform has a default MPI version and some # -# have an alternative version. see the include file # -# for the respective platform # -# MPI_DEFAULT defines the default MPI version # -# MPI_OTHER defines versions one can switch to # -# -dcoup for contact decoupling # -# currently not supported # -# -dir directory where the job i/o should take place. # -# defaults to current directory. # -# -sdir directory where scratch files are created # -# defaults to current directory. # -# # -# -alloc only perform memory allocation test, no analysis # -# -list y only list options in the input file, no analysis # -# -fe num set feature number "num" for the run. only one allowed # -# -dytran flag to switch from Dytran to Marc # -# dytran = 0, program will run w/o Marc-Dytran Switch # -# = 1, program will restart Marc after Dytran run # -# >= 2, Not supported yet. # -# currently not supported # -# -ou force analysis to use out-of-core control # -# =0, not used # -# =1, element storage out-of-core # -# -dll run marc using shared library libmarc.so and exe_marc # -# =1, used # -# =2, do not free streaming input memory # -# =3, run with marc input deck # -# -trk run marc for post-tracking # -# -gpuid run marc using GPGPU capability # -# specify gpuid on to be used in the analysis. Multiple # -# IDs may be assigned for DDM runs. # -# Separate a list of IDs with a colon. Each DMP # -# process will be assigned a GPU ID in round robin fastion# -# = 0 # -# = 0:1 etc... # -# # -# where parallel options are: # -# -------------------------- # -# # -# itree, host, and comp options are available for the domain # -# decomposition only. # -# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # -# # -# # -# -nprocd number of domains. # -# defaults to single domain solution. # -# -nprocds number of domains if single input file. # -# defaults to single domain solution. # -# -nps same as -nprocds. # -# -nsolver number of solver tasks for solver types 12 and 13 # -# these are distributed tasks operating via MPI # -# -nthread_elem number of threads for element assembly and recovery # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by element assembly # -# recovery. # -# Also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. # -# if both specified, -nthread_elem option will be used. # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor -nthread_elem specified. # -# -nthread_solver number of threads for solver types 6, 8, and 11 # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by 6, 8, and 11 # -# Also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. # -# if both specified, -nthread_solver option will be used. # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor -nthread_solver specified. # -# -nthread Same as -nthread_solver. # -# -itree message passing tree type for domain decomposition. # -# for debugging purposes; should not normally be used. # -# -host hostfile name for distributed execution on network. # -# defaults to no hostfile, unless jobid.defhost exists. # -# if jobid.defhost exists, only -np(s) necessary # -# -comp* y|n to be used with user routines on a network of # -# incompatible machines. # -# if set to no, a separate executable will be created # -# for each machine on the network. # -# if set to yes, the executable located on the machine # -# from which marc is started will be used on all machines.# -# defaults to no if O/S versions different on machines. # -# # -# -ci y|n copy input files to remote hosts (default: yes) # -# if "yes", input files are automatically copied to # -# remote hosts for a network run if necessary. # -# -cr y|n copy post files from remote hosts (default: yes) # -# if "yes", post files are automatically copied back from # -# remote hosts for a network run if necessary. # -############################################################################## -# set DIR to the directory in which this script is -REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" -DIR=`dirname $REALCOM` -# make sure DIR has an absolute path -case $DIR in - \/*) - ;; - *) - DIR=`pwd`/$DIR - ;; -esac -DIRSCRIPT=$DIR -AWK=awk -ARCH=`uname -a | cut -f 1 -d " "` -# Sun has a bad awk, use nawk instead -if test $ARCH = "SunOS" -then - AWK=nawk -fi -BASENAME=basename -# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists -if test $ARCH = "SunOS" -then - if test -x /usr/ucb/basename - then - BASENAME=/usr/ucb/basename - fi -fi - -# echo command line in the case of ECHO_COMMAND is true -if test "$ECHO_COMMAND" = true ; then - echo command "$0" "$@" -fi - -# -# "mode" selects version, i4 or i8 -# default is i4 -# this can be changed by a file run_marc_defaults -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MODE i8 -# it can also be set by the environmental variable MARC_INTEGER_SIZE -# and by the command line option "-mo" -# -mode= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -f $HOME/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -n "$MARC_INTEGER_SIZE" ; then - mode=$MARC_INTEGER_SIZE -fi -if test -z "$mode" ; then - mode=i8 -fi -case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "error, version mode must be i4 or i8" - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i4 or i8" - echo " " - echo " use -mo i4 or -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - setmode=true - fi - if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - fi - if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -done - -# set to i4 version for 32 bit Linux -if test "`uname -s`" = "Linux"; then - if test "`uname -m`" = "i686"; then - mode=i4 - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -fi - - -. "$DIR/getarch" - -. $MARC_INCLUDE -# - -# -# Dynamically determine the echo syntax -# - -case "`echo '\c'`" in - '\c') - ECHO='echo -n' - ECHOTXT=' ' - ;; - *) - ECHO='echo' - ECHOTXT=' \c' - ;; -esac - -# -# Variables for the MARC environment -# - -PRODUCT="Marc" -EXITMSG=$MARC_TOOLS/MESSAGES -export EXITMSG -FLEXDIR=$DIR/../flexlm/licenses -export FLEXDIR -TIMCHK=3600 -export TIMCHK -BINDIR=$MARC_BIN -export BINDIR -AFMATDAT=$MARC_RUNTIME/AF_flowmat/ -export AFMATDAT -# -# define directory path to global unified material database -# -MATFILE= -export MATFILE - -# -# define memory limit -# first set to MEMLIMIT from include -# -ml option overrules if specified -memlimit=$MEMLIMIT -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -# -if test $MACHINENAME = "HP" -then - SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH - export SHLIB_PATH -fi -# the one for IBM is defined futher down - -LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH -LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH -export LD_LIBRARY_PATH -export LD_LIBRARY64_PATH -export LD_LIBRARYN32_PATH - -atexit() { -kill -15 $$ -# -if test $MPITYPE = "myrinet" -then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi -fi -} - -trap "atexit" 2 - -# -# defaults -# - -prog=marc -exefile=marc -jid= -rid= -pid= -sid= -did= -vid= -user= -usersubname= -objs= -qid=background -cpu= -priority= -att= -trk= -verify=yes -prgsav=no -rmdll=no -cpdll=no -progdll= -pathdll= -error= -nprocd=0 -nprocdddm=1 -nprocdddmprint= -icreated=0 -nprocdarg= -nsolver=0 -nsolverarg=-ns -if test $nprocds -then - if test $nprocds -gt 1 - then - nprocdddm=$nprocds - nprocdddmprint=$nprocds - icreated=1 - nprocdarg=-nprocds - fi -fi -ntprint=0 -nt=-1 -nte=-1 -nts=-1 -ntarg=-nt -ntearg=-nte -ntsarg=-nts -nteprint= -ntsprint= -gpuids= -nauto=0 -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -itree=0 -iam= -link= -trkrun=0 -DIRJOB=`pwd` -DIRSCR=$DIRJOB -DIRSCRSET= -autoforge=0 -dotdat=.dat -dotdefhost=.defhost -host= -numhost= -mfile= -userhost= -makebdf= -cpinput=yes -cpresults=yes -marcdll=libmarc.$EXT_DLL -# define hostname and strip off extensions (alpha.aaa.com) -thishost=`hostname` -thishost=${thishost%%.*} -compatible=unknown -numfield=1 -justlist= -feature= -mpioption=false -MDSRCLIB=$MARC_LIB/mdsrc.a -# -# check run_marc_defaults file for default MPI setting -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MPI -# -value= -file= -if test -f $DIRSCRIPT/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$DIRSCRIPT/run_marc_defaults - fi -fi -if test -f $HOME/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$HOME/run_marc_defaults - fi -fi -if test -n "$value"; then - MARC_MPITYPE=$value - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - echo " " - echo " error, incorrect option for MARC_MPI" - echo " defined in $file: $MARC_MPITYPE" - echo " valid options: $MPI_DEFAULT $MPI_OTHER" - echo " " - exit - fi - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - fi -fi -# -# -# allow scratch directory to be specified with environmental variable -# MARCSCRATCH -if test $MARCSCRATCH -then - if test -d $MARCSCRATCH - then - DIRSCR=$MARCSCRATCH - else - echo "error, scratch directory '$MARCSCRATCH'" - echo " specified via environmental variable MARCSCRATCH does not exist" - exit - fi -fi -# -############################################################################## -# parse input - arguments always come in pairs # -############################################################################## - -arg=$1 -if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - shift - arg=$1 -fi -while [ -n "$arg" ] -do - shift - value=$1 - case $arg in - -al* | -AL*) - LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - $MARC_BIN/marc -alloc 1 - exit - ;; - -li* | -LI*) - justlist=yes - ;; - -fe* | -FE*) - feature=$value - ;; - -pr* | -PR*) - if test `dirname $value` = '.' - then - prog=`$BASENAME $value .marc` - progdll=`$BASENAME $value` - else - prog=`dirname $value`/`$BASENAME $value .marc` - progdll=`dirname $value`/`$BASENAME $value` - fi - prdir=`dirname $value` - case $prdir in - \/*) - ;; - *) - prog=`pwd`/$prdir/$prog - ;; - esac - ;; - -j* | -J*) - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - ;; - -r* | -R*) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - -si* | -SI*) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - -pi* | -PI*) - if test -f $value.t19 - then - pid=`$BASENAME $value .t19` - else - pid=`$BASENAME $value .t16` - fi - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - -bdf | -BDF) - makebdf=1 - ;; - -de* | -DE*) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - -vf | -VF) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - -u* | -U*) - user=`dirname $value`/`$BASENAME $value .f` - basefile=`$BASENAME $value` - if test ${basefile##*.} = F - then - user=`dirname $value`/`$BASENAME $value .F` - fi - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - if test -f $user.f - then - usersubname=$user.f - elif test -f $user.F - then - usersubname=$user.F - else - usersubname=$user - fi - ;; - -obj | -OBJ) - objs="$value" - ;; - -q* | -Q*) - qid=$value - ;; - -b* | -B*) - case $value in - y* | Y*) - qid=background - ;; - n* | N*) - qid=foreground - ;; - *) - ;; - esac - ;; - -at | -AT) - att=$value - ;; - -cpu* | -CPU*) - cpu=$value - ;; - -pq | -PQ*) - priority=$value - ;; - -v* | -V*) - verify=$value - ;; - -sa* | -SA*) - prgsav=$value - ;; - -np* | -NP*) - nprocdddm=$value - nprocdddmprint=$value - case $arg in - -nps* | -NPS* | -nprocds* | -NPROCDS*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - case $arg in - -np | -NP | -nprocd | -NPROCD) - icreated=0 - nprocdarg=-nprocd - ;; - esac - ;; - -ns* | -NS*) - nsolver=$value - ;; - -nt* | -NT*) - case $arg in - -nte | -NTE | -nthread_e* | -NTHREAD_E*) - nte=$value - ;; - esac - case $arg in - -nts | -NTS | -nthread_s* | -NTHREAD_S*) - nts=$value - ;; - esac - case $arg in - -nt | -NT | -nth* | -NTH* | -nthread* | -NTHREAD*) - nt=$value - ;; - esac - ;; - -gp* | -GP*) - gpuids=$value - ;; - -it* | -IT*) - itree=$value - ;; - -iam | -IAM) - iam=$value - ;; - -au* | -AU*) - nauto=$value - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -me | -ME ) - mesh=$value - ;; - -ml | -ML ) - memlimit=$value - ;; - -mo | -MO ) - ;; - -mpi | -MPI ) - mpioption=true - MARC_MPITYPE=$value - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - fi - fi - ;; - -dir* | -DIR*) - DIRJOB=$value - case $DIRJOB in - \/*) - ;; - *) - DIRJOB=`pwd`/$DIRJOB - ;; - esac - if test -z "$DIRSCRSET" - then - DIRSCR=$DIRJOB - fi - ;; - -sd* | -SD*) - DIRSCR=$value - DIRSCRSET=yes - case $DIRSCR in - \/*) - ;; - *) - DIRSCR=`pwd`/$DIRSCR - ;; - esac - ;; - -ho* | -HO*) - host=$value - ;; - -co* | -CO*) - compatible=$value - ;; - -ci* | -CI*) - cpinput=$value - ;; - -cr* | -CR*) - cpresults=$value - ;; - *) - error="$error -$arg: invalid option" - break - ;; - esac - case $value in - -*) - error="$error -$arg: invalid name $value" - break - ;; - esac - shift - arg=$1 - if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - shift - arg=$1 - fi -done -argc=`expr $# % 2` -if test $argc -eq 1 -then -# -# odd number of arguments -# - error="$error -argument list incomplete" -fi - -if test $nprocdddm -gt 0 -then -nprocd=$nprocdddm -fi - -if test $nsolver -gt 0 -then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi -fi -# Set defaults -if test $nt -eq -1 -then -nt=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nt -lt 0 -then -nt=0 -fi -if test $nte -eq -1 -then -nte=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nte -lt 0 -then -nte=0 -fi -if test $nts -eq -1 -then -nts=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nts -lt 0 -then -nts=0 -fi -# -# set number of element loop threads -# -ntprint=$nt -nteprint=$nte -# copy from -nprocd[s] -if test $nprocdddm -gt 1 -then - nteprint=$nprocdddm -fi -# override with -nthread_elem option -if test $nte -ne 0 -then -nteprint=$nte -fi -# check for minimum 1 threads per processes for DDM -if test $nprocdddm -gt 1 -then - if test $nteprint -lt $nprocdddm - then - nteprint=$nprocdddm - fi -fi -nte=$nteprint -# -# set number of Solver threads -# -ntsprint=$nts -# copy from -nthread or -nprocd[s] -if test $ntprint -ne 0 -then - ntsprint=$ntprint -else - if test $nprocdddm -gt 1 - then - ntsprint=$nprocdddm - fi -fi -# override with -nthread_solver option -if test $nts -ne 0 -then - ntsprint=$nts -fi -# check for minimum 1 threads per solver process. -if test $nsolver -lt $nprocdddm -then - if test $ntsprint -lt $nsolver - then - ntsprint=$nsolver - fi -else - if test $ntsprint -lt $nprocdddm - then - ntsprint=$nprocdddm - fi -fi -if test $ntsprint -eq 1 -then - set ntsprint=0 -fi -nts=$ntsprint - -# set stack size for multi-threading. -export KMP_MONITOR_STACKSIZE=7M -export OMP_STACKSIZE=7M - -# -# deprecate -nthread option at arugment of marc -nt=0 -# Reset nprocdddmm, nsolver and threads if not given. -if test $nprocdddm -eq 0 -then - nprocdarg= -fi -if test $nprocdddm -eq 0 -then - nprocdddmprint= -fi -if test $nprocdddm -eq 0 -then - nprocdddm= -fi - -if test $nsolver -eq 0 -then - nsolverprint= -fi -# end of threads setting. -gpuoption= -if test "$gpuids" = "" ; then - gpuoption= -else - gpuoption="-gp $gpuids" -fi - -if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH -else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH -fi -# Linux 64 + HPMPI, Below code is taken from include_linux64 -if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" -then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" -fi - -if test $nprocd -gt 1; then - if test -f $jid$dotdefhost; then - if test "$host" = ""; then - host=$jid$dotdefhost - fi - fi - if test -f hostfile_qa_$nprocd; then - if test "$host" = ""; then - host=hostfile_qa_$nprocd - fi - fi -fi - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then - dotdat=.inp - fi - - if test "$progdll"; then - /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll - rmdll=yes - pathdll=yes - progdll=${progdll}_$marcdll - else - progdll=$marcdll - fi - - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - pathdll=yes - fi -fi - -############################################################################## -# check parameter validity # -############################################################################## - -while test forever; do - -# -# check for input file existence -# -if test $nprocdddm -gt 1 -a $icreated -eq 0; then - if test ! -f $DIRJID/1$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/1$jid$dotdat not accessible" - fi - fi -else - if test ! -f $DIRJID/$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/$jid$dotdat not accessible" - fi - fi -fi - if test $nprocd -gt 1; then - if test "$host" ; then - if test ! -f $host; then - error="$error -host name file $host not accessible" - fi - fi - fi - -# -# check if the job is already running in the background -# -if test -f $DIRJOB/$jid.pid; then - error="$error -job is already running (the file $jid.pid exists)" -fi - -# -# if the program name is other than marc, then -# assume that this is a program in the users local directory -# - -bd=$MARC_BIN/ - -case $prog in - marc | MARC | $exefile) - program=$exefile - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$usersubname" - then - if test ! -f $usersubname - then - error="$error -user subroutine file $usersubname not accessible" - fi - fi - if test "$objs" - then - missingobjs= - for o in $objs - do - if test ! -f "$o" - then - if test -z "$missingobjs" - then - missingobjs="$o" - else - missingobjs="$missingobjs $o" - fi - fi - done - if test -n "$missingobjs" - then - error="$error -user object/library file(s) $missingobjs not accessible" - fi - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$vid" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRVID/1$vid.vfs - then - error="$error -view factor file $DIRVID/1$vid.vfs not accessible" - fi - else - if test ! -f $DIRVID/$vid.vfs - then - error="$error -view factor file $DIRVID/$vid.vfs not accessible" - fi - fi - fi - if $mpioption - then - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" - fi - fi - ;; - *) - program=$prog.marc - case $prog in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - error="$error -program option may not be used with user subroutine" - fi - if test "$objs" - then - error="$error -program option may not be used with user objects or libraries" - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$nauto" - then - if test $nauto -gt 2 - then - error="$error -incorrect option for auto restart " - fi - fi - if test "$ndcoup" - then - if test $ndcoup -gt 3 - then - error="$error -incorrect option for contact decoupling " - fi - fi - if test "$ndytran" - then - if test $ndytran -gt 1 - then - error="$error -incorrect option for Marc-Dytran Switch " - fi - fi - if $mpioption - then - if test ! -x $MARC_BIN/$exefile - then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE " - fi - fi - ;; -esac - -############################################################################## -# check argument integrity # -############################################################################## - -if test "$jid" -then - : -else - error="$error -job id required" -fi - -if test $nprocd -gt 1 -then - if test $nauto -gt 0 - then - error="$error -cannot run DDM job with auto restart (-au) option " - fi -fi -case $qid in - S* | s*) - qid=short - ;; - L* | l*) - qid=long - ;; - V* | v*) - qid=verylong - ;; - B* | b*) - qid=background - ;; - F* | f*) - qid=foreground - ;; - A* | a*) - qid=at - ;; - *) - error="$error -bad value for queue_id option" - ;; -esac - -case $prgsav in - N* | n*) - prgsav=no - ;; - Y* | y*) - prgsav=yes - ;; - *) - error="$error -bad value for save option" - ;; -esac - -case $verify in - N* | n*) - verify=no - ;; - Y* | y*) - verify=yes - ;; - *) - error="$error -bad value for verify option" - ;; -esac - -case $nprocdddm in - -* ) - error="$error -bad value for nprocd option" - ;; -esac - -case $nt in - -* ) - error="$error -bad value for nt option" - ;; -esac - -case $itree in - -* ) - error="$error -bad value for itree option" - ;; -esac -case $iam in - -* ) - error="$error -bad value for iam option" - ;; -esac -case $compatible in - N* | n*) - compatible=no - ;; - Y* | y*) - compatible=yes - ;; - unknown) - ;; - *) - error="$error -bad value for comp option" - ;; -esac -case $cpinput in - N* | n*) - cpinput=no - ;; - Y* | y*) - cpinput=yes - ;; - *) - error="$error -bad value for copy input option" - ;; -esac -case $cpresults in - N* | n*) - cpresults=no - ;; - Y* | y*) - cpresults=yes - ;; - *) - error="$error -bad value for copy results option" - ;; -esac - -# -# check for external file to run -# -if test -f $MARC_TOOLS/run_marc_check -then - . $MARC_TOOLS/run_marc_check -fi - -# -# pick up version data from bin/VERSION if it exists -# -if test -f $MARC_BIN/VERSION; then - ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` - if test -n "$ppp" ;then - PRODUCT=$ppp - fi - ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` - if test -n "$ppp" ;then - REVISION=", Build $ppp" - fi -fi -############################################################################## -# interact with the user to get the required information to run marc or # -# other marc system program # -############################################################################## - -deletelog=yes -if test $qid = background -a $verify = no -then -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $usersubname -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Element loop threads : $nteprint -Solver processes : $nsolverprint -Solver threads : $ntsprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto " > $jid.log -deletelog=no -fi -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $usersubname -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Element loop threads : $nteprint -Solver processes : $nsolverprint -Solver threads : $ntsprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto" - - -case $qid in - s* | S* | l* | L* | v* | V* ) - echo \ -"Queue priority : $priority -Queue CPU limit : $cpu -Queue start time : $att" - ;; -# * ) -# echo \ -#" " -# ;; -esac - -if test "$error" -then - if test $verify = yes - then - $ECHO "$error - -Please correct or quit(correct,quit,): $ECHOTXT" - error= - read answer - case $answer in - q* | Q*) - answer=quit - ;; - *) - answer=correct - ;; - esac - else - $ECHO "$error - $ECHOTXT" - echo " " - if test "$deletelog" = no - then - $ECHO "$error - $ECHOTXT" >> $jid.log - echo " " >> $jid.log - fi - answer=quit - fi -else - if test $verify = yes - then - $ECHO " -Are these parameters correct (yes,no,quit,)? $ECHOTXT" - read answer - case $answer in - q* | Q*) - answer=quit - ;; - y* | Y*) - answer=yes - ;; - *) - answer=no - ;; - esac - else - answer=yes - fi -fi - -case $answer in - no | correct) - -############################################################################## -# prompt for each value # -############################################################################## - - $ECHO " -Program name ($prog)? $ECHOTXT" - read value - if test "$value" - then - prog=$value - fi - $ECHO "Job ID ($jid)? $ECHOTXT" - read value - if test "$value" - then - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - fi - $ECHO "User subroutine name ($user)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - user= - ;; - *) - user=`dirname $value`/`$BASENAME $value .f` - basefile=`$BASENAME $value` - if test ${basefile##*.} = F - then - user=`dirname $value`/`$BASENAME $value .F` - fi - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - if test -f $user.f - then - usersubname=$user.f - elif test -f $user.F - then - usersubname=$user.F - else - usersubname=$user - fi - ;; - esac - fi - $ECHO "User objects or libraries ($objs)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - objs= - ;; - *) - objs="$value" - ;; - esac - fi - $ECHO "Restart File Job ID ($rid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - rid= - ;; - *) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - esac - fi - $ECHO "Substructure File ID ($sid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - sid= - ;; - *) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - esac - fi - $ECHO "Post File Job ID ($pid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - pid= - ;; - *) - pid=$value - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - esac - fi - $ECHO "Defaults File ID ($did)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - did= - ;; - *) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - esac - fi - $ECHO "View Factor File ID ($vid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - vid= - ;; - *) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - esac - fi - $ECHO "Save generated module ($prgsav)? $ECHOTXT" - read value - if test "$value" - then - prgsav=$value - fi - $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" - read value - if test "$value" - then - nprocdddm=$value - nprocdddmprint=$value - fi - $ECHO "Run on ($nte) Element loop threads ? $ECHOTXT" - read value - if test "$value" - then - nte=$value - fi - $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" - read value - if test "$value" - then - nsolver=$value - fi - $ECHO "Run on ($nts) Solver threads ? $ECHOTXT" - read value - if test "$value" - then - nts=$value - fi -# - if test $nprocdddm -gt 0 - then - nprocd=$nprocdddm - fi - if test $nsolver -gt 0 - then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi - fi -# Element loop threads. - if test $nte -eq -1 - then - nte=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nte -lt 0 - then - nte=0 - fi - nteprint=$nte -# Copy from ddm - if test $nprocdddm -gt 1 - then - nteprint=$nprocdddm - fi -# override with -nthread_elem option - if test $nte -ne 0 - then - nteprint=$nte - fi -# check for minimum 1 threads per processes for DDM - if test $nprocdddm -ne 0 - then - if test $nteprint -lt $nprocdddm - then - nteprint=$nprocdddm - fi - fi - nte=$nteprint -# Solver threads. - if test $nts -eq -1 - then - nts=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nts -lt 0 - then - nts=0 - fi - ntsprint=$nts -# Copy from ddm - if test $nprocdddm -gt 1 - then - ntsprint=$nprocdddm - fi -# override with -nthread_solver option - if test $nts -ne 0 - then - ntsprint=$nts - fi -# check for minimum 1 threads per solver process. - if test $nsolver -lt $nprocdddm - then - if test $ntsprint -lt $nsolver - then - ntsprint=$nsolver - fi - else - if test $ntsprint -lt $nprocdddm - then - ntsprint=$nprocdddm - fi - fi - if test $ntsprint -eq 1 - then - set ntsprint=0 - fi - nts=$ntsprint - $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" - read value - if test "$value" - then - gpuids=$value - fi - if test "$gpuids" = "" ; then - gpuoption= - else - gpuoption="-gp $gpuids" - fi - if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH - fi - if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - fi -# - if test $nprocd -gt 1 - then - $ECHO "Message passing type ($itree)? $ECHOTXT" - read value - if test "$value" - then - itree=$value - fi - $ECHO "Host file name ($host)? $ECHOTXT" - read value - if test "$value" - then - host=$value - fi - if test $nprocdddm -gt 1 - then - $ECHO "Single input file? $ECHOTXT" - read value - case $value in - y* | Y*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" - read value - if test "$value" - then - compatible=$value - fi - $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" - read value - if test "$value" - then - cpinput=$value - fi - $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" - read value - if test "$value" - then - cpresults=$value - fi - fi - fi - $ECHO "Run the job in the queue ($qid)? $ECHOTXT" - read value - if test "$value" - then - qid=$value - fi - case $qid in - s* | S* | l* | L* | v* | V* ) - $ECHO "Queue priority ($priority)? $ECHOTXT" - read value - if test "$value" - then - priority=$value - fi - $ECHO "Job starts at ($att)? $ECHOTXT" - read value - if test "$value" - then - att=$value - fi - $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" - read value - if test "$value" - then - cpu=$value - fi - ;; - * ) - ;; - esac - $ECHO "Auto Restart option ($nauto)? $ECHOTXT" - read value - if test "$value" - then - nauto=$value - fi - $ECHO "Run directory ($DIRJOB)? $ECHOTXT" - read value - if test "$value" - then - DIRJOB=$value - DIRSCR=$DIRJOB - fi - $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" - read value - if test "$value" - then - DIRSCR=$value - fi - ;; - quit) - exit 1 - ;; - *) - break - ;; - -esac - - if test $nt -eq -1 - then - nt=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nt -lt 0 - then - nt=0 - fi - -done -# -if test $nt -eq 0 -then - ntarg= -fi -if test $nt -eq 0 -then - ntprint= -fi -if test $nt -eq 0 -then - nt= -fi - -if test $nte -eq 0 -then - ntearg= -fi -if test $nte -eq 0 -then - nteprint= -fi -if test $nte -eq 0 -then - nte= -fi - -if test $nts -eq 0 -then - ntsarg= -fi -if test $nts -eq 0 -then - ntsprint= -fi -if test $nts -eq 0 -then - nts= -fi -# -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - pathdll=yes - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - fi - - if test "$pathdll"; then -# -# reset share lib path -# - if test $MACHINENAME = "HP" - then - SHLIB_PATH=$DIRJOB:$SHLIB_PATH - export SHLIB_PATH - fi - if test $MACHINENAME = "IBM" - then - LIBPATH=$DIRJOB:$LIBPATH - export LIBPATH - fi -# - LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH - LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH - LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH - export LD_LIBRARY_PATH - export LD_LIBRARY64_PATH - export LD_LIBRARYN32_PATH - fi -fi -# end of dllrun>0 - - -if test $program = $exefile -o $program = $prog.marc -then - -# delete the old .log file unless we run in the background -if test "$deletelog" = yes -then - /bin/rm $jid.log 2>/dev/null -else - echo - echo running the job in the background, see $jid.log - echo -fi - -# -# check if this is an autoforge or rezoning or radiation job -# -if test $nprocd -eq 1 -then - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` - if test "$line" - then - autoforge=1 - fi -fi -# -# check that jobname for restarted run is not the same -# as restart file basename -# -if test "$rid" -then - if test "$jid" = "$rid" - then - echo " " - echo "ERROR: job name of current run is the same as job name" - echo " of the restarted job" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "ERROR: job name of current run is the same as job name" >> $jid.log - echo " of the restarted job" >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi -fi - -# -# user objects/libraries used -# - - if test "$objs" - then - program="$DIRJOB/$jid.marc" - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# user subroutine used -# - - if test "$user" - then -# program=$user.marc - program=$DIRJOB/`$BASENAME $user .f`.marc - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# Special case for IBM using POE but not an SP machine -# in this case we always need a host file, also for serial jobs. -# -if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP -then - MP_HOSTFILE=${jid}.host - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $nprocd -gt 1 - then - numdom=$nprocd - while test $numdom -gt 0 - do - hostname -s >> $MP_HOSTFILE - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - else - hostname -s > $MP_HOSTFILE - fi -fi -# -# check ssh for all hosts in host file -# -if test $nprocd -gt 1 -then -if test $MPITYPE = "intelmpi" -a "$INTELMPI_VERSION" = "HYDRA" - then -# get host list - if test "$host" - then - line=`grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' | uniq` -# count failing hosts - counter=0 - for i in $line - do - $RSH -o BatchMode=yes -o ConnectTimeout=10 $i uname -n - status=$? - if [[ $status != 0 ]] ; then - counter=$((counter+1)) - if [ "$counter" = "1" ]; then - echo " " - echo " error - connection test failed... " - echo " " - fi - echo " " - echo " connection test with ssh failed on host $i" - echo " check the following command: ssh $i uname -n " - echo " " - fi - done -# echo error message and quit - if test $counter -ne 0 - then - echo " " - echo " A parallel job using IntelMPI cannot be started. " - echo " The ssh command must be working correctly between " - echo " the computers used in the analysis. Furthermore, " - echo " it must be set up such that it does not prompt the " - echo " user for a password. Note that this is the case " - echo " also for running on a single machine. " - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo " A parallel job using IntelMPI cannot be started. ">> $jid.log - echo " The ssh command must be working correctly between ">> $jid.log - echo " the computers used in the analysis. Furthermore, ">> $jid.log - echo " it must be set up such that it does not prompt the ">> $jid.log - echo " user for a password. Note that this is the case ">> $jid.log - echo " also for running on a single machine. ">> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - else - counter=1 -# test ssh `hostname` - if test $counter -ne 0 - then - line=`hostname` - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi -# test ssh `hostname` - if test $counter -ne 0 - then - line=`hostname -s` - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi -# test ssh localhost - if test $counter -ne 0 - then - line=localhost - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi - if test $counter -ne 0 - then - echo " error - connection test failed... " - echo " " - echo " ssh needs to work on the machine without asking for a password." - echo " check the following command: ssh localhost uname -n" - echo " " - echo " A parallel job using IntelMPI cannot be started. " - echo " The ssh command must be working correctly between " - echo " the computers used in the analysis. Furthermore, " - echo " it must be set up such that it does not prompt the " - echo " user for a password. Note that this is the case " - echo " also for running on a single machine. " - echo " " - if test "$deletelog" = no - then - echo " error - connection test failed... " >> $jid.log - echo " " >> $jid.log - echo " ssh needs to work on the machine without asking for a password." >> $jid.log - echo " check the following command: ssh localhost uname -n" >> $jid.log - echo " " >> $jid.log - echo " A parallel job using IntelMPI cannot be started. " >> $jid.log - echo " The ssh command must be working correctly between " >> $jid.log - echo " the computers used in the analysis. Furthermore, " >> $jid.log - echo " it must be set up such that it does not prompt the " >> $jid.log - echo " user for a password. Note that this is the case " >> $jid.log - echo " also for running on a single machine. " >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - echo $line $nprocd > $jid.hosts - host=$jid.hosts - fi - fi -fi -fi -# -# check correctness of host file; fix for user sub -# - if test $nprocd -gt 1 - then - -# construct the path name to the executable (execpath) - execpath=$MARC_BIN/$exefile - usersub=0 - if test $program = $prog.marc - then - execpath=$prog.marc - usersub=1 - fi - if test "$objs" - then - execpath="$DIRJOB/$jid.marc" - usersub=1 - fi - if test "$user" - then - execpath=$DIRJOB/`$BASENAME $user .f`.marc - usersub=1 - fi - export execpath - execname=`$BASENAME $execpath` - - if test "$host" - then - userhost=$host - case $userhost in - \/* | \.\/*) - ;; - *) - userhost=`pwd`/$userhost - ;; - esac - -# check that the number of processes specified in the hostfile is -# equal to nprocd specified by -nprocd. - numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` - if test $nprocd -ne $numproc - then - echo " " - echo "error, the number of processes specified in the host file" - echo "must be equal to the number of processes given by -nprocd/-nsolver" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, the number of processes specified in the host file" >> $jid.log - echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - -# check for Myrinet that the number of processes per host is -# less than number of available user ports, 5 -# .gmpi directory must exist in user's home directory -# and must have write permission from remote hosts - if test $MPITYPE = "myrinet" - then - numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` - if test $numproc -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes specified " - echo "in the hostfile must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes specified " >> $jid.log - echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - if test ! -d ~/.gmpi - then - echo " " - echo "error, for Myrinet a .gmpi directory must exist " - echo "under the user's home directory" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log - echo "under the user's home directory" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - homedir=`echo ~` - for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - echo " " - echo "error, for Myrinet a shared .gmpi directory must exist " - echo "under the user's home directory " - echo "with remote write permission" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log - echo "under the user's home directory " >> $jid.log - echo "with remote write permission" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - /bin/rm tmp.$$ - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - fi - fi - done - fi - fi - -# construct the host file $jid.host which is used by mpirun -# skip lines starting with # and only consider lines with more than -# one word in them. Note that the hostfile given to this script -# has two columns: the host name and the number of shared processes -# to run on this host. mpirun wants the number of _other_ -# processes to run in addition to the one being run on the machine -# on which the job is started. hence the $2-1 for fnr == 1. - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then -# HPMPI or HP hardware MPI - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ - -v mpihpspecial="$MPIHPSPECIAL" \ -'{if ( NF > 0) {\ - fnr++ ; \ - printf("-h %s -np %s",$1,$2); \ - printf(" %s",mpihpspecial); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ - if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ - }\ - }' > $jid.host -# end HPMPI or HP hardware MPI - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then -# IBM using hardware MPI (POE) - MP_HOSTFILE=$jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host -# end IBM using hardware MPI (POE) -# for Intel MPI, need to create a machinefile for DMP - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then -# Intel MPI - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - /bin/cp $host $jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Intel MPI for DMP -# for Solaris HPC 7.1, need to create a machinefile for DMP - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then -# Solaris HPC 7.1 - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Solaris HPC 7.1 for DMP -# for Myrinet, construct a configuration file in ~/.gmpi -# this must be readable by each process -# format is (hostname) (port number) for each process - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - grep -v '^#' $host | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ -{if ( NF > 0 ) \ - for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ -}' >> ~/.gmpi/$jid.host - else -# this is for mpich-1.2.5 and later, using the -pg option -# format: host nproc executable user arguments -# the arguments are added later - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s %s\n",path,user);\ - if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ - }\ - }' > $jid.host - fi -# end Myrinet - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then -# Compaq MPI via Memory Channel - grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host -# end Compaq MPI - else -# MPICH - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ - }\ - }' > $jid.host - fi -# define the variable host and host_filt -# host_filt is used for loops over hosts -# for Myrinet we need to use a filtered variant of userhost -# for others we can use $host - if test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - host=~/.gmpi/$jid.host - host_filt=$jid.host_tMp - grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt - else - host=$jid.host - host_filt=$host - fi - else - host=$jid.host - host_filt=$host - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - host_filt=$jid.mfile - fi - fi -# figure out if the machines in the hostfile are nfs mounted -# or distributed and set the variable "dirstatus" accordingly. -# only perform the check if user subroutine is used -# or a user subroutine executable is used - - numfield=1 - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - numfield=2 - fi - DIR1=$DIRJOB - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - counter=0 - echo " " - echo "checking if local or shared directories for host" - if test "$deletelog" = no - then - echo "checking if local or shared directories for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - dirstatus[$counter]="shared" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - dirstatus[$counter]="local" - /bin/rm tmp.$$ - else - if test ! -f $jid.$$ - then - dirstatus[$counter]="local" - $RSH $i /bin/rm $DIR1/$jid.$$ - else - /bin/rm $jid.$$ - fi - fi - if test -f tmp.$$ - then - /bin/rm tmp.$$ - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - echo " ${dirstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${dirstatus[$counter]}" >> $jid.log - fi - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - fi - -# figure out if this is a compatible set of machines -# unless explicitly specified with flag -comp -# only perform the check if user subroutine is used -# or a user subroutine executable is used -# Myrinet does not support heterogeneous - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - if test $compatible = "unknown" - then - thisname=$ARCH - compatible=yes - counter=0 - echo "checking if machines are compatible for host" - if test "$deletelog" = no - then - echo "checking if machines are compatible for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]="yes" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - othername=`$RSH $i uname -a | cut -f 1 -d " "` - if test $thisname != $othername - then - compatible=no - compstatus[$counter]="no" - fi - fi - echo " ${compstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${compstatus[$counter]}" >> $jid.log - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - else - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]=$compatible - fi - done - if test $compatible = "no" - then - echo "all machines assumed incompatible" - if test "$deletelog" = no - then - echo "all machines assumed incompatible" >> $jid.log - fi - else - echo "all machines compatible" - if test "$deletelog" = no - then - echo "all machines compatible" >> $jid.log - fi - fi - fi -# error out if user objects or libraries are used on incompatible machines - if test "$compatible" = "no" -a -n "$objs" - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" - if test "$deletelog" = no - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log - fi - exit 1 - fi -# modify new host file if NFS mounted heterogeneous machine - doit= - if test $program = $prog.marc - then - doit=yes - fi - if test "$user" - then - doit=yes - fi - if test "$doit" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - $AWK -v hst=$i '{fnr++ ; \ -if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ -printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} - /bin/mv $jid.host{$$} $jid.host - host=$jid.host - fi - fi - done - fi - fi # if test $program = $prog.marc -o $user -o $obj - - else # if test $host - # assume shared memory machine if no hostfile given and - # MPITYPE is set to mpich or Myrinet - # check for Myrinet that the total number of processes is - # less than number of available user ports, 5 - if test $MPITYPE = "mpich" -o $MPITYPE = "scali" - then - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - host=$jid.host - elif test $MPITYPE = "myrinet" - then - if test $nprocd -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes " - echo "must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes " >> $jid.log - echo "must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - echo `hostname` $nprocd | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ - {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ -' >> ~/.gmpi/$jid.host - host=~/.gmpi/$jid.host - else - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - - fi - fi # if test myrinet - - fi # if test $host - - fi # if test $nprocd -gt 1 - -fi # if test $program = $exefile -o $program = $prog.marc - -############################################################################## -# construct run stream (Marc only) # -############################################################################## - -# set maximum message length for ddm to a large number -# for vendor provided mpi -if test $itree -eq 0 -a $MPITYPE = hardware -then - itree=100000000 - if test $MACHINENAME = SGI - then - itree=100000001 - fi -fi -if test $itree -eq 0 -a $MPITYPE = hpmpi -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = myrinet -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = nec -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = scali -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = intelmpi -then - itree=100000000 -fi -if test $nprocdddm -lt 2 -then - nprocdarg= -else - nprocdarg="$nprocdarg $nprocdddm" -fi -if test $nsolver -eq 0 -then - nsolverarg= -else - nsolverarg="$nsolverarg $nsolver" -fi -if test $nprocdddm -lt 2 -a $nsolver -eq 0 -then -nprocd=0 -fi -if test $nprocd -gt 0 -then - if test "$host" - then - if test -z "$RUN_JOB2" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then - RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - else - RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" - RUN_JOB=" -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - numhost=`uniq $jid.mfile | wc -l` - if test "$INTELMPI_VERSION" = "HYDRA" - then - RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n $numhost -r $RSH -f $jid.mfile - RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" - fi - -# intelmpi uses configfile. format: -# -host host1 -n n1 executable marcargs -# one such line per host -# collect the marcargs in RUN_JOB and construct the config file later -# collect the run stream in RUN_JOB_TMP - RUN_JOB="-jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - - - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then - RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi - if test "$userhost" - then - RUN_JOB="$RUN_JOB -mhost $userhost" - fi - if test $MPITYPE = "scali" - then -# set default working directory to /tmp to allow -# different directory names - SCAMPI_WORKING_DIRECTORY=/tmp - export SCAMPI_WORKING_DIRECTORY - fi - else - if test -z "$RUN_JOB1" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - RUNNPROCD=$nprocd - if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" - then - RUNNPROCD= - MP_PROCS=$nprocd - export MP_PROCS - fi - if test $MPITYPE = "myrinet" - then - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n 1 -f $jid.hosts - fi - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi - fi -else - if test $nauto -gt 0 -o $ndcoup -gt 0 - then - RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ - $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - else -# this is for a serial job without auto restart: - RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ -$ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB " - fi -fi -if test "$rid" -then - RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" -fi -if test "$pid" -then - RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" -fi -if test "$sid" -then - RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" -fi -if test "$did" -then - RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" -fi -if test "$vid" -then - RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" -fi -if test $nauto -gt 0 -then - RUN_JOB="$RUN_JOB -autorst $nauto " -fi -if test $ndcoup -gt 0 -then - RUN_JOB="$RUN_JOB -dcoup $ndcoup " -fi -if test $ndytran -gt 0 -then - RUN_JOB="$RUN_JOB -dytran $ndytran " -fi -if test $mesh -gt 0 -then - RUN_JOB="$RUN_JOB -me $mesh " -fi -if test $noutcore -gt 0 -then - RUN_JOB="$RUN_JOB -outcore $noutcore " -fi -if test "$dllrun" -gt 0 -then - RUN_JOB="$RUN_JOB -dll $dllrun " -fi -if test "$trkrun" -gt 0 -then - RUN_JOB="$RUN_JOB -trk $trkrun " -fi -if test "$iam" -then - RUN_JOB="$RUN_JOB -iam $iam " -fi -if test "$justlist" -then - RUN_JOB="$RUN_JOB -list 1 " -fi -if test "$feature" -then - RUN_JOB="$RUN_JOB -feature $feature " -fi -if test "$memlimit" -ne 0 -then - RUN_JOB="$RUN_JOB -ml $memlimit " -fi -if test "$cpinput" -then - RUN_JOB="$RUN_JOB -ci $cpinput " -fi -if test "$cpresults" -then - RUN_JOB="$RUN_JOB -cr $cpresults " -fi -if test "$DIRSCR" != "$DIRJOB" -then - RUN_JOB="$RUN_JOB -dirscr $DIRSCR" -else - DIRSCR=$DIRJOB -fi -if test "$makebdf" -then - RUN_JOB="$RUN_JOB -bdf $makebdf " -fi -if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" -then - # append $RUN_JOB to all lines of the host file - # and set RUN_JOB - $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ - /bin/mv $host.$$ $host - RUN_JOB=$RUN_JOB_TMP -fi -if test $MPITYPE = "intelmpi" -a "$host" -then - # construct config file, append $RUN_JOB to all lines of the config file - # and set RUN_JOB - if test "$INTELMPI_VERSION" = "HYDRA" - then - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - else - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-host %s -n %s",$1,$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - fi - RUN_JOB=$RUN_JOB_TMP -fi -echo " " -echo "Final run stream value" -echo " RUNJOB="$RUN_JOB -if test "$deletelog" = no -then -echo " " >> $jid.log -echo "Final run stream value" >> $jid.log -echo " RUNJOB="$RUN_JOB >> $jid.log -fi - - -############################################################################## -# run marc using valgrind # -############################################################################## -#RUN_JOB="valgrind $RUN_JOB" -#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" -############################################################################## - - -############################################################################## -# run the requested program in a queue # -############################################################################## - -if test "$deletelog" = yes -then - echo - date -else - echo >> $jid.log - date >> $jid.log -fi -if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] -then - -/bin/rm -f $jid.runmarcscript - - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - userobj=$DIRJOB/`$BASENAME $user .f`.o - basefile=`$BASENAME $usersubname` - if test ${basefile##*.} = f - then - usersub=$DIRJOB/`$BASENAME $user .f`.F - ln -sf "$user.f" "$usersub" - else - usersub=$usersubname - fi - - fi - cat > $jid.runmarcscript << END4 - if test "$user" - then - if test ${basefile##*.} = f - then - ln -sf "$user.f" "$usersub" - fi - if test $MACHINENAME = "CRAY" - then - $FORTRAN $usersub || \ - { - echo "$0: compile failed for $user.f" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $FORTRAN $usersub -o $userobj || \ - { - echo "$0: compile failed for $user.f" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - if test ${basefile##*.} = f - then - /bin/rm -f "$usersub" - fi - fi - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $MARCCUDALIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } -END4 -else - prgsav=yes -fi -/bin/rm $userobj 2>/dev/null - -# -# run marc -# - -cat >> $jid.runmarcscript << END5 - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -# first remove all .out files and incremental restart files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null - /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null -fi - -if test $nprocdddm -gt 1 -then - $RUN_JOB 2>>$jid.log -else - $RUN_JOB 2>>$jid.log -fi - -if test $dllrun -eq 0; then - if test $prgsav = no - then - /bin/rm -f $bd$program 2>/dev/null - fi -else - if test $cpdll = yes; then - filename=`basename $usersubname .f` - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes - then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -END5 - - -# Submit to marc batch queue -# -if [ $qid = at ] -then -QUENAME=at -SUBMCMD= -else -# -# Submit to qsub queue -# -QUENAME=qsub -SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" -if test "$priority" -then - SUBMCMD=$SUBMCMD" -p $priority" -fi -if test "$att" -then - SUBMCMD=$SUBMCMD" -a $att" -fi -if test "$cpu" -then - SUBMCMD=$SUBMCMD" -lt $cpu" -fi - -fi -echo $QUENAME $SUBMCMD -#cat $jid.runmarcscript -$QUENAME $SUBMCMD < $jid.runmarcscript - -/bin/rm -f $jid.runmarcscript - -############################################################################## -# run the requested program in the background # -############################################################################## - -else -if test $qid = background -then - -# -# first remove all old .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi -# -# compile user subroutine if present -# -( -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user.f $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_user $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user.f on host $i" - echo " $PRODUCT Exit number 3" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser.f 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user.f on host `hostname`" - fi - userobj=$DIRJOB/`$BASENAME $user .f`.o - basefile=`$BASENAME $usersubname` - if test ${basefile##*.} = f - then - usersub=$DIRJOB/`$BASENAME $user .f`.F - ln -sf "$user.f" "$usersub" - else - usersub=$usersubname - fi - if test $MACHINENAME = "CRAY" - then - $FORTRAN $usersub || \ - { - echo "$0: compile failed for $user.f" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $FORTRAN $usersub -o $userobj || \ - { - echo "$0: compile failed for $user.f" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - if test ${basefile##*.} = f - then - /bin/rm -f "$usersub" - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - echo " $PRODUCT Exit number 3" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null - -# -# run marc - -# - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -$RUN_JOB & - -marcpid=$! -echo $marcpid > $DIRJOB/$jid.pid -wait $marcpid - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - if test "$host" - then - /bin/rm $jid.mfile 2> /dev/null - /bin/rm $jid.hosts 2> /dev/null - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.cfile 2> /dev/null - fi - fi - fi -fi - - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=`basename $usersubname .f` - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -) 1>>$jid.log 2>&1 & - - -############################################################################## -# run the requested program in the foreground # -############################################################################## - -else - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user.f $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_user $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user.f on host $i" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser.f 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user.f on host `hostname`" - fi - userobj=$DIRJOB/`$BASENAME $user .f`.o - basefile=`$BASENAME $usersubname` - if test ${basefile##*.} = f - then - usersub=$DIRJOB/`$BASENAME $user .f`.F - ln -sf "$user.f" "$usersub" - else - usersub=$usersubname - fi - if test $MACHINENAME = "CRAY" - then - $FORTRAN $usersub || \ - { - echo "$0: compile failed for $user.f" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $FORTRAN $usersub -o $userobj || \ - { - echo "$0: compile failed for $user.f" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - if test ${basefile##*.} = f - then - /bin/rm -f "$usersub" - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null - -# -# run marc -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi -# first remove all .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi - -$RUN_JOB - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - if test "$host" - then - /bin/rm $jid.mfile 2> /dev/null - /bin/rm $jid.hosts 2> /dev/null - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.cfile 2> /dev/null - else - echo " " > /dev/null - fi - else - if test "$host" - then - mpdcleanup -a -f $jid.mfile - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.mfile 2> /dev/null - else - mpdcleanup -a -f $jid.hosts - /bin/rm $jid.hosts 2> /dev/null - fi - fi - fi -fi - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=`basename $usersubname .f` - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t81* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t82* 2>/dev/null - /bin/rm $DIRSCR/$jid.*.t83* 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi - - -fi -fi diff --git a/installation/mods_MarcMentat/2013.1/Mentat_bin/edit_window b/installation/mods_MarcMentat/2013.1/Mentat_bin/edit_window deleted file mode 100644 index b732a7694..000000000 --- a/installation/mods_MarcMentat/2013.1/Mentat_bin/edit_window +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -# This script opens a window running an editor. -# The command to invoke the editor is specified during DAMASK installation - -%EDITOR% $* \ No newline at end of file diff --git a/installation/mods_MarcMentat/2013.1/Mentat_bin/edit_window.org b/installation/mods_MarcMentat/2013.1/Mentat_bin/edit_window.org deleted file mode 100644 index 64c0a68d0..000000000 --- a/installation/mods_MarcMentat/2013.1/Mentat_bin/edit_window.org +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# This script opens a window running an editor. The default window is an -# xterm, and the default editor is vi. These may be customized. - -dir= -for d in /usr/bin /usr/bin/X11; do - if test -x "$d/xterm"; then - dir="$d" - break - fi -done - -if test -z "$dir"; then - echo "$0: Could not find xterm" - exit 1 -fi - -"$dir/xterm" -T "vi $*" -n "vi $*" -e vi $* diff --git a/installation/mods_MarcMentat/2013.1/Mentat_bin/kill4 b/installation/mods_MarcMentat/2013.1/Mentat_bin/kill4 deleted file mode 100644 index 6d1ff84bf..000000000 --- a/installation/mods_MarcMentat/2013.1/Mentat_bin/kill4 +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "usage: $0 job_name" - exit 1 -fi - -echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2013.1/Mentat_bin/kill5 b/installation/mods_MarcMentat/2013.1/Mentat_bin/kill5 deleted file mode 100644 index 6d1ff84bf..000000000 --- a/installation/mods_MarcMentat/2013.1/Mentat_bin/kill5 +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "usage: $0 job_name" - exit 1 -fi - -echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2013.1/Mentat_bin/kill6 b/installation/mods_MarcMentat/2013.1/Mentat_bin/kill6 deleted file mode 100644 index 6d1ff84bf..000000000 --- a/installation/mods_MarcMentat/2013.1/Mentat_bin/kill6 +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "usage: $0 job_name" - exit 1 -fi - -echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2013.1/Mentat_bin/kill7 b/installation/mods_MarcMentat/2013.1/Mentat_bin/kill7 deleted file mode 100644 index 6d1ff84bf..000000000 --- a/installation/mods_MarcMentat/2013.1/Mentat_bin/kill7 +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "usage: $0 job_name" - exit 1 -fi - -echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2013.1/Mentat_bin/kill8 b/installation/mods_MarcMentat/2013.1/Mentat_bin/kill8 deleted file mode 100644 index 6d1ff84bf..000000000 --- a/installation/mods_MarcMentat/2013.1/Mentat_bin/kill8 +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "usage: $0 job_name" - exit 1 -fi - -echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2013.1/Mentat_bin/kill9 b/installation/mods_MarcMentat/2013.1/Mentat_bin/kill9 deleted file mode 100644 index 6d1ff84bf..000000000 --- a/installation/mods_MarcMentat/2013.1/Mentat_bin/kill9 +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "usage: $0 job_name" - exit 1 -fi - -echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2013.1/Mentat_bin/submit1.org b/installation/mods_MarcMentat/2013.1/Mentat_bin/submit1.org deleted file mode 100644 index f3b2f5c1c..000000000 --- a/installation/mods_MarcMentat/2013.1/Mentat_bin/submit1.org +++ /dev/null @@ -1,185 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=/msc/marc2013.1 -if test $MARCDIR1 -then - DIR=$MARCDIR1 -fi - -if test -z "$DIR"; then - REALCOM="`ls -l $0 |awk '{ print $NF; }'`" - DIRSCRIPT=`dirname $REALCOM` - case $DIRSCRIPT in - \/*) - ;; - *) - DIRSCRIPT=`pwd`/$DIRSCRIPT - ;; - esac - . $DIRSCRIPT/getarch - - DIR="$MENTAT_MARCDIR" -fi - -SRCEXT=.f -RSTEXT=.t08 -PSTEXT=.t19 -PSTEXTB=.t16 -VWFCEXT=.vfs - -slv=$1 -version=$2 -ndom_fea_solver=$3 -ndom_preprocessor=$4 -hostfile=$5 -compat=$6 -job=$7 -srcfile=$8 -srcmeth=$9 -shift 9 # cannot use $10, $11, ... -restart=$1 -postfile=$2 -viewfactorsfile=$3 -autorst=$4 -copy_datfile="-ci $5" -copy_postfile="-cr $6" -scr_dir=$7 -dcoup=$8 -assem_recov_nthread=$9 -shift 9 # cannot use $10, $11, ... -nthread=$1 -nsolver=$2 -mode=$3 -gpu=$4 - -if [ "$slv" != "" -a "$slv" != "marc" ]; then - slv="-iam sfm" -else - slv="" -fi - -if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then - nprocds="-nprocds $ndom_fea_solver" -else - nprocd="" - if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then - nprocd="-nprocd $ndom_preprocessor" - else - nprocd="" - fi -fi - -if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then - srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` - case "$srcmeth" in - -) - srcfile="-u $srcfile" - ;; - compsave) - srcfile="-u $srcfile -save y" - ;; - runsaved) - srcfile="-prog $srcfile" - ;; - esac -else - srcfile="" -fi - -if [ "$restart" != "" -a "$restart" != "-" ]; then - restart=`echo $restart | sed "s/$RSTEXT$//"` - restart="-r $restart" -else - restart="" -fi - -if [ "$postfile" != "" -a "$postfile" != "-" ]; then - postfile=`echo $postfile | sed "s/$PSTEXT$//"` - postfile=`echo $postfile | sed "s/$PSTEXTB$//"` - postfile="-pid $postfile" -else - postfile="" -fi - -if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then - viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` - viewfactorsfile="-vf $viewfactorsfile" -else - viewfactorsfile="" -fi - -if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then - hostfile="-ho $hostfile" -else - hostfile="" -fi - -if [ "$compat" != "" -a "$compat" != "-" ]; then - compat="-co $compat" -else - compat="" -fi - -if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then - scr_dir="-sd $scr_dir" -else - scr_dir="" -fi - -if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then - dcoup="-dcoup $dcoup" -else - dcoup="" -fi - -if [ "$assem_recov_nthread" != "" -a "$assem_recov_nthread" != "1" ]; then - assem_recov_nthread="-nthread_elem $assem_recov_nthread" -else - assem_recov_nthread="" -fi - -if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then - nthread="-nthread $nthread" -else - nthread="" -fi - -if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then - nsolver="-nsolver $nsolver" -else - nsolver="" -fi - -case "$mode" in - 4) mode="-mo i4" ;; - 8) mode="-mo i8" ;; - *) mode= ;; -esac - -if [ "$gpu" != "" -a "$gpu" != "-" ]; then - gpu="-gpu $gpu" -else - gpu="" -fi - -rm -f $job.cnt -rm -f $job.sts -rm -f $job.out -rm -f $job.log - -# To prevent a mismatch with the python version used by the solver -# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH -# unset environment variables PYTHONHOME and PYTHONPATH -unset PYTHONHOME -unset PYTHONPATH - -"${DIR}/tools/run_marc" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ - $srcfile $restart $postfile $viewfactorsfile $hostfile \ - $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ - $assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1 -sleep 1 -exit 0 diff --git a/installation/mods_MarcMentat/2013.1/Mentat_bin/submit4 b/installation/mods_MarcMentat/2013.1/Mentat_bin/submit4 deleted file mode 100644 index 8d985d09a..000000000 --- a/installation/mods_MarcMentat/2013.1/Mentat_bin/submit4 +++ /dev/null @@ -1,186 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=%INSTALLDIR%/marc%VERSION% -if test $MARCDIR1 -then - DIR=$MARCDIR1 -fi - -if test -z "$DIR"; then - REALCOM="`ls -l $0 |awk '{ print $NF; }'`" - DIRSCRIPT=`dirname $REALCOM` - case $DIRSCRIPT in - \/*) - ;; - *) - DIRSCRIPT=`pwd`/$DIRSCRIPT - ;; - esac - . $DIRSCRIPT/getarch - - DIR="$MENTAT_MARCDIR" -fi - -SRCEXT=.f -RSTEXT=.t08 -PSTEXT=.t19 -PSTEXTB=.t16 -VWFCEXT=.vfs - -slv=$1 -version=$2 -ndom_fea_solver=$3 -ndom_preprocessor=$4 -hostfile=$5 -compat=$6 -job=$7 -srcfile=$8 -srcmeth=$9 -shift 9 # cannot use $10, $11, ... -restart=$1 -postfile=$2 -viewfactorsfile=$3 -autorst=$4 -copy_datfile="-ci $5" -copy_postfile="-cr $6" -scr_dir=$7 -dcoup=$8 -assem_recov_nthread=$9 -shift 9 # cannot use $10, $11, ... -nthread=$1 -nsolver=$2 -mode=$3 -gpu=$4 - -if [ "$slv" != "" -a "$slv" != "marc" ]; then - slv="-iam sfm" -else - slv="" -fi - -if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then - nprocds="-nprocds $ndom_fea_solver" -else - nprocd="" - if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then - nprocd="-nprocd $ndom_preprocessor" - else - nprocd="" - fi -fi - -if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then -# srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` - case "$srcmeth" in - -) - srcfile="-u $srcfile" - ;; - compsave) - srcfile="-u $srcfile -save y" - ;; - runsaved) - srcfile=${srcfile%.*}".marc" - srcfile="-prog $srcfile" - ;; - esac -else - srcfile="" -fi - -if [ "$restart" != "" -a "$restart" != "-" ]; then - restart=`echo $restart | sed "s/$RSTEXT$//"` - restart="-r $restart" -else - restart="" -fi - -if [ "$postfile" != "" -a "$postfile" != "-" ]; then - postfile=`echo $postfile | sed "s/$PSTEXT$//"` - postfile=`echo $postfile | sed "s/$PSTEXTB$//"` - postfile="-pid $postfile" -else - postfile="" -fi - -if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then - viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` - viewfactorsfile="-vf $viewfactorsfile" -else - viewfactorsfile="" -fi - -if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then - hostfile="-ho $hostfile" -else - hostfile="" -fi - -if [ "$compat" != "" -a "$compat" != "-" ]; then - compat="-co $compat" -else - compat="" -fi - -if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then - scr_dir="-sd $scr_dir" -else - scr_dir="" -fi - -if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then - dcoup="-dcoup $dcoup" -else - dcoup="" -fi - -if [ "$assem_recov_nthread" != "" -a "$assem_recov_nthread" != "1" ]; then - assem_recov_nthread="-nthread_elem $assem_recov_nthread" -else - assem_recov_nthread="" -fi - -if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then - nthread="-nthread $nthread" -else - nthread="" -fi - -if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then - nsolver="-nsolver $nsolver" -else - nsolver="" -fi - -case "$mode" in - 4) mode="-mo i4" ;; - 8) mode="-mo i8" ;; - *) mode= ;; -esac - -if [ "$gpu" != "" -a "$gpu" != "-" ]; then - gpu="-gpu $gpu" -else - gpu="" -fi - -rm -f $job.cnt -rm -f $job.sts -rm -f $job.out -rm -f $job.log - -# To prevent a mismatch with the python version used by the solver -# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH -# unset environment variables PYTHONHOME and PYTHONPATH -unset PYTHONHOME -unset PYTHONPATH - -"${DIR}/tools/run_damask_hmp" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ - $srcfile $restart $postfile $viewfactorsfile $hostfile \ - $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ - $assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1 -sleep 1 -exit 0 diff --git a/installation/mods_MarcMentat/2013.1/Mentat_bin/submit5 b/installation/mods_MarcMentat/2013.1/Mentat_bin/submit5 deleted file mode 100644 index f78ef9511..000000000 --- a/installation/mods_MarcMentat/2013.1/Mentat_bin/submit5 +++ /dev/null @@ -1,186 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=%INSTALLDIR%/marc%VERSION% -if test $MARCDIR1 -then - DIR=$MARCDIR1 -fi - -if test -z "$DIR"; then - REALCOM="`ls -l $0 |awk '{ print $NF; }'`" - DIRSCRIPT=`dirname $REALCOM` - case $DIRSCRIPT in - \/*) - ;; - *) - DIRSCRIPT=`pwd`/$DIRSCRIPT - ;; - esac - . $DIRSCRIPT/getarch - - DIR="$MENTAT_MARCDIR" -fi - -SRCEXT=.f -RSTEXT=.t08 -PSTEXT=.t19 -PSTEXTB=.t16 -VWFCEXT=.vfs - -slv=$1 -version=$2 -ndom_fea_solver=$3 -ndom_preprocessor=$4 -hostfile=$5 -compat=$6 -job=$7 -srcfile=$8 -srcmeth=$9 -shift 9 # cannot use $10, $11, ... -restart=$1 -postfile=$2 -viewfactorsfile=$3 -autorst=$4 -copy_datfile="-ci $5" -copy_postfile="-cr $6" -scr_dir=$7 -dcoup=$8 -assem_recov_nthread=$9 -shift 9 # cannot use $10, $11, ... -nthread=$1 -nsolver=$2 -mode=$3 -gpu=$4 - -if [ "$slv" != "" -a "$slv" != "marc" ]; then - slv="-iam sfm" -else - slv="" -fi - -if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then - nprocds="-nprocds $ndom_fea_solver" -else - nprocd="" - if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then - nprocd="-nprocd $ndom_preprocessor" - else - nprocd="" - fi -fi - -if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then -# srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` - case "$srcmeth" in - -) - srcfile="-u $srcfile" - ;; - compsave) - srcfile="-u $srcfile -save y" - ;; - runsaved) - srcfile=${srcfile%.*}".marc" - srcfile="-prog $srcfile" - ;; - esac -else - srcfile="" -fi - -if [ "$restart" != "" -a "$restart" != "-" ]; then - restart=`echo $restart | sed "s/$RSTEXT$//"` - restart="-r $restart" -else - restart="" -fi - -if [ "$postfile" != "" -a "$postfile" != "-" ]; then - postfile=`echo $postfile | sed "s/$PSTEXT$//"` - postfile=`echo $postfile | sed "s/$PSTEXTB$//"` - postfile="-pid $postfile" -else - postfile="" -fi - -if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then - viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` - viewfactorsfile="-vf $viewfactorsfile" -else - viewfactorsfile="" -fi - -if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then - hostfile="-ho $hostfile" -else - hostfile="" -fi - -if [ "$compat" != "" -a "$compat" != "-" ]; then - compat="-co $compat" -else - compat="" -fi - -if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then - scr_dir="-sd $scr_dir" -else - scr_dir="" -fi - -if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then - dcoup="-dcoup $dcoup" -else - dcoup="" -fi - -if [ "$assem_recov_nthread" != "" -a "$assem_recov_nthread" != "1" ]; then - assem_recov_nthread="-nthread_elem $assem_recov_nthread" -else - assem_recov_nthread="" -fi - -if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then - nthread="-nthread $nthread" -else - nthread="" -fi - -if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then - nsolver="-nsolver $nsolver" -else - nsolver="" -fi - -case "$mode" in - 4) mode="-mo i4" ;; - 8) mode="-mo i8" ;; - *) mode= ;; -esac - -if [ "$gpu" != "" -a "$gpu" != "-" ]; then - gpu="-gpu $gpu" -else - gpu="" -fi - -rm -f $job.cnt -rm -f $job.sts -rm -f $job.out -rm -f $job.log - -# To prevent a mismatch with the python version used by the solver -# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH -# unset environment variables PYTHONHOME and PYTHONPATH -unset PYTHONHOME -unset PYTHONPATH - -"${DIR}/tools/run_damask_mp" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ - $srcfile $restart $postfile $viewfactorsfile $hostfile \ - $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ - $assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1 -sleep 1 -exit 0 diff --git a/installation/mods_MarcMentat/2013.1/Mentat_bin/submit6 b/installation/mods_MarcMentat/2013.1/Mentat_bin/submit6 deleted file mode 100644 index 058a00aa1..000000000 --- a/installation/mods_MarcMentat/2013.1/Mentat_bin/submit6 +++ /dev/null @@ -1,186 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=%INSTALLDIR%/marc%VERSION% -if test $MARCDIR1 -then - DIR=$MARCDIR1 -fi - -if test -z "$DIR"; then - REALCOM="`ls -l $0 |awk '{ print $NF; }'`" - DIRSCRIPT=`dirname $REALCOM` - case $DIRSCRIPT in - \/*) - ;; - *) - DIRSCRIPT=`pwd`/$DIRSCRIPT - ;; - esac - . $DIRSCRIPT/getarch - - DIR="$MENTAT_MARCDIR" -fi - -SRCEXT=.f -RSTEXT=.t08 -PSTEXT=.t19 -PSTEXTB=.t16 -VWFCEXT=.vfs - -slv=$1 -version=$2 -ndom_fea_solver=$3 -ndom_preprocessor=$4 -hostfile=$5 -compat=$6 -job=$7 -srcfile=$8 -srcmeth=$9 -shift 9 # cannot use $10, $11, ... -restart=$1 -postfile=$2 -viewfactorsfile=$3 -autorst=$4 -copy_datfile="-ci $5" -copy_postfile="-cr $6" -scr_dir=$7 -dcoup=$8 -assem_recov_nthread=$9 -shift 9 # cannot use $10, $11, ... -nthread=$1 -nsolver=$2 -mode=$3 -gpu=$4 - -if [ "$slv" != "" -a "$slv" != "marc" ]; then - slv="-iam sfm" -else - slv="" -fi - -if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then - nprocds="-nprocds $ndom_fea_solver" -else - nprocd="" - if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then - nprocd="-nprocd $ndom_preprocessor" - else - nprocd="" - fi -fi - -if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then -# srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` - case "$srcmeth" in - -) - srcfile="-u $srcfile" - ;; - compsave) - srcfile="-u $srcfile -save y" - ;; - runsaved) - srcfile=${srcfile%.*}".marc" - srcfile="-prog $srcfile" - ;; - esac -else - srcfile="" -fi - -if [ "$restart" != "" -a "$restart" != "-" ]; then - restart=`echo $restart | sed "s/$RSTEXT$//"` - restart="-r $restart" -else - restart="" -fi - -if [ "$postfile" != "" -a "$postfile" != "-" ]; then - postfile=`echo $postfile | sed "s/$PSTEXT$//"` - postfile=`echo $postfile | sed "s/$PSTEXTB$//"` - postfile="-pid $postfile" -else - postfile="" -fi - -if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then - viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` - viewfactorsfile="-vf $viewfactorsfile" -else - viewfactorsfile="" -fi - -if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then - hostfile="-ho $hostfile" -else - hostfile="" -fi - -if [ "$compat" != "" -a "$compat" != "-" ]; then - compat="-co $compat" -else - compat="" -fi - -if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then - scr_dir="-sd $scr_dir" -else - scr_dir="" -fi - -if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then - dcoup="-dcoup $dcoup" -else - dcoup="" -fi - -if [ "$assem_recov_nthread" != "" -a "$assem_recov_nthread" != "1" ]; then - assem_recov_nthread="-nthread_elem $assem_recov_nthread" -else - assem_recov_nthread="" -fi - -if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then - nthread="-nthread $nthread" -else - nthread="" -fi - -if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then - nsolver="-nsolver $nsolver" -else - nsolver="" -fi - -case "$mode" in - 4) mode="-mo i4" ;; - 8) mode="-mo i8" ;; - *) mode= ;; -esac - -if [ "$gpu" != "" -a "$gpu" != "-" ]; then - gpu="-gpu $gpu" -else - gpu="" -fi - -rm -f $job.cnt -rm -f $job.sts -rm -f $job.out -rm -f $job.log - -# To prevent a mismatch with the python version used by the solver -# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH -# unset environment variables PYTHONHOME and PYTHONPATH -unset PYTHONHOME -unset PYTHONPATH - -"${DIR}/tools/run_damask_lmp" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ - $srcfile $restart $postfile $viewfactorsfile $hostfile \ - $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ - $assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1 -sleep 1 -exit 0 diff --git a/installation/mods_MarcMentat/2013.1/Mentat_bin/submit7 b/installation/mods_MarcMentat/2013.1/Mentat_bin/submit7 deleted file mode 100644 index 59e2b74e3..000000000 --- a/installation/mods_MarcMentat/2013.1/Mentat_bin/submit7 +++ /dev/null @@ -1,186 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=%INSTALLDIR%/marc%VERSION% -if test $MARCDIR1 -then - DIR=$MARCDIR1 -fi - -if test -z "$DIR"; then - REALCOM="`ls -l $0 |awk '{ print $NF; }'`" - DIRSCRIPT=`dirname $REALCOM` - case $DIRSCRIPT in - \/*) - ;; - *) - DIRSCRIPT=`pwd`/$DIRSCRIPT - ;; - esac - . $DIRSCRIPT/getarch - - DIR="$MENTAT_MARCDIR" -fi - -SRCEXT=.f -RSTEXT=.t08 -PSTEXT=.t19 -PSTEXTB=.t16 -VWFCEXT=.vfs - -slv=$1 -version=$2 -ndom_fea_solver=$3 -ndom_preprocessor=$4 -hostfile=$5 -compat=$6 -job=$7 -srcfile=$8 -srcmeth=$9 -shift 9 # cannot use $10, $11, ... -restart=$1 -postfile=$2 -viewfactorsfile=$3 -autorst=$4 -copy_datfile="-ci $5" -copy_postfile="-cr $6" -scr_dir=$7 -dcoup=$8 -assem_recov_nthread=$9 -shift 9 # cannot use $10, $11, ... -nthread=$1 -nsolver=$2 -mode=$3 -gpu=$4 - -if [ "$slv" != "" -a "$slv" != "marc" ]; then - slv="-iam sfm" -else - slv="" -fi - -if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then - nprocds="-nprocds $ndom_fea_solver" -else - nprocd="" - if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then - nprocd="-nprocd $ndom_preprocessor" - else - nprocd="" - fi -fi - -if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then -# srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` - case "$srcmeth" in - -) - srcfile="-u $srcfile" - ;; - compsave) - srcfile="-u $srcfile -save y" - ;; - runsaved) - srcfile=${srcfile%.*}".marc" - srcfile="-prog $srcfile" - ;; - esac -else - srcfile="" -fi - -if [ "$restart" != "" -a "$restart" != "-" ]; then - restart=`echo $restart | sed "s/$RSTEXT$//"` - restart="-r $restart" -else - restart="" -fi - -if [ "$postfile" != "" -a "$postfile" != "-" ]; then - postfile=`echo $postfile | sed "s/$PSTEXT$//"` - postfile=`echo $postfile | sed "s/$PSTEXTB$//"` - postfile="-pid $postfile" -else - postfile="" -fi - -if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then - viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` - viewfactorsfile="-vf $viewfactorsfile" -else - viewfactorsfile="" -fi - -if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then - hostfile="-ho $hostfile" -else - hostfile="" -fi - -if [ "$compat" != "" -a "$compat" != "-" ]; then - compat="-co $compat" -else - compat="" -fi - -if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then - scr_dir="-sd $scr_dir" -else - scr_dir="" -fi - -if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then - dcoup="-dcoup $dcoup" -else - dcoup="" -fi - -if [ "$assem_recov_nthread" != "" -a "$assem_recov_nthread" != "1" ]; then - assem_recov_nthread="-nthread_elem $assem_recov_nthread" -else - assem_recov_nthread="" -fi - -if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then - nthread="-nthread $nthread" -else - nthread="" -fi - -if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then - nsolver="-nsolver $nsolver" -else - nsolver="" -fi - -case "$mode" in - 4) mode="-mo i4" ;; - 8) mode="-mo i8" ;; - *) mode= ;; -esac - -if [ "$gpu" != "" -a "$gpu" != "-" ]; then - gpu="-gpu $gpu" -else - gpu="" -fi - -rm -f $job.cnt -rm -f $job.sts -rm -f $job.out -rm -f $job.log - -# To prevent a mismatch with the python version used by the solver -# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH -# unset environment variables PYTHONHOME and PYTHONPATH -unset PYTHONHOME -unset PYTHONPATH - -"${DIR}/tools/run_damask_h" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ - $srcfile $restart $postfile $viewfactorsfile $hostfile \ - $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ - $assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1 -sleep 1 -exit 0 diff --git a/installation/mods_MarcMentat/2013.1/Mentat_bin/submit8 b/installation/mods_MarcMentat/2013.1/Mentat_bin/submit8 deleted file mode 100644 index f8fe07a7d..000000000 --- a/installation/mods_MarcMentat/2013.1/Mentat_bin/submit8 +++ /dev/null @@ -1,186 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=%INSTALLDIR%/marc%VERSION% -if test $MARCDIR1 -then - DIR=$MARCDIR1 -fi - -if test -z "$DIR"; then - REALCOM="`ls -l $0 |awk '{ print $NF; }'`" - DIRSCRIPT=`dirname $REALCOM` - case $DIRSCRIPT in - \/*) - ;; - *) - DIRSCRIPT=`pwd`/$DIRSCRIPT - ;; - esac - . $DIRSCRIPT/getarch - - DIR="$MENTAT_MARCDIR" -fi - -SRCEXT=.f -RSTEXT=.t08 -PSTEXT=.t19 -PSTEXTB=.t16 -VWFCEXT=.vfs - -slv=$1 -version=$2 -ndom_fea_solver=$3 -ndom_preprocessor=$4 -hostfile=$5 -compat=$6 -job=$7 -srcfile=$8 -srcmeth=$9 -shift 9 # cannot use $10, $11, ... -restart=$1 -postfile=$2 -viewfactorsfile=$3 -autorst=$4 -copy_datfile="-ci $5" -copy_postfile="-cr $6" -scr_dir=$7 -dcoup=$8 -assem_recov_nthread=$9 -shift 9 # cannot use $10, $11, ... -nthread=$1 -nsolver=$2 -mode=$3 -gpu=$4 - -if [ "$slv" != "" -a "$slv" != "marc" ]; then - slv="-iam sfm" -else - slv="" -fi - -if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then - nprocds="-nprocds $ndom_fea_solver" -else - nprocd="" - if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then - nprocd="-nprocd $ndom_preprocessor" - else - nprocd="" - fi -fi - -if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then -# srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` - case "$srcmeth" in - -) - srcfile="-u $srcfile" - ;; - compsave) - srcfile="-u $srcfile -save y" - ;; - runsaved) - srcfile=${srcfile%.*}".marc" - srcfile="-prog $srcfile" - ;; - esac -else - srcfile="" -fi - -if [ "$restart" != "" -a "$restart" != "-" ]; then - restart=`echo $restart | sed "s/$RSTEXT$//"` - restart="-r $restart" -else - restart="" -fi - -if [ "$postfile" != "" -a "$postfile" != "-" ]; then - postfile=`echo $postfile | sed "s/$PSTEXT$//"` - postfile=`echo $postfile | sed "s/$PSTEXTB$//"` - postfile="-pid $postfile" -else - postfile="" -fi - -if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then - viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` - viewfactorsfile="-vf $viewfactorsfile" -else - viewfactorsfile="" -fi - -if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then - hostfile="-ho $hostfile" -else - hostfile="" -fi - -if [ "$compat" != "" -a "$compat" != "-" ]; then - compat="-co $compat" -else - compat="" -fi - -if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then - scr_dir="-sd $scr_dir" -else - scr_dir="" -fi - -if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then - dcoup="-dcoup $dcoup" -else - dcoup="" -fi - -if [ "$assem_recov_nthread" != "" -a "$assem_recov_nthread" != "1" ]; then - assem_recov_nthread="-nthread_elem $assem_recov_nthread" -else - assem_recov_nthread="" -fi - -if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then - nthread="-nthread $nthread" -else - nthread="" -fi - -if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then - nsolver="-nsolver $nsolver" -else - nsolver="" -fi - -case "$mode" in - 4) mode="-mo i4" ;; - 8) mode="-mo i8" ;; - *) mode= ;; -esac - -if [ "$gpu" != "" -a "$gpu" != "-" ]; then - gpu="-gpu $gpu" -else - gpu="" -fi - -rm -f $job.cnt -rm -f $job.sts -rm -f $job.out -rm -f $job.log - -# To prevent a mismatch with the python version used by the solver -# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH -# unset environment variables PYTHONHOME and PYTHONPATH -unset PYTHONHOME -unset PYTHONPATH - -"${DIR}/tools/run_damask" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ - $srcfile $restart $postfile $viewfactorsfile $hostfile \ - $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ - $assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1 -sleep 1 -exit 0 diff --git a/installation/mods_MarcMentat/2013.1/Mentat_bin/submit9 b/installation/mods_MarcMentat/2013.1/Mentat_bin/submit9 deleted file mode 100644 index b6dcb75be..000000000 --- a/installation/mods_MarcMentat/2013.1/Mentat_bin/submit9 +++ /dev/null @@ -1,186 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=%INSTALLDIR%/marc%VERSION% -if test $MARCDIR1 -then - DIR=$MARCDIR1 -fi - -if test -z "$DIR"; then - REALCOM="`ls -l $0 |awk '{ print $NF; }'`" - DIRSCRIPT=`dirname $REALCOM` - case $DIRSCRIPT in - \/*) - ;; - *) - DIRSCRIPT=`pwd`/$DIRSCRIPT - ;; - esac - . $DIRSCRIPT/getarch - - DIR="$MENTAT_MARCDIR" -fi - -SRCEXT=.f -RSTEXT=.t08 -PSTEXT=.t19 -PSTEXTB=.t16 -VWFCEXT=.vfs - -slv=$1 -version=$2 -ndom_fea_solver=$3 -ndom_preprocessor=$4 -hostfile=$5 -compat=$6 -job=$7 -srcfile=$8 -srcmeth=$9 -shift 9 # cannot use $10, $11, ... -restart=$1 -postfile=$2 -viewfactorsfile=$3 -autorst=$4 -copy_datfile="-ci $5" -copy_postfile="-cr $6" -scr_dir=$7 -dcoup=$8 -assem_recov_nthread=$9 -shift 9 # cannot use $10, $11, ... -nthread=$1 -nsolver=$2 -mode=$3 -gpu=$4 - -if [ "$slv" != "" -a "$slv" != "marc" ]; then - slv="-iam sfm" -else - slv="" -fi - -if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then - nprocds="-nprocds $ndom_fea_solver" -else - nprocd="" - if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then - nprocd="-nprocd $ndom_preprocessor" - else - nprocd="" - fi -fi - -if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then -# srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` - case "$srcmeth" in - -) - srcfile="-u $srcfile" - ;; - compsave) - srcfile="-u $srcfile -save y" - ;; - runsaved) - srcfile=${srcfile%.*}".marc" - srcfile="-prog $srcfile" - ;; - esac -else - srcfile="" -fi - -if [ "$restart" != "" -a "$restart" != "-" ]; then - restart=`echo $restart | sed "s/$RSTEXT$//"` - restart="-r $restart" -else - restart="" -fi - -if [ "$postfile" != "" -a "$postfile" != "-" ]; then - postfile=`echo $postfile | sed "s/$PSTEXT$//"` - postfile=`echo $postfile | sed "s/$PSTEXTB$//"` - postfile="-pid $postfile" -else - postfile="" -fi - -if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then - viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` - viewfactorsfile="-vf $viewfactorsfile" -else - viewfactorsfile="" -fi - -if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then - hostfile="-ho $hostfile" -else - hostfile="" -fi - -if [ "$compat" != "" -a "$compat" != "-" ]; then - compat="-co $compat" -else - compat="" -fi - -if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then - scr_dir="-sd $scr_dir" -else - scr_dir="" -fi - -if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then - dcoup="-dcoup $dcoup" -else - dcoup="" -fi - -if [ "$assem_recov_nthread" != "" -a "$assem_recov_nthread" != "1" ]; then - assem_recov_nthread="-nthread_elem $assem_recov_nthread" -else - assem_recov_nthread="" -fi - -if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then - nthread="-nthread $nthread" -else - nthread="" -fi - -if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then - nsolver="-nsolver $nsolver" -else - nsolver="" -fi - -case "$mode" in - 4) mode="-mo i4" ;; - 8) mode="-mo i8" ;; - *) mode= ;; -esac - -if [ "$gpu" != "" -a "$gpu" != "-" ]; then - gpu="-gpu $gpu" -else - gpu="" -fi - -rm -f $job.cnt -rm -f $job.sts -rm -f $job.out -rm -f $job.log - -# To prevent a mismatch with the python version used by the solver -# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH -# unset environment variables PYTHONHOME and PYTHONPATH -unset PYTHONHOME -unset PYTHONPATH - -"${DIR}/tools/run_damask_l" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ - $srcfile $restart $postfile $viewfactorsfile $hostfile \ - $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ - $assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1 -sleep 1 -exit 0 diff --git a/installation/mods_MarcMentat/2013.1/Mentat_menus/job_run.ms b/installation/mods_MarcMentat/2013.1/Mentat_menus/job_run.ms deleted file mode 100644 index 630c23b1b..000000000 --- a/installation/mods_MarcMentat/2013.1/Mentat_menus/job_run.ms +++ /dev/null @@ -1,3215 +0,0 @@ -#ifndef AUTOFORGE -popmenu job_title_pm file jobs.ms -popdown job_title_ok file jobs.ms -#ifndef QT_MENTAT -popmenu marc_input_style_pm file job_common.ms -popmenu marc_input_style_run_adv_pm file job_common.ms -popmenu marc_version_run_pm file job_common.ms -#endif - -group job_solver_gr file job_common.ms -group user_domains_gr file domain_decomposition.ms -group user_domains_generate_gr file domain_decomposition.ms -group user_domains_tail_gr file domain_decomposition.ms -group job_solver_opts_gr file job_common.ms -popmenu ddm_options file job_common.ms - -#ifdef QT_MENTAT -browser edit_browser file file.ms -browser directory_browser file file.ms -screen domains file domain_decomposition.ms -#else -popmenu edit_browser_popmenu file file.ms -popmenu directory_browser_popmenu file file.ms -#endif - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu usersub_file_browser_pm { - - group { -#endif - - browser usersub_file_browser { - position 0 0 - size 82 72 - text "$usersub_file_browser_label" ($usersub_file_browser_label) - filter "*.f *.f90" - nvisible 10 - select_files true - cancel_action popdown - ok_action popdown - command "$usersub_file_browser_command" ($usersub_file_browser_command) - } -#ifndef QT_MENTAT - } - - window { - title " Select MARC User Subroutine File" - origin 30 30 - size 82 72 - } - - mode dialog - disable_right_mouse_button -} -#endif - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu host_file_browser_pm { - - group { -#endif - - browser host_file_browser { - position 0 0 - size 82 72 - text "$host_file_browser_label" ($host_file_browser_label) - filter "*" - nvisible 10 - select_files true - cancel_action popdown - ok_action popdown - command "$host_file_browser_command" ($host_file_browser_command) - } -#ifndef QT_MENTAT - } - - window { - title " Select MARC Host File" - origin 30 30 - size 82 72 - } - - mode dialog - disable_right_mouse_button -} -#endif - - -#-------------------------------------------------------------------------------------------------- -popmenu job_run_popmenu { - -#ifdef QT_MENTAT - text "RUN JOB" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 52 4 - text "RUN JOB" - } -#endif - -#ifdef QT_MENTAT - label { - position 0 0 - size 6 4 - text "NAME" - } - - display { - position +6 = - size 26 4 - display "job_name" - } - - label { - position 0 +4 - size 6 4 - text "TYPE" - } - - display { - position +6 = - size 26 4 - display job_class_label - } -#endif - - button { -#ifdef QT_MENTAT - position 1 9 -#else - position 1 5 -#endif - size 24 4 - text "USER SUBROUTINE FILE" -#ifdef QT_MENTAT - browser usersub_file_browser -#else - popmenu usersub_file_browser_pm -#endif - settext $usersub_file_browser_label "SELECT USER SUBROUTINE FILE" - set $usersub_file_browser_command "*job_usersub_file" - help job_usersub_file - } - - toggle { - position +26 = - size 22 4 - text "SELECTED USER SUBS" - toggle job_usersubs - help job_run_seluser - visible job_usersubs - popmenu job_usersub_pm - } - - display { - position 1 +4 - size 50 4 - display job_usersub_file - } - - button { - position 1 +4 - size 12 4 - text "EDIT" - command "*job_edit_usersub_file" - visible job_usersub_file - } - - button { - position +12 = - size 12 4 - text "CLEAR" - command "*job_clear_usersub_file" - visible job_usersub_file - } - - roller { - position +12 = - size 26 4 - nvalues 3 - texts "COMPILE / NO SAVE" - "COMPILE AND SAVE" - "RUN SAVED EXECUTABLE" - help job_run_compile - roller "job_option user_source" - visible job_usersub_file -#ifdef QT_MENTAT - commands "*job_option user_source:compile_nosave" - "*job_option user_source:compile_save" - "*job_option user_source:run_saved" -#else - popmenu job_user_source_pm -#endif - } - - toggle { - position 1 +6 - size 22 4 - text "PARALLELIZATION/\{GPU}" - help job_run_parallel - toggle "or(*job_option parallel:on, \ - *job_option assem_recov_multi_threading:on, \ - solver_multi_procs, \ - solver_multi_threads, \ - and(job_solver_mfront_sparse,\ - job_nonsym_off,\ - *job_option solver_use_gpu:on))" - popmenu job_run_parallelization_pm - set $popname2 "job_run_parallelization_pm" - } - - frame { - position +22 = - size 28 16 - border_width 1 - border_color black - - group { - - display { - position 0 0 - size 28 4 - display job_ddm_domains - } - - display { - position = +4 - size 28 4 - display job_assem_recov_nthreads - } - - display { - position = +4 - size 28 4 - display job_solver_procs - visible solver_allows_multi_procs - } - - display { - position = = - size 28 4 - display job_solver_threads - visible "and(solver_allows_multi_threads,\ - not(and(job_solver_mfront_sparse,\ - *job_option parallel:on)))" - } - - display { - position = +4 - size 28 4 - display job_solver_gpu - visible "and(job_solver_mfront_sparse,job_nonsym_off)" - } - } - } - - button { - position 1 +18 - size 8 4 - text "TITLE" - popmenu job_title_pm - command "*job_title" - } - -# see also job_common.ms -# see also the ADVANCED JOB SUBMISSION popmenu in this file - - label { - position +10 = - size 7 4 - text "STYLE" - border_width 1 - border_color black - } - - roller { - position +7 = - size 18 4 - nvalues 3 - texts "TABLE-DRIVEN" - "MULTI-PHYSICS" - "OLD" - rollers "job_input_style_table_driven" - "job_input_style_multi_physics" - "job_input_style_old" -#ifdef QT_MENTAT - commands "*job_option input_style:new *job_option input_physics_style:old" - "*job_option input_physics_style:new *job_option input_style:new" - "*job_option input_style:old *job_option input_physics_style:old" - visibles "job_allows_input_style_table_driven" - "job_allows_input_style_multi_physics" - "job_allows_input_style_old" -#else - popmenu marc_input_style_pm -#endif - help job_option_input_style - } - - button { - position +20 = - size 13 4 - text "SAVE MODEL" - command "*save_model" - } - - button { - position 1 +6 - size 16 6 - text "SUBMIT (1)" - command "*submit_job 1 *monitor_job" - } - - button { - position +16 = - size 16 6 - text "ADV. JOB SUBM." - popmenu job_submit_adv_pm - } - - button { - position +16 = - size 18 6 - text "DAMASK" - popmenu damask - } - - button { - position 1 +6 - size 16 6 - text "UPDATE" - command "*update_job" - } - - button { - position +16 = - size 16 6 - text "MONITOR" - command "*monitor_job" - } - - button { - position +16 = - size 18 6 - text "KILL" - command "*kill_job *monitor_job" - } - - label { - position 1 +7 - size 32 4 - text "STATUS" - border_width 1 - border_color black - } - - display { - position +32 = - size 18 4 - display "job_status" - } - - label { - position -32 +4 - size 32 4 - text "CURRENT INCREMENT (CYCLE)" - border_width 1 - border_color black - } - - display { - position +32 = - size 18 4 - display "job_increment" - } - - label { - position -32 +4 - size 32 4 - text "SINGULARITY RATIO" - border_width 1 - border_color black - } - - float { - position +32 = - size 18 4 - display "job_singularity_ratio" - } - - label { - position -32 +4 - size 32 4 - text "CONVERGENCE RATIO" - border_width 1 - border_color black - } - - float { - position +32 = - size 18 4 - display "job_convergence_ratio" - } - - label { - position 1 +4 - size 32 4 - text "ANALYSIS TIME" - border_width 1 - border_color black - } - - float { - position +32 = - size 18 4 - display "job_analysis_time" - } - - label { - position -32 +4 - size 32 4 - text "WALL TIME" - border_width 1 - border_color black - } - - float { - position +32 = - size 18 4 - display "job_time" - } - - frame { - position 1 +4 - size 50 8 - - group { - - frame { - position 0 0 - size 50 8 - text "TOTAL" - border_width 1 - border_color black - group { - - label { - position +6 = - size 13 4 - text "CYCLES" - border_width 1 - border_color black - } - - integer { - position +13 = - size 10 4 - display "acc_job_cycles" - border_width 1 - border_color black - } - - label { - position -13 +4 - size 13 4 - text "SEPARATIONS" - border_width 1 - border_color black - } - - integer { - position +13 = - size 10 4 - display "acc_job_separations" - border_width 1 - border_color black - } - - label { - position +10 -4 - size 11 4 - text "CUT BACKS" - border_width 1 - border_color black - } - - integer { - position +11 = - size 10 4 - display "acc_job_cut_backs" - border_width 1 - border_color black - } - - label { - position -11 +4 - size 11 4 - text "REMESHES" - border_width 1 - border_color black - } - - integer { - position +11 = - size 10 4 - display "acc_job_remeshes" - border_width 1 - border_color black - } - } - } - } - } - - label { - position 1 +8 - size 19 4 - text "EXIT NUMBER" - border_width 1 - border_color black - } - - integer { - position +19 = - size 10 4 - display "job_exit" - } - - button { - position +10 = - size 21 4 - text "EXIT MESSAGE" - popmenu job_exit_msg_pm - help exit_message - } - - label { - position 1 +6 - size 7 4 - text "EDIT" - border_width 1 - border_color black - } - - button { - position +7 = - size 12 4 - text "OUTPUT FILE" - command "*job_edit_output" - } - - button { - position +12 = - size 9 4 - text "LOG FILE" - command "*job_edit_log_file" - } - - button { - position +9 = - size 12 4 - text "STATUS FILE" - command "*job_edit_status_file" - } - - button { - position +12 = - size 10 4 - text "ANY FILE" - settext $edit_browser_label "EDIT FILE" - set $edit_browser_command "*edit_file" -#ifdef QT_MENTAT - browser edit_browser -#else - popmenu edit_browser_popmenu -#endif - help edit_file - } - - popdown { - position 1 +6 - size 32 4 -#ifdef QT_MENTAT - text "OPEN POST FILE (MODEL PLOT RESULTS MENU)" - command "@popdown(job_properties_pm) @main(results) @popup(modelplot_pm) *post_open_default" -#else - text "OPEN POST FILE (RESULTS MENU)" - screen results - command "*post_open_default" -#endif - } - - button { - position 1 +6 - size 12 8 - text "RESET" - command "*job_submit_reset" - } - - popdown { - position +38 = - size 12 8 - text "OK" - } - } - - window job_run_wi { - parent mentat - origin 35 1 - size 52 115 - background_color body - border_width 1 - border_color border - buffering single - } - -#ifdef QT_MENTAT - mode permanent -#else - mode dialog -#endif -} - - -#-------------------------------------------------------------------------------------------------- -popmenu job_usersub_pm { - -#ifdef QT_MENTAT - text "CURRENTLY SELECTED USER SUBROUTINES" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 66 4 - text "CURRENTLY SELECTED USER SUBROUTINES" - } -#endif - - display { - position 1 +5 - size 64 86 - display "job_usersubs" - } - - popdown { - position 27 +88 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 38 8 - size 66 102 - background_color body - border_width 1 - border_color border - buffering single - } - - mode dialog -} - - -#-------------------------------------------------------------------------------------------------- -popmenu job_submit_adv_pm { - -#ifdef QT_MENTAT - text "ADVANCED JOB SUBMISSION" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 50 4 - text "ADVANCED JOB SUBMISSION" - } -#endif - -#ifdef QT_MENTAT - label { - position 0 0 - size 6 4 - text "NAME" - } - - display { - position +6 = - size 26 4 - display "job_name" - } - - label { - position 0 +4 - size 6 4 - text "TYPE" - } - - display { - position +6 = - size 26 4 - display job_class_label - } -#endif - - label { -#ifdef QT_MENTAT - position 1 9 -#else - position 1 5 -#endif - size 19 4 - text "INITIAL ALLOCATION" - border_width 1 - border_color black - } -#ifdef QT_MENTAT - label { - position +19 = - size 15 4 - text "GENERAL MEMORY" - help job_param_general_init_allocation - } -#else - button { - position +19 = - size 15 4 - text "GENERAL MEMORY" - help job_param_general_init_allocation - command "*job_param general_init_allocation" - } -#endif - text { - position +15 = - size 10 4 - display "job_param_value_general_init_allocation" - command "*job_param general_init_allocation" - help job_param_general_init_allocation - } - - label { - position +10 = - size 4 4 - text "MB" - border_width 1 - border_color black - } - - toggle { - position 1 +5 - size 32 4 - text "OUT-OF-CORE ELEMENT STORAGE" - help job_param_elsto - toggle "*job_option elsto:on" - true_command "*job_option elsto:on" - false_command "*job_option elsto:off" - } - - toggle { - position 1 +4 - size 32 4 - text "OUT-OF-CORE INCREMENTAL BACKUP" - help job_param_inc_backup_storage - toggle "*job_option inc_backup_storage:out_of_core" - true_command "*job_option inc_backup_storage:out_of_core" - false_command "*job_option inc_backup_storage:in_core" - } - - toggle { - position +34 = - size 14 4 - text "CHECK SIZES" - help job_run_check - toggle "*job_option check:on" - true_command "*job_option check:on" - false_command "*job_option check:off" - } - - label { - position 1 +6 - size 16 4 - text "INTEGER SIZE" - border_width 1 - border_color black - } - - roller { - position +16 = - size 32 4 - nvalues 3 - texts "DEFAULT" - "4-BYTE INTEGERS" - "8-BYTE INTEGERS" -#ifdef QT_MENTAT - commands "*job_option marc_integer_size:default" - "*job_option marc_integer_size:i4" - "*job_option marc_integer_size:i8" -#else - popmenu marc_integer_size_pm -#endif - help job_run_intsize - roller "job_option marc_integer_size" - } - - frame { - position 1 +6 - size 48 12 - text "MARC INPUT FILE" - border_width 1 - border_color black - - group { - - label { - position 0 4 - size 9 4 - text "VERSION" - border_width 1 - border_color black - } - - roller { - position +9 = - size 14 4 - nvalues 17 - nvisible 17 - texts "DEFAULT" -#if 0 - "2013.1" -#endif - "2013" - "2012" - "2011" - "2010.2" - "2010" - "2008" - "2007" - "2005R3" - "2005" - "2003" - "2001" - "2000" -#if 0 - "8" -#endif - "K7" - "K6.2" - "K5" - "K4" - help job_param_version - rollers "job_input_version_default" -#if 0 - "job_input_version_2013.1" -#endif - "job_input_version_2013" - "job_input_version_2012" - "job_input_version_2011" - "job_input_version_2010.2" - "job_input_version_2010" - "job_input_version_2008" - "job_input_version_2007" - "job_input_version_2005r3" - "job_input_version_2005" - "job_input_version_2003" - "job_input_version_2001" - "job_input_version_2000" -#if 0 - "job_input_version_8" -#endif - "job_input_version_k7" - "job_input_version_k6" - "job_input_version_k5" - "job_input_version_k4" -#ifdef QT_MENTAT - commands "*job_option version:default" -#if 0 - "*job_option version:2013.1" -#endif - "*job_option version:2013" - "*job_option version:2012" - "*job_option version:2011" - "*job_option version:2010.2" - "*job_option version:2010" - "*job_option version:2008" - "*job_option version:2007" - "*job_option version:2005r3" - "*job_option version:2005" - "*job_option version:2003" - "*job_option version:2001" - "*job_option version:2000" -#if 0 - "*job_option version:8" -#endif - "*job_option version:k7" - "*job_option version:k6" - "*job_option version:k5" - "*job_option version:k4" - visibles "job_allows_input_version_default" -#if 0 - "job_allows_input_version_2013.1" -#endif - "job_allows_input_version_2013" - "job_allows_input_version_2012" - "job_allows_input_version_2011" - "job_allows_input_version_2010.2" - "job_allows_input_version_2010" - "job_allows_input_version_2008" - "job_allows_input_version_2007" - "job_allows_input_version_2005r3" - "job_allows_input_version_2005" - "job_allows_input_version_2003" - "job_allows_input_version_2001" - "job_allows_input_version_2000" -#if 0 - "job_allows_input_version_8" -#endif - "job_allows_input_version_k7" - "job_allows_input_version_k6" - "job_allows_input_version_k5" - "job_allows_input_version_k4" -#else - popmenu marc_version_run_pm -#endif - } - -# see also job_common.ms -# see also the RUN JOB popmenu in this file - - label { - position +14 = - size 7 4 - text "STYLE" - border_width 1 - border_color black - } - - roller { - position +7 = - size 18 4 - nvalues 3 - texts "TABLE-DRIVEN" - "MULTI-PHYSICS" - "OLD" - rollers "job_input_style_table_driven" - "job_input_style_multi_physics" - "job_input_style_old" -#ifdef QT_MENTAT - commands "*job_option input_style:new *job_option input_physics_style:old" - "*job_option input_physics_style:new *job_option input_style:new" - "*job_option input_style:old *job_option input_physics_style:old" - visibles "job_allows_input_style_table_driven" - "job_allows_input_style_multi_physics" - "job_allows_input_style_old" -#else - popmenu marc_input_style_run_adv_pm -#endif - help job_option_input_style - } - - toggle { - position 0 +4 - size 48 4 - text "EXTENDED PRECISION" - help job_run_precision - toggle "*job_option inp_file_prec:extended" - true_command "*job_option inp_file_prec:extended" - false_command "*job_option inp_file_prec:normal" - } - } - } - - button { - position 1 +14 - size 24 4 - text "SCRATCH DIRECTORY" - settext $directory_browser_label "JOB SCRATCH DIRECTORY" - set $directory_browser_command "*job_scratch_directory" -#ifdef QT_MENTAT - browser directory_browser -#else - popmenu directory_browser_popmenu -#endif - help job_scratch_directory - } - - button { - position +24 = - size 24 4 - text "CLEAR" - command "*job_clear_scratch_directory" - visible job_scratch_directory - } - - text { - position 1 +4 - size 48 4 - display job_scratch_dir - command "*job_scratch_directory" - } - -#ifdef DCOM - toggle { - position 1 +6 - size 8 4 - text "\{DCOM}" - toggle "*job_option dcom:on" - help job_run_dcom - true_command "*job_option dcom:on" - false_command "*job_option dcom:off" - visible win32_available - } - - button { - position +8 = - size 12 4 - text "HOSTNAME" - command "*job_dcom_hostname" - visible "and(win32_available, *job_option dcom:on)" - } - - text job_dcom_hostname { - position +12 = - size 28 4 - display "job_dcom_hostname" - command "*job_dcom_hostname" - visible "and(win32_available, *job_option dcom:on)" - } -#endif - - button { - position 1 +6 - size 24 4 - text "TITLE" - popmenu job_title_pm - command "*job_title" - } - - button { - position +24 = - size 24 4 - text "SAVE MODEL" - command "*save_model" - } - - button { - position +4 +6 - size 20 4 - text "WRITE INPUT FILE" - command "*job_write_input" - } - - button { - position = +4 - size 20 4 - text "EDIT INPUT FILE" - command "*job_edit_input" - } - - popdown { - position 1 +5 - size 20 6 - text "SUBMIT 1" - command "*submit_job 1 *monitor_job" - } - - popdown { - position +28 = - size 20 6 - text "EXECUTE 1" - command "*execute_job 1 *monitor_job" - } - - popdown { - position -28 +6 - size 20 6 - text "SUBMIT 2" - command "*submit_job 2 *monitor_job" - } - - popdown { - position +28 = - size 20 6 - text "EXECUTE 2" - command "*execute_job 2 *monitor_job" - } - - popdown { - position -28 +6 - size 20 6 - text "SUBMIT 3" - command "*submit_job 3 *monitor_job" - } - - popdown { - position +28 = - size 20 6 - text "EXECUTE 3" - command "*execute_job 3 *monitor_job" - } - - popdown { - position 19 +8 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 38 8 -#ifdef DCOM - size 50 100 -#else - size 50 94 -#endif - background_color body - border_width 1 - border_color border - buffering single - } - -#ifdef QT_MENTAT - mode permanent -#else - mode dialog -#endif -} - -#-------------------------------------------------------------------------------------------------- -popmenu damask { - -#ifdef QT_MENTAT - text "DAMASK.MPIE.DE" -#endif - - group { -#ifndef QT_MENTAT - label { - position 0 0 - size 50 4 - text "DAMASK.MPIE.DE" - } -#endif - - label { - position 1 6 - size 13 6 - text "Optimzation" - border_width 1 - border_color black - } - - label { - position +13 = - size 20 6 - text "write Input" - border_width 1 - border_color black - } - - label { - position +18 = - size 30 6 - text "do not write Inp." - border_width 1 - border_color black - } - - label { - position -32 +6 - size 12 6 - text "O2 / OpenMP" - border_width 1 - border_color black - } - - popdown { - position +12 = - size 20 6 - text "Submit" - command "*submit_job 4 *monitor_job" - } - - popdown { - position +20 = - size 20 6 - text "Execute" - command "*execute_job 4 *monitor_job" - } - - label { - position -32 +6 - size 12 6 - text "O1 / OpenMP" - border_width 1 - border_color black - } - - popdown { - position +12 = - size 20 6 - text "Submit" - command "*submit_job 5 *monitor_job" - } - - popdown { - position +20 = - size 20 6 - text "Execute" - command "*execute_job 5 *monitor_job" - } - - label { - position -32 +6 - size 12 6 - text "O0 / OpenMP" - border_width 1 - border_color black - } - - popdown { - position +12 = - size 20 6 - text "Submit" - command "*submit_job 6 *monitor_job" - } - - popdown { - position +20 = - size 20 6 - text "Execute" - command "*execute_job 6 *monitor_job" - } - - popdown { - position 19 +8 - size 12 8 - text "CANCEL" - } -} - - - - window { - parent mentat - origin 38 8 -#ifdef DCOM - size 50 100 -#else - size 50 94 -#endif - background_color body - border_width 1 - border_color border - buffering single - } - mode dialog -} - -#-------------------------------------------------------------------------------------------------- -popmenu job_exit_msg_pm { - -#ifdef QT_MENTAT - text "EXIT MESSAGE" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 86 4 - text "EXIT MESSAGE" - } - - display { - position 1 5 - size 84 74 - display "job_exit_msg" - } -#endif - -#ifdef QT_MENTAT - - text { - position 1 5 - size 84 74 - multiline - readonly - display "job_exit_msg" - } - -#endif - popdown { - position 37 +76 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 38 8 - size 86 90 - background_color body - border_width 1 - border_color border - buffering single - } - - mode dialog -} - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu job_user_source_pm { - - window { - parent job_run_wi - origin 25 17 - size 26 17 - border_width 1 - border_color border - background_color body - } - mode dialog - - group job_user_source_gr -} - - -#-------------------------------------------------------------------------------------------------- -group job_user_source_gr { - popdown { - position 0 0 - size 26 4 - text "COMPILE / NO SAVE" - command "*job_option user_source:compile_nosave" - } - - popdown { - position = +4 - size 26 4 - text "COMPILE AND SAVE" - command "*job_option user_source:compile_save" - } - - popdown { - position = +4 - size 26 4 - text "RUN SAVED EXECUTABLE" - command "*job_option user_source:run_saved" - } - - popdown { - position = +5 - size 26 4 - text "CANCEL" - } -} -#endif - - -#-------------------------------------------------------------------------------------------------- -popmenu job_run_parallelization_pm { - -#ifdef QT_MENTAT - text "PARALLELIZATION/\{GPU}" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 60 4 - text "PARALLELIZATION/GPU" - } -#endif - -#ifdef QT_MENTAT - label { - position 0 0 - size 6 4 - text "NAME" - } - - display { - position +6 = - size 26 4 - display "job_name" - } - - label { - position 0 +4 - size 6 4 - text "TYPE" - } - - display { - position +6 = - size 26 4 - display job_class_label - } -#endif - - frame { -#ifdef QT_MENTAT - position 1 9 -#else - position 1 5 -#endif - size 48 28 - group job_ddm_gr - text "DOMAIN DECOMPOSITION" - border_width 1 - border_color black - } - - frame { - position 1 +29 - size 36 13 - group job_assem_recov_gr - text "ASSEMBLY AND RECOVERY" - border_width 1 - border_color black - } - - frame { - position 1 +14 - size 58 31 - group job_parallel_matrix_solver_gr - text "MATRIX SOLVER" - border_width 1 - border_color black - } - - frame { - position 1 +32 - size 48 28 - group job_parallel_env_gr - text "PARALLELIZATION ENVIRONMENT" - border_width 1 - border_color black - visible "or(*job_option parallel:on, \ - solver_multi_procs)" - } - - popdown { - position 24 +30 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 38 1 - size 60 119 - background_color body - border_width 1 - border_color border - buffering single - } -#ifdef QT_MENTAT - mode permanent -#else - mode dialog -#endif -} - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_gr { - - toggle { - position 1 4 - size 30 4 - text "USE \{DDM}" - toggle "*job_option parallel:on" - help job_run_ddm_use - true_command "*job_option parallel:on" - false_command "*job_option parallel:off" - } - - frame { - position +2 +5 - size 44 18 - group job_ddm_use_gr - visible "*job_option parallel:on" - } -} - -group job_ddm_use_gr { - roller { - position 0 0 - size 30 4 - nvalues 2 - texts "DECOMPOSITION IN MARC" - "DECOMPOSITION IN MENTAT" - roller "job_option ddm_generator" -#ifdef QT_MENTAT - commands "*job_option ddm_generator:fea_solver" - "*job_option ddm_generator:preprocessor" -#else - popmenu job_ddm_generator_pm -#endif - help job_run_ddm_generator - } - - frame { - position 0 +5 - size 44 8 - group job_ddm_fea_solver_gr - visible "*job_option ddm_generator:fea_solver" - } - - frame { - position = = - size 44 8 - group job_ddm_preprocessor_gr - visible "*job_option ddm_generator:preprocessor" - } - - text { - position 0 +9 - size 22 4 -#ifdef QT_MENTAT - text "Single Input File" -#else - text "SINGLE INPUT FILE" -#endif - readonly - visible "*job_option ddm_generator:fea_solver" - } - - roller { - position = = - size 22 4 - nvalues 2 - texts "MULTIPLE INPUT FILES" - "SINGLE INPUT FILE" - roller "job_option ddm_single_input" - commands "*job_option ddm_single_input:off" - "*job_option ddm_single_input:on" - visible "*job_option ddm_generator:preprocessor" - help job_run_ddm_single_input - } - - roller { - position +23 = - size 21 4 - nvalues 2 - texts "MULTIPLE POST FILES" - "SINGLE POST FILE" - roller "job_option ddm_single_post" - commands "*job_option ddm_single_post:off" - "*job_option ddm_single_post:on" - help job_run_ddm_single_post - } -} - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu job_ddm_generator_pm { - - window { - parent mentat - origin 42 19 - size 30 13 - border_width 1 - border_color border - background_color body - } - - mode dialog - - group job_ddm_generator_gr -} - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_generator_gr { - - popdown { - position 0 0 - size 30 4 - text "DECOMPOSITION IN MARC" - command "*job_option ddm_generator:fea_solver" - help job_run_ddm_generator - } - - popdown { - position = +4 - size 30 4 - text "DECOMPOSITION IN MENTAT" - command "*job_option ddm_generator:preprocessor" - help job_run_ddm_generator - } - - popdown { - position = +5 - size 30 4 - text "CANCEL" - help job_run_ddm_generator - } -} -#endif - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_fea_solver_gr { - -#ifdef QT_MENTAT - label { - position 0 0 - size 10 4 - text "# DOMAINS" - help job_param - } -#else - button { - position 0 0 - size 10 4 - text "# DOMAINS" - command "*job_param ndomains" - } -#endif - - text { - position +10 = - size 4 4 - display "job_param_value_ndomains" - command "*job_param ndomains" - } - - label { - position +4 = - size 7 4 - text "METHOD" - border_width 1 - border_color black - } - - roller { - position +7 = - size 23 4 - nvalues 7 - texts "METIS BEST" - "METIS ELEMENT" - "METIS NODE" - "REC. COORD. BISECTION" - "VECTOR" - "RADIAL" - "ANGULAR" - help set_job_decomp_type - rollers "*job_option ddm_method:metis_best" - "*job_option ddm_method:metis_element_based" - "*job_option ddm_method:metis_node_based" - "*job_option ddm_method:recur_coord_bisect" - "*job_option ddm_method:vector" - "*job_option ddm_method:radial" - "*job_option ddm_method:angular" -#ifdef QT_MENTAT - commands "*job_option ddm_method:metis_best" - "*job_option ddm_method:metis_element_based" - "*job_option ddm_method:metis_node_based" - "*job_option ddm_method:recur_coord_bisect" - "*job_option ddm_method:vector" - "*job_option ddm_method:radial" - "*job_option ddm_method:angular" -#else - popmenu job_ddm_method_pm -#endif - } - - button { - position +4 +4 - size 19 4 - text "ADVANCED SETTINGS" -#ifdef QT_MENTAT - popmenu job_ddm_fea_solver_pm -#else - screen job_ddm_fea_solver_sc - command "@popdown($popname2) @popdown($popname1)" ($popname2, $popname1) -#endif - } -} - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu job_ddm_method_pm { - - window { - parent mentat - origin 56 24 - size 30 33 - border_width 1 - border_color border - background_color body - } - - mode dialog - - group job_ddm_method_gr -} - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_method_gr { - - popdown { - position 0 0 - size 30 4 - text "METIS BEST" - command "*job_option ddm_method:metis_best" - } - - popdown { - position = +4 - size 30 4 - text "METIS ELEMENT BASED" - command "*job_option ddm_method:metis_element_based" - } - - popdown { - position = +4 - size 30 4 - text "METIS NODE BASED" - command "*job_option ddm_method:metis_node_based" - } - - popdown { - position = +4 - size 30 4 - text "RECURSIVE COORDINATE BISECTION" - command "*job_option ddm_method:recur_coord_bisect" - } - - popdown { - position = +4 - size 30 4 - text "VECTOR" - command "*job_option ddm_method:vector" - } - - popdown { - position = +4 - size 30 4 - text "RADIAL" - command "*job_option ddm_method:radial" - } - - popdown { - position = +4 - size 30 4 - text "ANGULAR" - command "*job_option ddm_method:angular" - } - - popdown { - position = +5 - size 30 4 - text "CANCEL" - } -} -#endif - - -#ifdef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu job_ddm_fea_solver_pm { - - text "JOB PARALLELIZATION" -#else -screen job_ddm_fea_solver_sc { - - menu { -#endif - - group { - units 32 120 - -#ifndef QT_MENTAT - label { - position 0 0 - size 32 4 - text "JOB PARALLELIZATION" - } -#endif - - label { - position 0 5 - size 6 4 - text "NAME" - } - - display { - position +6 = - size 26 4 - display "job_name" - } - -#ifdef QT_MENTAT - label { - position 0 +4 - size 6 4 - text "TYPE" - } - - display { - position +6 = - size 26 4 - display job_class_label - } -#endif - - frame { - -#ifdef QT_MENTAT - position 0 +9 -#else - position 0 +5 -#endif - size 32 76 - text "ADVANCED DECOMPOSITION IN MARC" - border_width 1 - border_color black - - group { - -#ifdef QT_MENTAT - label { - position 1 4 - size 16 4 - text "# DOMAINS" - help job_param - } -#else - button { - position 1 4 - size 16 4 - text "# DOMAINS" - command "*job_param ndomains" - } -#endif - - text { - position +16 = - size 14 4 - display "job_param_value_ndomains" - command "*job_param ndomains" - } - - label { - position 1 +4 - size 7 4 - text "METHOD" - border_width 1 - border_color black - } - - roller { - position +7 = - size 23 4 - nvalues 7 - texts "METIS BEST" - "METIS ELEMENT" - "METIS NODE" - "REC. COORD. BISECTION" - "VECTOR" - "RADIAL" - "ANGULAR" - help set_job_decomp_type - rollers "*job_option ddm_method:metis_best" - "*job_option ddm_method:metis_element_based" - "*job_option ddm_method:metis_node_based" - "*job_option ddm_method:recur_coord_bisect" - "*job_option ddm_method:vector" - "*job_option ddm_method:radial" - "*job_option ddm_method:angular" -#ifdef QT_MENTAT - commands "*job_option ddm_method:metis_best" - "*job_option ddm_method:metis_element_based" - "*job_option ddm_method:metis_node_based" - "*job_option ddm_method:recur_coord_bisect" - "*job_option ddm_method:vector" - "*job_option ddm_method:radial" - "*job_option ddm_method:angular" -#else - popmenu job_ddm_method2_pm -#endif - } - - frame { - position 1 +5 - size 30 20 - group job_ddm_direction_gr - visible "or(*job_option ddm_method:vector, \ - *job_option ddm_method:radial, \ - *job_option ddm_method:angular)" - } - - toggle { - position 1 +21 - size 30 4 - text "DOMAIN ISLAND REMOVAL" - toggle "*job_option ddm_island_removal:on" - true_command "*job_option ddm_island_removal:on" - false_command "*job_option ddm_island_removal:off" - } - - label { - position 1 +4 - size 15 4 - border_width 1 - border_color black - text "GRAPH" - } - - roller { - position +15 = - size 15 4 - nvalues 2 - texts "COARSE" - "FINE" - help ddm_decomp_coarse_graph - rollers "*job_option ddm_graph:coarse" - "*job_option ddm_graph:fine" - commands "*job_option ddm_graph:coarse" - "*job_option ddm_graph:fine" - visible "or(*job_option ddm_method:metis_best, \ - *job_option ddm_method:metis_element_based, \ - *job_option ddm_method:metis_node_based)" - } - - label { - position 1 +4 - size 15 4 - border_width 1 - border_color black - text "QUADRATIC ELEMENTS" - } - - roller { - position +15 = - size 15 4 - nvalues 2 - texts "GENUINE" - "LINEARIZED" - help job_run_ddm_decomp_linearized - rollers "*job_option ddm_quadr_elems:genuine" - "*job_option ddm_quadr_elems:linearized" - commands "*job_option ddm_quadr_elems:genuine" - "*job_option ddm_quadr_elems:linearized" - } - -#ifdef QT_MENTAT - label { - position 1 +5 - size 15 4 - text "ELEMENT WEIGHT FACTOR" - help job_param - } -#else - button { - position 1 +5 - size 15 4 - text "ELEMENT WEIGHT FACTOR" - command "*job_param ddm_elem_weight_factor" - help job_run_ddm_decomp_element_weight_factor - } -#endif - - text { - position +15 = - size 15 4 - display "job_param_value_ddm_elem_weight_factor" - command "*job_param ddm_elem_weight_factor" - help job_run_ddm_decomp_element_weight_factor - } - - toggle { - position 1 +5 - size 30 4 - text "DETECT CONTACT" - toggle "*job_option ddm_detect_contact:on" - true_command "*job_option ddm_detect_contact:on" - false_command "*job_option ddm_detect_contact:off" - visible "or(*job_option ddm_method:metis_best, \ - *job_option ddm_method:metis_element_based, \ - *job_option ddm_method:metis_node_based)" - help job_run_ddm_decomp_detect_contact - } - -#ifdef QT_MENTAT - label { - position = +5 - size 15 4 - text "CONTACT TOLERANCE" - visible "*job_option ddm_detect_contact:on" - } -#else - button { - position = +5 - size 15 4 - text "CONTACT TOLERANCE" - command "*job_param ddm_contact_tolerance" - visible "*job_option ddm_detect_contact:on" - help job_run_ddm_decomp_contact_tolerance - } -#endif - - text { - position +15 = - size 15 4 - command "*set_ddm_contact_tolerance" - display "job_param_value_ddm_contact_tolerance" - command "*job_param ddm_contact_tolerance" - visible "*job_option ddm_detect_contact:on" - help job_run_ddm_decomp_contact_tolerance - } - -#ifdef QT_MENTAT - label { - position -15 +4 - size 15 4 - text "CONTACT CONSTR FACTOR" - visible "*job_option ddm_detect_contact:on" - } -#else - button { - position -15 +4 - size 15 4 - text "CONTACT CONSTR FACTOR" - command "*job_param ddm_contact_constr_factor" - visible "*job_option ddm_detect_contact:on" - help job_run_ddm_decomp_contact_constraint_factor - } -#endif - - text { - position +15 = - size 15 4 - display "job_param_value_ddm_contact_constr_factor" - command "*job_param ddm_contact_constr_factor" - visible "*job_option ddm_detect_contact:on" - help job_run_ddm_decomp_contact_constraint_factor - } - } - } - -#ifdef QT_MENTAT - popdown { - position 0 +77 - size 32 8 - text "OK" - } -#else - frame { - position 0 +77 - size 32 8 - group ok2_gr - } - - frame select_frame - frame inactive_return -#endif - } -#ifndef QT_MENTAT - window main_window - disable_right_mouse_button - } - - menu transform -} # job_ddm_fea_solver_sc -#else - mode permanent -} # job_ddm_fea_solver_pm -#endif - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu job_ddm_method2_pm { - - window { - parent mentat - origin 1 22 - size 30 33 - border_width 1 - border_color border - background_color body - } - - mode dialog - - group job_ddm_method_gr -} -#endif - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_direction_gr { - - button { - position 0 0 - size 15 4 - text "DIRECTION" - command "*job_vector ddm_sort_direction_x" - visible "*job_option ddm_method:vector" - } - - button { - position = = - size 15 4 - text "DIRECTION" - command "*job_vector ddm_sort_direction_x" - visible "not(*job_option ddm_method:vector)" - } - - button { - position +15 = - size 15 4 - text "FROM / TO" - command "*job_vector_from_to ddm_sort_direction_x" - } - - text { - position -15 +4 - size 10 4 - command "*job_param ddm_sort_direction_x" - display "job_param_value_ddm_sort_direction_x" - help ddm_job_decomp_user_direction_x - } - - text { - position +10 = - size 10 4 - command "*job_param ddm_sort_direction_y" - display "job_param_value_ddm_sort_direction_y" - } - - text { - position +10 = - size 10 4 - command "*job_param ddm_sort_direction_z" - display "job_param_value_ddm_sort_direction_z" - } - - frame { - position 0 +4 - size 30 8 - group job_ddm_sort_point_gr - visible "not(*job_option ddm_method:vector)" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_sort_point_gr { - - label { - position 0 0 - size 14 4 - border_width 1 - border_color black - text "POINT ON AXIS" - } - - roller { - position +14 = - size 10 4 - nvalues 2 - texts "DEFAULT" - "USER" - roller "job_option ddm_sort_point" -#ifdef QT_MENTAT - commands "*job_option ddm_sort_point:default" - "*job_option ddm_sort_point:user" -#else - popmenu job_ddm_sort_point_meth_pm -#endif - } - - button { - position +10 = - size 6 4 - text "SET" - command "*job_position ddm_sort_point_x" - visible "*job_option ddm_sort_point:user" - } - - text { - position 0 +4 - size 10 4 - command "*job_param ddm_sort_point_x" - display "job_param_value_ddm_sort_point_x" - visible "*job_option ddm_sort_point:user" - } - - text { - position +10 = - size 10 4 - command "*job_param ddm_sort_point_y" - display "job_param_value_ddm_sort_point_y" - visible "*job_option ddm_sort_point:user" - } - - text { - position +10 = - size 10 4 - command "*job_param ddm_sort_point_z" - display "job_param_value_ddm_sort_point_z" - visible "*job_option ddm_sort_point:user" - } -} - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu job_ddm_sort_point_meth_pm { - - window { - parent mentat - origin 15 35 - size 14 13 - border_width 1 - border_color border - background_color body - } - - mode dialog - - group job_ddm_sort_point_meth_gr -} - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_sort_point_meth_gr { - - popdown { - position 0 0 - size 14 4 - text "DEFAULT" - command "*job_option ddm_sort_point:default" - } - - popdown { - position = +4 - size 14 4 - text "USER DEFINED" - command "*job_option ddm_sort_point:user" - } - - popdown { - position = +5 - size 14 4 - text "CANCEL" - } -} -#endif - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_preprocessor_gr { - - label { - position 0 0 - size 10 4 - text "# DOMAINS" - border_width 1 - border_color black - } - - integer { - position +10 = - size 4 4 - display valid_domains - } - - button { - position +4 = - size 30 4 - text "USER DOMAINS" -#ifdef QT_MENTAT - screen domains -#else - screen job_ddm_user_domains_sc - command "@popdown($popname2) @popdown($popname1)" ($popname2, $popname1) -#endif - help job_run_ddm_user_domains - } -} - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -screen job_ddm_user_domains_sc { - - menu { - - group { - units 32 120 - - label { - position 0 0 - size 32 4 - text "USER DOMAINS" - } - - frame { - position 0 5 - size 32 28 - group user_domains_gr - } - - frame { - position 0 +29 - size 32 49 - group user_domains_generate_gr - } - - frame { - position 0 +50 - size 32 8 - group user_domains_tail_gr - } - - frame { - position 0 92 - size 32 8 - group ok2_gr - } - - frame select_frame - frame inactive_return - } - window main_window - disable_right_mouse_button - - } - - menu transform - -} # job_ddm_user_domains_sc -#endif - - -#-------------------------------------------------------------------------------------------------- -group job_assem_recov_gr { - - toggle { - position 1 +4 - size 30 4 - text "MULTIPLE THREADS" - true_command "*job_option assem_recov_multi_threading:on" - false_command "*job_option assem_recov_multi_threading:off" - toggle "*job_option assem_recov_multi_threading:on" - } - -#ifdef QT_MENTAT - label { - position +2 +4 - size 12 4 - text "# THREADS" - visible "*job_option assem_recov_multi_threading:on" - } -#else - button { - position +2 +4 - size 12 4 - text "# THREADS" - command "*job_param assem_recov_nthreads" - visible "*job_option assem_recov_multi_threading:on" - } -#endif - - text { - position +12 = - size 4 4 - display "job_param_value_assem_recov_nthreads" - command "*job_param assem_recov_nthreads" - visible "*job_option assem_recov_multi_threading:on" - } - - label { - position +4 = - size 12 4 - visible "and(*job_option assem_recov_multi_threading:on, \ - *job_option parallel:on)" - text "PER DOMAIN" - border_width 1 - border_color black - } - - display { - position +12 = - size 4 4 - display "job_assem_recov_nthreads_dom" - visible "and(*job_option assem_recov_multi_threading:on, \ - *job_option parallel:on)" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_parallel_matrix_solver_gr { - - label { - position 3 4 - size 12 4 - text "SOLUTION" - border_width 1 - border_color black - } - - roller { - position +12 = - size 18 4 - nvalues 2 - texts "SYMMETRIC" - "NONSYMMETRIC" - rollers job_nonsym_off - job_nonsym_on - commands "*job_option solver_nonsym:off" - "*job_option solver_nonsym:on" - help job_param_solver_method - } - - label { - position -12 +4 - size 6 4 - text "TYPE" - border_width 1 - border_color black - } - - roller { - position +6 = - size 24 4 - nvalues 9 - help job_param_solver_method - texts "MULTIFRONTAL SPARSE" - "MIXED DIRECT-ITERATIVE" - "CASI ITERATIVE" - "PARDISO DIRECT SPARSE" - "MUMPS PARALLEL DIRECT" - "HARDWARE SPARSE" - "ITERATIVE SPARSE" - "DIRECT PROFILE" - "DIRECT SPARSE" - rollers job_solver_mfront_sparse - job_solver_mixed_direct_iterative - job_solver_it_ext - job_solver_pardiso - job_solver_mumps - job_solver_sparse - job_solver_it_sparse - job_solver_dir_profile - job_solver_dir_sparse -#ifdef QT_MENTAT - commands "*job_option solver:mfront_sparse" - "*job_option solver:mixed_direct_iterative" - "*job_option solver:it_ext" - "*job_option solver:pardiso" - "*job_option solver:mumps" - "*job_option solver:sparse" - "*job_option solver:it_sparse" - "*job_option solver:dir_profile" - "*job_option solver:dir_sparse" - visibles job_allows_solver_mfront_sparse - job_allows_solver_mixed_direct_iterative - job_allows_solver_it_ext - job_allows_solver_pardiso - job_allows_solver_mumps - job_allows_solver_sparse - job_allows_solver_it_sparse - job_allows_solver_dir_profile - job_allows_solver_dir_sparse - help job_param_solver_method -#else - popmenu job_set_parallel_matrix_solver_pm -#endif - } - - button { - position +24 = - size 10 4 - text "OPTIONS" - popmenu job_parallel_matrix_solver_opt_pm - } - - frame { - position +10 = - size 14 4 - group job_run_solver_ddm_opts_gr - visible "*job_option parallel:on" - } - - frame { - position 1 +5 - size 46 8 - group job_solver_multi_procs_gr - visible solver_allows_multi_procs - } - - frame { - position = = - size 46 8 - group job_solver_multi_threads_gr - visible solver_allows_multi_threads - } - - frame { - position 1 +9 - size 46 8 - group job_solver_gpu_gr - visible "and(job_solver_mfront_sparse,job_nonsym_off)" - } -} - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu job_set_parallel_matrix_solver_pm { - window { - parent mentat - origin 48 61 - size 24 42 - border_width 1 - border_color border - background_color body - } - mode dialog - - group job_solver_gr -} -#endif - - -#-------------------------------------------------------------------------------------------------- -popmenu job_parallel_matrix_solver_opt_pm { - -#ifdef QT_MENTAT - text "MATRIX SOLVER OPTIONS" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 38 4 - text "MATRIX SOLVER OPTIONS" - } -#endif - - frame { - position 1 5 - size 36 23 - group job_solver_opts_gr - } - - popdown { - position 13 +25 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 41 12 - size 38 39 - border_width 1 - border_color border - background_color body - } - mode dialog -} - - -#-------------------------------------------------------------------------------------------------- -group job_run_solver_ddm_opts_gr { - - button { - position 0 0 - size 14 4 - text "\{DDM} OPTIONS" - popmenu ddm_options -# see also job_common.ms! - visible "not(or(job_solver_it_sparse, \ - job_solver_it_ext, \ - job_solver_mixed_direct_iterative, \ - job_solver_pardiso, \ - job_solver_mumps))" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_procs_gr { - frame { - position 0 0 - size 46 8 - group job_solver_multi_procs_parallel_off_gr - visible "*job_option parallel:off" - } - - frame { - position = = - size 46 8 - group job_solver_multi_procs_parallel_on_gr - visible "*job_option parallel:on" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_procs_parallel_off_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - true_command "*job_option nsolver_procs_serial:on" - false_command "*job_option nsolver_procs_serial:off" - toggle "*job_option nsolver_procs_serial:on" - help job_run_multithreading - } - -#ifdef QT_MENTAT - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - visible "*job_option nsolver_procs_serial:on" - help job_param - } -#else - button { - position +2 +4 - size 14 4 - text "# PROCESSES" - command "*job_param nsolver_procs" - visible "*job_option nsolver_procs_serial:on" - } -#endif - - text { - position +14 = - size 14 4 - display "job_param_value_nsolver_procs" - command "*job_param nsolver_procs" - visible "*job_option nsolver_procs_serial:on" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_procs_parallel_on_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - help job_run_multithreading - toggle true -#ifdef QT_MENTAT - set $dummy dummy -#endif - } - - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - border_width 1 - border_color black - } - - roller { - position +14 = - size 14 4 - nvalues 2 - texts "AUTOMATIC" - "USER" - commands "*job_option nsolver_procs_ddm:automatic" - "*job_option nsolver_procs_ddm:user" - help job_run_multithreading - rollers "*job_option nsolver_procs_ddm:automatic" - "*job_option nsolver_procs_ddm:user" - } - - frame { - position +14 = - size 16 4 - group job_nsolver_procs_ddm_automatic_gr - visible "*job_option nsolver_procs_ddm:automatic" - } - - frame { - position = = - size 16 4 - group job_nsolver_procs_ddm_user_gr - visible "*job_option nsolver_procs_ddm:user" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_nsolver_procs_ddm_automatic_gr { - - label { - position 0 0 - size 8 4 - text "VALUE" - border_width 1 - border_color black - } - - integer { - position +8 = - size 8 4 - display valid_domains - visible "*job_option ddm_generator:preprocessor" - } - - integer { - position = = - size 8 4 - display "job_param_ndomains" - visible "*job_option ddm_generator:fea_solver" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_nsolver_procs_ddm_user_gr { - -#ifdef QT_MENTAT - label { - position 0 0 - size 8 4 - text "VALUE" - help job_param - } -#else - button { - position 0 0 - size 8 4 - text "VALUE" - command "*job_param nsolver_procs" - } -#endif - - text { - position +8 = - size 8 4 - display "job_param_value_nsolver_procs" - command "*job_param nsolver_procs" - } -} - -group job_solver_multi_threads_gr { - frame { - position 0 0 - size 30 8 - group job_solver_multi_threads_mfront_sparse_gr - visible "and(job_solver_mfront_sparse,*job_option parallel:off)" - } - - frame { - position = = - size 46 8 - group job_solver_multi_threads_pardiso_parallel_off_gr - visible "and(job_solver_pardiso,*job_option parallel:off)" - } - - frame { - position = = - size 46 8 - group job_solver_multi_threads_pardiso_parallel_on_gr - visible "and(job_solver_pardiso,*job_option parallel:on)" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_threads_mfront_sparse_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE THREADS" - toggle "*job_option mfront_sparse_multi_threading:on" - true_command "*job_option mfront_sparse_multi_threading:on" - false_command "*job_option mfront_sparse_multi_threading:off" - help job_run_multithreading - } - -#ifdef QT_MENTAT - label { - position +2 +4 - size 14 4 - text "# THREADS" - visible "*job_option mfront_sparse_multi_threading:on" - help job_param - } -#else - button { - position +2 +4 - size 14 4 - text "# THREADS" - command "*job_param nthreads" - visible "*job_option mfront_sparse_multi_threading:on" - } -#endif - - text { - position +14 = - size 14 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - visible "*job_option mfront_sparse_multi_threading:on" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_gpu_gr { - - toggle { - position 0 0 - size 30 4 - text "USE \{GPU(s)}" - toggle "*job_option solver_use_gpu:on" - true_command "*job_option solver_use_gpu:on" - false_command "*job_option solver_use_gpu:off" - help job_solver_gpu - } - - label { - position +2 +4 - size 16 4 - text "\{GPU} SELECTION" - border_width 1 - border_color black - visible "*job_option solver_use_gpu:on" - } - - roller { - position +16 = - size 12 4 - nvalues 2 - texts "AUTOMATIC" - "USER" - commands "*job_option solver_gpus:automatic" - "*job_option solver_gpus:user" - rollers "*job_option solver_gpus:automatic" - "*job_option solver_gpus:user" - visible "*job_option solver_use_gpu:on" - help job_solver_gpu - } - - text { - position +12 = - size 16 4 - display job_solver_gpus - command "*clear_job_solver_gpus *job_solver_gpus" - visible "and(*job_option solver_use_gpu:on,*job_option solver_gpus:user)" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_threads_pardiso_parallel_off_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE THREADS" - toggle "*job_option pardiso_multi_threading:on" - true_command "*job_option pardiso_multi_threading:on" - false_command "*job_option pardiso_multi_threading:off" - help job_run_multithreading - } - -#ifdef QT_MENTAT - label { - position +2 +4 - size 14 4 - text "# THREADS" - visible "*job_option pardiso_multi_threading:on" - help job_param - } -#else - button { - position +2 +4 - size 14 4 - text "# THREADS" - command "*job_param nthreads" - visible "*job_option pardiso_multi_threading:on" - } -#endif - - text { - position +14 = - size 14 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - visible "*job_option pardiso_multi_threading:on" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_threads_pardiso_parallel_on_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE THREADS" - help job_run_multithreading - toggle true -#ifdef QT_MENTAT - set $dummy dummy -#endif - } - - label { - position +2 +4 - size 14 4 - text "# THREADS" - border_color black - border_width 1 - } - - roller { - position +14 = - size 14 4 - nvalues 2 - texts "AUTOMATIC" - "USER" - commands "*job_option pardiso_multi_threading_ddm:automatic" - "*job_option pardiso_multi_threading_ddm:user" - help job_run_multithreading - rollers "*job_option pardiso_multi_threading_ddm:automatic" - "*job_option pardiso_multi_threading_ddm:user" - } - - frame { - position +14 = - size 16 4 - group job_pardiso_multi_threads_ddm_automatic_gr - visible "*job_option pardiso_multi_threading_ddm:automatic" - } - - frame { - position = = - size 16 4 - group job_pardiso_multi_threads_ddm_user_gr - visible "*job_option pardiso_multi_threading_ddm:user" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_pardiso_multi_threads_ddm_automatic_gr { - - label { - position 0 0 - size 8 4 - text "VALUE" - border_width 1 - border_color black - } - - integer { - position +8 = - size 8 4 - display valid_domains - visible "*job_option ddm_generator:preprocessor" - } - - integer { - position = = - size 8 4 - display "job_param_ndomains" - visible "*job_option ddm_generator:fea_solver" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_pardiso_multi_threads_ddm_user_gr { - -#ifdef QT_MENTAT - label { - position 0 0 - size 8 4 - text "VALUE" - help job_param - } -#else - button { - position 0 0 - size 8 4 - text "VALUE" - command "*job_param nthreads" - } -#endif - - text { - position +8 = - size 8 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_parallel_env_gr { - - roller { - position 1 4 - size 30 4 - nvalues 2 - texts "SINGLE MACHINE" - "NETWORK" - help job_run_ddm_setup - roller "job_option parallel_setup" - commands "*job_option parallel_setup:single" - "*job_option parallel_setup:network" - } - - frame { - position +2 +5 - size 44 18 - group job_parallel_env_network_gr - visible "*job_option parallel_setup:network" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_parallel_env_network_gr { - - button { - position 0 0 - size 28 4 - text "HOST FILE" -#ifdef QT_MENTAT - browser host_file_browser -#else - popmenu host_file_browser_pm -#endif - settext $host_file_browser_label "SELECT HOST FILE" - set $host_file_browser_command "*job_host_file" - help job_host_file - } - - button { - position +28 = - size 8 4 - text "EDIT" - command "*job_edit_host_file" - help job_edit_host_file - visible job_host_file - } - - button { - position +8 = - size 8 4 - text "CLEAR" - command "*job_clear_host_file" - help job_clear_host_file - visible job_host_file - } - - display { - position 0 +4 - size 44 4 - display job_host_file - } - - frame { - position 0 +5 - size 44 9 - group job_parallel_env_network_ddm_gr - visible "*job_option parallel:on" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_parallel_env_network_ddm_gr { - - toggle { - position 0 0 - size 22 4 - text "COPY INPUT FILE" - toggle "*job_option copy_input_file:on" - true_command "*job_option copy_input_file:on" - false_command "*job_option copy_input_file:off" - help job_host_copy_inputfile - } - - toggle { - position +23 = - size 21 4 - text "COPY POST FILE" - toggle "*job_option copy_post_file:on" - true_command "*job_option copy_post_file:on" - false_command "*job_option copy_post_file:off" - help job_host_copy_inputfile - } - - label { - position 0 +5 - size 10 4 - text "HOSTS" - border_width 1 - border_color black - visible job_usersub_file - } - - roller { - position +10 = - size 18 4 - nvalues 2 - texts "COMPATIBLE" - "INCOMPATIBLE" - roller "job_option network_hosts" - commands "*job_option network_hosts:compatible" - "*job_option network_hosts:incompatible" - help job_host_comp - visible job_usersub_file - } -} - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu marc_integer_size_pm { - - window { - parent mentat - origin 55 32 - size 32 17 - border_width 1 - border_color border - background_color body - } - mode dialog - - group marc_integer_size_gr -} - - -#-------------------------------------------------------------------------------------------------- -group marc_integer_size_gr { - - popdown { - position 0 0 - size 32 4 - text "DEFAULT" - command "*job_option marc_integer_size:default" - help job_run_intsize - } - - popdown { - position = +4 - size 32 4 - text "4-BYTE INTEGERS" - command "*job_option marc_integer_size:i4" - help job_run_intsize - } - - popdown { - position = +4 - size 32 4 - text "8-BYTE INTEGERS" - command "*job_option marc_integer_size:i8" - help job_run_intsize - } - - popdown { - position = +5 - size 32 4 - text "CANCEL" - help job_run_intsize - } -} -#endif -#endif diff --git a/installation/mods_MarcMentat/2013.1/Mentat_menus/job_run.ms.org b/installation/mods_MarcMentat/2013.1/Mentat_menus/job_run.ms.org deleted file mode 100644 index 4c8dde20a..000000000 --- a/installation/mods_MarcMentat/2013.1/Mentat_menus/job_run.ms.org +++ /dev/null @@ -1,3078 +0,0 @@ -#ifndef AUTOFORGE -popmenu job_title_pm file jobs.ms -popdown job_title_ok file jobs.ms -#ifndef QT_MENTAT -popmenu marc_input_style_pm file job_common.ms -popmenu marc_input_style_run_adv_pm file job_common.ms -popmenu marc_version_run_pm file job_common.ms -#endif - -group job_solver_gr file job_common.ms -group user_domains_gr file domain_decomposition.ms -group user_domains_generate_gr file domain_decomposition.ms -group user_domains_tail_gr file domain_decomposition.ms -group job_solver_opts_gr file job_common.ms -popmenu ddm_options file job_common.ms - -#ifdef QT_MENTAT -browser edit_browser file file.ms -browser directory_browser file file.ms -screen domains file domain_decomposition.ms -#else -popmenu edit_browser_popmenu file file.ms -popmenu directory_browser_popmenu file file.ms -#endif - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu usersub_file_browser_pm { - - group { -#endif - - browser usersub_file_browser { - position 0 0 - size 82 72 - text "$usersub_file_browser_label" ($usersub_file_browser_label) - filter "*.f *.F" - nvisible 10 - select_files true - cancel_action popdown - ok_action popdown - command "$usersub_file_browser_command" ($usersub_file_browser_command) - } -#ifndef QT_MENTAT - } - - window { - title " Select MARC User Subroutine File" - origin 30 30 - size 82 72 - } - - mode dialog - disable_right_mouse_button -} -#endif - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu host_file_browser_pm { - - group { -#endif - - browser host_file_browser { - position 0 0 - size 82 72 - text "$host_file_browser_label" ($host_file_browser_label) - filter "*" - nvisible 10 - select_files true - cancel_action popdown - ok_action popdown - command "$host_file_browser_command" ($host_file_browser_command) - } -#ifndef QT_MENTAT - } - - window { - title " Select MARC Host File" - origin 30 30 - size 82 72 - } - - mode dialog - disable_right_mouse_button -} -#endif - - -#-------------------------------------------------------------------------------------------------- -popmenu job_run_popmenu { - -#ifdef QT_MENTAT - text "RUN JOB" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 52 4 - text "RUN JOB" - } -#endif - -#ifdef QT_MENTAT - label { - position 0 0 - size 6 4 - text "NAME" - } - - display { - position +6 = - size 26 4 - display "job_name" - } - - label { - position 0 +4 - size 6 4 - text "TYPE" - } - - display { - position +6 = - size 26 4 - display job_class_label - } -#endif - - button { -#ifdef QT_MENTAT - position 1 9 -#else - position 1 5 -#endif - size 24 4 - text "USER SUBROUTINE FILE" -#ifdef QT_MENTAT - browser usersub_file_browser -#else - popmenu usersub_file_browser_pm -#endif - settext $usersub_file_browser_label "SELECT USER SUBROUTINE FILE" - set $usersub_file_browser_command "*job_usersub_file" - help job_usersub_file - } - - toggle { - position +26 = - size 22 4 - text "SELECTED USER SUBS" - toggle job_usersubs - help job_run_seluser - visible job_usersubs - popmenu job_usersub_pm - } - - display { - position 1 +4 - size 50 4 - display job_usersub_file - } - - button { - position 1 +4 - size 12 4 - text "EDIT" - command "*job_edit_usersub_file" - visible job_usersub_file - } - - button { - position +12 = - size 12 4 - text "CLEAR" - command "*job_clear_usersub_file" - visible job_usersub_file - } - - roller { - position +12 = - size 26 4 - nvalues 3 - texts "COMPILE / NO SAVE" - "COMPILE AND SAVE" - "RUN SAVED EXECUTABLE" - help job_run_compile - roller "job_option user_source" - visible job_usersub_file -#ifdef QT_MENTAT - commands "*job_option user_source:compile_nosave" - "*job_option user_source:compile_save" - "*job_option user_source:run_saved" -#else - popmenu job_user_source_pm -#endif - } - - toggle { - position 1 +6 - size 22 4 - text "PARALLELIZATION/\{GPU}" - help job_run_parallel - toggle "or(*job_option parallel:on, \ - *job_option assem_recov_multi_threading:on, \ - solver_multi_procs, \ - solver_multi_threads, \ - and(job_solver_mfront_sparse,\ - job_nonsym_off,\ - *job_option solver_use_gpu:on))" - popmenu job_run_parallelization_pm - set $popname2 "job_run_parallelization_pm" - } - - frame { - position +22 = - size 28 16 - border_width 1 - border_color black - - group { - - display { - position 0 0 - size 28 4 - display job_ddm_domains - } - - display { - position = +4 - size 28 4 - display job_assem_recov_nthreads - } - - display { - position = +4 - size 28 4 - display job_solver_procs - visible solver_allows_multi_procs - } - - display { - position = = - size 28 4 - display job_solver_threads - visible "and(solver_allows_multi_threads,\ - not(and(job_solver_mfront_sparse,\ - *job_option parallel:on)))" - } - - display { - position = +4 - size 28 4 - display job_solver_gpu - visible "and(job_solver_mfront_sparse,job_nonsym_off)" - } - } - } - - button { - position 1 +18 - size 8 4 - text "TITLE" - popmenu job_title_pm - command "*job_title" - } - -# see also job_common.ms -# see also the ADVANCED JOB SUBMISSION popmenu in this file - - label { - position +10 = - size 7 4 - text "STYLE" - border_width 1 - border_color black - } - - roller { - position +7 = - size 18 4 - nvalues 3 - texts "TABLE-DRIVEN" - "MULTI-PHYSICS" - "OLD" - rollers "job_input_style_table_driven" - "job_input_style_multi_physics" - "job_input_style_old" -#ifdef QT_MENTAT - commands "*job_option input_style:new *job_option input_physics_style:old" - "*job_option input_physics_style:new *job_option input_style:new" - "*job_option input_style:old *job_option input_physics_style:old" - visibles "job_allows_input_style_table_driven" - "job_allows_input_style_multi_physics" - "job_allows_input_style_old" -#else - popmenu marc_input_style_pm -#endif - help job_option_input_style - } - - button { - position +20 = - size 13 4 - text "SAVE MODEL" - command "*save_model" - } - - button { - position 1 +6 - size 16 6 - text "SUBMIT (1)" - command "*submit_job 1 *monitor_job" - } - - button { - position +16 = - size 34 6 - text "ADVANCED JOB SUBMISSION" - popmenu job_submit_adv_pm - } - - button { - position 1 +6 - size 16 6 - text "UPDATE" - command "*update_job" - } - - button { - position +16 = - size 16 6 - text "MONITOR" - command "*monitor_job" - } - - button { - position +16 = - size 18 6 - text "KILL" - command "*kill_job *monitor_job" - } - - label { - position 1 +7 - size 32 4 - text "STATUS" - border_width 1 - border_color black - } - - display { - position +32 = - size 18 4 - display "job_status" - } - - label { - position -32 +4 - size 32 4 - text "CURRENT INCREMENT (CYCLE)" - border_width 1 - border_color black - } - - display { - position +32 = - size 18 4 - display "job_increment" - } - - label { - position -32 +4 - size 32 4 - text "SINGULARITY RATIO" - border_width 1 - border_color black - } - - float { - position +32 = - size 18 4 - display "job_singularity_ratio" - } - - label { - position -32 +4 - size 32 4 - text "CONVERGENCE RATIO" - border_width 1 - border_color black - } - - float { - position +32 = - size 18 4 - display "job_convergence_ratio" - } - - label { - position 1 +4 - size 32 4 - text "ANALYSIS TIME" - border_width 1 - border_color black - } - - float { - position +32 = - size 18 4 - display "job_analysis_time" - } - - label { - position -32 +4 - size 32 4 - text "WALL TIME" - border_width 1 - border_color black - } - - float { - position +32 = - size 18 4 - display "job_time" - } - - frame { - position 1 +4 - size 50 8 - - group { - - frame { - position 0 0 - size 50 8 - text "TOTAL" - border_width 1 - border_color black - group { - - label { - position +6 = - size 13 4 - text "CYCLES" - border_width 1 - border_color black - } - - integer { - position +13 = - size 10 4 - display "acc_job_cycles" - border_width 1 - border_color black - } - - label { - position -13 +4 - size 13 4 - text "SEPARATIONS" - border_width 1 - border_color black - } - - integer { - position +13 = - size 10 4 - display "acc_job_separations" - border_width 1 - border_color black - } - - label { - position +10 -4 - size 11 4 - text "CUT BACKS" - border_width 1 - border_color black - } - - integer { - position +11 = - size 10 4 - display "acc_job_cut_backs" - border_width 1 - border_color black - } - - label { - position -11 +4 - size 11 4 - text "REMESHES" - border_width 1 - border_color black - } - - integer { - position +11 = - size 10 4 - display "acc_job_remeshes" - border_width 1 - border_color black - } - } - } - } - } - - label { - position 1 +8 - size 19 4 - text "EXIT NUMBER" - border_width 1 - border_color black - } - - integer { - position +19 = - size 10 4 - display "job_exit" - } - - button { - position +10 = - size 21 4 - text "EXIT MESSAGE" - popmenu job_exit_msg_pm - help exit_message - } - - label { - position 1 +6 - size 7 4 - text "EDIT" - border_width 1 - border_color black - } - - button { - position +7 = - size 12 4 - text "OUTPUT FILE" - command "*job_edit_output" - } - - button { - position +12 = - size 9 4 - text "LOG FILE" - command "*job_edit_log_file" - } - - button { - position +9 = - size 12 4 - text "STATUS FILE" - command "*job_edit_status_file" - } - - button { - position +12 = - size 10 4 - text "ANY FILE" - settext $edit_browser_label "EDIT FILE" - set $edit_browser_command "*edit_file" -#ifdef QT_MENTAT - browser edit_browser -#else - popmenu edit_browser_popmenu -#endif - help edit_file - } - - popdown { - position 1 +6 - size 32 4 -#ifdef QT_MENTAT - text "OPEN POST FILE (MODEL PLOT RESULTS MENU)" - command "@popdown(job_properties_pm) @main(results) @popup(modelplot_pm) *post_open_default" -#else - text "OPEN POST FILE (RESULTS MENU)" - screen results - command "*post_open_default" -#endif - } - - button { - position 1 +6 - size 12 8 - text "RESET" - command "*job_submit_reset" - } - - popdown { - position +38 = - size 12 8 - text "OK" - } - } - - window job_run_wi { - parent mentat - origin 35 1 - size 52 115 - background_color body - border_width 1 - border_color border - buffering single - } - -#ifdef QT_MENTAT - mode permanent -#else - mode dialog -#endif -} - - -#-------------------------------------------------------------------------------------------------- -popmenu job_usersub_pm { - -#ifdef QT_MENTAT - text "CURRENTLY SELECTED USER SUBROUTINES" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 66 4 - text "CURRENTLY SELECTED USER SUBROUTINES" - } -#endif - - display { - position 1 +5 - size 64 86 - display "job_usersubs" - } - - popdown { - position 27 +88 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 38 8 - size 66 102 - background_color body - border_width 1 - border_color border - buffering single - } - - mode dialog -} - - -#-------------------------------------------------------------------------------------------------- -popmenu job_submit_adv_pm { - -#ifdef QT_MENTAT - text "ADVANCED JOB SUBMISSION" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 50 4 - text "ADVANCED JOB SUBMISSION" - } -#endif - -#ifdef QT_MENTAT - label { - position 0 0 - size 6 4 - text "NAME" - } - - display { - position +6 = - size 26 4 - display "job_name" - } - - label { - position 0 +4 - size 6 4 - text "TYPE" - } - - display { - position +6 = - size 26 4 - display job_class_label - } -#endif - - label { -#ifdef QT_MENTAT - position 1 9 -#else - position 1 5 -#endif - size 19 4 - text "INITIAL ALLOCATION" - border_width 1 - border_color black - } -#ifdef QT_MENTAT - label { - position +19 = - size 15 4 - text "GENERAL MEMORY" - help job_param_general_init_allocation - } -#else - button { - position +19 = - size 15 4 - text "GENERAL MEMORY" - help job_param_general_init_allocation - command "*job_param general_init_allocation" - } -#endif - text { - position +15 = - size 10 4 - display "job_param_value_general_init_allocation" - command "*job_param general_init_allocation" - help job_param_general_init_allocation - } - - label { - position +10 = - size 4 4 - text "MB" - border_width 1 - border_color black - } - - toggle { - position 1 +5 - size 32 4 - text "OUT-OF-CORE ELEMENT STORAGE" - help job_param_elsto - toggle "*job_option elsto:on" - true_command "*job_option elsto:on" - false_command "*job_option elsto:off" - } - - toggle { - position 1 +4 - size 32 4 - text "OUT-OF-CORE INCREMENTAL BACKUP" - help job_param_inc_backup_storage - toggle "*job_option inc_backup_storage:out_of_core" - true_command "*job_option inc_backup_storage:out_of_core" - false_command "*job_option inc_backup_storage:in_core" - } - - toggle { - position +34 = - size 14 4 - text "CHECK SIZES" - help job_run_check - toggle "*job_option check:on" - true_command "*job_option check:on" - false_command "*job_option check:off" - } - - label { - position 1 +6 - size 16 4 - text "INTEGER SIZE" - border_width 1 - border_color black - } - - roller { - position +16 = - size 32 4 - nvalues 3 - texts "DEFAULT" - "4-BYTE INTEGERS" - "8-BYTE INTEGERS" -#ifdef QT_MENTAT - commands "*job_option marc_integer_size:default" - "*job_option marc_integer_size:i4" - "*job_option marc_integer_size:i8" -#else - popmenu marc_integer_size_pm -#endif - help job_run_intsize - roller "job_option marc_integer_size" - } - - frame { - position 1 +6 - size 48 12 - text "MARC INPUT FILE" - border_width 1 - border_color black - - group { - - label { - position 0 4 - size 9 4 - text "VERSION" - border_width 1 - border_color black - } - - roller { - position +9 = - size 14 4 - nvalues 17 - nvisible 17 - texts "DEFAULT" -#if 0 - "2013.1" -#endif - "2013" - "2012" - "2011" - "2010.2" - "2010" - "2008" - "2007" - "2005R3" - "2005" - "2003" - "2001" - "2000" -#if 0 - "8" -#endif - "K7" - "K6.2" - "K5" - "K4" - help job_param_version - rollers "job_input_version_default" -#if 0 - "job_input_version_2013.1" -#endif - "job_input_version_2013" - "job_input_version_2012" - "job_input_version_2011" - "job_input_version_2010.2" - "job_input_version_2010" - "job_input_version_2008" - "job_input_version_2007" - "job_input_version_2005r3" - "job_input_version_2005" - "job_input_version_2003" - "job_input_version_2001" - "job_input_version_2000" -#if 0 - "job_input_version_8" -#endif - "job_input_version_k7" - "job_input_version_k6" - "job_input_version_k5" - "job_input_version_k4" -#ifdef QT_MENTAT - commands "*job_option version:default" -#if 0 - "*job_option version:2013.1" -#endif - "*job_option version:2013" - "*job_option version:2012" - "*job_option version:2011" - "*job_option version:2010.2" - "*job_option version:2010" - "*job_option version:2008" - "*job_option version:2007" - "*job_option version:2005r3" - "*job_option version:2005" - "*job_option version:2003" - "*job_option version:2001" - "*job_option version:2000" -#if 0 - "*job_option version:8" -#endif - "*job_option version:k7" - "*job_option version:k6" - "*job_option version:k5" - "*job_option version:k4" - visibles "job_allows_input_version_default" -#if 0 - "job_allows_input_version_2013.1" -#endif - "job_allows_input_version_2013" - "job_allows_input_version_2012" - "job_allows_input_version_2011" - "job_allows_input_version_2010.2" - "job_allows_input_version_2010" - "job_allows_input_version_2008" - "job_allows_input_version_2007" - "job_allows_input_version_2005r3" - "job_allows_input_version_2005" - "job_allows_input_version_2003" - "job_allows_input_version_2001" - "job_allows_input_version_2000" -#if 0 - "job_allows_input_version_8" -#endif - "job_allows_input_version_k7" - "job_allows_input_version_k6" - "job_allows_input_version_k5" - "job_allows_input_version_k4" -#else - popmenu marc_version_run_pm -#endif - } - -# see also job_common.ms -# see also the RUN JOB popmenu in this file - - label { - position +14 = - size 7 4 - text "STYLE" - border_width 1 - border_color black - } - - roller { - position +7 = - size 18 4 - nvalues 3 - texts "TABLE-DRIVEN" - "MULTI-PHYSICS" - "OLD" - rollers "job_input_style_table_driven" - "job_input_style_multi_physics" - "job_input_style_old" -#ifdef QT_MENTAT - commands "*job_option input_style:new *job_option input_physics_style:old" - "*job_option input_physics_style:new *job_option input_style:new" - "*job_option input_style:old *job_option input_physics_style:old" - visibles "job_allows_input_style_table_driven" - "job_allows_input_style_multi_physics" - "job_allows_input_style_old" -#else - popmenu marc_input_style_run_adv_pm -#endif - help job_option_input_style - } - - toggle { - position 0 +4 - size 48 4 - text "EXTENDED PRECISION" - help job_run_precision - toggle "*job_option inp_file_prec:extended" - true_command "*job_option inp_file_prec:extended" - false_command "*job_option inp_file_prec:normal" - } - } - } - - button { - position 1 +14 - size 24 4 - text "SCRATCH DIRECTORY" - settext $directory_browser_label "JOB SCRATCH DIRECTORY" - set $directory_browser_command "*job_scratch_directory" -#ifdef QT_MENTAT - browser directory_browser -#else - popmenu directory_browser_popmenu -#endif - help job_scratch_directory - } - - button { - position +24 = - size 24 4 - text "CLEAR" - command "*job_clear_scratch_directory" - visible job_scratch_directory - } - - text { - position 1 +4 - size 48 4 - display job_scratch_dir - command "*job_scratch_directory" - } - -#ifdef DCOM - toggle { - position 1 +6 - size 8 4 - text "\{DCOM}" - toggle "*job_option dcom:on" - help job_run_dcom - true_command "*job_option dcom:on" - false_command "*job_option dcom:off" - visible win32_available - } - - button { - position +8 = - size 12 4 - text "HOSTNAME" - command "*job_dcom_hostname" - visible "and(win32_available, *job_option dcom:on)" - } - - text job_dcom_hostname { - position +12 = - size 28 4 - display "job_dcom_hostname" - command "*job_dcom_hostname" - visible "and(win32_available, *job_option dcom:on)" - } -#endif - - button { - position 1 +6 - size 24 4 - text "TITLE" - popmenu job_title_pm - command "*job_title" - } - - button { - position +24 = - size 24 4 - text "SAVE MODEL" - command "*save_model" - } - - button { - position +4 +6 - size 20 4 - text "WRITE INPUT FILE" - command "*job_write_input" - } - - button { - position = +4 - size 20 4 - text "EDIT INPUT FILE" - command "*job_edit_input" - } - - popdown { - position 1 +5 - size 20 6 - text "SUBMIT 1" - command "*submit_job 1 *monitor_job" - } - - popdown { - position +28 = - size 20 6 - text "EXECUTE 1" - command "*execute_job 1 *monitor_job" - } - - popdown { - position -28 +6 - size 20 6 - text "SUBMIT 2" - command "*submit_job 2 *monitor_job" - } - - popdown { - position +28 = - size 20 6 - text "EXECUTE 2" - command "*execute_job 2 *monitor_job" - } - - popdown { - position -28 +6 - size 20 6 - text "SUBMIT 3" - command "*submit_job 3 *monitor_job" - } - - popdown { - position +28 = - size 20 6 - text "EXECUTE 3" - command "*execute_job 3 *monitor_job" - } - - popdown { - position 19 +8 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 38 8 -#ifdef DCOM - size 50 100 -#else - size 50 94 -#endif - background_color body - border_width 1 - border_color border - buffering single - } - -#ifdef QT_MENTAT - mode permanent -#else - mode dialog -#endif -} - - -#-------------------------------------------------------------------------------------------------- -popmenu job_exit_msg_pm { - -#ifdef QT_MENTAT - text "EXIT MESSAGE" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 86 4 - text "EXIT MESSAGE" - } - - display { - position 1 5 - size 84 74 - display "job_exit_msg" - } -#endif - -#ifdef QT_MENTAT - - text { - position 1 5 - size 84 74 - multiline - readonly - display "job_exit_msg" - } - -#endif - popdown { - position 37 +76 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 38 8 - size 86 90 - background_color body - border_width 1 - border_color border - buffering single - } - - mode dialog -} - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu job_user_source_pm { - - window { - parent job_run_wi - origin 25 17 - size 26 17 - border_width 1 - border_color border - background_color body - } - mode dialog - - group job_user_source_gr -} - - -#-------------------------------------------------------------------------------------------------- -group job_user_source_gr { - popdown { - position 0 0 - size 26 4 - text "COMPILE / NO SAVE" - command "*job_option user_source:compile_nosave" - } - - popdown { - position = +4 - size 26 4 - text "COMPILE AND SAVE" - command "*job_option user_source:compile_save" - } - - popdown { - position = +4 - size 26 4 - text "RUN SAVED EXECUTABLE" - command "*job_option user_source:run_saved" - } - - popdown { - position = +5 - size 26 4 - text "CANCEL" - } -} -#endif - - -#-------------------------------------------------------------------------------------------------- -popmenu job_run_parallelization_pm { - -#ifdef QT_MENTAT - text "PARALLELIZATION/\{GPU}" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 60 4 - text "PARALLELIZATION/GPU" - } -#endif - -#ifdef QT_MENTAT - label { - position 0 0 - size 6 4 - text "NAME" - } - - display { - position +6 = - size 26 4 - display "job_name" - } - - label { - position 0 +4 - size 6 4 - text "TYPE" - } - - display { - position +6 = - size 26 4 - display job_class_label - } -#endif - - frame { -#ifdef QT_MENTAT - position 1 9 -#else - position 1 5 -#endif - size 48 28 - group job_ddm_gr - text "DOMAIN DECOMPOSITION" - border_width 1 - border_color black - } - - frame { - position 1 +29 - size 36 13 - group job_assem_recov_gr - text "ASSEMBLY AND RECOVERY" - border_width 1 - border_color black - } - - frame { - position 1 +14 - size 58 31 - group job_parallel_matrix_solver_gr - text "MATRIX SOLVER" - border_width 1 - border_color black - } - - frame { - position 1 +32 - size 48 28 - group job_parallel_env_gr - text "PARALLELIZATION ENVIRONMENT" - border_width 1 - border_color black - visible "or(*job_option parallel:on, \ - solver_multi_procs)" - } - - popdown { - position 24 +30 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 38 1 - size 60 119 - background_color body - border_width 1 - border_color border - buffering single - } -#ifdef QT_MENTAT - mode permanent -#else - mode dialog -#endif -} - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_gr { - - toggle { - position 1 4 - size 30 4 - text "USE \{DDM}" - toggle "*job_option parallel:on" - help job_run_ddm_use - true_command "*job_option parallel:on" - false_command "*job_option parallel:off" - } - - frame { - position +2 +5 - size 44 18 - group job_ddm_use_gr - visible "*job_option parallel:on" - } -} - -group job_ddm_use_gr { - roller { - position 0 0 - size 30 4 - nvalues 2 - texts "DECOMPOSITION IN MARC" - "DECOMPOSITION IN MENTAT" - roller "job_option ddm_generator" -#ifdef QT_MENTAT - commands "*job_option ddm_generator:fea_solver" - "*job_option ddm_generator:preprocessor" -#else - popmenu job_ddm_generator_pm -#endif - help job_run_ddm_generator - } - - frame { - position 0 +5 - size 44 8 - group job_ddm_fea_solver_gr - visible "*job_option ddm_generator:fea_solver" - } - - frame { - position = = - size 44 8 - group job_ddm_preprocessor_gr - visible "*job_option ddm_generator:preprocessor" - } - - text { - position 0 +9 - size 22 4 -#ifdef QT_MENTAT - text "Single Input File" -#else - text "SINGLE INPUT FILE" -#endif - readonly - visible "*job_option ddm_generator:fea_solver" - } - - roller { - position = = - size 22 4 - nvalues 2 - texts "MULTIPLE INPUT FILES" - "SINGLE INPUT FILE" - roller "job_option ddm_single_input" - commands "*job_option ddm_single_input:off" - "*job_option ddm_single_input:on" - visible "*job_option ddm_generator:preprocessor" - help job_run_ddm_single_input - } - - roller { - position +23 = - size 21 4 - nvalues 2 - texts "MULTIPLE POST FILES" - "SINGLE POST FILE" - roller "job_option ddm_single_post" - commands "*job_option ddm_single_post:off" - "*job_option ddm_single_post:on" - help job_run_ddm_single_post - } -} - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu job_ddm_generator_pm { - - window { - parent mentat - origin 42 19 - size 30 13 - border_width 1 - border_color border - background_color body - } - - mode dialog - - group job_ddm_generator_gr -} - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_generator_gr { - - popdown { - position 0 0 - size 30 4 - text "DECOMPOSITION IN MARC" - command "*job_option ddm_generator:fea_solver" - help job_run_ddm_generator - } - - popdown { - position = +4 - size 30 4 - text "DECOMPOSITION IN MENTAT" - command "*job_option ddm_generator:preprocessor" - help job_run_ddm_generator - } - - popdown { - position = +5 - size 30 4 - text "CANCEL" - help job_run_ddm_generator - } -} -#endif - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_fea_solver_gr { - -#ifdef QT_MENTAT - label { - position 0 0 - size 10 4 - text "# DOMAINS" - help job_param - } -#else - button { - position 0 0 - size 10 4 - text "# DOMAINS" - command "*job_param ndomains" - } -#endif - - text { - position +10 = - size 4 4 - display "job_param_value_ndomains" - command "*job_param ndomains" - } - - label { - position +4 = - size 7 4 - text "METHOD" - border_width 1 - border_color black - } - - roller { - position +7 = - size 23 4 - nvalues 7 - texts "METIS BEST" - "METIS ELEMENT" - "METIS NODE" - "REC. COORD. BISECTION" - "VECTOR" - "RADIAL" - "ANGULAR" - help set_job_decomp_type - rollers "*job_option ddm_method:metis_best" - "*job_option ddm_method:metis_element_based" - "*job_option ddm_method:metis_node_based" - "*job_option ddm_method:recur_coord_bisect" - "*job_option ddm_method:vector" - "*job_option ddm_method:radial" - "*job_option ddm_method:angular" -#ifdef QT_MENTAT - commands "*job_option ddm_method:metis_best" - "*job_option ddm_method:metis_element_based" - "*job_option ddm_method:metis_node_based" - "*job_option ddm_method:recur_coord_bisect" - "*job_option ddm_method:vector" - "*job_option ddm_method:radial" - "*job_option ddm_method:angular" -#else - popmenu job_ddm_method_pm -#endif - } - - button { - position +4 +4 - size 19 4 - text "ADVANCED SETTINGS" -#ifdef QT_MENTAT - popmenu job_ddm_fea_solver_pm -#else - screen job_ddm_fea_solver_sc - command "@popdown($popname2) @popdown($popname1)" ($popname2, $popname1) -#endif - } -} - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu job_ddm_method_pm { - - window { - parent mentat - origin 56 24 - size 30 33 - border_width 1 - border_color border - background_color body - } - - mode dialog - - group job_ddm_method_gr -} - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_method_gr { - - popdown { - position 0 0 - size 30 4 - text "METIS BEST" - command "*job_option ddm_method:metis_best" - } - - popdown { - position = +4 - size 30 4 - text "METIS ELEMENT BASED" - command "*job_option ddm_method:metis_element_based" - } - - popdown { - position = +4 - size 30 4 - text "METIS NODE BASED" - command "*job_option ddm_method:metis_node_based" - } - - popdown { - position = +4 - size 30 4 - text "RECURSIVE COORDINATE BISECTION" - command "*job_option ddm_method:recur_coord_bisect" - } - - popdown { - position = +4 - size 30 4 - text "VECTOR" - command "*job_option ddm_method:vector" - } - - popdown { - position = +4 - size 30 4 - text "RADIAL" - command "*job_option ddm_method:radial" - } - - popdown { - position = +4 - size 30 4 - text "ANGULAR" - command "*job_option ddm_method:angular" - } - - popdown { - position = +5 - size 30 4 - text "CANCEL" - } -} -#endif - - -#ifdef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu job_ddm_fea_solver_pm { - - text "JOB PARALLELIZATION" -#else -screen job_ddm_fea_solver_sc { - - menu { -#endif - - group { - units 32 120 - -#ifndef QT_MENTAT - label { - position 0 0 - size 32 4 - text "JOB PARALLELIZATION" - } -#endif - - label { - position 0 5 - size 6 4 - text "NAME" - } - - display { - position +6 = - size 26 4 - display "job_name" - } - -#ifdef QT_MENTAT - label { - position 0 +4 - size 6 4 - text "TYPE" - } - - display { - position +6 = - size 26 4 - display job_class_label - } -#endif - - frame { - -#ifdef QT_MENTAT - position 0 +9 -#else - position 0 +5 -#endif - size 32 76 - text "ADVANCED DECOMPOSITION IN MARC" - border_width 1 - border_color black - - group { - -#ifdef QT_MENTAT - label { - position 1 4 - size 16 4 - text "# DOMAINS" - help job_param - } -#else - button { - position 1 4 - size 16 4 - text "# DOMAINS" - command "*job_param ndomains" - } -#endif - - text { - position +16 = - size 14 4 - display "job_param_value_ndomains" - command "*job_param ndomains" - } - - label { - position 1 +4 - size 7 4 - text "METHOD" - border_width 1 - border_color black - } - - roller { - position +7 = - size 23 4 - nvalues 7 - texts "METIS BEST" - "METIS ELEMENT" - "METIS NODE" - "REC. COORD. BISECTION" - "VECTOR" - "RADIAL" - "ANGULAR" - help set_job_decomp_type - rollers "*job_option ddm_method:metis_best" - "*job_option ddm_method:metis_element_based" - "*job_option ddm_method:metis_node_based" - "*job_option ddm_method:recur_coord_bisect" - "*job_option ddm_method:vector" - "*job_option ddm_method:radial" - "*job_option ddm_method:angular" -#ifdef QT_MENTAT - commands "*job_option ddm_method:metis_best" - "*job_option ddm_method:metis_element_based" - "*job_option ddm_method:metis_node_based" - "*job_option ddm_method:recur_coord_bisect" - "*job_option ddm_method:vector" - "*job_option ddm_method:radial" - "*job_option ddm_method:angular" -#else - popmenu job_ddm_method2_pm -#endif - } - - frame { - position 1 +5 - size 30 20 - group job_ddm_direction_gr - visible "or(*job_option ddm_method:vector, \ - *job_option ddm_method:radial, \ - *job_option ddm_method:angular)" - } - - toggle { - position 1 +21 - size 30 4 - text "DOMAIN ISLAND REMOVAL" - toggle "*job_option ddm_island_removal:on" - true_command "*job_option ddm_island_removal:on" - false_command "*job_option ddm_island_removal:off" - } - - label { - position 1 +4 - size 15 4 - border_width 1 - border_color black - text "GRAPH" - } - - roller { - position +15 = - size 15 4 - nvalues 2 - texts "COARSE" - "FINE" - help ddm_decomp_coarse_graph - rollers "*job_option ddm_graph:coarse" - "*job_option ddm_graph:fine" - commands "*job_option ddm_graph:coarse" - "*job_option ddm_graph:fine" - visible "or(*job_option ddm_method:metis_best, \ - *job_option ddm_method:metis_element_based, \ - *job_option ddm_method:metis_node_based)" - } - - label { - position 1 +4 - size 15 4 - border_width 1 - border_color black - text "QUADRATIC ELEMENTS" - } - - roller { - position +15 = - size 15 4 - nvalues 2 - texts "GENUINE" - "LINEARIZED" - help job_run_ddm_decomp_linearized - rollers "*job_option ddm_quadr_elems:genuine" - "*job_option ddm_quadr_elems:linearized" - commands "*job_option ddm_quadr_elems:genuine" - "*job_option ddm_quadr_elems:linearized" - } - -#ifdef QT_MENTAT - label { - position 1 +5 - size 15 4 - text "ELEMENT WEIGHT FACTOR" - help job_param - } -#else - button { - position 1 +5 - size 15 4 - text "ELEMENT WEIGHT FACTOR" - command "*job_param ddm_elem_weight_factor" - help job_run_ddm_decomp_element_weight_factor - } -#endif - - text { - position +15 = - size 15 4 - display "job_param_value_ddm_elem_weight_factor" - command "*job_param ddm_elem_weight_factor" - help job_run_ddm_decomp_element_weight_factor - } - - toggle { - position 1 +5 - size 30 4 - text "DETECT CONTACT" - toggle "*job_option ddm_detect_contact:on" - true_command "*job_option ddm_detect_contact:on" - false_command "*job_option ddm_detect_contact:off" - visible "or(*job_option ddm_method:metis_best, \ - *job_option ddm_method:metis_element_based, \ - *job_option ddm_method:metis_node_based)" - help job_run_ddm_decomp_detect_contact - } - -#ifdef QT_MENTAT - label { - position = +5 - size 15 4 - text "CONTACT TOLERANCE" - visible "*job_option ddm_detect_contact:on" - } -#else - button { - position = +5 - size 15 4 - text "CONTACT TOLERANCE" - command "*job_param ddm_contact_tolerance" - visible "*job_option ddm_detect_contact:on" - help job_run_ddm_decomp_contact_tolerance - } -#endif - - text { - position +15 = - size 15 4 - command "*set_ddm_contact_tolerance" - display "job_param_value_ddm_contact_tolerance" - command "*job_param ddm_contact_tolerance" - visible "*job_option ddm_detect_contact:on" - help job_run_ddm_decomp_contact_tolerance - } - -#ifdef QT_MENTAT - label { - position -15 +4 - size 15 4 - text "CONTACT CONSTR FACTOR" - visible "*job_option ddm_detect_contact:on" - } -#else - button { - position -15 +4 - size 15 4 - text "CONTACT CONSTR FACTOR" - command "*job_param ddm_contact_constr_factor" - visible "*job_option ddm_detect_contact:on" - help job_run_ddm_decomp_contact_constraint_factor - } -#endif - - text { - position +15 = - size 15 4 - display "job_param_value_ddm_contact_constr_factor" - command "*job_param ddm_contact_constr_factor" - visible "*job_option ddm_detect_contact:on" - help job_run_ddm_decomp_contact_constraint_factor - } - } - } - -#ifdef QT_MENTAT - popdown { - position 0 +77 - size 32 8 - text "OK" - } -#else - frame { - position 0 +77 - size 32 8 - group ok2_gr - } - - frame select_frame - frame inactive_return -#endif - } -#ifndef QT_MENTAT - window main_window - disable_right_mouse_button - } - - menu transform -} # job_ddm_fea_solver_sc -#else - mode permanent -} # job_ddm_fea_solver_pm -#endif - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu job_ddm_method2_pm { - - window { - parent mentat - origin 1 22 - size 30 33 - border_width 1 - border_color border - background_color body - } - - mode dialog - - group job_ddm_method_gr -} -#endif - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_direction_gr { - - button { - position 0 0 - size 15 4 - text "DIRECTION" - command "*job_vector ddm_sort_direction_x" - visible "*job_option ddm_method:vector" - } - - button { - position = = - size 15 4 - text "DIRECTION" - command "*job_vector ddm_sort_direction_x" - visible "not(*job_option ddm_method:vector)" - } - - button { - position +15 = - size 15 4 - text "FROM / TO" - command "*job_vector_from_to ddm_sort_direction_x" - } - - text { - position -15 +4 - size 10 4 - command "*job_param ddm_sort_direction_x" - display "job_param_value_ddm_sort_direction_x" - help ddm_job_decomp_user_direction_x - } - - text { - position +10 = - size 10 4 - command "*job_param ddm_sort_direction_y" - display "job_param_value_ddm_sort_direction_y" - } - - text { - position +10 = - size 10 4 - command "*job_param ddm_sort_direction_z" - display "job_param_value_ddm_sort_direction_z" - } - - frame { - position 0 +4 - size 30 8 - group job_ddm_sort_point_gr - visible "not(*job_option ddm_method:vector)" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_sort_point_gr { - - label { - position 0 0 - size 14 4 - border_width 1 - border_color black - text "POINT ON AXIS" - } - - roller { - position +14 = - size 10 4 - nvalues 2 - texts "DEFAULT" - "USER" - roller "job_option ddm_sort_point" -#ifdef QT_MENTAT - commands "*job_option ddm_sort_point:default" - "*job_option ddm_sort_point:user" -#else - popmenu job_ddm_sort_point_meth_pm -#endif - } - - button { - position +10 = - size 6 4 - text "SET" - command "*job_position ddm_sort_point_x" - visible "*job_option ddm_sort_point:user" - } - - text { - position 0 +4 - size 10 4 - command "*job_param ddm_sort_point_x" - display "job_param_value_ddm_sort_point_x" - visible "*job_option ddm_sort_point:user" - } - - text { - position +10 = - size 10 4 - command "*job_param ddm_sort_point_y" - display "job_param_value_ddm_sort_point_y" - visible "*job_option ddm_sort_point:user" - } - - text { - position +10 = - size 10 4 - command "*job_param ddm_sort_point_z" - display "job_param_value_ddm_sort_point_z" - visible "*job_option ddm_sort_point:user" - } -} - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu job_ddm_sort_point_meth_pm { - - window { - parent mentat - origin 15 35 - size 14 13 - border_width 1 - border_color border - background_color body - } - - mode dialog - - group job_ddm_sort_point_meth_gr -} - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_sort_point_meth_gr { - - popdown { - position 0 0 - size 14 4 - text "DEFAULT" - command "*job_option ddm_sort_point:default" - } - - popdown { - position = +4 - size 14 4 - text "USER DEFINED" - command "*job_option ddm_sort_point:user" - } - - popdown { - position = +5 - size 14 4 - text "CANCEL" - } -} -#endif - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_preprocessor_gr { - - label { - position 0 0 - size 10 4 - text "# DOMAINS" - border_width 1 - border_color black - } - - integer { - position +10 = - size 4 4 - display valid_domains - } - - button { - position +4 = - size 30 4 - text "USER DOMAINS" -#ifdef QT_MENTAT - screen domains -#else - screen job_ddm_user_domains_sc - command "@popdown($popname2) @popdown($popname1)" ($popname2, $popname1) -#endif - help job_run_ddm_user_domains - } -} - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -screen job_ddm_user_domains_sc { - - menu { - - group { - units 32 120 - - label { - position 0 0 - size 32 4 - text "USER DOMAINS" - } - - frame { - position 0 5 - size 32 28 - group user_domains_gr - } - - frame { - position 0 +29 - size 32 49 - group user_domains_generate_gr - } - - frame { - position 0 +50 - size 32 8 - group user_domains_tail_gr - } - - frame { - position 0 92 - size 32 8 - group ok2_gr - } - - frame select_frame - frame inactive_return - } - window main_window - disable_right_mouse_button - - } - - menu transform - -} # job_ddm_user_domains_sc -#endif - - -#-------------------------------------------------------------------------------------------------- -group job_assem_recov_gr { - - toggle { - position 1 +4 - size 30 4 - text "MULTIPLE THREADS" - true_command "*job_option assem_recov_multi_threading:on" - false_command "*job_option assem_recov_multi_threading:off" - toggle "*job_option assem_recov_multi_threading:on" - } - -#ifdef QT_MENTAT - label { - position +2 +4 - size 12 4 - text "# THREADS" - visible "*job_option assem_recov_multi_threading:on" - } -#else - button { - position +2 +4 - size 12 4 - text "# THREADS" - command "*job_param assem_recov_nthreads" - visible "*job_option assem_recov_multi_threading:on" - } -#endif - - text { - position +12 = - size 4 4 - display "job_param_value_assem_recov_nthreads" - command "*job_param assem_recov_nthreads" - visible "*job_option assem_recov_multi_threading:on" - } - - label { - position +4 = - size 12 4 - visible "and(*job_option assem_recov_multi_threading:on, \ - *job_option parallel:on)" - text "PER DOMAIN" - border_width 1 - border_color black - } - - display { - position +12 = - size 4 4 - display "job_assem_recov_nthreads_dom" - visible "and(*job_option assem_recov_multi_threading:on, \ - *job_option parallel:on)" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_parallel_matrix_solver_gr { - - label { - position 3 4 - size 12 4 - text "SOLUTION" - border_width 1 - border_color black - } - - roller { - position +12 = - size 18 4 - nvalues 2 - texts "SYMMETRIC" - "NONSYMMETRIC" - rollers job_nonsym_off - job_nonsym_on - commands "*job_option solver_nonsym:off" - "*job_option solver_nonsym:on" - help job_param_solver_method - } - - label { - position -12 +4 - size 6 4 - text "TYPE" - border_width 1 - border_color black - } - - roller { - position +6 = - size 24 4 - nvalues 9 - help job_param_solver_method - texts "MULTIFRONTAL SPARSE" - "MIXED DIRECT-ITERATIVE" - "CASI ITERATIVE" - "PARDISO DIRECT SPARSE" - "MUMPS PARALLEL DIRECT" - "HARDWARE SPARSE" - "ITERATIVE SPARSE" - "DIRECT PROFILE" - "DIRECT SPARSE" - rollers job_solver_mfront_sparse - job_solver_mixed_direct_iterative - job_solver_it_ext - job_solver_pardiso - job_solver_mumps - job_solver_sparse - job_solver_it_sparse - job_solver_dir_profile - job_solver_dir_sparse -#ifdef QT_MENTAT - commands "*job_option solver:mfront_sparse" - "*job_option solver:mixed_direct_iterative" - "*job_option solver:it_ext" - "*job_option solver:pardiso" - "*job_option solver:mumps" - "*job_option solver:sparse" - "*job_option solver:it_sparse" - "*job_option solver:dir_profile" - "*job_option solver:dir_sparse" - visibles job_allows_solver_mfront_sparse - job_allows_solver_mixed_direct_iterative - job_allows_solver_it_ext - job_allows_solver_pardiso - job_allows_solver_mumps - job_allows_solver_sparse - job_allows_solver_it_sparse - job_allows_solver_dir_profile - job_allows_solver_dir_sparse - help job_param_solver_method -#else - popmenu job_set_parallel_matrix_solver_pm -#endif - } - - button { - position +24 = - size 10 4 - text "OPTIONS" - popmenu job_parallel_matrix_solver_opt_pm - } - - frame { - position +10 = - size 14 4 - group job_run_solver_ddm_opts_gr - visible "*job_option parallel:on" - } - - frame { - position 1 +5 - size 46 8 - group job_solver_multi_procs_gr - visible solver_allows_multi_procs - } - - frame { - position = = - size 46 8 - group job_solver_multi_threads_gr - visible solver_allows_multi_threads - } - - frame { - position 1 +9 - size 46 8 - group job_solver_gpu_gr - visible "and(job_solver_mfront_sparse,job_nonsym_off)" - } -} - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu job_set_parallel_matrix_solver_pm { - window { - parent mentat - origin 48 61 - size 24 42 - border_width 1 - border_color border - background_color body - } - mode dialog - - group job_solver_gr -} -#endif - - -#-------------------------------------------------------------------------------------------------- -popmenu job_parallel_matrix_solver_opt_pm { - -#ifdef QT_MENTAT - text "MATRIX SOLVER OPTIONS" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 38 4 - text "MATRIX SOLVER OPTIONS" - } -#endif - - frame { - position 1 5 - size 36 23 - group job_solver_opts_gr - } - - popdown { - position 13 +25 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 41 12 - size 38 39 - border_width 1 - border_color border - background_color body - } - mode dialog -} - - -#-------------------------------------------------------------------------------------------------- -group job_run_solver_ddm_opts_gr { - - button { - position 0 0 - size 14 4 - text "\{DDM} OPTIONS" - popmenu ddm_options -# see also job_common.ms! - visible "not(or(job_solver_it_sparse, \ - job_solver_it_ext, \ - job_solver_mixed_direct_iterative, \ - job_solver_pardiso, \ - job_solver_mumps))" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_procs_gr { - frame { - position 0 0 - size 46 8 - group job_solver_multi_procs_parallel_off_gr - visible "*job_option parallel:off" - } - - frame { - position = = - size 46 8 - group job_solver_multi_procs_parallel_on_gr - visible "*job_option parallel:on" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_procs_parallel_off_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - true_command "*job_option nsolver_procs_serial:on" - false_command "*job_option nsolver_procs_serial:off" - toggle "*job_option nsolver_procs_serial:on" - help job_run_multithreading - } - -#ifdef QT_MENTAT - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - visible "*job_option nsolver_procs_serial:on" - help job_param - } -#else - button { - position +2 +4 - size 14 4 - text "# PROCESSES" - command "*job_param nsolver_procs" - visible "*job_option nsolver_procs_serial:on" - } -#endif - - text { - position +14 = - size 14 4 - display "job_param_value_nsolver_procs" - command "*job_param nsolver_procs" - visible "*job_option nsolver_procs_serial:on" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_procs_parallel_on_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - help job_run_multithreading - toggle true -#ifdef QT_MENTAT - set $dummy dummy -#endif - } - - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - border_width 1 - border_color black - } - - roller { - position +14 = - size 14 4 - nvalues 2 - texts "AUTOMATIC" - "USER" - commands "*job_option nsolver_procs_ddm:automatic" - "*job_option nsolver_procs_ddm:user" - help job_run_multithreading - rollers "*job_option nsolver_procs_ddm:automatic" - "*job_option nsolver_procs_ddm:user" - } - - frame { - position +14 = - size 16 4 - group job_nsolver_procs_ddm_automatic_gr - visible "*job_option nsolver_procs_ddm:automatic" - } - - frame { - position = = - size 16 4 - group job_nsolver_procs_ddm_user_gr - visible "*job_option nsolver_procs_ddm:user" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_nsolver_procs_ddm_automatic_gr { - - label { - position 0 0 - size 8 4 - text "VALUE" - border_width 1 - border_color black - } - - integer { - position +8 = - size 8 4 - display valid_domains - visible "*job_option ddm_generator:preprocessor" - } - - integer { - position = = - size 8 4 - display "job_param_ndomains" - visible "*job_option ddm_generator:fea_solver" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_nsolver_procs_ddm_user_gr { - -#ifdef QT_MENTAT - label { - position 0 0 - size 8 4 - text "VALUE" - help job_param - } -#else - button { - position 0 0 - size 8 4 - text "VALUE" - command "*job_param nsolver_procs" - } -#endif - - text { - position +8 = - size 8 4 - display "job_param_value_nsolver_procs" - command "*job_param nsolver_procs" - } -} - -group job_solver_multi_threads_gr { - frame { - position 0 0 - size 30 8 - group job_solver_multi_threads_mfront_sparse_gr - visible "and(job_solver_mfront_sparse,*job_option parallel:off)" - } - - frame { - position = = - size 46 8 - group job_solver_multi_threads_pardiso_parallel_off_gr - visible "and(job_solver_pardiso,*job_option parallel:off)" - } - - frame { - position = = - size 46 8 - group job_solver_multi_threads_pardiso_parallel_on_gr - visible "and(job_solver_pardiso,*job_option parallel:on)" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_threads_mfront_sparse_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE THREADS" - toggle "*job_option mfront_sparse_multi_threading:on" - true_command "*job_option mfront_sparse_multi_threading:on" - false_command "*job_option mfront_sparse_multi_threading:off" - help job_run_multithreading - } - -#ifdef QT_MENTAT - label { - position +2 +4 - size 14 4 - text "# THREADS" - visible "*job_option mfront_sparse_multi_threading:on" - help job_param - } -#else - button { - position +2 +4 - size 14 4 - text "# THREADS" - command "*job_param nthreads" - visible "*job_option mfront_sparse_multi_threading:on" - } -#endif - - text { - position +14 = - size 14 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - visible "*job_option mfront_sparse_multi_threading:on" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_gpu_gr { - - toggle { - position 0 0 - size 30 4 - text "USE \{GPU(s)}" - toggle "*job_option solver_use_gpu:on" - true_command "*job_option solver_use_gpu:on" - false_command "*job_option solver_use_gpu:off" - help job_solver_gpu - } - - label { - position +2 +4 - size 16 4 - text "\{GPU} SELECTION" - border_width 1 - border_color black - visible "*job_option solver_use_gpu:on" - } - - roller { - position +16 = - size 12 4 - nvalues 2 - texts "AUTOMATIC" - "USER" - commands "*job_option solver_gpus:automatic" - "*job_option solver_gpus:user" - rollers "*job_option solver_gpus:automatic" - "*job_option solver_gpus:user" - visible "*job_option solver_use_gpu:on" - help job_solver_gpu - } - - text { - position +12 = - size 16 4 - display job_solver_gpus - command "*clear_job_solver_gpus *job_solver_gpus" - visible "and(*job_option solver_use_gpu:on,*job_option solver_gpus:user)" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_threads_pardiso_parallel_off_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE THREADS" - toggle "*job_option pardiso_multi_threading:on" - true_command "*job_option pardiso_multi_threading:on" - false_command "*job_option pardiso_multi_threading:off" - help job_run_multithreading - } - -#ifdef QT_MENTAT - label { - position +2 +4 - size 14 4 - text "# THREADS" - visible "*job_option pardiso_multi_threading:on" - help job_param - } -#else - button { - position +2 +4 - size 14 4 - text "# THREADS" - command "*job_param nthreads" - visible "*job_option pardiso_multi_threading:on" - } -#endif - - text { - position +14 = - size 14 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - visible "*job_option pardiso_multi_threading:on" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_threads_pardiso_parallel_on_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE THREADS" - help job_run_multithreading - toggle true -#ifdef QT_MENTAT - set $dummy dummy -#endif - } - - label { - position +2 +4 - size 14 4 - text "# THREADS" - border_color black - border_width 1 - } - - roller { - position +14 = - size 14 4 - nvalues 2 - texts "AUTOMATIC" - "USER" - commands "*job_option pardiso_multi_threading_ddm:automatic" - "*job_option pardiso_multi_threading_ddm:user" - help job_run_multithreading - rollers "*job_option pardiso_multi_threading_ddm:automatic" - "*job_option pardiso_multi_threading_ddm:user" - } - - frame { - position +14 = - size 16 4 - group job_pardiso_multi_threads_ddm_automatic_gr - visible "*job_option pardiso_multi_threading_ddm:automatic" - } - - frame { - position = = - size 16 4 - group job_pardiso_multi_threads_ddm_user_gr - visible "*job_option pardiso_multi_threading_ddm:user" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_pardiso_multi_threads_ddm_automatic_gr { - - label { - position 0 0 - size 8 4 - text "VALUE" - border_width 1 - border_color black - } - - integer { - position +8 = - size 8 4 - display valid_domains - visible "*job_option ddm_generator:preprocessor" - } - - integer { - position = = - size 8 4 - display "job_param_ndomains" - visible "*job_option ddm_generator:fea_solver" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_pardiso_multi_threads_ddm_user_gr { - -#ifdef QT_MENTAT - label { - position 0 0 - size 8 4 - text "VALUE" - help job_param - } -#else - button { - position 0 0 - size 8 4 - text "VALUE" - command "*job_param nthreads" - } -#endif - - text { - position +8 = - size 8 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_parallel_env_gr { - - roller { - position 1 4 - size 30 4 - nvalues 2 - texts "SINGLE MACHINE" - "NETWORK" - help job_run_ddm_setup - roller "job_option parallel_setup" - commands "*job_option parallel_setup:single" - "*job_option parallel_setup:network" - } - - frame { - position +2 +5 - size 44 18 - group job_parallel_env_network_gr - visible "*job_option parallel_setup:network" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_parallel_env_network_gr { - - button { - position 0 0 - size 28 4 - text "HOST FILE" -#ifdef QT_MENTAT - browser host_file_browser -#else - popmenu host_file_browser_pm -#endif - settext $host_file_browser_label "SELECT HOST FILE" - set $host_file_browser_command "*job_host_file" - help job_host_file - } - - button { - position +28 = - size 8 4 - text "EDIT" - command "*job_edit_host_file" - help job_edit_host_file - visible job_host_file - } - - button { - position +8 = - size 8 4 - text "CLEAR" - command "*job_clear_host_file" - help job_clear_host_file - visible job_host_file - } - - display { - position 0 +4 - size 44 4 - display job_host_file - } - - frame { - position 0 +5 - size 44 9 - group job_parallel_env_network_ddm_gr - visible "*job_option parallel:on" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_parallel_env_network_ddm_gr { - - toggle { - position 0 0 - size 22 4 - text "COPY INPUT FILE" - toggle "*job_option copy_input_file:on" - true_command "*job_option copy_input_file:on" - false_command "*job_option copy_input_file:off" - help job_host_copy_inputfile - } - - toggle { - position +23 = - size 21 4 - text "COPY POST FILE" - toggle "*job_option copy_post_file:on" - true_command "*job_option copy_post_file:on" - false_command "*job_option copy_post_file:off" - help job_host_copy_inputfile - } - - label { - position 0 +5 - size 10 4 - text "HOSTS" - border_width 1 - border_color black - visible job_usersub_file - } - - roller { - position +10 = - size 18 4 - nvalues 2 - texts "COMPATIBLE" - "INCOMPATIBLE" - roller "job_option network_hosts" - commands "*job_option network_hosts:compatible" - "*job_option network_hosts:incompatible" - help job_host_comp - visible job_usersub_file - } -} - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu marc_integer_size_pm { - - window { - parent mentat - origin 55 32 - size 32 17 - border_width 1 - border_color border - background_color body - } - mode dialog - - group marc_integer_size_gr -} - - -#-------------------------------------------------------------------------------------------------- -group marc_integer_size_gr { - - popdown { - position 0 0 - size 32 4 - text "DEFAULT" - command "*job_option marc_integer_size:default" - help job_run_intsize - } - - popdown { - position = +4 - size 32 4 - text "4-BYTE INTEGERS" - command "*job_option marc_integer_size:i4" - help job_run_intsize - } - - popdown { - position = +4 - size 32 4 - text "8-BYTE INTEGERS" - command "*job_option marc_integer_size:i8" - help job_run_intsize - } - - popdown { - position = +5 - size 32 4 - text "CANCEL" - help job_run_intsize - } -} -#endif -#endif diff --git a/installation/mods_MarcMentat/2013/Marc_tools/comp_damask b/installation/mods_MarcMentat/2013/Marc_tools/comp_damask deleted file mode 100644 index 2d144b8a4..000000000 --- a/installation/mods_MarcMentat/2013/Marc_tools/comp_damask +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/ksh -# 1st arg: $DIR -# 2nd arg: $DIRJOB -# 3rd arg: $user -# 4th arg: $program -DIR=$1 -user=$3 -program=$4 -usernoext=$user -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - -# add BLAS options for linking - BLAS="%BLAS%" - -. $DIR/tools/include -DIRJOB=$2 -cd $DIRJOB -echo "Compiling and linking user subroutine $user on host `hostname`" -echo "program: $program" - $DFORTRAN $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - userobj=$usernoext.o - - - $LOAD ${program} $DIR/lib/main.o\ - $DIR/lib/blkdta.o $DIR/lib/comm?.o \ - ${userobj-} \ - $DIR/lib/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ../lib/mdsrc.a \ - ../lib/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $BLAS \ - $SYSLIBS || \ - { - echo "$0: link failed for $usernoext.o on host `hostname`" - exit 1 - } - /bin/rm $userobj - /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2013/Marc_tools/comp_damask_h b/installation/mods_MarcMentat/2013/Marc_tools/comp_damask_h deleted file mode 100644 index 01464f095..000000000 --- a/installation/mods_MarcMentat/2013/Marc_tools/comp_damask_h +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/ksh -# 1st arg: $DIR -# 2nd arg: $DIRJOB -# 3rd arg: $user -# 4th arg: $program -DIR=$1 -user=$3 -program=$4 -usernoext=$user -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - -# add BLAS options for linking - BLAS="%BLAS%" - -. $DIR/tools/include -DIRJOB=$2 -cd $DIRJOB -echo "Compiling and linking user subroutine $user on host `hostname`" -echo "program: $program" - $DFORTHIGH $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - userobj=$usernoext.o - - - $LOAD ${program} $DIR/lib/main.o\ - $DIR/lib/blkdta.o $DIR/lib/comm?.o \ - ${userobj-} \ - $DIR/lib/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ../lib/mdsrc.a \ - ../lib/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $BLAS \ - $SYSLIBS || \ - { - echo "$0: link failed for $usernoext.o on host `hostname`" - exit 1 - } - /bin/rm $userobj - /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2013/Marc_tools/comp_damask_hmp b/installation/mods_MarcMentat/2013/Marc_tools/comp_damask_hmp deleted file mode 100644 index 36ced6543..000000000 --- a/installation/mods_MarcMentat/2013/Marc_tools/comp_damask_hmp +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/ksh -# 1st arg: $DIR -# 2nd arg: $DIRJOB -# 3rd arg: $user -# 4th arg: $program -DIR=$1 -user=$3 -program=$4 -usernoext=$user -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - -# add BLAS options for linking - BLAS="%BLAS%" - -. $DIR/tools/include -DIRJOB=$2 -cd $DIRJOB -echo "Compiling and linking user subroutine $user on host `hostname`" -echo "program: $program" - $DFORTHIGHMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - userobj=$usernoext.o - - - $LOAD ${program} $DIR/lib/main.o\ - $DIR/lib/blkdta.o $DIR/lib/comm?.o \ - ${userobj-} \ - $DIR/lib/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ../lib/mdsrc.a \ - ../lib/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $BLAS \ - $SYSLIBS || \ - { - echo "$0: link failed for $usernoext.o on host `hostname`" - exit 1 - } - /bin/rm $userobj - /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2013/Marc_tools/comp_damask_l b/installation/mods_MarcMentat/2013/Marc_tools/comp_damask_l deleted file mode 100644 index 31b5cd175..000000000 --- a/installation/mods_MarcMentat/2013/Marc_tools/comp_damask_l +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/ksh -# 1st arg: $DIR -# 2nd arg: $DIRJOB -# 3rd arg: $user -# 4th arg: $program -DIR=$1 -user=$3 -program=$4 -usernoext=$user -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - -# add BLAS options for linking - BLAS="%BLAS%" - -. $DIR/tools/include -DIRJOB=$2 -cd $DIRJOB -echo "Compiling and linking user subroutine $user on host `hostname`" -echo "program: $program" - $DFORTLOW $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - userobj=$usernoext.o - - - $LOAD ${program} $DIR/lib/main.o\ - $DIR/lib/blkdta.o $DIR/lib/comm?.o \ - ${userobj-} \ - $DIR/lib/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ../lib/mdsrc.a \ - ../lib/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $BLAS \ - $SYSLIBS || \ - { - echo "$0: link failed for $usernoext.o on host `hostname`" - exit 1 - } - /bin/rm $userobj - /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2013/Marc_tools/comp_damask_lmp b/installation/mods_MarcMentat/2013/Marc_tools/comp_damask_lmp deleted file mode 100644 index 8a0c1255d..000000000 --- a/installation/mods_MarcMentat/2013/Marc_tools/comp_damask_lmp +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/ksh -# 1st arg: $DIR -# 2nd arg: $DIRJOB -# 3rd arg: $user -# 4th arg: $program -DIR=$1 -user=$3 -program=$4 -usernoext=$user -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - -# add BLAS options for linking - BLAS="%BLAS%" - -. $DIR/tools/include -DIRJOB=$2 -cd $DIRJOB -echo "Compiling and linking user subroutine $user on host `hostname`" -echo "program: $program" - $DFORTRANLOWMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - userobj=$usernoext.o - - - $LOAD ${program} $DIR/lib/main.o\ - $DIR/lib/blkdta.o $DIR/lib/comm?.o \ - ${userobj-} \ - $DIR/lib/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ../lib/mdsrc.a \ - ../lib/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $BLAS \ - $SYSLIBS || \ - { - echo "$0: link failed for $usernoext.o on host `hostname`" - exit 1 - } - /bin/rm $userobj - /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2013/Marc_tools/comp_damask_mp b/installation/mods_MarcMentat/2013/Marc_tools/comp_damask_mp deleted file mode 100644 index 986d9ae04..000000000 --- a/installation/mods_MarcMentat/2013/Marc_tools/comp_damask_mp +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/ksh -# 1st arg: $DIR -# 2nd arg: $DIRJOB -# 3rd arg: $user -# 4th arg: $program -DIR=$1 -user=$3 -program=$4 -usernoext=$user -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` -usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - -# add BLAS options for linking - BLAS="%BLAS%" - -. $DIR/tools/include -DIRJOB=$2 -cd $DIRJOB -echo "Compiling and linking user subroutine $user on host `hostname`" -echo "program: $program" - $DFORTRANMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - userobj=$usernoext.o - - - $LOAD ${program} $DIR/lib/main.o\ - $DIR/lib/blkdta.o $DIR/lib/comm?.o \ - ${userobj-} \ - $DIR/lib/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ../lib/mdsrc.a \ - ../lib/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $BLAS \ - $SYSLIBS || \ - { - echo "$0: link failed for $usernoext.o on host `hostname`" - exit 1 - } - /bin/rm $userobj - /bin/rm $DIRJOB/*.mod diff --git a/installation/mods_MarcMentat/2013/Marc_tools/comp_user.original b/installation/mods_MarcMentat/2013/Marc_tools/comp_user.original deleted file mode 100644 index 8679bb041..000000000 --- a/installation/mods_MarcMentat/2013/Marc_tools/comp_user.original +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/ksh -# 1st arg: $DIR -# 2nd arg: $DIRJOB -# 3rd arg: $user -# 4th arg: $program -DIR=$1 -user=$3 -program=$4 -. $DIR/tools/include -DIRJOB=$2 -cd $DIRJOB -echo "Compiling and linking user subroutine $user.f on host `hostname`" -echo "program: $program" - $FORTRAN $user.f || \ - { - echo "$0: compile failed for $user.f" - exit 1 - } - /bin/rm $program 2>/dev/null - userobj=$user.o - - - $LOAD ${program} $DIR/lib/main.o\ - $DIR/lib/blkdta.o $DIR/lib/comm?.o \ - ${userobj-} \ - $DIR/lib/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ../lib/mdsrc.a \ - ../lib/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $SYSLIBS || \ - { - echo "$0: link failed for $user.o on host `hostname`" - exit 1 - } - /bin/rm $userobj diff --git a/installation/mods_MarcMentat/2013/Marc_tools/include_linux64 b/installation/mods_MarcMentat/2013/Marc_tools/include_linux64 deleted file mode 100644 index 9af09e049..000000000 --- a/installation/mods_MarcMentat/2013/Marc_tools/include_linux64 +++ /dev/null @@ -1,709 +0,0 @@ -# -# General definitions for the Marc 2011 version -# -# EM64T -# ( LP64 - i4 version) -# (ILP64 - i8 version) -# -# Linux RedHat 5.4 -# -# 64 bit MPI version -# -# Intel(R) Fortran Compiler -# Version 12.0.4 -# -# Intel(R) C Compiler -# Version 12.0.4 -# -# DATE -# -# To check the O/S level, type: -# uname -a -# -# Distributed parallel MPI libraries: -# 1) HP MPI 2.3 -# To check the mpi version, type: -# mpirun -version -# 2) Intel MPI 4.0.1.007 -# To check the mpi version, type: -# mpirun -version -# -# MKL Libraries: -# Intel(R) MKL 10.3.0.084 -# -# To check the Compiler level, type using the compiler -# installation path: -# ifort -V -# icc -V -# -# REMARKS : This file contains the definitions of variables used during -# compilation loading and use of the MARC programmes . The -# current machine type is identified by means of the variable -# MACHINE , defined below. -# -# -# MPI_ROOT: root directory in which mpi shared libraries, etc. are located -# DIRJOB : directory in which spawned jobs should look for Marc input -# MPI_ARCH: system architecture -# MPI_EPATH: path where executable resides -# - -REVISION="VERSION, BUILD" -HOSTNAME=`hostname` - -# find available memory in Mbyte on the machine -# can be set explicitly -MEMLIMIT=`free -m | awk '/Mem:/ {print $2}'` - -# set _OEM_NASTRAN to 1 for MD Nastran build -# override _OEM_NASTRAN setting with MARC_MD_NASTRAN environment variable -_OEM_NASTRAN="${MARC_MD_NASTRAN:-0}" - -# uncomment the following line for an autoforge build -#AUTOFORGE=1 -AUTOFORGE=0 -export AUTOFORGE - -# integer size -if test "$MARC_INTEGER_SIZE" = "" ; then - INTEGER_PATH= -else - INTEGER_PATH=/$MARC_INTEGER_SIZE -fi - -FCOMP=ifort - -# -# settings for Metis -# -METIS="-I$METIS_SOURCE" -METISLIBS="$MARC_LIB/metis.a " - -# -# settings for MPI -# -# RCP and RSH are used for parallel network runs -# replace with similar commands like rsh if needed -RCP=/usr/bin/scp -RSH=/usr/bin/ssh -# - - -MPI_DEFAULT=intelmpi -MPI_OTHER=hpmpi - -MPITYPE=$MPI_DEFAULT - -if test $AUTOFORGE -then - if test $AUTOFORGE = 1 - then - MPITYPE=none - fi -fi - - -# overrule MPITYPE setting with environmental variable MARC_MPITYPE -if test $MARC_MPITYPE -then - MPITYPE=$MARC_MPITYPE -fi - -# always set MPITYPE to none for MD Nastran -if test "$_OEM_NASTRAN" -ne 0 -then - MPITYPE=none -fi - -# Edit following lines to build with GPGPU version of BCS Solver for -# NVIDIA platforms -#BCSGPUSOLVER=NONE -BCSGPUSOLVER=BCSGPU - -SOLVERFLAGS= -if test "$BCSGPUSOLVER" = BCSGPU -then - SOLVERFLAGS="$SOLVERFLAGS -DBCSGPU -DCUDA" - BCS_DIR=bcsgpusolver - export PATH=$MARC_CUDA/bin:$MARC_CUDA/nvvm:$PATH - export LD_LIBRARY_PATH=$MARC_CUDA/lib64:$LD_LIBRARY_PATH -else - BCS_DIR=bcssolver -fi -# -# settings for MPI -# -DDM= -if test $MPITYPE != none -then - if test $MPITYPE = hpmpi - then - FCOMPMPI=mpif90 - export MPI_ROOT=$MARC_HPMPI - export MPI_REMSH=$RSH - export MPI_F77=$FCOMP - ARCHITECTURE=linux_amd64 - DDM="-I$MPI_ROOT/include/64 -DDDM -DHPMPI" - MPI_CLEAN= - export MPI_EPATH=$MARC_BIN - export LD_LIBRARY_PATH=$MPI_ROOT/lib/$ARCHITECTURE:$MARC_LIB:$MARC_LIB_SHARED:$LD_LIBRARY_PATH - export MPIHPSPECIAL="-e MPI_FLAGS=E,T,y1" -# Below line is moved in run_marc file -# export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - export MPIHPSPECIAL="$MPIHPSPECIAL -e BINDIR=$MARC_BIN" - if test -n "$MSC_LICENSE_FILE" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e MSC_LICENSE_FILE=$MSC_LICENSE_FILE" - fi - if test -n "$LM_LICENSE_FILE" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LM_LICENSE_FILE=$LM_LICENSE_FILE" - fi - export MPIHPSPECIAL="$MPIHPSPECIAL -e MPI_LIC_CHECKER=$MPI_ROOT/bin/licensing/amd64_s8/lichk.x" - RUN_JOB2="$MPI_ROOT/bin/mpirun ${MPIRUNOPTIONS} -prot -f " - RUN_JOB1="$MPI_ROOT/bin/mpirun ${MPIRUNOPTIONS} -prot -w $MPIHPSPECIAL -np " - RUN_JOB0= - fi - if test $MPITYPE = intelmpi - then - INTELMPI_VERSION=HYDRA - FCOMPMPI=mpiifort - MPI_ROOT=$MARC_INTELMPI - DDM="-I${MPI_ROOT}/include64 -DDDM" - PATH=$MPI_ROOT/bin64:$PATH - export PATH - LD_LIBRARY_PATH=$MPI_ROOT/lib64:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - if test $INTELMPI_VERSION = HYDRA - then - RUN_JOB1="${MPI_ROOT}/bin64/mpiexec.hydra -genvall -n " - RUN_JOB2="${MPI_ROOT}/bin64/mpiexec.hydra -genvall" - else - RUN_JOB1="${MPI_ROOT}/bin64/mpiexec -n " - RUN_JOB2="${MPI_ROOT}/bin64/mpiexec -configfile " - fi - RUN_JOB0= - MPI_CLEAN= - MPI_EPATH=$MARC_BIN - MPIR_HOME=$MPI_ROOT - MPICH_F77=$FCOMP - MPICH_F77LINKER=$FCOMP - export MPI_ROOT MPI_EPATH MPIR_HOME MPICH_F77 MPICH_F77LINKER - I_MPI_PIN_DOMAIN=node - export I_MPI_PIN_DOMAIN - fi -else - MPI_ROOT=$MARC_DUMMYMPI - export MPI_ROOT=$MARC_DUMMYMPI - DDM="-I$MPI_ROOT/include" -fi - -# -# variables for the "maintain" script -# - -MACHINENAME=LINUX -MACHINE64BIT=yes -MACHINE=Linux_EM64T -DEV=/dev/tape -GETLOG="whoami" -CLEAR="clear" -MY_UNAME=`uname -a` - -# Edit following 2 lines to build with VKI Solver -#VKISOLVER=VKI -VKISOLVER=NONE - -# Edit following 2 lines to build with CASI Solver -CASISOLVER=CASI -#CASISOLVER=NONE - -# Edit following 2 lines to build with MF2 Solver -MF2SOLVER=NONE -#MF2SOLVER=SERIAL -#MF2SOLVER=MF2PARALLEL - -# Edit following lines to build with Intel(c) Multithreaded solver (PARDISO) -#INTELSOLVER=NONE -INTELSOLVER=PARDISO - -# Edit following lines to build with MUMPS -if test "$MARC_INTEGER_SIZE" = "i4" ; then - #MUMPSSOLVER=NONE - MUMPSSOLVER=MUMPS -else - #MUMPSSOLVER=NONE - MUMPSSOLVER=MUMPS -fi - -# Edit following 2 lines to build MARC dynamic shared library -MARC_DLL=MARC_DLL -#MARC_DLL=NONE - -# always set VKISOLVER, CASISOLVER, BCSGPUSOLVER, and MARC_DLL to NONE for MD Nastran -if test "$_OEM_NASTRAN" -ne 0 -then - VKISOLVER=NONE - CASISOLVER=NONE - MF2SOLVER=NONE - INTELSOLVER=NONE - MUMPSSOLVER=NONE - BCSGPUSOLVER=NONE - MARC_DLL=NONE -fi - -# -# define Fortran and C compile syntax -# -if test "$VKISOLVER" = VKI -then - SOLVERFLAGS="$SOLVERFLAGS -DVKI" -fi - -if test "$CASISOLVER" = CASI -then - SOLVERFLAGS="$SOLVERFLAGS -DCASI" -fi - -if test "$MF2SOLVER" = MF2PARALLEL -then - SOLVERFLAGS="$SOLVERFLAGS -DMF2PARALLEL" -fi -if test "$MF2SOLVER" = MF2SERIAL -then - SOLVERFLAGS="$SOLVERFLAGS -DMF2SERIAL" -fi - -if test "$INTELSOLVER" = PARDISO -then - SOLVERFLAGS="$SOLVERFLAGS -DPARDISO" -fi - -if test "$MUMPSSOLVER" = MUMPS -then - SOLVERFLAGS="$SOLVERFLAGS -DMUMPS" -fi - - -if test "$MARC_DLL" = MARC_DLL -then - SOLVERFLAGS="$SOLVERFLAGS -DMARC_DLL" -fi - -LINK_OPT= -DEBUG_OPT= -C_DEBUG_OPT= - -#Uncomment following line to build Marc in debuggable mode -MARCDEBUG= -#MARCDEBUG="ON" - -if test "$MARCDEBUG" = "ON" -then - LINK_OPT="-debug -traceback" - DEBUG_OPT="-debug -traceback" - C_DEBUG_OPT="-debug -traceback" -fi - - -MARCCHECK= -#MARCCHECK="ON" -if test "$MARCCHECK" = "ON" -then - DEBUG_OPT="$DEBUG_OPT -fpe0 -fp-stack-check -check all -ftrapuv " - C_DEBUG_OPT="$C_DEBUG_OPT -fp-stack-check -check-uninit -Wformat -ftrapuv " -fi - -MARCCODECOV= -#MARCCODECOV="ON" - -if test "$MARC_INTEGER_SIZE" = "i4" ; then - I8FFLAGS="-real-size 64 -integer-size 32" - I8DEFINES="-DFLOAT=8 -DINT=4" - I8CDEFINES= - I8CASIDEFS= -else - I8FFLAGS="-i8 -real-size 64 -integer-size 64" - I8DEFINES="-DI64 -DFLOAT=8 -DINT=8" - I8CDEFINES="-U_DOUBLE -D_SINGLE" - I8CASIDEFS="-DCASI_64BIT_INT=1" -fi - - -CDEFINES= -FDEFINES= - -if test "$_OEM_NASTRAN" -ne 0 -then - CDEFINES="$CDEFINES -D_OEM_NASTRAN" - FDEFINES="$FDEFINES -D_OEM_NASTRAN" -fi - -FDEFINES="$FDEFINES -D_IMPLICITNONE" - -if test "$_OEM_NASTRAN" -eq 0 -then - FDEFINES="$FDEFINES -DOPENMP -DMKL" -fi - -# -D_MSCMARC -FDEFINES="$FDEFINES -D_MSCMARC $DEBUG_OPT" -CDEFINES="$CDEFINES -D_MSCMARC $C_DEBUG_OPT $I8CDEFINES" - -CINCL="-I$MARC_SOURCE/mdsrc -I$MARC_SOURCE/csource $METIS" -if test "$_OEM_NASTRAN" -ne 0 -then - CINCL="$CINCL -I../../include" -fi - -CC="icc -c -O1 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " -CCLOW="icc -c -O0 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " -CCHIGH="icc -c -O3 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " - -if test "$MARCDEBUG" = "ON" -then - CC="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " - CCLOW="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " - CCHIGH="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " -fi - -LOAD_CC="icc -O1 -DLinux -DLINUX -DLinux_intel" -CCT="$CC" -CCTLOW="$CCLOW" -CCTHIGH="$CCHIGH" - -CC_CASI="$CC -c99 $I8CASIDEFS" -CCLOW_CASI="$CCLOW -c99 $I8CASIDEFS" -CCHIGH_CASI="$CCHIGH -c99 $I8CASIDEFS" - -CCT_CASI="$CCT -c99 $I8CASIDEFS" -CCTLOW_CASI="$CCLOW -c99 $I8CASIDEFS" -CCTHIGH_CASI="$CCHIGH -c99 $I8CASIDEFS" - -#PROFILE="-Mprof=func" -#PROFILE="-Mprof=lines" -#PROFILE="-Mprof=func,mpi" -PROFILE= -if test "$MARCCODECOV" = "ON" -then -PROFILE="-prof-gen=srcpos" -fi - -FORTLOW="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -O0 $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -FORTRAN="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -O1 $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -FORTHIGH="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -FORTNA="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr -save -zero -mp1 -WB -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" - -# determine DAMASK version -HIT=0 -for arg in "$@" -do - if [ $HIT = 1 ] - then - DAMASKPATH=`dirname $arg` - break - elif [ ${arg:0:2} = -u -o ${arg:0:2} = -U ] - then - HIT=1 - fi -done -read DAMASKVERSION < $DAMASKPATH/../VERSION -DAMASKVERSION="'"$DAMASKVERSION"'" - -# DAMASK compiler calls: additional flags are in line 2 OpenMP flags in line 3; removed -save for calls with openMP -DFORTLOW="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -O0 $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013 -DDAMASKVERSION=$DAMASKVERSION \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -DFORTLOWMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB -O0 $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013 -DDAMASKVERSION=$DAMASKVERSION \ - -openmp -openmp_report2 \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -DFORTRAN="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -O1 $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013 -DDAMASKVERSION=$DAMASKVERSION \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -DFORTRANMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB -O1 $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013 -DDAMASKVERSION=$DAMASKVERSION \ - -openmp -openmp_report2 \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -DFORTHIGH="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -fno-alias -O2 $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013 -DDAMASKVERSION=$DAMASKVERSION \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -DFORTHIGHMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB -fno-alias -O2 $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013 -DDAMASKVERSION=$DAMASKVERSION \ - -openmp -openmp_report2 \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - -if test "$MARCDEBUG" = "ON" -then - FORTLOW="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - FORTRAN="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - FORTHIGH="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - FORTNA="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr -save -zero -mp1 -WB -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" - -# DAMASK compiler calls: additional flags are in line 2 OpenMP flags in line 3; removed -save for calls with openMP - DFORTLOW="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013 -DDAMASKVERSION=$DAMASKVERSION \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - DFORTLOWMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013 -DDAMASKVERSION=$DAMASKVERSION \ - -openmp -openmp_report2 \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - DFORTRAN="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013 -DDAMASKVERSION=$DAMASKVERSION \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - DFORTRANMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013 -DDAMASKVERSION=$DAMASKVERSION \ - -openmp -openmp_report2 \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - DFORTHIGH="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013 -DDAMASKVERSION=$DAMASKVERSION \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - DFORTHIGHMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ - -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2013 -DDAMASKVERSION=$DAMASKVERSION \ - -openmp -openmp_report2 \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -fi - -FORTLOWT="$FORTLOW" -FORTRANT="$FORTRAN" -FORTHIGHT="$FORTHIGH" - -FORTRANMNF="$FCOMP -c $FDEFINES " -CCMNF="icc -c -O1 -DLinux -DLINUX -DLinux_intel -Dport2egcs -I$MARC_SOURCE/marctoadams/mnf/include -D_LARGEFILE64_SOURCE" - -FORTRANMUMPS="$FCOMP -fpp -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -fno-alias -O1 -fp-model precise $FDEFINES -D_IMPLICITNONE $I8FFLAGS $I8DEFINES $DDM -I$MARC_SOURCE/mumpssolver/include -Dintel_ -DALLOW_NON_INIT -Dmetis -nofor_main" -CCMUMPS="icc -c -DAdd_ -Dmetis -I$MARC_SOURCE/mumpssolver/include" - - -BCSCC="icc -c -O3 -DLOWERCASE_ -I${MARC_SOURCE}/${BCS_DIR}/bcslib_csrc $CDEFINES $CINCL" -NVCC="nvcc -c -O3 -arch sm_20 -DLOWERCASE_ -I${MARC_SOURCE}/${BCS_DIR}/bcslib_cuda/include -I${MARC_CUDA}/include -I$MARC_SOURCE/mdsrc $I8DEFINES -Xcompiler -fvisibility=hidden -Xcompiler -fPIC $I8DEFINES " -NVCCLIB="ar rvl" -NVCCLD=icc -BCSFORTLOW="$FORTLOW -I${MARC_SOURCE}/${BCS_DIR}/common" -BCSFORTRAN="$FORTRAN -I${MARC_SOURCE}/${BCS_DIR}/common" -BCSFORTHIGH="$FORTHIGH -I${MARC_SOURCE}/${BCS_DIR}/common" -BCSFORT90HIGH="$BCSFORTHIGH" -if test "$MARCDEBUG" = "ON" -then - BCSFORTRAN=$BCSFORTLOW - BCSFORTHIGH=$BCSFORTLOW - BCSFORT90HIGH=$BCSFORTLOW -fi - -if test $MPITYPE != none -then - if test $MPITYPE = hpmpi - then - LOAD="$MPI_ROOT/bin/$FCOMPMPI ${LOADOPTIONS} -L$MPI_ROOT/lib/$ARCHITECTURE $PROFILE $LINK_OPT -o " - LOADT="$MPI_ROOT/bin/$FCOMPMPI ${LOADOPTIONS} -L$MPI_ROOT/lib/$ARCHITECTURE $PROFILE $LINK_OPT -o " - fi -# Uncomment the following lines to turn on the tracer and commnet out the next 5 lines -# if test $MPITYPE = intelmpi -# then -# INCLUDEMPI="-I$MPI_ROOT/include64 -I$VT_ROOT/include" -# LOAD="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " -# LOADT="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " -# fi - if test $MPITYPE = intelmpi - then - LOAD="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $LINK_OPT -o " - LOADT="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $LINK_OPT -o " - fi -else - LOAD="$FCOMP $LINK_OPT -o " - LOADT="$FCOMP $LINK_OPT -o " -fi - -if test "$MARC_DLL" = MARC_DLL -then - FORTLOW="$FORTLOW -fpp -fPIC" - FORTRAN="$FORTRAN -fpp -fPIC" - FORTHIGH="$FORTHIGH -fpp -fPIC" - FORTRANMNF="$FORTRANMNF -fpp -fPIC" - CC="$CC -fPIC" - CCMNF="$CCMNF -fPIC" - CC_CASI="$CC_CASI -fPIC" - CCLOW_CASI="$CCLOW_CASI -fPIC" - CCHIGH_CASI="$CCHIGH_CASI -fPIC" - LINK_EXE_MARC="-L$MARC_LIB -lmarc -L$MARC_LIB_SHARED -lguide -lpthread" - LINK_MARC_DLL="-shared -fPIC" - LOAD_DLL=$LOAD - LOADT_DLL=$LOADT - EXT_DLL="so" -fi - - -XLIBS="-L/usr/X11/lib -lX11 " - -# -# define archive and ranlib syntax -# - -ARC="ar rvl" -ARD="ar dvl" -ARX="ar xl" -RAN="" - -# -# choose which libraries you want to use ( e.g. blas ) -# - -if test "$VKISOLVER" = VKI -then - VKISOLVERLIBS="$MARC_LIB/vkisolver.a" -else - VKISOLVERLIBS= -fi - -if test "$CASISOLVER" = CASI -then - CASISOLVERLIBS="$MARC_LIB/casilib.a" -else - CASISOLVERLIBS= -fi - -MF2SOLVERLIBS= -if test "$MF2SOLVER" = MF2PARALLEL -then - MF2SOLVERLIBS="$MARC_LIB/mf2parallel/libseq.a \ - $MARC_LIB/mf2parallel/libsym.a \ - $MARC_LIB/mf2parallel/libmet.a \ - $MARC_LIB/mf2parallel/libmf2.a \ - $MARC_LIB/mf2parallel/libgauss.a \ - $MARC_LIB/mf2parallel/libmf2.a \ - $MARC_LIB/mf2parallel/libgauss.a \ - $MARC_LIB/mf2parallel/libnum.a \ - $MARC_LIB/mf2parallel/libutl.a \ - $MARC_LIB/mf2parallel/libr8.a \ - $MARC_LIB/mf2parallel/libz.a " -fi - -if test "$INTELSOLVER" = PARDISO -then - if test "$MARC_INTEGER_SIZE" = "i4" ; then - INTELSOLVERLIBS="$MARC_MKL/libmkl_solver_lp64.a" - else - INTELSOLVERLIBS="$MARC_MKL/libmkl_solver_ilp64.a" - fi -else - INTELSOLVERLIBS= -fi - -if test "$MUMPSSOLVER" = MUMPS -then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - if test $MPITYPE = none - then - MUMPSSOLVERLIBS2= - echo hello > /dev/null - fi - if test $MPITYPE = intelmpi - then - if test "$MARC_INTEGER_SIZE" = "i4" ; then - MUMPSSOLVERLIBS2="$MARC_MKL/libmkl_scalapack_lp64.a $MARC_MKL/libmkl_blacs_intelmpi_lp64.a" - else - MUMPSSOLVERLIBS2="$MARC_MKL/libmkl_scalapack_ilp64.a $MARC_MKL/libmkl_blacs_intelmpi_ilp64.a" - fi - fi - if test $MPITYPE = hpmpi - then - if test "$MARC_INTEGER_SIZE" = "i4" ; then - MUMPSSOLVERLIBS2="$MARC_MKL/libmkl_scalapack_lp64.a $MARC_MKL/libmkl_blacs_lp64.a" - else - MUMPSSOLVERLIBS2="$MARC_MKL/libmkl_scalapack_ilp64.a $MARC_MKL/libmkl_blacs_ilp64.a" - fi - fi -else - MUMPSSOLVERLIBS= - MUMPSSOLVERLIBS2= -fi - -if test "$BCSGPUSOLVER" = BCSGPU -then - BCSSOLVERLIBS="${MARC_LIB}/bcsgpulib.a " - MARCCUDALIBS1="-L${MARC_LIB}/cuda_dummy -lmarccuda " - MARCCUDALIBS2="-L${MARC_LIB}/cuda -lmarccuda " - MARCCUDALIBS=$MARCCUDALIBS1 - CUDALIBS="-L$MARC_CUDA/lib64 -lcudart -lcublas -L/usr/lib64 -lcuda " -else - BCSSOLVERLIBS="${MARC_LIB}/bcslib.a " -fi - -if test "$MARC_INTEGER_SIZE" = "i4" ; then - MKLLIB=$MARC_MKL/libmkl_intel_lp64.a -else - MKLLIB=$MARC_MKL/libmkl_intel_ilp64.a -fi - -SECLIBS="-L$MARC_LIB -llapi" - -SOLVERLIBS="${BCSSOLVERLIBS} \ - ${INTELSOLVERLIBS} ${MUMPSSOLVERLIBS2} ${MF2SOLVERLIBS} \ - -Wl,--start-group $MKLLIB $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_core.a -Wl,--end-group \ - $MARC_MKL/libguide.a \ - $MARC_LIB/blas_src.a ${VKISOLVERLIBS} ${CASISOLVERLIBS} " -SOLVERLIBS_DLL=${SOLVERLIBS} - -MRCLIBS="$MARC_LIB/clib.a ${CASISOLVERLIBS}" -MRCLIBSPAR="$MARC_LIB/clib.a" -STUBS="$MARC_LIB/stubs.a " -MNFLIBS="$MARC_LIB/libmnf.a" -MDUSER="$MARC_LIB/md_user.a" - - -OPENMP="-openmp" - -SYSLIBS=" $OPENMP -lpthread " - -# Uncomment the following lines to turn on the trace and comment out the next 4 lines -# if test $MPITYPE = intelmpi -# then -# SYSLIBS="-L${VT_ROOT}/lib -lVT -ldwarf -lelf -lm -lpthread \ -# -L${MPI_ROOT}/lib64 -lmpi -lmpiif -lmpigi -lrt" -# fi -if test $MPITYPE = intelmpi -then - SYSLIBS="-L${MPI_ROOT}/lib64 -lmpi -lmpiif -lmpigi -lrt $OPENMP -lpthread" -fi - -SYSLIBSPAR=" " - -MARC_DLL_CODES="runmarc.f" - - -BLAS_SRC="dzero.f icopy.f izero.f" -if test "$_OEM_NASTRAN" -ne 0 -then - if test "$MARC_INTEGER_SIZE" = "i4" ; then - BLAS_SRC="$BLAS_SRC dsctr.f zsctr.f dzasum.f daxpyi.f zaxpyi.f dgthr.f zgthr.f" - else - BLAS_SRC="ALL" - fi -fi - -LOW_OPT_CODES="are163.f contro.f ndext.f omarc.f omarca.f omarcb.f omarcc.f \ - omars.f fixbc.f triang.f bet049.f norst3.f eldata.f \ - elec*.f elct*.f fmeig.f oada00.f ogeig.f updtrbe2.f cycrota.f \ - cordef.f ogpk.f ogtan.f eldam.f formrbe3.f \ - inertie.f em_sso072.f cn_fol3d_qpatch6.f" -if test "$MARC_INTEGER_SIZE" = "i8" ; then - LOW_OPT_CODES="$LOW_OPT_CODES bbcseg.f" -fi -LOW_OPT_CODES_CASI="" - -HIGH_OPT_CODES="dpsmsa1.f dpsmsa2.f dpsmsa3.f dpsmsa4.f dpsmsa5.f dpsmsa6.f \ - dpsmsa7.f dpsmsa8.f dpsmsa9.f dpsmsa10.f dpsmsa11.f dpsmsa12.f \ - dpsmsa13.f dpsmsa14.f dpsmsa15.f dpsmsa16.f " - - -HIGH_OPT_CODES_CASI="arithkernels.c blockedroutines.c blockedroutines_fd.c elemmatgenkernels.c longvecroutines.c sfmultutils.c solvewithbd.c" - -MAXNUM=1000000 diff --git a/installation/mods_MarcMentat/2013/Marc_tools/include_linux64.original b/installation/mods_MarcMentat/2013/Marc_tools/include_linux64.original deleted file mode 100644 index eed3d07db..000000000 --- a/installation/mods_MarcMentat/2013/Marc_tools/include_linux64.original +++ /dev/null @@ -1,647 +0,0 @@ -# -# General definitions for the Marc 2011 version -# -# EM64T -# ( LP64 - i4 version) -# (ILP64 - i8 version) -# -# Linux RedHat 5.4 -# -# 64 bit MPI version -# -# Intel(R) Fortran Compiler -# Version 12.0.4 -# -# Intel(R) C Compiler -# Version 12.0.4 -# -# DATE -# -# To check the O/S level, type: -# uname -a -# -# Distributed parallel MPI libraries: -# 1) HP MPI 2.3 -# To check the mpi version, type: -# mpirun -version -# 2) Intel MPI 4.0.1.007 -# To check the mpi version, type: -# mpirun -version -# -# MKL Libraries: -# Intel(R) MKL 10.3.0.084 -# -# To check the Compiler level, type using the compiler -# installation path: -# ifort -V -# icc -V -# -# REMARKS : This file contains the definitions of variables used during -# compilation loading and use of the MARC programmes . The -# current machine type is identified by means of the variable -# MACHINE , defined below. -# -# -# MPI_ROOT: root directory in which mpi shared libraries, etc. are located -# DIRJOB : directory in which spawned jobs should look for Marc input -# MPI_ARCH: system architecture -# MPI_EPATH: path where executable resides -# - -REVISION="VERSION, BUILD" -HOSTNAME=`hostname` - -# find available memory in Mbyte on the machine -# can be set explicitly -MEMLIMIT=`free -m | awk '/Mem:/ {print $2}'` - -# set _OEM_NASTRAN to 1 for MD Nastran build -# override _OEM_NASTRAN setting with MARC_MD_NASTRAN environment variable -_OEM_NASTRAN="${MARC_MD_NASTRAN:-0}" - -# uncomment the following line for an autoforge build -#AUTOFORGE=1 -AUTOFORGE=0 -export AUTOFORGE - -# integer size -if test "$MARC_INTEGER_SIZE" = "" ; then - INTEGER_PATH= -else - INTEGER_PATH=/$MARC_INTEGER_SIZE -fi - -FCOMP=ifort - -# -# settings for Metis -# -METIS="-I$METIS_SOURCE" -METISLIBS="$MARC_LIB/metis.a " - -# -# settings for MPI -# -# RCP and RSH are used for parallel network runs -# replace with similar commands like rsh if needed -RCP=/usr/bin/scp -RSH=/usr/bin/ssh -# - - -MPI_DEFAULT=intelmpi -MPI_OTHER=hpmpi - -MPITYPE=$MPI_DEFAULT - -if test $AUTOFORGE -then - if test $AUTOFORGE = 1 - then - MPITYPE=none - fi -fi - - -# overrule MPITYPE setting with environmental variable MARC_MPITYPE -if test $MARC_MPITYPE -then - MPITYPE=$MARC_MPITYPE -fi - -# always set MPITYPE to none for MD Nastran -if test "$_OEM_NASTRAN" -ne 0 -then - MPITYPE=none -fi - -# Edit following lines to build with GPGPU version of BCS Solver for -# NVIDIA platforms -#BCSGPUSOLVER=NONE -BCSGPUSOLVER=BCSGPU - -SOLVERFLAGS= -if test "$BCSGPUSOLVER" = BCSGPU -then - SOLVERFLAGS="$SOLVERFLAGS -DBCSGPU -DCUDA" - BCS_DIR=bcsgpusolver - export PATH=$MARC_CUDA/bin:$MARC_CUDA/nvvm:$PATH - export LD_LIBRARY_PATH=$MARC_CUDA/lib64:$LD_LIBRARY_PATH -else - BCS_DIR=bcssolver -fi -# -# settings for MPI -# -DDM= -if test $MPITYPE != none -then - if test $MPITYPE = hpmpi - then - FCOMPMPI=mpif90 - export MPI_ROOT=$MARC_HPMPI - export MPI_REMSH=$RSH - export MPI_F77=$FCOMP - ARCHITECTURE=linux_amd64 - DDM="-I$MPI_ROOT/include/64 -DDDM -DHPMPI" - MPI_CLEAN= - export MPI_EPATH=$MARC_BIN - export LD_LIBRARY_PATH=$MPI_ROOT/lib/$ARCHITECTURE:$MARC_LIB:$MARC_LIB_SHARED:$LD_LIBRARY_PATH - export MPIHPSPECIAL="-e MPI_FLAGS=E,T,y1" -# Below line is moved in run_marc file -# export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - export MPIHPSPECIAL="$MPIHPSPECIAL -e BINDIR=$MARC_BIN" - if test -n "$MSC_LICENSE_FILE" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e MSC_LICENSE_FILE=$MSC_LICENSE_FILE" - fi - if test -n "$LM_LICENSE_FILE" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LM_LICENSE_FILE=$LM_LICENSE_FILE" - fi - export MPIHPSPECIAL="$MPIHPSPECIAL -e MPI_LIC_CHECKER=$MPI_ROOT/bin/licensing/amd64_s8/lichk.x" - RUN_JOB2="$MPI_ROOT/bin/mpirun ${MPIRUNOPTIONS} -prot -f " - RUN_JOB1="$MPI_ROOT/bin/mpirun ${MPIRUNOPTIONS} -prot -w $MPIHPSPECIAL -np " - RUN_JOB0= - fi - if test $MPITYPE = intelmpi - then - INTELMPI_VERSION=HYDRA - FCOMPMPI=mpiifort - MPI_ROOT=$MARC_INTELMPI - DDM="-I${MPI_ROOT}/include64 -DDDM" - PATH=$MPI_ROOT/bin64:$PATH - export PATH - LD_LIBRARY_PATH=$MPI_ROOT/lib64:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - if test $INTELMPI_VERSION = HYDRA - then - RUN_JOB1="${MPI_ROOT}/bin64/mpiexec.hydra -genvall -n " - RUN_JOB2="${MPI_ROOT}/bin64/mpiexec.hydra -genvall" - else - RUN_JOB1="${MPI_ROOT}/bin64/mpiexec -n " - RUN_JOB2="${MPI_ROOT}/bin64/mpiexec -configfile " - fi - RUN_JOB0= - MPI_CLEAN= - MPI_EPATH=$MARC_BIN - MPIR_HOME=$MPI_ROOT - MPICH_F77=$FCOMP - MPICH_F77LINKER=$FCOMP - export MPI_ROOT MPI_EPATH MPIR_HOME MPICH_F77 MPICH_F77LINKER - I_MPI_PIN_DOMAIN=node - export I_MPI_PIN_DOMAIN - fi -else - MPI_ROOT=$MARC_DUMMYMPI - export MPI_ROOT=$MARC_DUMMYMPI - DDM="-I$MPI_ROOT/include" -fi - -# -# variables for the "maintain" script -# - -MACHINENAME=LINUX -MACHINE64BIT=yes -MACHINE=Linux_EM64T -DEV=/dev/tape -GETLOG="whoami" -CLEAR="clear" -MY_UNAME=`uname -a` - -# Edit following 2 lines to build with VKI Solver -#VKISOLVER=VKI -VKISOLVER=NONE - -# Edit following 2 lines to build with CASI Solver -CASISOLVER=CASI -#CASISOLVER=NONE - -# Edit following 2 lines to build with MF2 Solver -MF2SOLVER=NONE -#MF2SOLVER=SERIAL -#MF2SOLVER=MF2PARALLEL - -# Edit following lines to build with Intel(c) Multithreaded solver (PARDISO) -#INTELSOLVER=NONE -INTELSOLVER=PARDISO - -# Edit following lines to build with MUMPS -if test "$MARC_INTEGER_SIZE" = "i4" ; then - #MUMPSSOLVER=NONE - MUMPSSOLVER=MUMPS -else - #MUMPSSOLVER=NONE - MUMPSSOLVER=MUMPS -fi - -# Edit following 2 lines to build MARC dynamic shared library -MARC_DLL=MARC_DLL -#MARC_DLL=NONE - -# always set VKISOLVER, CASISOLVER, BCSGPUSOLVER, and MARC_DLL to NONE for MD Nastran -if test "$_OEM_NASTRAN" -ne 0 -then - VKISOLVER=NONE - CASISOLVER=NONE - MF2SOLVER=NONE - INTELSOLVER=NONE - MUMPSSOLVER=NONE - BCSGPUSOLVER=NONE - MARC_DLL=NONE -fi - -# -# define Fortran and C compile syntax -# -if test "$VKISOLVER" = VKI -then - SOLVERFLAGS="$SOLVERFLAGS -DVKI" -fi - -if test "$CASISOLVER" = CASI -then - SOLVERFLAGS="$SOLVERFLAGS -DCASI" -fi - -if test "$MF2SOLVER" = MF2PARALLEL -then - SOLVERFLAGS="$SOLVERFLAGS -DMF2PARALLEL" -fi -if test "$MF2SOLVER" = MF2SERIAL -then - SOLVERFLAGS="$SOLVERFLAGS -DMF2SERIAL" -fi - -if test "$INTELSOLVER" = PARDISO -then - SOLVERFLAGS="$SOLVERFLAGS -DPARDISO" -fi - -if test "$MUMPSSOLVER" = MUMPS -then - SOLVERFLAGS="$SOLVERFLAGS -DMUMPS" -fi - - -if test "$MARC_DLL" = MARC_DLL -then - SOLVERFLAGS="$SOLVERFLAGS -DMARC_DLL" -fi - -LINK_OPT= -DEBUG_OPT= -C_DEBUG_OPT= - -#Uncomment following line to build Marc in debuggable mode -MARCDEBUG= -#MARCDEBUG="ON" - -if test "$MARCDEBUG" = "ON" -then - LINK_OPT="-debug -traceback" - DEBUG_OPT="-debug -traceback" - C_DEBUG_OPT="-debug -traceback" -fi - - -MARCCHECK= -#MARCCHECK="ON" -if test "$MARCCHECK" = "ON" -then - DEBUG_OPT="$DEBUG_OPT -fpe0 -fp-stack-check -check all -ftrapuv " - C_DEBUG_OPT="$C_DEBUG_OPT -fp-stack-check -check-uninit -Wformat -ftrapuv " -fi - -MARCCODECOV= -#MARCCODECOV="ON" - -if test "$MARC_INTEGER_SIZE" = "i4" ; then - I8FFLAGS= - I8DEFINES= - I8CDEFINES= - I8CASIDEFS= -else - I8FFLAGS="-i8" - I8DEFINES="-DI64" - I8CDEFINES="-U_DOUBLE -D_SINGLE" - I8CASIDEFS="-DCASI_64BIT_INT=1" -fi - - -CDEFINES= -FDEFINES= - -if test "$_OEM_NASTRAN" -ne 0 -then - CDEFINES="$CDEFINES -D_OEM_NASTRAN" - FDEFINES="$FDEFINES -D_OEM_NASTRAN" -fi - -FDEFINES="$FDEFINES -D_IMPLICITNONE" - -if test "$_OEM_NASTRAN" -eq 0 -then - FDEFINES="$FDEFINES -DOPENMP -DMKL" -fi - -# -D_MSCMARC -FDEFINES="$FDEFINES -D_MSCMARC $DEBUG_OPT" -CDEFINES="$CDEFINES -D_MSCMARC $C_DEBUG_OPT $I8CDEFINES" - -CINCL="-I$MARC_SOURCE/mdsrc -I$MARC_SOURCE/csource $METIS" -if test "$_OEM_NASTRAN" -ne 0 -then - CINCL="$CINCL -I../../include" -fi - -CC="icc -c -O1 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " -CCLOW="icc -c -O0 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " -CCHIGH="icc -c -O3 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " - -if test "$MARCDEBUG" = "ON" -then - CC="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " - CCLOW="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " - CCHIGH="icc -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS " -fi - -LOAD_CC="icc -O1 -DLinux -DLINUX -DLinux_intel" -CCT="$CC" -CCTLOW="$CCLOW" -CCTHIGH="$CCHIGH" - -CC_CASI="$CC -c99 $I8CASIDEFS" -CCLOW_CASI="$CCLOW -c99 $I8CASIDEFS" -CCHIGH_CASI="$CCHIGH -c99 $I8CASIDEFS" - -CCT_CASI="$CCT -c99 $I8CASIDEFS" -CCTLOW_CASI="$CCLOW -c99 $I8CASIDEFS" -CCTHIGH_CASI="$CCHIGH -c99 $I8CASIDEFS" - -#PROFILE="-Mprof=func" -#PROFILE="-Mprof=lines" -#PROFILE="-Mprof=func,mpi" -PROFILE= -if test "$MARCCODECOV" = "ON" -then -PROFILE="-prof-gen=srcpos" -fi - -FORTLOW="$FCOMP -c -assume byterecl -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -O0 $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -FORTRAN="$FCOMP -c -assume byterecl -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -O1 $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -FORTHIGH="$FCOMP -c -assume byterecl -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" -FORTNA="$FCOMP -c -assume byterecl -safe_cray_ptr -save -zero -mp1 -WB -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" - -if test "$MARCDEBUG" = "ON" -then - FORTLOW="$FCOMP -c -assume byterecl -safe_cray_ptr $PROFILE -save -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - FORTRAN="$FCOMP -c -assume byterecl -safe_cray_ptr $PROFILE -save -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - FORTHIGH="$FCOMP -c -assume byterecl -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" - FORTNA="$FCOMP -c -assume byterecl -safe_cray_ptr -save -zero -mp1 -WB -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ - -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" -fi - -FORTLOWT="$FORTLOW" -FORTRANT="$FORTRAN" -FORTHIGHT="$FORTHIGH" - -FORTRANMNF="$FCOMP -c $FDEFINES " -CCMNF="icc -c -O1 -DLinux -DLINUX -DLinux_intel -Dport2egcs -I$MARC_SOURCE/marctoadams/mnf/include -D_LARGEFILE64_SOURCE" - -FORTRANMUMPS="$FCOMP -fpp -c -assume byterecl -safe_cray_ptr $PROFILE -save -zero -mp1 -WB -fno-alias -O1 -fp-model precise $FDEFINES -D_IMPLICITNONE $I8FFLAGS $I8DEFINES $DDM -I$MARC_SOURCE/mumpssolver/include -Dintel_ -DALLOW_NON_INIT -Dmetis -nofor_main" -CCMUMPS="icc -c -DAdd_ -Dmetis -I$MARC_SOURCE/mumpssolver/include" - - -BCSCC="icc -c -O3 -DLOWERCASE_ -I${MARC_SOURCE}/${BCS_DIR}/bcslib_csrc $CDEFINES $CINCL" -NVCC="nvcc -c -O3 -arch sm_20 -DLOWERCASE_ -I${MARC_SOURCE}/${BCS_DIR}/bcslib_cuda/include -I${MARC_CUDA}/include -I$MARC_SOURCE/mdsrc $I8DEFINES -Xcompiler -fvisibility=hidden -Xcompiler -fPIC $I8DEFINES " -NVCCLIB="ar rvl" -NVCCLD=icc -BCSFORTLOW="$FORTLOW -I${MARC_SOURCE}/${BCS_DIR}/common" -BCSFORTRAN="$FORTRAN -I${MARC_SOURCE}/${BCS_DIR}/common" -BCSFORTHIGH="$FORTHIGH -I${MARC_SOURCE}/${BCS_DIR}/common" -BCSFORT90HIGH="$BCSFORTHIGH" -if test "$MARCDEBUG" = "ON" -then - BCSFORTRAN=$BCSFORTLOW - BCSFORTHIGH=$BCSFORTLOW - BCSFORT90HIGH=$BCSFORTLOW -fi - -if test $MPITYPE != none -then - if test $MPITYPE = hpmpi - then - LOAD="$MPI_ROOT/bin/$FCOMPMPI ${LOADOPTIONS} -L$MPI_ROOT/lib/$ARCHITECTURE $PROFILE $LINK_OPT -o " - LOADT="$MPI_ROOT/bin/$FCOMPMPI ${LOADOPTIONS} -L$MPI_ROOT/lib/$ARCHITECTURE $PROFILE $LINK_OPT -o " - fi -# Uncomment the following lines to turn on the tracer and commnet out the next 5 lines -# if test $MPITYPE = intelmpi -# then -# INCLUDEMPI="-I$MPI_ROOT/include64 -I$VT_ROOT/include" -# LOAD="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " -# LOADT="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o " -# fi - if test $MPITYPE = intelmpi - then - LOAD="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $LINK_OPT -o " - LOADT="$MPI_ROOT/bin64/$FCOMPMPI $PROFILE $LINK_OPT -o " - fi -else - LOAD="$FCOMP $LINK_OPT -o " - LOADT="$FCOMP $LINK_OPT -o " -fi - -if test "$MARC_DLL" = MARC_DLL -then - FORTLOW="$FORTLOW -fpp -fPIC" - FORTRAN="$FORTRAN -fpp -fPIC" - FORTHIGH="$FORTHIGH -fpp -fPIC" - FORTRANMNF="$FORTRANMNF -fpp -fPIC" - CC="$CC -fPIC" - CCMNF="$CCMNF -fPIC" - CC_CASI="$CC_CASI -fPIC" - CCLOW_CASI="$CCLOW_CASI -fPIC" - CCHIGH_CASI="$CCHIGH_CASI -fPIC" - LINK_EXE_MARC="-L$MARC_LIB -lmarc -L$MARC_LIB_SHARED -lguide -lpthread" - LINK_MARC_DLL="-shared -fPIC" - LOAD_DLL=$LOAD - LOADT_DLL=$LOADT - EXT_DLL="so" -fi - - -XLIBS="-L/usr/X11/lib -lX11 " - -# -# define archive and ranlib syntax -# - -ARC="ar rvl" -ARD="ar dvl" -ARX="ar xl" -RAN="" - -# -# choose which libraries you want to use ( e.g. blas ) -# - -if test "$VKISOLVER" = VKI -then - VKISOLVERLIBS="$MARC_LIB/vkisolver.a" -else - VKISOLVERLIBS= -fi - -if test "$CASISOLVER" = CASI -then - CASISOLVERLIBS="$MARC_LIB/casilib.a" -else - CASISOLVERLIBS= -fi - -MF2SOLVERLIBS= -if test "$MF2SOLVER" = MF2PARALLEL -then - MF2SOLVERLIBS="$MARC_LIB/mf2parallel/libseq.a \ - $MARC_LIB/mf2parallel/libsym.a \ - $MARC_LIB/mf2parallel/libmet.a \ - $MARC_LIB/mf2parallel/libmf2.a \ - $MARC_LIB/mf2parallel/libgauss.a \ - $MARC_LIB/mf2parallel/libmf2.a \ - $MARC_LIB/mf2parallel/libgauss.a \ - $MARC_LIB/mf2parallel/libnum.a \ - $MARC_LIB/mf2parallel/libutl.a \ - $MARC_LIB/mf2parallel/libr8.a \ - $MARC_LIB/mf2parallel/libz.a " -fi - -if test "$INTELSOLVER" = PARDISO -then - if test "$MARC_INTEGER_SIZE" = "i4" ; then - INTELSOLVERLIBS="$MARC_MKL/libmkl_solver_lp64.a" - else - INTELSOLVERLIBS="$MARC_MKL/libmkl_solver_ilp64.a" - fi -else - INTELSOLVERLIBS= -fi - -if test "$MUMPSSOLVER" = MUMPS -then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - if test $MPITYPE = none - then - MUMPSSOLVERLIBS2= - echo hello > /dev/null - fi - if test $MPITYPE = intelmpi - then - if test "$MARC_INTEGER_SIZE" = "i4" ; then - MUMPSSOLVERLIBS2="$MARC_MKL/libmkl_scalapack_lp64.a $MARC_MKL/libmkl_blacs_intelmpi_lp64.a" - else - MUMPSSOLVERLIBS2="$MARC_MKL/libmkl_scalapack_ilp64.a $MARC_MKL/libmkl_blacs_intelmpi_ilp64.a" - fi - fi - if test $MPITYPE = hpmpi - then - if test "$MARC_INTEGER_SIZE" = "i4" ; then - MUMPSSOLVERLIBS2="$MARC_MKL/libmkl_scalapack_lp64.a $MARC_MKL/libmkl_blacs_lp64.a" - else - MUMPSSOLVERLIBS2="$MARC_MKL/libmkl_scalapack_ilp64.a $MARC_MKL/libmkl_blacs_ilp64.a" - fi - fi -else - MUMPSSOLVERLIBS= - MUMPSSOLVERLIBS2= -fi - -if test "$BCSGPUSOLVER" = BCSGPU -then - BCSSOLVERLIBS="${MARC_LIB}/bcsgpulib.a " - MARCCUDALIBS1="-L${MARC_LIB}/cuda_dummy -lmarccuda " - MARCCUDALIBS2="-L${MARC_LIB}/cuda -lmarccuda " - MARCCUDALIBS=$MARCCUDALIBS1 - CUDALIBS="-L$MARC_CUDA/lib64 -lcudart -lcublas -L/usr/lib64 -lcuda " -else - BCSSOLVERLIBS="${MARC_LIB}/bcslib.a " -fi - -if test "$MARC_INTEGER_SIZE" = "i4" ; then - MKLLIB=$MARC_MKL/libmkl_intel_lp64.a -else - MKLLIB=$MARC_MKL/libmkl_intel_ilp64.a -fi - -SECLIBS="-L$MARC_LIB -llapi" - -SOLVERLIBS="${BCSSOLVERLIBS} \ - ${INTELSOLVERLIBS} ${MUMPSSOLVERLIBS2} ${MF2SOLVERLIBS} \ - -Wl,--start-group $MKLLIB $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_core.a -Wl,--end-group \ - $MARC_MKL/libguide.a \ - $MARC_LIB/blas_src.a ${VKISOLVERLIBS} ${CASISOLVERLIBS} " -SOLVERLIBS_DLL=${SOLVERLIBS} - -MRCLIBS="$MARC_LIB/clib.a ${CASISOLVERLIBS}" -MRCLIBSPAR="$MARC_LIB/clib.a" -STUBS="$MARC_LIB/stubs.a " -MNFLIBS="$MARC_LIB/libmnf.a" -MDUSER="$MARC_LIB/md_user.a" - - -OPENMP="-openmp" - -SYSLIBS=" $OPENMP -lpthread " - -# Uncomment the following lines to turn on the trace and comment out the next 4 lines -# if test $MPITYPE = intelmpi -# then -# SYSLIBS="-L${VT_ROOT}/lib -lVT -ldwarf -lelf -lm -lpthread \ -# -L${MPI_ROOT}/lib64 -lmpi -lmpiif -lmpigi -lrt" -# fi -if test $MPITYPE = intelmpi -then - SYSLIBS="-L${MPI_ROOT}/lib64 -lmpi -lmpiif -lmpigi -lrt $OPENMP -lpthread" -fi - -SYSLIBSPAR=" " - -MARC_DLL_CODES="runmarc.f" - - -BLAS_SRC="dzero.f icopy.f izero.f" -if test "$_OEM_NASTRAN" -ne 0 -then - if test "$MARC_INTEGER_SIZE" = "i4" ; then - BLAS_SRC="$BLAS_SRC dsctr.f zsctr.f dzasum.f daxpyi.f zaxpyi.f dgthr.f zgthr.f" - else - BLAS_SRC="ALL" - fi -fi - -LOW_OPT_CODES="are163.f contro.f ndext.f omarc.f omarca.f omarcb.f omarcc.f \ - omars.f fixbc.f triang.f bet049.f norst3.f eldata.f \ - elec*.f elct*.f fmeig.f oada00.f ogeig.f updtrbe2.f cycrota.f \ - cordef.f ogpk.f ogtan.f eldam.f formrbe3.f \ - inertie.f em_sso072.f cn_fol3d_qpatch6.f" -if test "$MARC_INTEGER_SIZE" = "i8" ; then - LOW_OPT_CODES="$LOW_OPT_CODES bbcseg.f" -fi -LOW_OPT_CODES_CASI="" - -HIGH_OPT_CODES="dpsmsa1.f dpsmsa2.f dpsmsa3.f dpsmsa4.f dpsmsa5.f dpsmsa6.f \ - dpsmsa7.f dpsmsa8.f dpsmsa9.f dpsmsa10.f dpsmsa11.f dpsmsa12.f \ - dpsmsa13.f dpsmsa14.f dpsmsa15.f dpsmsa16.f " - - -HIGH_OPT_CODES_CASI="arithkernels.c blockedroutines.c blockedroutines_fd.c elemmatgenkernels.c longvecroutines.c sfmultutils.c solvewithbd.c" - -MAXNUM=1000000 diff --git a/installation/mods_MarcMentat/2013/Marc_tools/run_damask b/installation/mods_MarcMentat/2013/Marc_tools/run_damask deleted file mode 100644 index 485b77525..000000000 --- a/installation/mods_MarcMentat/2013/Marc_tools/run_damask +++ /dev/null @@ -1,3849 +0,0 @@ -#!/bin/ksh -############################################################################## -# # -# run_marc - run a marc job # -# ------------------------- # -# # -# usage: run_marc -j jid { options } # -# # -# where standard options are: required: defaults: # -# -------------------------- # -# # -# -j* jid job id number. ** YES ** . # -# -pr* prog program name. . marc # -# -v* y|n do or do not verify inputs. . yes # -# -q* s|l|v|b|f batch queue name or background, . short # -# foreground. # -# -b* as alternative to option -q* # -# # -# ( batch queues only : # -# -pq* intra queue priority. . . # -# -at DATE/TIME delay start of job. . . # -# format : January,1,1990,12:31 # -# or : today,5pm # -# -cpu* secs job CPU limit . . ) # -# # -# -r* rid restart file job id. . . # -# -si* sid substructure file id. . . # -# -pi* post post file job id. . . # -# -de* did defaults file . no # -# -vf vid viewfactor . no # -# # -# -u* user user subroutine. . . # -# -obj obj user objects or libraries. . . # -# -sa* y|n do or do not save load module. . no # -# -autorst auto restart flag for auto forge . no # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo selects i4 or i8 version # -# default: i4 or via defaults file run_marc_defaults # -# the -mo option will override # -# -mpi selects MPI version # -# each platform has a default MPI version and some # -# have an alternative version. see the include file # -# for the respective platform # -# MPI_DEFAULT defines the default MPI version # -# MPI_OTHER defines versions one can switch to # -# -dcoup for contact decoupling # -# currently not supported # -# -dir directory where the job i/o should take place. # -# defaults to current directory. # -# -sdir directory where scratch files are created # -# defaults to current directory. # -# # -# -alloc only perform memory allocation test, no analysis # -# -list y only list options in the input file, no analysis # -# -fe num set feature number "num" for the run. only one allowed # -# -dytran flag to switch from Dytran to Marc # -# dytran = 0, program will run w/o Marc-Dytran Switch # -# = 1, program will restart Marc after Dytran run # -# >= 2, Not supported yet. # -# currently not supported # -# -ou force analysis to use out-of-core control # -# =0, not used # -# =1, element storage out-of-core # -# -dll run marc using shared library libmarc.so and exe_marc # -# =1, used # -# =2, do not free streaming input memory # -# =3, run with marc input deck # -# -trk run marc for post-tracking # -# -gpuid run marc using GPGPU capability # -# specify gpuid on to be used in the analysis. Multiple # -# IDs may be assigned for DDM runs. # -# Separate a list of IDs with a colon. Each DMP # -# process will be assigned a GPU ID in round robin fastion# -# = 0 # -# = 0:1 etc... # -# # -# where parallel options are: # -# -------------------------- # -# # -# itree, host, and comp options are available for the domain # -# decomposition only. # -# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # -# # -# # -# -nprocd number of domains. # -# defaults to single domain solution. # -# -nprocds number of domains if single input file. # -# defaults to single domain solution. # -# -nps same as -nprocds. # -# -nsolver number of solver tasks for solver types 12 and 13 # -# these are distributed tasks operating via MPI # -# -nthread number of solver threads for solver types 6, 8, and 11 # -# also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. if both specified, nthread option# -# will be used. # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by 6, 8, and 11 # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor nthread specified. # -# -itree message passing tree type for domain decomposition. # -# for debugging purposes; should not normally be used. # -# -host hostfile name for distributed execution on network. # -# defaults to no hostfile, unless jobid.defhost exists. # -# if jobid.defhost exists, only -np(s) necessary # -# -comp* y|n to be used with user routines on a network of # -# incompatible machines. # -# if set to no, a separate executable will be created # -# for each machine on the network. # -# if set to yes, the executable located on the machine # -# from which marc is started will be used on all machines.# -# defaults to no if O/S versions different on machines. # -# # -# -ci y|n copy input files to remote hosts (default: yes) # -# if "yes", input files are automatically copied to # -# remote hosts for a network run if necessary. # -# -cr y|n copy post files from remote hosts (default: yes) # -# if "yes", post files are automatically copied back from # -# remote hosts for a network run if necessary. # -############################################################################## -# set DIR to the directory in which this script is -REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" -DIR=`dirname $REALCOM` -# make sure DIR has an absolute path -case $DIR in - \/*) - ;; - *) - DIR=`pwd`/$DIR - ;; -esac -DIRSCRIPT=$DIR -AWK=awk -ARCH=`uname -a | cut -f 1 -d " "` -# Sun has a bad awk, use nawk instead -if test $ARCH = "SunOS" -then - AWK=nawk -fi -BASENAME=basename -# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists -if test $ARCH = "SunOS" -then - if test -x /usr/ucb/basename - then - BASENAME=/usr/ucb/basename - fi -fi - -# echo command line in the case of ECHO_COMMAND is true -if test "$ECHO_COMMAND" = true ; then - echo command "$0" "$@" -fi - -# -# "mode" selects version, i4 or i8 -# default is i4 -# this can be changed by a file run_marc_defaults -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MODE i8 -# it can also be set by the environmental variable MARC_INTEGER_SIZE -# and by the command line option "-mo" -# -mode= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -f $HOME/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -n "$MARC_INTEGER_SIZE" ; then - mode=$MARC_INTEGER_SIZE -fi -if test -z "$mode" ; then - mode=i4 -fi -case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "error, version mode must be i4 or i8" - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i4 or i8" - echo " " - echo " use -mo i4 or -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - setmode=true - fi - if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - fi - if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -done - -# set to i4 version for 32 bit Linux -if test "`uname -s`" = "Linux"; then - if test "`uname -m`" = "i686"; then - mode=i4 - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -fi - - -. "$DIR/getarch" - -# Change_me -. $MARC_INCLUDE -# - -# -# Dynamically determine the echo syntax -# - -case "`echo '\c'`" in - '\c') - ECHO='echo -n' - ECHOTXT=' ' - ;; - *) - ECHO='echo' - ECHOTXT=' \c' - ;; -esac - -# -# Variables for the MARC environment -# - -PRODUCT="Marc" -EXITMSG=$MARC_TOOLS/MESSAGES -export EXITMSG -FLEXDIR=$DIR/../flexlm/licenses -export FLEXDIR -TIMCHK=3600 -export TIMCHK -BINDIR=$MARC_BIN -export BINDIR -AFMATDAT=$MARC_RUNTIME/AF_flowmat/ -export AFMATDAT -# -# define directory path to global unified material database -# -MATFILE= -export MATFILE - -# -# define memory limit -# first set to MEMLIMIT from include -# -ml option overrules if specified -memlimit=$MEMLIMIT -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -# -if test $MACHINENAME = "HP" -then - SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH - export SHLIB_PATH -fi -# the one for IBM is defined futher down - -LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH -LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH -export LD_LIBRARY_PATH -export LD_LIBRARY64_PATH -export LD_LIBRARYN32_PATH - -atexit() { -kill -15 $$ -# -if test $MPITYPE = "myrinet" -then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi -fi -} - -trap "atexit" 2 - -# -# defaults -# - -prog=marc -exefile=marc -jid= -rid= -pid= -sid= -did= -vid= -user= -usersnoext= -objs= -qid=background -cpu= -priority= -att= -trk= -verify=yes -prgsav=no -rmdll=no -cpdll=no -progdll= -pathdll= -error= -nprocd=0 -nprocdddm=1 -nprocdddmprint= -icreated=0 -nprocdarg= -nsolver=0 -nsolverarg=-ns -if test $nprocds -then - if test $nprocds -gt 1 - then - nprocdddm=$nprocds - nprocdddmprint=$nprocds - icreated=1 - nprocdarg=-nprocds - fi -fi -nthread=-1 -gpuids= -nauto=0 -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -nthreadprint=0 -itree=0 -iam= -link= -trkrun=0 -DIRJOB=`pwd` -DIRSCR=$DIRJOB -DIRSCRSET= -autoforge=0 -dotdat=.dat -dotdefhost=.defhost -host= -numhost= -mfile= -userhost= -makebdf= -cpinput=yes -cpresults=yes -marcdll=libmarc.$EXT_DLL -# define hostname and strip off extensions (alpha.aaa.com) -thishost=`hostname` -thishost=${thishost%%.*} -compatible=unknown -numfield=1 -justlist= -feature= -mpioption=false -MDSRCLIB=$MARC_LIB/mdsrc.a -# -# check run_marc_defaults file for default MPI setting -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MPI -# -value= -file= -if test -f $DIRSCRIPT/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$DIRSCRIPT/run_marc_defaults - fi -fi -if test -f $HOME/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$HOME/run_marc_defaults - fi -fi -if test -n "$value"; then - MARC_MPITYPE=$value - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - echo " " - echo " error, incorrect option for MARC_MPI" - echo " defined in $file: $MARC_MPITYPE" - echo " valid options: $MPI_DEFAULT $MPI_OTHER" - echo " " - exit - fi - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - fi -fi -# -# -# allow scratch directory to be specified with environmental variable -# MARCSCRATCH -if test $MARCSCRATCH -then - if test -d $MARCSCRATCH - then - DIRSCR=$MARCSCRATCH - else - echo "error, scratch directory '$MARCSCRATCH'" - echo " specified via environmental variable MARCSCRATCH does not exist" - exit - fi -fi -# -############################################################################## -# parse input - arguments always come in pairs # -############################################################################## - -arg=$1 -if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - shift - arg=$1 -fi -while [ -n "$arg" ] -do - shift - value=$1 - case $arg in - -al* | -AL*) - LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - $MARC_BIN/marc -alloc 1 - exit - ;; - -li* | -LI*) - justlist=yes - ;; - -fe* | -FE*) - feature=$value - ;; - -pr* | -PR*) - if test `dirname $value` = '.' - then - prog=`$BASENAME $value .marc` - progdll=`$BASENAME $value` - else - prog=`dirname $value`/`$BASENAME $value .marc` - progdll=`dirname $value`/`$BASENAME $value` - fi - prdir=`dirname $value` - case $prdir in - \/*) - ;; - *) - prog=`pwd`/$prdir/$prog - ;; - esac - ;; - -j* | -J*) - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - ;; - -r* | -R*) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - -si* | -SI*) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - -pi* | -PI*) - if test -f $value.t19 - then - pid=`$BASENAME $value .t19` - else - pid=`$BASENAME $value .t16` - fi - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - -bdf | -BDF) - makebdf=1 - ;; - -de* | -DE*) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - -vf | -VF) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - -u* | -U*) - - user=$value - - - - - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - -obj | -OBJ) - objs="$value" - ;; - -q* | -Q*) - qid=$value - ;; - -b* | -B*) - case $value in - y* | Y*) - qid=background - ;; - n* | N*) - qid=foreground - ;; - *) - ;; - esac - ;; - -at | -AT) - att=$value - ;; - -cpu* | -CPU*) - cpu=$value - ;; - -pq | -PQ*) - priority=$value - ;; - -v* | -V*) - verify=$value - ;; - -sa* | -SA*) - prgsav=$value - ;; - -np* | -NP*) - nprocdddm=$value - nprocdddmprint=$value - case $arg in - -nps* | -NPS* | -nprocds* | -NPROCDS*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - case $arg in - -np | -NP | -nprocd | -NPROCD) - icreated=0 - nprocdarg=-nprocd - ;; - esac - ;; - -ns* | -NS*) - nsolver=$value - ;; - -nt* | -NT*) - nthread=$value - ;; - -gp* | -GP*) - gpuids=$value - ;; - -it* | -IT*) - itree=$value - ;; - -iam | -IAM) - iam=$value - ;; - -au* | -AU*) - nauto=$value - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -me | -ME ) - mesh=$value - ;; - -ml | -ML ) - memlimit=$value - ;; - -mo | -MO ) - ;; - -mpi | -MPI ) - mpioption=true - MARC_MPITYPE=$value - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - fi - fi - ;; - -dir* | -DIR*) - DIRJOB=$value - case $DIRJOB in - \/*) - ;; - *) - DIRJOB=`pwd`/$DIRJOB - ;; - esac - if test -z "$DIRSCRSET" - then - DIRSCR=$DIRJOB - fi - ;; - -sd* | -SD*) - DIRSCR=$value - DIRSCRSET=yes - case $DIRSCR in - \/*) - ;; - *) - DIRSCR=`pwd`/$DIRSCR - ;; - esac - ;; - -ho* | -HO*) - host=$value - ;; - -co* | -CO*) - compatible=$value - ;; - -ci* | -CI*) - cpinput=$value - ;; - -cr* | -CR*) - cpresults=$value - ;; - *) - error="$error -$arg: invalid option" - break - ;; - esac - case $value in - -*) - error="$error -$arg: invalid name $value" - break - ;; - esac - shift - arg=$1 - if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - shift - arg=$1 - fi -done -argc=`expr $# % 2` -if test $argc -eq 1 -then -# -# odd number of arguments -# - error="$error -argument list incomplete" -fi - -if test $nprocdddm -gt 0 -then -nprocd=$nprocdddm -fi - -if test $nsolver -gt 0 -then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi -fi - -if test $nthread -eq -1 -then -nthread=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nthread -lt 0 -then -nthread=0 -fi - -nthreadprint=$nthread -if test $nthreadprint -eq 0 -then -nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi -fi - -nthread=$nthreadprint - -gpuoption= -if test "$gpuids" = "" ; then - gpuoption= -else - gpuoption="-gp $gpuids" -fi - -if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH -else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH -fi -# Linux 64 + HPMPI, Below code is taken from include_linux64 -if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" -then -export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" -fi - -if test $nprocd -gt 1; then - if test -f $jid$dotdefhost; then - if test "$host" = ""; then - host=$jid$dotdefhost - fi - fi - if test -f hostfile_qa_$nprocd; then - if test "$host" = ""; then - host=hostfile_qa_$nprocd - fi - fi -fi - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then - dotdat=.inp - fi - - if test "$progdll"; then - /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll - rmdll=yes - pathdll=yes - progdll=${progdll}_$marcdll - else - progdll=$marcdll - fi - - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - pathdll=yes - fi -fi - -############################################################################## -# check parameter validity # -############################################################################## - -while test forever; do - -# -# check for input file existence -# -if test $nprocdddm -gt 1 -a $icreated -eq 0; then - if test ! -f $DIRJID/1$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/1$jid$dotdat not accessible" - fi - fi -else - if test ! -f $DIRJID/$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/$jid$dotdat not accessible" - fi - fi -fi - if test $nprocd -gt 1; then - if test "$host" ; then - if test ! -f $host; then - error="$error -host name file $host not accessible" - fi - fi - fi - -# -# check if the job is already running in the background -# -if test -f $DIRJOB/$jid.pid; then - error="$error -job is already running (the file $jid.pid exists)" -fi - -# -# if the program name is other than marc, then -# assume that this is a program in the users local directory -# - -bd=$MARC_BIN/ - -case $prog in - marc | MARC | $exefile) - program=$exefile - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - if test ! -f $user - then - error="$error -user subroutine file $user not accessible" - fi - fi - if test "$objs" - then - missingobjs= - for o in $objs - do - if test ! -f "$o" - then - if test -z "$missingobjs" - then - missingobjs="$o" - else - missingobjs="$missingobjs $o" - fi - fi - done - if test -n "$missingobjs" - then - error="$error -user object/library file(s) $missingobjs not accessible" - fi - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$vid" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRVID/1$vid.vfs - then - error="$error -view factor file $DIRVID/1$vid.vfs not accessible" - fi - else - if test ! -f $DIRVID/$vid.vfs - then - error="$error -view factor file $DIRVID/$vid.vfs not accessible" - fi - fi - fi - if $mpioption - then - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" - fi - fi - ;; - *) - program=$prog.marc - case $prog in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - error="$error -program option may not be used with user subroutine" - fi - if test "$objs" - then - error="$error -program option may not be used with user objects or libraries" - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$nauto" - then - if test $nauto -gt 2 - then - error="$error -incorrect option for auto restart " - fi - fi - if test "$ndcoup" - then - if test $ndcoup -gt 3 - then - error="$error -incorrect option for contact decoupling " - fi - fi - if test "$ndytran" - then - if test $ndytran -gt 1 - then - error="$error -incorrect option for Marc-Dytran Switch " - fi - fi - if $mpioption - then - if test ! -x $MARC_BIN/$exefile - then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE " - fi - fi - ;; -esac - -############################################################################## -# check argument integrity # -############################################################################## - -if test "$jid" -then - : -else - error="$error -job id required" -fi - -if test $nprocd -gt 1 -then - if test $nauto -gt 0 - then - error="$error -cannot run DDM job with auto restart (-au) option " - fi -fi -case $qid in - S* | s*) - qid=short - ;; - L* | l*) - qid=long - ;; - V* | v*) - qid=verylong - ;; - B* | b*) - qid=background - ;; - F* | f*) - qid=foreground - ;; - A* | a*) - qid=at - ;; - *) - error="$error -bad value for queue_id option" - ;; -esac - -case $prgsav in - N* | n*) - prgsav=no - ;; - Y* | y*) - prgsav=yes - ;; - *) - error="$error -bad value for save option" - ;; -esac - -case $verify in - N* | n*) - verify=no - ;; - Y* | y*) - verify=yes - ;; - *) - error="$error -bad value for verify option" - ;; -esac - -case $nprocdddm in - -* ) - error="$error -bad value for nprocd option" - ;; -esac - -case $nthread in - -* ) - error="$error -bad value for nthread option" - ;; -esac - -case $itree in - -* ) - error="$error -bad value for itree option" - ;; -esac -case $iam in - -* ) - error="$error -bad value for iam option" - ;; -esac -case $compatible in - N* | n*) - compatible=no - ;; - Y* | y*) - compatible=yes - ;; - unknown) - ;; - *) - error="$error -bad value for comp option" - ;; -esac -case $cpinput in - N* | n*) - cpinput=no - ;; - Y* | y*) - cpinput=yes - ;; - *) - error="$error -bad value for copy input option" - ;; -esac -case $cpresults in - N* | n*) - cpresults=no - ;; - Y* | y*) - cpresults=yes - ;; - *) - error="$error -bad value for copy results option" - ;; -esac - -# -# check for external file to run -# -if test -f $MARC_TOOLS/run_marc_check -then - . $MARC_TOOLS/run_marc_check -fi - -# -# pick up version data from bin/VERSION if it exists -# -if test -f $MARC_BIN/VERSION; then - ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` - if test -n "$ppp" ;then - PRODUCT=$ppp - fi - ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` - if test -n "$ppp" ;then - REVISION=", Build $ppp" - fi -fi -############################################################################## -# interact with the user to get the required information to run marc or # -# other marc system program # -############################################################################## - -deletelog=yes -if test $qid = background -a $verify = no -then -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto " > $jid.log -deletelog=no -fi -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto" - - -case $qid in - s* | S* | l* | L* | v* | V* ) - echo \ -"Queue priority : $priority -Queue CPU limit : $cpu -Queue start time : $att" - ;; -# * ) -# echo \ -#" " -# ;; -esac - -if test "$error" -then - if test $verify = yes - then - $ECHO "$error - -Please correct or quit(correct,quit,): $ECHOTXT" - error= - read answer - case $answer in - q* | Q*) - answer=quit - ;; - *) - answer=correct - ;; - esac - else - $ECHO "$error - $ECHOTXT" - echo " " - if test "$deletelog" = no - then - $ECHO "$error - $ECHOTXT" >> $jid.log - echo " " >> $jid.log - fi - answer=quit - fi -else - if test $verify = yes - then - $ECHO " -Are these parameters correct (yes,no,quit,)? $ECHOTXT" - read answer - case $answer in - q* | Q*) - answer=quit - ;; - y* | Y*) - answer=yes - ;; - *) - answer=no - ;; - esac - else - answer=yes - fi -fi - -case $answer in - no | correct) - -############################################################################## -# prompt for each value # -############################################################################## - - $ECHO " -Program name ($prog)? $ECHOTXT" - read value - if test "$value" - then - prog=$value - fi - $ECHO "Job ID ($jid)? $ECHOTXT" - read value - if test "$value" - then - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - fi - $ECHO "User subroutine name ($user)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - user= - ;; - *) - user=$value - - - - - - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - esac - fi - $ECHO "User objects or libraries ($objs)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - objs= - ;; - *) - objs="$value" - ;; - esac - fi - $ECHO "Restart File Job ID ($rid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - rid= - ;; - *) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - esac - fi - $ECHO "Substructure File ID ($sid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - sid= - ;; - *) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - esac - fi - $ECHO "Post File Job ID ($pid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - pid= - ;; - *) - pid=$value - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - esac - fi - $ECHO "Defaults File ID ($did)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - did= - ;; - *) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - esac - fi - $ECHO "View Factor File ID ($vid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - vid= - ;; - *) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - esac - fi - $ECHO "Save generated module ($prgsav)? $ECHOTXT" - read value - if test "$value" - then - prgsav=$value - fi - $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" - read value - if test "$value" - then - nprocdddm=$value - nprocdddmprint=$value - fi - $ECHO "Run on ($nthread) threads ? $ECHOTXT" - read value - if test "$value" - then - nthread=$value - fi - $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" - read value - if test "$value" - then - nsolver=$value - fi -# - if test $nprocdddm -gt 0 - then - nprocd=$nprocdddm - fi - if test $nsolver -gt 0 - then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi - fi - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - nthreadprint=$nthread - if test $nthreadprint -eq 0 - then - nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi - fi -# - $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" - read value - if test "$value" - then - gpuids=$value - fi - if test "$gpuids" = "" ; then - gpuoption= - else - gpuoption="-gp $gpuids" - fi - if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH - fi - if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - fi -# - if test $nprocd -gt 1 - then - $ECHO "Message passing type ($itree)? $ECHOTXT" - read value - if test "$value" - then - itree=$value - fi - $ECHO "Host file name ($host)? $ECHOTXT" - read value - if test "$value" - then - host=$value - fi - if test $nprocdddm -gt 1 - then - $ECHO "Single input file? $ECHOTXT" - read value - case $value in - y* | Y*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" - read value - if test "$value" - then - compatible=$value - fi - $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" - read value - if test "$value" - then - cpinput=$value - fi - $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" - read value - if test "$value" - then - cpresults=$value - fi - fi - fi - $ECHO "Run the job in the queue ($qid)? $ECHOTXT" - read value - if test "$value" - then - qid=$value - fi - case $qid in - s* | S* | l* | L* | v* | V* ) - $ECHO "Queue priority ($priority)? $ECHOTXT" - read value - if test "$value" - then - priority=$value - fi - $ECHO "Job starts at ($att)? $ECHOTXT" - read value - if test "$value" - then - att=$value - fi - $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" - read value - if test "$value" - then - cpu=$value - fi - ;; - * ) - ;; - esac - $ECHO "Auto Restart option ($nauto)? $ECHOTXT" - read value - if test "$value" - then - nauto=$value - fi - $ECHO "Run directory ($DIRJOB)? $ECHOTXT" - read value - if test "$value" - then - DIRJOB=$value - DIRSCR=$DIRJOB - fi - $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" - read value - if test "$value" - then - DIRSCR=$value - fi - ;; - quit) - exit 1 - ;; - *) - break - ;; - -esac - - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - -done - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - pathdll=yes - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - fi - - if test "$pathdll"; then -# -# reset share lib path -# - if test $MACHINENAME = "HP" - then - SHLIB_PATH=$DIRJOB:$SHLIB_PATH - export SHLIB_PATH - fi - if test $MACHINENAME = "IBM" - then - LIBPATH=$DIRJOB:$LIBPATH - export LIBPATH - fi -# - LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH - LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH - LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH - export LD_LIBRARY_PATH - export LD_LIBRARY64_PATH - export LD_LIBRARYN32_PATH - fi -fi -# end of dllrun>0 - - -if test $program = $exefile -o $program = $prog.marc -then - -# delete the old .log file unless we run in the background -if test "$deletelog" = yes -then - /bin/rm $jid.log 2>/dev/null -else - echo - echo running the job in the background, see $jid.log - echo -fi - -# -# check if this is an autoforge or rezoning or radiation job -# -if test $nprocd -eq 1 -then - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` - if test "$line" - then - autoforge=1 - fi -fi -# -# check that jobname for restarted run is not the same -# as restart file basename -# -if test "$rid" -then - if test "$jid" = "$rid" - then - echo " " - echo "ERROR: job name of current run is the same as job name" - echo " of the restarted job" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "ERROR: job name of current run is the same as job name" >> $jid.log - echo " of the restarted job" >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi -fi - -# -# user objects/libraries used -# - - if test "$objs" - then - program="$DIRJOB/$jid.marc" - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# user subroutine used -# -# add DAMASK options for linking - DAMASK="" - - if test "$user" - then - program=$usernoext.marc - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# Special case for IBM using POE but not an SP machine -# in this case we always need a host file, also for serial jobs. -# -if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP -then - MP_HOSTFILE=${jid}.host - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $nprocd -gt 1 - then - numdom=$nprocd - while test $numdom -gt 0 - do - hostname -s >> $MP_HOSTFILE - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - else - hostname -s > $MP_HOSTFILE - fi -fi -# -# check ssh for all hosts in host file -# -if test $nprocd -gt 1 -then -if test $MPITYPE = "intelmpi" -a "$INTELMPI_VERSION" = "HYDRA" - then -# get host list - if test "$host" - then - line=`grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' | uniq` -# count failing hosts - counter=0 - for i in $line - do - $RSH -o BatchMode=yes -o ConnectTimeout=10 $i uname -n - status=$? - if [[ $status != 0 ]] ; then - counter=$((counter+1)) - if [ "$counter" = "1" ]; then - echo " " - echo " error - connection test failed... " - echo " " - fi - echo " " - echo " connection test with ssh failed on host $i" - echo " check the following command: ssh $i uname -n " - echo " " - fi - done -# echo error message and quit - if test $counter -ne 0 - then - echo " " - echo " A parallel job using IntelMPI cannot be started. " - echo " The ssh command must be working correctly between " - echo " the computers used in the analysis. Furthermore, " - echo " it must be set up such that it does not prompt the " - echo " user for a password. Note that this is the case " - echo " also for running on a single machine. " - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo " A parallel job using IntelMPI cannot be started. ">> $jid.log - echo " The ssh command must be working correctly between ">> $jid.log - echo " the computers used in the analysis. Furthermore, ">> $jid.log - echo " it must be set up such that it does not prompt the ">> $jid.log - echo " user for a password. Note that this is the case ">> $jid.log - echo " also for running on a single machine. ">> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - else - counter=1 -# test ssh `hostname` - if test $counter -ne 0 - then - line=`hostname` - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi -# test ssh `hostname` - if test $counter -ne 0 - then - line=`hostname -s` - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi -# test ssh localhost - if test $counter -ne 0 - then - line=localhost - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi - if test $counter -ne 0 - then - echo " error - connection test failed... " - echo " " - echo " ssh needs to work on the machine without asking for a password." - echo " check the following command: ssh localhost uname -n" - echo " " - echo " A parallel job using IntelMPI cannot be started. " - echo " The ssh command must be working correctly between " - echo " the computers used in the analysis. Furthermore, " - echo " it must be set up such that it does not prompt the " - echo " user for a password. Note that this is the case " - echo " also for running on a single machine. " - echo " " - if test "$deletelog" = no - then - echo " error - connection test failed... " >> $jid.log - echo " " >> $jid.log - echo " ssh needs to work on the machine without asking for a password." >> $jid.log - echo " check the following command: ssh localhost uname -n" >> $jid.log - echo " " >> $jid.log - echo " A parallel job using IntelMPI cannot be started. " >> $jid.log - echo " The ssh command must be working correctly between " >> $jid.log - echo " the computers used in the analysis. Furthermore, " >> $jid.log - echo " it must be set up such that it does not prompt the " >> $jid.log - echo " user for a password. Note that this is the case " >> $jid.log - echo " also for running on a single machine. " >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - echo $line $nprocd > $jid.hosts - host=$jid.hosts - fi - fi -fi -fi -# -# check correctness of host file; fix for user sub -# - if test $nprocd -gt 1 - then - -# construct the path name to the executable (execpath) - execpath=$MARC_BIN/$exefile - usersub=0 - if test $program = $prog.marc - then - execpath=$prog.marc - usersub=1 - fi - if test "$objs" - then - execpath="$DIRJOB/$jid.marc" - usersub=1 - fi - if test "$user" - then - execpath=$usernoext.marc - usersub=1 - fi - export execpath - execname=`$BASENAME $execpath` - - if test "$host" - then - userhost=$host - case $userhost in - \/* | \.\/*) - ;; - *) - userhost=`pwd`/$userhost - ;; - esac - -# check that the number of processes specified in the hostfile is -# equal to nprocd specified by -nprocd. - numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` - if test $nprocd -ne $numproc - then - echo " " - echo "error, the number of processes specified in the host file" - echo "must be equal to the number of processes given by -nprocd/-nsolver" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, the number of processes specified in the host file" >> $jid.log - echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - -# check for Myrinet that the number of processes per host is -# less than number of available user ports, 5 -# .gmpi directory must exist in user's home directory -# and must have write permission from remote hosts - if test $MPITYPE = "myrinet" - then - numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` - if test $numproc -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes specified " - echo "in the hostfile must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes specified " >> $jid.log - echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - if test ! -d ~/.gmpi - then - echo " " - echo "error, for Myrinet a .gmpi directory must exist " - echo "under the user's home directory" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log - echo "under the user's home directory" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - homedir=`echo ~` - for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - echo " " - echo "error, for Myrinet a shared .gmpi directory must exist " - echo "under the user's home directory " - echo "with remote write permission" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log - echo "under the user's home directory " >> $jid.log - echo "with remote write permission" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - /bin/rm tmp.$$ - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - fi - fi - done - fi - fi - -# construct the host file $jid.host which is used by mpirun -# skip lines starting with # and only consider lines with more than -# one word in them. Note that the hostfile given to this script -# has two columns: the host name and the number of shared processes -# to run on this host. mpirun wants the number of _other_ -# processes to run in addition to the one being run on the machine -# on which the job is started. hence the $2-1 for fnr == 1. - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then -# HPMPI or HP hardware MPI - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ - -v mpihpspecial="$MPIHPSPECIAL" \ -'{if ( NF > 0) {\ - fnr++ ; \ - printf("-h %s -np %s",$1,$2); \ - printf(" %s",mpihpspecial); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ - if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ - }\ - }' > $jid.host -# end HPMPI or HP hardware MPI - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then -# IBM using hardware MPI (POE) - MP_HOSTFILE=$jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host -# end IBM using hardware MPI (POE) -# for Intel MPI, need to create a machinefile for DMP - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then -# Intel MPI - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - /bin/cp $host $jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Intel MPI for DMP -# for Solaris HPC 7.1, need to create a machinefile for DMP - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then -# Solaris HPC 7.1 - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Solaris HPC 7.1 for DMP -# for Myrinet, construct a configuration file in ~/.gmpi -# this must be readable by each process -# format is (hostname) (port number) for each process - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - grep -v '^#' $host | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ -{if ( NF > 0 ) \ - for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ -}' >> ~/.gmpi/$jid.host - else -# this is for mpich-1.2.5 and later, using the -pg option -# format: host nproc executable user arguments -# the arguments are added later - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s %s\n",path,user);\ - if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ - }\ - }' > $jid.host - fi -# end Myrinet - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then -# Compaq MPI via Memory Channel - grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host -# end Compaq MPI - else -# MPICH - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ - }\ - }' > $jid.host - fi -# define the variable host and host_filt -# host_filt is used for loops over hosts -# for Myrinet we need to use a filtered variant of userhost -# for others we can use $host - if test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - host=~/.gmpi/$jid.host - host_filt=$jid.host_tMp - grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt - else - host=$jid.host - host_filt=$host - fi - else - host=$jid.host - host_filt=$host - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - host_filt=$jid.mfile - fi - fi -# figure out if the machines in the hostfile are nfs mounted -# or distributed and set the variable "dirstatus" accordingly. -# only perform the check if user subroutine is used -# or a user subroutine executable is used - - numfield=1 - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - numfield=2 - fi - DIR1=$DIRJOB - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - counter=0 - echo " " - echo "checking if local or shared directories for host" - if test "$deletelog" = no - then - echo "checking if local or shared directories for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - dirstatus[$counter]="shared" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - dirstatus[$counter]="local" - /bin/rm tmp.$$ - else - if test ! -f $jid.$$ - then - dirstatus[$counter]="local" - $RSH $i /bin/rm $DIR1/$jid.$$ - else - /bin/rm $jid.$$ - fi - fi - if test -f tmp.$$ - then - /bin/rm tmp.$$ - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - echo " ${dirstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${dirstatus[$counter]}" >> $jid.log - fi - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - fi - -# figure out if this is a compatible set of machines -# unless explicitly specified with flag -comp -# only perform the check if user subroutine is used -# or a user subroutine executable is used -# Myrinet does not support heterogeneous - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - if test $compatible = "unknown" - then - thisname=$ARCH - compatible=yes - counter=0 - echo "checking if machines are compatible for host" - if test "$deletelog" = no - then - echo "checking if machines are compatible for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]="yes" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - othername=`$RSH $i uname -a | cut -f 1 -d " "` - if test $thisname != $othername - then - compatible=no - compstatus[$counter]="no" - fi - fi - echo " ${compstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${compstatus[$counter]}" >> $jid.log - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - else - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]=$compatible - fi - done - if test $compatible = "no" - then - echo "all machines assumed incompatible" - if test "$deletelog" = no - then - echo "all machines assumed incompatible" >> $jid.log - fi - else - echo "all machines compatible" - if test "$deletelog" = no - then - echo "all machines compatible" >> $jid.log - fi - fi - fi -# error out if user objects or libraries are used on incompatible machines - if test "$compatible" = "no" -a -n "$objs" - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" - if test "$deletelog" = no - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log - fi - exit 1 - fi -# modify new host file if NFS mounted heterogeneous machine - doit= - if test $program = $prog.marc - then - doit=yes - fi - if test "$user" - then - doit=yes - fi - if test "$doit" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - $AWK -v hst=$i '{fnr++ ; \ -if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ -printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} - /bin/mv $jid.host{$$} $jid.host - host=$jid.host - fi - fi - done - fi - fi # if test $program = $prog.marc -o $user -o $obj - - else # if test $host - # assume shared memory machine if no hostfile given and - # MPITYPE is set to mpich or Myrinet - # check for Myrinet that the total number of processes is - # less than number of available user ports, 5 - if test $MPITYPE = "mpich" -o $MPITYPE = "scali" - then - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - host=$jid.host - elif test $MPITYPE = "myrinet" - then - if test $nprocd -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes " - echo "must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes " >> $jid.log - echo "must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - echo `hostname` $nprocd | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ - {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ -' >> ~/.gmpi/$jid.host - host=~/.gmpi/$jid.host - else - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - - fi - fi # if test myrinet - - fi # if test $host - - fi # if test $nprocd -gt 1 - -fi # if test $program = $exefile -o $program = $prog.marc - -############################################################################## -# construct run stream (Marc only) # -############################################################################## - -# set maximum message length for ddm to a large number -# for vendor provided mpi -if test $itree -eq 0 -a $MPITYPE = hardware -then - itree=100000000 - if test $MACHINENAME = SGI - then - itree=100000001 - fi -fi -if test $itree -eq 0 -a $MPITYPE = hpmpi -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = myrinet -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = nec -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = scali -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = intelmpi -then - itree=100000000 -fi -if test $nprocdddm -lt 2 -then - nprocdarg= -else - nprocdarg="$nprocdarg $nprocdddm" -fi -if test $nsolver -eq 0 -then - nsolverarg= -else - nsolverarg="$nsolverarg $nsolver" -fi -if test $nprocdddm -lt 2 -a $nsolver -eq 0 -then -nprocd=0 -fi -if test $nprocd -gt 0 -then - if test "$host" - then - if test -z "$RUN_JOB2" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then - RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" - RUN_JOB=" -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - numhost=`uniq $jid.mfile | wc -l` - if test "$INTELMPI_VERSION" = "HYDRA" - then - RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n $numhost -r $RSH -f $jid.mfile - RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" - fi - -# intelmpi uses configfile. format: -# -host host1 -n n1 executable marcargs -# one such line per host -# collect the marcargs in RUN_JOB and construct the config file later -# collect the run stream in RUN_JOB_TMP - RUN_JOB="-jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - - - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then - RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - if test "$userhost" - then - RUN_JOB="$RUN_JOB -mhost $userhost" - fi - if test $MPITYPE = "scali" - then -# set default working directory to /tmp to allow -# different directory names - SCAMPI_WORKING_DIRECTORY=/tmp - export SCAMPI_WORKING_DIRECTORY - fi - else - if test -z "$RUN_JOB1" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - RUNNPROCD=$nprocd - if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" - then - RUNNPROCD= - MP_PROCS=$nprocd - export MP_PROCS - fi - if test $MPITYPE = "myrinet" - then - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n 1 -f $jid.hosts - fi - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - fi -else - if test $nauto -gt 0 -o $ndcoup -gt 0 - then - RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - else -# this is for a serial job without auto restart: - RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi -fi -if test "$rid" -then - RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" -fi -if test "$pid" -then - RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" -fi -if test "$sid" -then - RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" -fi -if test "$did" -then - RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" -fi -if test "$vid" -then - RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" -fi -if test $nauto -gt 0 -then - RUN_JOB="$RUN_JOB -autorst $nauto " -fi -if test $ndcoup -gt 0 -then - RUN_JOB="$RUN_JOB -dcoup $ndcoup " -fi -if test $ndytran -gt 0 -then - RUN_JOB="$RUN_JOB -dytran $ndytran " -fi -if test $mesh -gt 0 -then - RUN_JOB="$RUN_JOB -me $mesh " -fi -if test $noutcore -gt 0 -then - RUN_JOB="$RUN_JOB -outcore $noutcore " -fi -if test "$dllrun" -gt 0 -then - RUN_JOB="$RUN_JOB -dll $dllrun " -fi -if test "$trkrun" -gt 0 -then - RUN_JOB="$RUN_JOB -trk $trkrun " -fi -if test "$iam" -then - RUN_JOB="$RUN_JOB -iam $iam " -fi -if test "$justlist" -then - RUN_JOB="$RUN_JOB -list 1 " -fi -if test "$feature" -then - RUN_JOB="$RUN_JOB -feature $feature " -fi -if test "$memlimit" -ne 0 -then - RUN_JOB="$RUN_JOB -ml $memlimit " -fi -if test "$cpinput" -then - RUN_JOB="$RUN_JOB -ci $cpinput " -fi -if test "$cpresults" -then - RUN_JOB="$RUN_JOB -cr $cpresults " -fi -if test "$DIRSCR" != "$DIRJOB" -then - RUN_JOB="$RUN_JOB -dirscr $DIRSCR" -else - DIRSCR=$DIRJOB -fi -if test "$makebdf" -then - RUN_JOB="$RUN_JOB -bdf $makebdf " -fi -if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" -then - # append $RUN_JOB to all lines of the host file - # and set RUN_JOB - $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ - /bin/mv $host.$$ $host - RUN_JOB=$RUN_JOB_TMP -fi -if test $MPITYPE = "intelmpi" -a "$host" -then - # construct config file, append $RUN_JOB to all lines of the config file - # and set RUN_JOB - if test "$INTELMPI_VERSION" = "HYDRA" - then - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - else - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-host %s -n %s",$1,$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - fi - RUN_JOB=$RUN_JOB_TMP -fi -echo " " -echo "Final run stream value" -echo " RUNJOB="$RUN_JOB -if test "$deletelog" = no -then -echo " " >> $jid.log -echo "Final run stream value" >> $jid.log -echo " RUNJOB="$RUN_JOB >> $jid.log -fi - - -############################################################################## -# run marc using valgrind # -############################################################################## -#RUN_JOB="valgrind $RUN_JOB" -#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" -############################################################################## - - -############################################################################## -# run the requested program in a queue # -############################################################################## - -if test "$deletelog" = yes -then - echo - date -else - echo >> $jid.log - date >> $jid.log -fi -if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] -then - -/bin/rm -f $jid.runmarcscript - - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - userobj=$usernoext.o - fi - cat > $jid.runmarcscript << END4 - if test "$user" - then - if test $MACHINENAME = "CRAY" - then - $DFORTRAN $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTRAN $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $MARCCUDALIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } -END4 -else - prgsav=yes -fi -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# - -cat >> $jid.runmarcscript << END5 - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -# first remove all .out files and incremental restart files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null - /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null -fi - -if test $nprocdddm -gt 1 -then - $RUN_JOB 2>>$jid.log -else - $RUN_JOB 2>>$jid.log -fi - -if test $dllrun -eq 0; then - if test $prgsav = no - then - /bin/rm -f $bd$program 2>/dev/null - fi -else - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes - then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -END5 - - -# Submit to marc batch queue -# -if [ $qid = at ] -then -QUENAME=at -SUBMCMD= -else -# -# Submit to qsub queue -# -QUENAME=qsub -SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" -if test "$priority" -then - SUBMCMD=$SUBMCMD" -p $priority" -fi -if test "$att" -then - SUBMCMD=$SUBMCMD" -a $att" -fi -if test "$cpu" -then - SUBMCMD=$SUBMCMD" -lt $cpu" -fi - -fi -echo $QUENAME $SUBMCMD -#cat $jid.runmarcscript -$QUENAME $SUBMCMD < $jid.runmarcscript - -/bin/rm -f $jid.runmarcscript - -############################################################################## -# run the requested program in the background # -############################################################################## - -else -if test $qid = background -then - -# -# first remove all old .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi -# -# compile user subroutine if present -# -( -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - echo " $PRODUCT Exit number 3" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTRAN $user || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTRAN $user -o $userobj || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - echo " $PRODUCT Exit number 3" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc - -# - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -$RUN_JOB & - -marcpid=$! -echo $marcpid > $DIRJOB/$jid.pid -wait $marcpid - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - if test "$host" - then - /bin/rm $jid.mfile 2> /dev/null - /bin/rm $jid.hosts 2> /dev/null - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.cfile 2> /dev/null - fi - fi - fi -fi - - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -) 1>>$jid.log 2>&1 & - - -############################################################################## -# run the requested program in the foreground # -############################################################################## - -else - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTRAN $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTRAN $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi -# first remove all .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi - -$RUN_JOB - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - if test "$host" - then - /bin/rm $jid.mfile 2> /dev/null - /bin/rm $jid.hosts 2> /dev/null - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.cfile 2> /dev/null - else - echo " " > /dev/null - fi - else - if test "$host" - then - mpdcleanup -a -f $jid.mfile - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.mfile 2> /dev/null - else - mpdcleanup -a -f $jid.hosts - /bin/rm $jid.hosts 2> /dev/null - fi - fi - fi -fi - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi - - -fi -fi diff --git a/installation/mods_MarcMentat/2013/Marc_tools/run_damask_h b/installation/mods_MarcMentat/2013/Marc_tools/run_damask_h deleted file mode 100644 index dec30e5e0..000000000 --- a/installation/mods_MarcMentat/2013/Marc_tools/run_damask_h +++ /dev/null @@ -1,3849 +0,0 @@ -#!/bin/ksh -############################################################################## -# # -# run_marc - run a marc job # -# ------------------------- # -# # -# usage: run_marc -j jid { options } # -# # -# where standard options are: required: defaults: # -# -------------------------- # -# # -# -j* jid job id number. ** YES ** . # -# -pr* prog program name. . marc # -# -v* y|n do or do not verify inputs. . yes # -# -q* s|l|v|b|f batch queue name or background, . short # -# foreground. # -# -b* as alternative to option -q* # -# # -# ( batch queues only : # -# -pq* intra queue priority. . . # -# -at DATE/TIME delay start of job. . . # -# format : January,1,1990,12:31 # -# or : today,5pm # -# -cpu* secs job CPU limit . . ) # -# # -# -r* rid restart file job id. . . # -# -si* sid substructure file id. . . # -# -pi* post post file job id. . . # -# -de* did defaults file . no # -# -vf vid viewfactor . no # -# # -# -u* user user subroutine. . . # -# -obj obj user objects or libraries. . . # -# -sa* y|n do or do not save load module. . no # -# -autorst auto restart flag for auto forge . no # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo selects i4 or i8 version # -# default: i4 or via defaults file run_marc_defaults # -# the -mo option will override # -# -mpi selects MPI version # -# each platform has a default MPI version and some # -# have an alternative version. see the include file # -# for the respective platform # -# MPI_DEFAULT defines the default MPI version # -# MPI_OTHER defines versions one can switch to # -# -dcoup for contact decoupling # -# currently not supported # -# -dir directory where the job i/o should take place. # -# defaults to current directory. # -# -sdir directory where scratch files are created # -# defaults to current directory. # -# # -# -alloc only perform memory allocation test, no analysis # -# -list y only list options in the input file, no analysis # -# -fe num set feature number "num" for the run. only one allowed # -# -dytran flag to switch from Dytran to Marc # -# dytran = 0, program will run w/o Marc-Dytran Switch # -# = 1, program will restart Marc after Dytran run # -# >= 2, Not supported yet. # -# currently not supported # -# -ou force analysis to use out-of-core control # -# =0, not used # -# =1, element storage out-of-core # -# -dll run marc using shared library libmarc.so and exe_marc # -# =1, used # -# =2, do not free streaming input memory # -# =3, run with marc input deck # -# -trk run marc for post-tracking # -# -gpuid run marc using GPGPU capability # -# specify gpuid on to be used in the analysis. Multiple # -# IDs may be assigned for DDM runs. # -# Separate a list of IDs with a colon. Each DMP # -# process will be assigned a GPU ID in round robin fastion# -# = 0 # -# = 0:1 etc... # -# # -# where parallel options are: # -# -------------------------- # -# # -# itree, host, and comp options are available for the domain # -# decomposition only. # -# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # -# # -# # -# -nprocd number of domains. # -# defaults to single domain solution. # -# -nprocds number of domains if single input file. # -# defaults to single domain solution. # -# -nps same as -nprocds. # -# -nsolver number of solver tasks for solver types 12 and 13 # -# these are distributed tasks operating via MPI # -# -nthread number of solver threads for solver types 6, 8, and 11 # -# also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. if both specified, nthread option# -# will be used. # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by 6, 8, and 11 # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor nthread specified. # -# -itree message passing tree type for domain decomposition. # -# for debugging purposes; should not normally be used. # -# -host hostfile name for distributed execution on network. # -# defaults to no hostfile, unless jobid.defhost exists. # -# if jobid.defhost exists, only -np(s) necessary # -# -comp* y|n to be used with user routines on a network of # -# incompatible machines. # -# if set to no, a separate executable will be created # -# for each machine on the network. # -# if set to yes, the executable located on the machine # -# from which marc is started will be used on all machines.# -# defaults to no if O/S versions different on machines. # -# # -# -ci y|n copy input files to remote hosts (default: yes) # -# if "yes", input files are automatically copied to # -# remote hosts for a network run if necessary. # -# -cr y|n copy post files from remote hosts (default: yes) # -# if "yes", post files are automatically copied back from # -# remote hosts for a network run if necessary. # -############################################################################## -# set DIR to the directory in which this script is -REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" -DIR=`dirname $REALCOM` -# make sure DIR has an absolute path -case $DIR in - \/*) - ;; - *) - DIR=`pwd`/$DIR - ;; -esac -DIRSCRIPT=$DIR -AWK=awk -ARCH=`uname -a | cut -f 1 -d " "` -# Sun has a bad awk, use nawk instead -if test $ARCH = "SunOS" -then - AWK=nawk -fi -BASENAME=basename -# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists -if test $ARCH = "SunOS" -then - if test -x /usr/ucb/basename - then - BASENAME=/usr/ucb/basename - fi -fi - -# echo command line in the case of ECHO_COMMAND is true -if test "$ECHO_COMMAND" = true ; then - echo command "$0" "$@" -fi - -# -# "mode" selects version, i4 or i8 -# default is i4 -# this can be changed by a file run_marc_defaults -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MODE i8 -# it can also be set by the environmental variable MARC_INTEGER_SIZE -# and by the command line option "-mo" -# -mode= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -f $HOME/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -n "$MARC_INTEGER_SIZE" ; then - mode=$MARC_INTEGER_SIZE -fi -if test -z "$mode" ; then - mode=i4 -fi -case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "error, version mode must be i4 or i8" - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i4 or i8" - echo " " - echo " use -mo i4 or -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - setmode=true - fi - if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - fi - if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -done - -# set to i4 version for 32 bit Linux -if test "`uname -s`" = "Linux"; then - if test "`uname -m`" = "i686"; then - mode=i4 - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -fi - - -. "$DIR/getarch" - -# Change_me -. $MARC_INCLUDE -# - -# -# Dynamically determine the echo syntax -# - -case "`echo '\c'`" in - '\c') - ECHO='echo -n' - ECHOTXT=' ' - ;; - *) - ECHO='echo' - ECHOTXT=' \c' - ;; -esac - -# -# Variables for the MARC environment -# - -PRODUCT="Marc" -EXITMSG=$MARC_TOOLS/MESSAGES -export EXITMSG -FLEXDIR=$DIR/../flexlm/licenses -export FLEXDIR -TIMCHK=3600 -export TIMCHK -BINDIR=$MARC_BIN -export BINDIR -AFMATDAT=$MARC_RUNTIME/AF_flowmat/ -export AFMATDAT -# -# define directory path to global unified material database -# -MATFILE= -export MATFILE - -# -# define memory limit -# first set to MEMLIMIT from include -# -ml option overrules if specified -memlimit=$MEMLIMIT -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -# -if test $MACHINENAME = "HP" -then - SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH - export SHLIB_PATH -fi -# the one for IBM is defined futher down - -LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH -LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH -export LD_LIBRARY_PATH -export LD_LIBRARY64_PATH -export LD_LIBRARYN32_PATH - -atexit() { -kill -15 $$ -# -if test $MPITYPE = "myrinet" -then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi -fi -} - -trap "atexit" 2 - -# -# defaults -# - -prog=marc -exefile=marc -jid= -rid= -pid= -sid= -did= -vid= -user= -usersnoext= -objs= -qid=background -cpu= -priority= -att= -trk= -verify=yes -prgsav=no -rmdll=no -cpdll=no -progdll= -pathdll= -error= -nprocd=0 -nprocdddm=1 -nprocdddmprint= -icreated=0 -nprocdarg= -nsolver=0 -nsolverarg=-ns -if test $nprocds -then - if test $nprocds -gt 1 - then - nprocdddm=$nprocds - nprocdddmprint=$nprocds - icreated=1 - nprocdarg=-nprocds - fi -fi -nthread=-1 -gpuids= -nauto=0 -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -nthreadprint=0 -itree=0 -iam= -link= -trkrun=0 -DIRJOB=`pwd` -DIRSCR=$DIRJOB -DIRSCRSET= -autoforge=0 -dotdat=.dat -dotdefhost=.defhost -host= -numhost= -mfile= -userhost= -makebdf= -cpinput=yes -cpresults=yes -marcdll=libmarc.$EXT_DLL -# define hostname and strip off extensions (alpha.aaa.com) -thishost=`hostname` -thishost=${thishost%%.*} -compatible=unknown -numfield=1 -justlist= -feature= -mpioption=false -MDSRCLIB=$MARC_LIB/mdsrc.a -# -# check run_marc_defaults file for default MPI setting -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MPI -# -value= -file= -if test -f $DIRSCRIPT/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$DIRSCRIPT/run_marc_defaults - fi -fi -if test -f $HOME/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$HOME/run_marc_defaults - fi -fi -if test -n "$value"; then - MARC_MPITYPE=$value - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - echo " " - echo " error, incorrect option for MARC_MPI" - echo " defined in $file: $MARC_MPITYPE" - echo " valid options: $MPI_DEFAULT $MPI_OTHER" - echo " " - exit - fi - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - fi -fi -# -# -# allow scratch directory to be specified with environmental variable -# MARCSCRATCH -if test $MARCSCRATCH -then - if test -d $MARCSCRATCH - then - DIRSCR=$MARCSCRATCH - else - echo "error, scratch directory '$MARCSCRATCH'" - echo " specified via environmental variable MARCSCRATCH does not exist" - exit - fi -fi -# -############################################################################## -# parse input - arguments always come in pairs # -############################################################################## - -arg=$1 -if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - shift - arg=$1 -fi -while [ -n "$arg" ] -do - shift - value=$1 - case $arg in - -al* | -AL*) - LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - $MARC_BIN/marc -alloc 1 - exit - ;; - -li* | -LI*) - justlist=yes - ;; - -fe* | -FE*) - feature=$value - ;; - -pr* | -PR*) - if test `dirname $value` = '.' - then - prog=`$BASENAME $value .marc` - progdll=`$BASENAME $value` - else - prog=`dirname $value`/`$BASENAME $value .marc` - progdll=`dirname $value`/`$BASENAME $value` - fi - prdir=`dirname $value` - case $prdir in - \/*) - ;; - *) - prog=`pwd`/$prdir/$prog - ;; - esac - ;; - -j* | -J*) - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - ;; - -r* | -R*) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - -si* | -SI*) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - -pi* | -PI*) - if test -f $value.t19 - then - pid=`$BASENAME $value .t19` - else - pid=`$BASENAME $value .t16` - fi - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - -bdf | -BDF) - makebdf=1 - ;; - -de* | -DE*) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - -vf | -VF) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - -u* | -U*) - - user=$value - - - - - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - -obj | -OBJ) - objs="$value" - ;; - -q* | -Q*) - qid=$value - ;; - -b* | -B*) - case $value in - y* | Y*) - qid=background - ;; - n* | N*) - qid=foreground - ;; - *) - ;; - esac - ;; - -at | -AT) - att=$value - ;; - -cpu* | -CPU*) - cpu=$value - ;; - -pq | -PQ*) - priority=$value - ;; - -v* | -V*) - verify=$value - ;; - -sa* | -SA*) - prgsav=$value - ;; - -np* | -NP*) - nprocdddm=$value - nprocdddmprint=$value - case $arg in - -nps* | -NPS* | -nprocds* | -NPROCDS*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - case $arg in - -np | -NP | -nprocd | -NPROCD) - icreated=0 - nprocdarg=-nprocd - ;; - esac - ;; - -ns* | -NS*) - nsolver=$value - ;; - -nt* | -NT*) - nthread=$value - ;; - -gp* | -GP*) - gpuids=$value - ;; - -it* | -IT*) - itree=$value - ;; - -iam | -IAM) - iam=$value - ;; - -au* | -AU*) - nauto=$value - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -me | -ME ) - mesh=$value - ;; - -ml | -ML ) - memlimit=$value - ;; - -mo | -MO ) - ;; - -mpi | -MPI ) - mpioption=true - MARC_MPITYPE=$value - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - fi - fi - ;; - -dir* | -DIR*) - DIRJOB=$value - case $DIRJOB in - \/*) - ;; - *) - DIRJOB=`pwd`/$DIRJOB - ;; - esac - if test -z "$DIRSCRSET" - then - DIRSCR=$DIRJOB - fi - ;; - -sd* | -SD*) - DIRSCR=$value - DIRSCRSET=yes - case $DIRSCR in - \/*) - ;; - *) - DIRSCR=`pwd`/$DIRSCR - ;; - esac - ;; - -ho* | -HO*) - host=$value - ;; - -co* | -CO*) - compatible=$value - ;; - -ci* | -CI*) - cpinput=$value - ;; - -cr* | -CR*) - cpresults=$value - ;; - *) - error="$error -$arg: invalid option" - break - ;; - esac - case $value in - -*) - error="$error -$arg: invalid name $value" - break - ;; - esac - shift - arg=$1 - if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - shift - arg=$1 - fi -done -argc=`expr $# % 2` -if test $argc -eq 1 -then -# -# odd number of arguments -# - error="$error -argument list incomplete" -fi - -if test $nprocdddm -gt 0 -then -nprocd=$nprocdddm -fi - -if test $nsolver -gt 0 -then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi -fi - -if test $nthread -eq -1 -then -nthread=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nthread -lt 0 -then -nthread=0 -fi - -nthreadprint=$nthread -if test $nthreadprint -eq 0 -then -nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi -fi - -nthread=$nthreadprint - -gpuoption= -if test "$gpuids" = "" ; then - gpuoption= -else - gpuoption="-gp $gpuids" -fi - -if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH -else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH -fi -# Linux 64 + HPMPI, Below code is taken from include_linux64 -if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" -then -export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" -fi - -if test $nprocd -gt 1; then - if test -f $jid$dotdefhost; then - if test "$host" = ""; then - host=$jid$dotdefhost - fi - fi - if test -f hostfile_qa_$nprocd; then - if test "$host" = ""; then - host=hostfile_qa_$nprocd - fi - fi -fi - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then - dotdat=.inp - fi - - if test "$progdll"; then - /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll - rmdll=yes - pathdll=yes - progdll=${progdll}_$marcdll - else - progdll=$marcdll - fi - - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - pathdll=yes - fi -fi - -############################################################################## -# check parameter validity # -############################################################################## - -while test forever; do - -# -# check for input file existence -# -if test $nprocdddm -gt 1 -a $icreated -eq 0; then - if test ! -f $DIRJID/1$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/1$jid$dotdat not accessible" - fi - fi -else - if test ! -f $DIRJID/$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/$jid$dotdat not accessible" - fi - fi -fi - if test $nprocd -gt 1; then - if test "$host" ; then - if test ! -f $host; then - error="$error -host name file $host not accessible" - fi - fi - fi - -# -# check if the job is already running in the background -# -if test -f $DIRJOB/$jid.pid; then - error="$error -job is already running (the file $jid.pid exists)" -fi - -# -# if the program name is other than marc, then -# assume that this is a program in the users local directory -# - -bd=$MARC_BIN/ - -case $prog in - marc | MARC | $exefile) - program=$exefile - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - if test ! -f $user - then - error="$error -user subroutine file $user not accessible" - fi - fi - if test "$objs" - then - missingobjs= - for o in $objs - do - if test ! -f "$o" - then - if test -z "$missingobjs" - then - missingobjs="$o" - else - missingobjs="$missingobjs $o" - fi - fi - done - if test -n "$missingobjs" - then - error="$error -user object/library file(s) $missingobjs not accessible" - fi - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$vid" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRVID/1$vid.vfs - then - error="$error -view factor file $DIRVID/1$vid.vfs not accessible" - fi - else - if test ! -f $DIRVID/$vid.vfs - then - error="$error -view factor file $DIRVID/$vid.vfs not accessible" - fi - fi - fi - if $mpioption - then - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" - fi - fi - ;; - *) - program=$prog.marc - case $prog in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - error="$error -program option may not be used with user subroutine" - fi - if test "$objs" - then - error="$error -program option may not be used with user objects or libraries" - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$nauto" - then - if test $nauto -gt 2 - then - error="$error -incorrect option for auto restart " - fi - fi - if test "$ndcoup" - then - if test $ndcoup -gt 3 - then - error="$error -incorrect option for contact decoupling " - fi - fi - if test "$ndytran" - then - if test $ndytran -gt 1 - then - error="$error -incorrect option for Marc-Dytran Switch " - fi - fi - if $mpioption - then - if test ! -x $MARC_BIN/$exefile - then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE " - fi - fi - ;; -esac - -############################################################################## -# check argument integrity # -############################################################################## - -if test "$jid" -then - : -else - error="$error -job id required" -fi - -if test $nprocd -gt 1 -then - if test $nauto -gt 0 - then - error="$error -cannot run DDM job with auto restart (-au) option " - fi -fi -case $qid in - S* | s*) - qid=short - ;; - L* | l*) - qid=long - ;; - V* | v*) - qid=verylong - ;; - B* | b*) - qid=background - ;; - F* | f*) - qid=foreground - ;; - A* | a*) - qid=at - ;; - *) - error="$error -bad value for queue_id option" - ;; -esac - -case $prgsav in - N* | n*) - prgsav=no - ;; - Y* | y*) - prgsav=yes - ;; - *) - error="$error -bad value for save option" - ;; -esac - -case $verify in - N* | n*) - verify=no - ;; - Y* | y*) - verify=yes - ;; - *) - error="$error -bad value for verify option" - ;; -esac - -case $nprocdddm in - -* ) - error="$error -bad value for nprocd option" - ;; -esac - -case $nthread in - -* ) - error="$error -bad value for nthread option" - ;; -esac - -case $itree in - -* ) - error="$error -bad value for itree option" - ;; -esac -case $iam in - -* ) - error="$error -bad value for iam option" - ;; -esac -case $compatible in - N* | n*) - compatible=no - ;; - Y* | y*) - compatible=yes - ;; - unknown) - ;; - *) - error="$error -bad value for comp option" - ;; -esac -case $cpinput in - N* | n*) - cpinput=no - ;; - Y* | y*) - cpinput=yes - ;; - *) - error="$error -bad value for copy input option" - ;; -esac -case $cpresults in - N* | n*) - cpresults=no - ;; - Y* | y*) - cpresults=yes - ;; - *) - error="$error -bad value for copy results option" - ;; -esac - -# -# check for external file to run -# -if test -f $MARC_TOOLS/run_marc_check -then - . $MARC_TOOLS/run_marc_check -fi - -# -# pick up version data from bin/VERSION if it exists -# -if test -f $MARC_BIN/VERSION; then - ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` - if test -n "$ppp" ;then - PRODUCT=$ppp - fi - ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` - if test -n "$ppp" ;then - REVISION=", Build $ppp" - fi -fi -############################################################################## -# interact with the user to get the required information to run marc or # -# other marc system program # -############################################################################## - -deletelog=yes -if test $qid = background -a $verify = no -then -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto " > $jid.log -deletelog=no -fi -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto" - - -case $qid in - s* | S* | l* | L* | v* | V* ) - echo \ -"Queue priority : $priority -Queue CPU limit : $cpu -Queue start time : $att" - ;; -# * ) -# echo \ -#" " -# ;; -esac - -if test "$error" -then - if test $verify = yes - then - $ECHO "$error - -Please correct or quit(correct,quit,): $ECHOTXT" - error= - read answer - case $answer in - q* | Q*) - answer=quit - ;; - *) - answer=correct - ;; - esac - else - $ECHO "$error - $ECHOTXT" - echo " " - if test "$deletelog" = no - then - $ECHO "$error - $ECHOTXT" >> $jid.log - echo " " >> $jid.log - fi - answer=quit - fi -else - if test $verify = yes - then - $ECHO " -Are these parameters correct (yes,no,quit,)? $ECHOTXT" - read answer - case $answer in - q* | Q*) - answer=quit - ;; - y* | Y*) - answer=yes - ;; - *) - answer=no - ;; - esac - else - answer=yes - fi -fi - -case $answer in - no | correct) - -############################################################################## -# prompt for each value # -############################################################################## - - $ECHO " -Program name ($prog)? $ECHOTXT" - read value - if test "$value" - then - prog=$value - fi - $ECHO "Job ID ($jid)? $ECHOTXT" - read value - if test "$value" - then - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - fi - $ECHO "User subroutine name ($user)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - user= - ;; - *) - user=$value - - - - - - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - esac - fi - $ECHO "User objects or libraries ($objs)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - objs= - ;; - *) - objs="$value" - ;; - esac - fi - $ECHO "Restart File Job ID ($rid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - rid= - ;; - *) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - esac - fi - $ECHO "Substructure File ID ($sid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - sid= - ;; - *) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - esac - fi - $ECHO "Post File Job ID ($pid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - pid= - ;; - *) - pid=$value - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - esac - fi - $ECHO "Defaults File ID ($did)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - did= - ;; - *) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - esac - fi - $ECHO "View Factor File ID ($vid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - vid= - ;; - *) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - esac - fi - $ECHO "Save generated module ($prgsav)? $ECHOTXT" - read value - if test "$value" - then - prgsav=$value - fi - $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" - read value - if test "$value" - then - nprocdddm=$value - nprocdddmprint=$value - fi - $ECHO "Run on ($nthread) threads ? $ECHOTXT" - read value - if test "$value" - then - nthread=$value - fi - $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" - read value - if test "$value" - then - nsolver=$value - fi -# - if test $nprocdddm -gt 0 - then - nprocd=$nprocdddm - fi - if test $nsolver -gt 0 - then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi - fi - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - nthreadprint=$nthread - if test $nthreadprint -eq 0 - then - nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi - fi -# - $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" - read value - if test "$value" - then - gpuids=$value - fi - if test "$gpuids" = "" ; then - gpuoption= - else - gpuoption="-gp $gpuids" - fi - if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH - fi - if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - fi -# - if test $nprocd -gt 1 - then - $ECHO "Message passing type ($itree)? $ECHOTXT" - read value - if test "$value" - then - itree=$value - fi - $ECHO "Host file name ($host)? $ECHOTXT" - read value - if test "$value" - then - host=$value - fi - if test $nprocdddm -gt 1 - then - $ECHO "Single input file? $ECHOTXT" - read value - case $value in - y* | Y*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" - read value - if test "$value" - then - compatible=$value - fi - $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" - read value - if test "$value" - then - cpinput=$value - fi - $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" - read value - if test "$value" - then - cpresults=$value - fi - fi - fi - $ECHO "Run the job in the queue ($qid)? $ECHOTXT" - read value - if test "$value" - then - qid=$value - fi - case $qid in - s* | S* | l* | L* | v* | V* ) - $ECHO "Queue priority ($priority)? $ECHOTXT" - read value - if test "$value" - then - priority=$value - fi - $ECHO "Job starts at ($att)? $ECHOTXT" - read value - if test "$value" - then - att=$value - fi - $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" - read value - if test "$value" - then - cpu=$value - fi - ;; - * ) - ;; - esac - $ECHO "Auto Restart option ($nauto)? $ECHOTXT" - read value - if test "$value" - then - nauto=$value - fi - $ECHO "Run directory ($DIRJOB)? $ECHOTXT" - read value - if test "$value" - then - DIRJOB=$value - DIRSCR=$DIRJOB - fi - $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" - read value - if test "$value" - then - DIRSCR=$value - fi - ;; - quit) - exit 1 - ;; - *) - break - ;; - -esac - - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - -done - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - pathdll=yes - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - fi - - if test "$pathdll"; then -# -# reset share lib path -# - if test $MACHINENAME = "HP" - then - SHLIB_PATH=$DIRJOB:$SHLIB_PATH - export SHLIB_PATH - fi - if test $MACHINENAME = "IBM" - then - LIBPATH=$DIRJOB:$LIBPATH - export LIBPATH - fi -# - LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH - LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH - LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH - export LD_LIBRARY_PATH - export LD_LIBRARY64_PATH - export LD_LIBRARYN32_PATH - fi -fi -# end of dllrun>0 - - -if test $program = $exefile -o $program = $prog.marc -then - -# delete the old .log file unless we run in the background -if test "$deletelog" = yes -then - /bin/rm $jid.log 2>/dev/null -else - echo - echo running the job in the background, see $jid.log - echo -fi - -# -# check if this is an autoforge or rezoning or radiation job -# -if test $nprocd -eq 1 -then - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` - if test "$line" - then - autoforge=1 - fi -fi -# -# check that jobname for restarted run is not the same -# as restart file basename -# -if test "$rid" -then - if test "$jid" = "$rid" - then - echo " " - echo "ERROR: job name of current run is the same as job name" - echo " of the restarted job" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "ERROR: job name of current run is the same as job name" >> $jid.log - echo " of the restarted job" >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi -fi - -# -# user objects/libraries used -# - - if test "$objs" - then - program="$DIRJOB/$jid.marc" - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# user subroutine used -# -# add DAMASK options for linking - DAMASK="" - - if test "$user" - then - program=$usernoext.marc - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# Special case for IBM using POE but not an SP machine -# in this case we always need a host file, also for serial jobs. -# -if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP -then - MP_HOSTFILE=${jid}.host - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $nprocd -gt 1 - then - numdom=$nprocd - while test $numdom -gt 0 - do - hostname -s >> $MP_HOSTFILE - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - else - hostname -s > $MP_HOSTFILE - fi -fi -# -# check ssh for all hosts in host file -# -if test $nprocd -gt 1 -then -if test $MPITYPE = "intelmpi" -a "$INTELMPI_VERSION" = "HYDRA" - then -# get host list - if test "$host" - then - line=`grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' | uniq` -# count failing hosts - counter=0 - for i in $line - do - $RSH -o BatchMode=yes -o ConnectTimeout=10 $i uname -n - status=$? - if [[ $status != 0 ]] ; then - counter=$((counter+1)) - if [ "$counter" = "1" ]; then - echo " " - echo " error - connection test failed... " - echo " " - fi - echo " " - echo " connection test with ssh failed on host $i" - echo " check the following command: ssh $i uname -n " - echo " " - fi - done -# echo error message and quit - if test $counter -ne 0 - then - echo " " - echo " A parallel job using IntelMPI cannot be started. " - echo " The ssh command must be working correctly between " - echo " the computers used in the analysis. Furthermore, " - echo " it must be set up such that it does not prompt the " - echo " user for a password. Note that this is the case " - echo " also for running on a single machine. " - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo " A parallel job using IntelMPI cannot be started. ">> $jid.log - echo " The ssh command must be working correctly between ">> $jid.log - echo " the computers used in the analysis. Furthermore, ">> $jid.log - echo " it must be set up such that it does not prompt the ">> $jid.log - echo " user for a password. Note that this is the case ">> $jid.log - echo " also for running on a single machine. ">> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - else - counter=1 -# test ssh `hostname` - if test $counter -ne 0 - then - line=`hostname` - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi -# test ssh `hostname` - if test $counter -ne 0 - then - line=`hostname -s` - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi -# test ssh localhost - if test $counter -ne 0 - then - line=localhost - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi - if test $counter -ne 0 - then - echo " error - connection test failed... " - echo " " - echo " ssh needs to work on the machine without asking for a password." - echo " check the following command: ssh localhost uname -n" - echo " " - echo " A parallel job using IntelMPI cannot be started. " - echo " The ssh command must be working correctly between " - echo " the computers used in the analysis. Furthermore, " - echo " it must be set up such that it does not prompt the " - echo " user for a password. Note that this is the case " - echo " also for running on a single machine. " - echo " " - if test "$deletelog" = no - then - echo " error - connection test failed... " >> $jid.log - echo " " >> $jid.log - echo " ssh needs to work on the machine without asking for a password." >> $jid.log - echo " check the following command: ssh localhost uname -n" >> $jid.log - echo " " >> $jid.log - echo " A parallel job using IntelMPI cannot be started. " >> $jid.log - echo " The ssh command must be working correctly between " >> $jid.log - echo " the computers used in the analysis. Furthermore, " >> $jid.log - echo " it must be set up such that it does not prompt the " >> $jid.log - echo " user for a password. Note that this is the case " >> $jid.log - echo " also for running on a single machine. " >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - echo $line $nprocd > $jid.hosts - host=$jid.hosts - fi - fi -fi -fi -# -# check correctness of host file; fix for user sub -# - if test $nprocd -gt 1 - then - -# construct the path name to the executable (execpath) - execpath=$MARC_BIN/$exefile - usersub=0 - if test $program = $prog.marc - then - execpath=$prog.marc - usersub=1 - fi - if test "$objs" - then - execpath="$DIRJOB/$jid.marc" - usersub=1 - fi - if test "$user" - then - execpath=$usernoext.marc - usersub=1 - fi - export execpath - execname=`$BASENAME $execpath` - - if test "$host" - then - userhost=$host - case $userhost in - \/* | \.\/*) - ;; - *) - userhost=`pwd`/$userhost - ;; - esac - -# check that the number of processes specified in the hostfile is -# equal to nprocd specified by -nprocd. - numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` - if test $nprocd -ne $numproc - then - echo " " - echo "error, the number of processes specified in the host file" - echo "must be equal to the number of processes given by -nprocd/-nsolver" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, the number of processes specified in the host file" >> $jid.log - echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - -# check for Myrinet that the number of processes per host is -# less than number of available user ports, 5 -# .gmpi directory must exist in user's home directory -# and must have write permission from remote hosts - if test $MPITYPE = "myrinet" - then - numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` - if test $numproc -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes specified " - echo "in the hostfile must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes specified " >> $jid.log - echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - if test ! -d ~/.gmpi - then - echo " " - echo "error, for Myrinet a .gmpi directory must exist " - echo "under the user's home directory" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log - echo "under the user's home directory" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - homedir=`echo ~` - for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - echo " " - echo "error, for Myrinet a shared .gmpi directory must exist " - echo "under the user's home directory " - echo "with remote write permission" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log - echo "under the user's home directory " >> $jid.log - echo "with remote write permission" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - /bin/rm tmp.$$ - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - fi - fi - done - fi - fi - -# construct the host file $jid.host which is used by mpirun -# skip lines starting with # and only consider lines with more than -# one word in them. Note that the hostfile given to this script -# has two columns: the host name and the number of shared processes -# to run on this host. mpirun wants the number of _other_ -# processes to run in addition to the one being run on the machine -# on which the job is started. hence the $2-1 for fnr == 1. - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then -# HPMPI or HP hardware MPI - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ - -v mpihpspecial="$MPIHPSPECIAL" \ -'{if ( NF > 0) {\ - fnr++ ; \ - printf("-h %s -np %s",$1,$2); \ - printf(" %s",mpihpspecial); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ - if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ - }\ - }' > $jid.host -# end HPMPI or HP hardware MPI - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then -# IBM using hardware MPI (POE) - MP_HOSTFILE=$jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host -# end IBM using hardware MPI (POE) -# for Intel MPI, need to create a machinefile for DMP - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then -# Intel MPI - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - /bin/cp $host $jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Intel MPI for DMP -# for Solaris HPC 7.1, need to create a machinefile for DMP - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then -# Solaris HPC 7.1 - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Solaris HPC 7.1 for DMP -# for Myrinet, construct a configuration file in ~/.gmpi -# this must be readable by each process -# format is (hostname) (port number) for each process - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - grep -v '^#' $host | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ -{if ( NF > 0 ) \ - for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ -}' >> ~/.gmpi/$jid.host - else -# this is for mpich-1.2.5 and later, using the -pg option -# format: host nproc executable user arguments -# the arguments are added later - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s %s\n",path,user);\ - if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ - }\ - }' > $jid.host - fi -# end Myrinet - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then -# Compaq MPI via Memory Channel - grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host -# end Compaq MPI - else -# MPICH - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ - }\ - }' > $jid.host - fi -# define the variable host and host_filt -# host_filt is used for loops over hosts -# for Myrinet we need to use a filtered variant of userhost -# for others we can use $host - if test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - host=~/.gmpi/$jid.host - host_filt=$jid.host_tMp - grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt - else - host=$jid.host - host_filt=$host - fi - else - host=$jid.host - host_filt=$host - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - host_filt=$jid.mfile - fi - fi -# figure out if the machines in the hostfile are nfs mounted -# or distributed and set the variable "dirstatus" accordingly. -# only perform the check if user subroutine is used -# or a user subroutine executable is used - - numfield=1 - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - numfield=2 - fi - DIR1=$DIRJOB - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - counter=0 - echo " " - echo "checking if local or shared directories for host" - if test "$deletelog" = no - then - echo "checking if local or shared directories for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - dirstatus[$counter]="shared" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - dirstatus[$counter]="local" - /bin/rm tmp.$$ - else - if test ! -f $jid.$$ - then - dirstatus[$counter]="local" - $RSH $i /bin/rm $DIR1/$jid.$$ - else - /bin/rm $jid.$$ - fi - fi - if test -f tmp.$$ - then - /bin/rm tmp.$$ - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - echo " ${dirstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${dirstatus[$counter]}" >> $jid.log - fi - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - fi - -# figure out if this is a compatible set of machines -# unless explicitly specified with flag -comp -# only perform the check if user subroutine is used -# or a user subroutine executable is used -# Myrinet does not support heterogeneous - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - if test $compatible = "unknown" - then - thisname=$ARCH - compatible=yes - counter=0 - echo "checking if machines are compatible for host" - if test "$deletelog" = no - then - echo "checking if machines are compatible for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]="yes" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - othername=`$RSH $i uname -a | cut -f 1 -d " "` - if test $thisname != $othername - then - compatible=no - compstatus[$counter]="no" - fi - fi - echo " ${compstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${compstatus[$counter]}" >> $jid.log - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - else - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]=$compatible - fi - done - if test $compatible = "no" - then - echo "all machines assumed incompatible" - if test "$deletelog" = no - then - echo "all machines assumed incompatible" >> $jid.log - fi - else - echo "all machines compatible" - if test "$deletelog" = no - then - echo "all machines compatible" >> $jid.log - fi - fi - fi -# error out if user objects or libraries are used on incompatible machines - if test "$compatible" = "no" -a -n "$objs" - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" - if test "$deletelog" = no - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log - fi - exit 1 - fi -# modify new host file if NFS mounted heterogeneous machine - doit= - if test $program = $prog.marc - then - doit=yes - fi - if test "$user" - then - doit=yes - fi - if test "$doit" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - $AWK -v hst=$i '{fnr++ ; \ -if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ -printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} - /bin/mv $jid.host{$$} $jid.host - host=$jid.host - fi - fi - done - fi - fi # if test $program = $prog.marc -o $user -o $obj - - else # if test $host - # assume shared memory machine if no hostfile given and - # MPITYPE is set to mpich or Myrinet - # check for Myrinet that the total number of processes is - # less than number of available user ports, 5 - if test $MPITYPE = "mpich" -o $MPITYPE = "scali" - then - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - host=$jid.host - elif test $MPITYPE = "myrinet" - then - if test $nprocd -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes " - echo "must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes " >> $jid.log - echo "must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - echo `hostname` $nprocd | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ - {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ -' >> ~/.gmpi/$jid.host - host=~/.gmpi/$jid.host - else - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - - fi - fi # if test myrinet - - fi # if test $host - - fi # if test $nprocd -gt 1 - -fi # if test $program = $exefile -o $program = $prog.marc - -############################################################################## -# construct run stream (Marc only) # -############################################################################## - -# set maximum message length for ddm to a large number -# for vendor provided mpi -if test $itree -eq 0 -a $MPITYPE = hardware -then - itree=100000000 - if test $MACHINENAME = SGI - then - itree=100000001 - fi -fi -if test $itree -eq 0 -a $MPITYPE = hpmpi -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = myrinet -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = nec -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = scali -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = intelmpi -then - itree=100000000 -fi -if test $nprocdddm -lt 2 -then - nprocdarg= -else - nprocdarg="$nprocdarg $nprocdddm" -fi -if test $nsolver -eq 0 -then - nsolverarg= -else - nsolverarg="$nsolverarg $nsolver" -fi -if test $nprocdddm -lt 2 -a $nsolver -eq 0 -then -nprocd=0 -fi -if test $nprocd -gt 0 -then - if test "$host" - then - if test -z "$RUN_JOB2" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then - RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" - RUN_JOB=" -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - numhost=`uniq $jid.mfile | wc -l` - if test "$INTELMPI_VERSION" = "HYDRA" - then - RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n $numhost -r $RSH -f $jid.mfile - RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" - fi - -# intelmpi uses configfile. format: -# -host host1 -n n1 executable marcargs -# one such line per host -# collect the marcargs in RUN_JOB and construct the config file later -# collect the run stream in RUN_JOB_TMP - RUN_JOB="-jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - - - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then - RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - if test "$userhost" - then - RUN_JOB="$RUN_JOB -mhost $userhost" - fi - if test $MPITYPE = "scali" - then -# set default working directory to /tmp to allow -# different directory names - SCAMPI_WORKING_DIRECTORY=/tmp - export SCAMPI_WORKING_DIRECTORY - fi - else - if test -z "$RUN_JOB1" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - RUNNPROCD=$nprocd - if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" - then - RUNNPROCD= - MP_PROCS=$nprocd - export MP_PROCS - fi - if test $MPITYPE = "myrinet" - then - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n 1 -f $jid.hosts - fi - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - fi -else - if test $nauto -gt 0 -o $ndcoup -gt 0 - then - RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - else -# this is for a serial job without auto restart: - RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi -fi -if test "$rid" -then - RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" -fi -if test "$pid" -then - RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" -fi -if test "$sid" -then - RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" -fi -if test "$did" -then - RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" -fi -if test "$vid" -then - RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" -fi -if test $nauto -gt 0 -then - RUN_JOB="$RUN_JOB -autorst $nauto " -fi -if test $ndcoup -gt 0 -then - RUN_JOB="$RUN_JOB -dcoup $ndcoup " -fi -if test $ndytran -gt 0 -then - RUN_JOB="$RUN_JOB -dytran $ndytran " -fi -if test $mesh -gt 0 -then - RUN_JOB="$RUN_JOB -me $mesh " -fi -if test $noutcore -gt 0 -then - RUN_JOB="$RUN_JOB -outcore $noutcore " -fi -if test "$dllrun" -gt 0 -then - RUN_JOB="$RUN_JOB -dll $dllrun " -fi -if test "$trkrun" -gt 0 -then - RUN_JOB="$RUN_JOB -trk $trkrun " -fi -if test "$iam" -then - RUN_JOB="$RUN_JOB -iam $iam " -fi -if test "$justlist" -then - RUN_JOB="$RUN_JOB -list 1 " -fi -if test "$feature" -then - RUN_JOB="$RUN_JOB -feature $feature " -fi -if test "$memlimit" -ne 0 -then - RUN_JOB="$RUN_JOB -ml $memlimit " -fi -if test "$cpinput" -then - RUN_JOB="$RUN_JOB -ci $cpinput " -fi -if test "$cpresults" -then - RUN_JOB="$RUN_JOB -cr $cpresults " -fi -if test "$DIRSCR" != "$DIRJOB" -then - RUN_JOB="$RUN_JOB -dirscr $DIRSCR" -else - DIRSCR=$DIRJOB -fi -if test "$makebdf" -then - RUN_JOB="$RUN_JOB -bdf $makebdf " -fi -if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" -then - # append $RUN_JOB to all lines of the host file - # and set RUN_JOB - $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ - /bin/mv $host.$$ $host - RUN_JOB=$RUN_JOB_TMP -fi -if test $MPITYPE = "intelmpi" -a "$host" -then - # construct config file, append $RUN_JOB to all lines of the config file - # and set RUN_JOB - if test "$INTELMPI_VERSION" = "HYDRA" - then - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - else - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-host %s -n %s",$1,$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - fi - RUN_JOB=$RUN_JOB_TMP -fi -echo " " -echo "Final run stream value" -echo " RUNJOB="$RUN_JOB -if test "$deletelog" = no -then -echo " " >> $jid.log -echo "Final run stream value" >> $jid.log -echo " RUNJOB="$RUN_JOB >> $jid.log -fi - - -############################################################################## -# run marc using valgrind # -############################################################################## -#RUN_JOB="valgrind $RUN_JOB" -#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" -############################################################################## - - -############################################################################## -# run the requested program in a queue # -############################################################################## - -if test "$deletelog" = yes -then - echo - date -else - echo >> $jid.log - date >> $jid.log -fi -if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] -then - -/bin/rm -f $jid.runmarcscript - - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - userobj=$usernoext.o - fi - cat > $jid.runmarcscript << END4 - if test "$user" - then - if test $MACHINENAME = "CRAY" - then - $DFORTHIGH $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTHIGH $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $MARCCUDALIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } -END4 -else - prgsav=yes -fi -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# - -cat >> $jid.runmarcscript << END5 - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -# first remove all .out files and incremental restart files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null - /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null -fi - -if test $nprocdddm -gt 1 -then - $RUN_JOB 2>>$jid.log -else - $RUN_JOB 2>>$jid.log -fi - -if test $dllrun -eq 0; then - if test $prgsav = no - then - /bin/rm -f $bd$program 2>/dev/null - fi -else - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes - then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -END5 - - -# Submit to marc batch queue -# -if [ $qid = at ] -then -QUENAME=at -SUBMCMD= -else -# -# Submit to qsub queue -# -QUENAME=qsub -SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" -if test "$priority" -then - SUBMCMD=$SUBMCMD" -p $priority" -fi -if test "$att" -then - SUBMCMD=$SUBMCMD" -a $att" -fi -if test "$cpu" -then - SUBMCMD=$SUBMCMD" -lt $cpu" -fi - -fi -echo $QUENAME $SUBMCMD -#cat $jid.runmarcscript -$QUENAME $SUBMCMD < $jid.runmarcscript - -/bin/rm -f $jid.runmarcscript - -############################################################################## -# run the requested program in the background # -############################################################################## - -else -if test $qid = background -then - -# -# first remove all old .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi -# -# compile user subroutine if present -# -( -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_h $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - echo " $PRODUCT Exit number 3" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTHIGH $user || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTHIGH $user -o $userobj || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - echo " $PRODUCT Exit number 3" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc - -# - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -$RUN_JOB & - -marcpid=$! -echo $marcpid > $DIRJOB/$jid.pid -wait $marcpid - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - if test "$host" - then - /bin/rm $jid.mfile 2> /dev/null - /bin/rm $jid.hosts 2> /dev/null - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.cfile 2> /dev/null - fi - fi - fi -fi - - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -) 1>>$jid.log 2>&1 & - - -############################################################################## -# run the requested program in the foreground # -############################################################################## - -else - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_h $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTHIGH $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTHIGH $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi -# first remove all .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi - -$RUN_JOB - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - if test "$host" - then - /bin/rm $jid.mfile 2> /dev/null - /bin/rm $jid.hosts 2> /dev/null - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.cfile 2> /dev/null - else - echo " " > /dev/null - fi - else - if test "$host" - then - mpdcleanup -a -f $jid.mfile - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.mfile 2> /dev/null - else - mpdcleanup -a -f $jid.hosts - /bin/rm $jid.hosts 2> /dev/null - fi - fi - fi -fi - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi - - -fi -fi diff --git a/installation/mods_MarcMentat/2013/Marc_tools/run_damask_hmp b/installation/mods_MarcMentat/2013/Marc_tools/run_damask_hmp deleted file mode 100644 index c59e40760..000000000 --- a/installation/mods_MarcMentat/2013/Marc_tools/run_damask_hmp +++ /dev/null @@ -1,3849 +0,0 @@ -#!/bin/ksh -############################################################################## -# # -# run_marc - run a marc job # -# ------------------------- # -# # -# usage: run_marc -j jid { options } # -# # -# where standard options are: required: defaults: # -# -------------------------- # -# # -# -j* jid job id number. ** YES ** . # -# -pr* prog program name. . marc # -# -v* y|n do or do not verify inputs. . yes # -# -q* s|l|v|b|f batch queue name or background, . short # -# foreground. # -# -b* as alternative to option -q* # -# # -# ( batch queues only : # -# -pq* intra queue priority. . . # -# -at DATE/TIME delay start of job. . . # -# format : January,1,1990,12:31 # -# or : today,5pm # -# -cpu* secs job CPU limit . . ) # -# # -# -r* rid restart file job id. . . # -# -si* sid substructure file id. . . # -# -pi* post post file job id. . . # -# -de* did defaults file . no # -# -vf vid viewfactor . no # -# # -# -u* user user subroutine. . . # -# -obj obj user objects or libraries. . . # -# -sa* y|n do or do not save load module. . no # -# -autorst auto restart flag for auto forge . no # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo selects i4 or i8 version # -# default: i4 or via defaults file run_marc_defaults # -# the -mo option will override # -# -mpi selects MPI version # -# each platform has a default MPI version and some # -# have an alternative version. see the include file # -# for the respective platform # -# MPI_DEFAULT defines the default MPI version # -# MPI_OTHER defines versions one can switch to # -# -dcoup for contact decoupling # -# currently not supported # -# -dir directory where the job i/o should take place. # -# defaults to current directory. # -# -sdir directory where scratch files are created # -# defaults to current directory. # -# # -# -alloc only perform memory allocation test, no analysis # -# -list y only list options in the input file, no analysis # -# -fe num set feature number "num" for the run. only one allowed # -# -dytran flag to switch from Dytran to Marc # -# dytran = 0, program will run w/o Marc-Dytran Switch # -# = 1, program will restart Marc after Dytran run # -# >= 2, Not supported yet. # -# currently not supported # -# -ou force analysis to use out-of-core control # -# =0, not used # -# =1, element storage out-of-core # -# -dll run marc using shared library libmarc.so and exe_marc # -# =1, used # -# =2, do not free streaming input memory # -# =3, run with marc input deck # -# -trk run marc for post-tracking # -# -gpuid run marc using GPGPU capability # -# specify gpuid on to be used in the analysis. Multiple # -# IDs may be assigned for DDM runs. # -# Separate a list of IDs with a colon. Each DMP # -# process will be assigned a GPU ID in round robin fastion# -# = 0 # -# = 0:1 etc... # -# # -# where parallel options are: # -# -------------------------- # -# # -# itree, host, and comp options are available for the domain # -# decomposition only. # -# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # -# # -# # -# -nprocd number of domains. # -# defaults to single domain solution. # -# -nprocds number of domains if single input file. # -# defaults to single domain solution. # -# -nps same as -nprocds. # -# -nsolver number of solver tasks for solver types 12 and 13 # -# these are distributed tasks operating via MPI # -# -nthread number of solver threads for solver types 6, 8, and 11 # -# also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. if both specified, nthread option# -# will be used. # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by 6, 8, and 11 # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor nthread specified. # -# -itree message passing tree type for domain decomposition. # -# for debugging purposes; should not normally be used. # -# -host hostfile name for distributed execution on network. # -# defaults to no hostfile, unless jobid.defhost exists. # -# if jobid.defhost exists, only -np(s) necessary # -# -comp* y|n to be used with user routines on a network of # -# incompatible machines. # -# if set to no, a separate executable will be created # -# for each machine on the network. # -# if set to yes, the executable located on the machine # -# from which marc is started will be used on all machines.# -# defaults to no if O/S versions different on machines. # -# # -# -ci y|n copy input files to remote hosts (default: yes) # -# if "yes", input files are automatically copied to # -# remote hosts for a network run if necessary. # -# -cr y|n copy post files from remote hosts (default: yes) # -# if "yes", post files are automatically copied back from # -# remote hosts for a network run if necessary. # -############################################################################## -# set DIR to the directory in which this script is -REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" -DIR=`dirname $REALCOM` -# make sure DIR has an absolute path -case $DIR in - \/*) - ;; - *) - DIR=`pwd`/$DIR - ;; -esac -DIRSCRIPT=$DIR -AWK=awk -ARCH=`uname -a | cut -f 1 -d " "` -# Sun has a bad awk, use nawk instead -if test $ARCH = "SunOS" -then - AWK=nawk -fi -BASENAME=basename -# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists -if test $ARCH = "SunOS" -then - if test -x /usr/ucb/basename - then - BASENAME=/usr/ucb/basename - fi -fi - -# echo command line in the case of ECHO_COMMAND is true -if test "$ECHO_COMMAND" = true ; then - echo command "$0" "$@" -fi - -# -# "mode" selects version, i4 or i8 -# default is i4 -# this can be changed by a file run_marc_defaults -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MODE i8 -# it can also be set by the environmental variable MARC_INTEGER_SIZE -# and by the command line option "-mo" -# -mode= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -f $HOME/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -n "$MARC_INTEGER_SIZE" ; then - mode=$MARC_INTEGER_SIZE -fi -if test -z "$mode" ; then - mode=i4 -fi -case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "error, version mode must be i4 or i8" - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i4 or i8" - echo " " - echo " use -mo i4 or -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - setmode=true - fi - if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - fi - if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -done - -# set to i4 version for 32 bit Linux -if test "`uname -s`" = "Linux"; then - if test "`uname -m`" = "i686"; then - mode=i4 - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -fi - - -. "$DIR/getarch" - -# Change_me -. $MARC_INCLUDE -# - -# -# Dynamically determine the echo syntax -# - -case "`echo '\c'`" in - '\c') - ECHO='echo -n' - ECHOTXT=' ' - ;; - *) - ECHO='echo' - ECHOTXT=' \c' - ;; -esac - -# -# Variables for the MARC environment -# - -PRODUCT="Marc" -EXITMSG=$MARC_TOOLS/MESSAGES -export EXITMSG -FLEXDIR=$DIR/../flexlm/licenses -export FLEXDIR -TIMCHK=3600 -export TIMCHK -BINDIR=$MARC_BIN -export BINDIR -AFMATDAT=$MARC_RUNTIME/AF_flowmat/ -export AFMATDAT -# -# define directory path to global unified material database -# -MATFILE= -export MATFILE - -# -# define memory limit -# first set to MEMLIMIT from include -# -ml option overrules if specified -memlimit=$MEMLIMIT -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -# -if test $MACHINENAME = "HP" -then - SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH - export SHLIB_PATH -fi -# the one for IBM is defined futher down - -LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH -LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH -export LD_LIBRARY_PATH -export LD_LIBRARY64_PATH -export LD_LIBRARYN32_PATH - -atexit() { -kill -15 $$ -# -if test $MPITYPE = "myrinet" -then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi -fi -} - -trap "atexit" 2 - -# -# defaults -# - -prog=marc -exefile=marc -jid= -rid= -pid= -sid= -did= -vid= -user= -usersnoext= -objs= -qid=background -cpu= -priority= -att= -trk= -verify=yes -prgsav=no -rmdll=no -cpdll=no -progdll= -pathdll= -error= -nprocd=0 -nprocdddm=1 -nprocdddmprint= -icreated=0 -nprocdarg= -nsolver=0 -nsolverarg=-ns -if test $nprocds -then - if test $nprocds -gt 1 - then - nprocdddm=$nprocds - nprocdddmprint=$nprocds - icreated=1 - nprocdarg=-nprocds - fi -fi -nthread=-1 -gpuids= -nauto=0 -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -nthreadprint=0 -itree=0 -iam= -link= -trkrun=0 -DIRJOB=`pwd` -DIRSCR=$DIRJOB -DIRSCRSET= -autoforge=0 -dotdat=.dat -dotdefhost=.defhost -host= -numhost= -mfile= -userhost= -makebdf= -cpinput=yes -cpresults=yes -marcdll=libmarc.$EXT_DLL -# define hostname and strip off extensions (alpha.aaa.com) -thishost=`hostname` -thishost=${thishost%%.*} -compatible=unknown -numfield=1 -justlist= -feature= -mpioption=false -MDSRCLIB=$MARC_LIB/mdsrc.a -# -# check run_marc_defaults file for default MPI setting -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MPI -# -value= -file= -if test -f $DIRSCRIPT/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$DIRSCRIPT/run_marc_defaults - fi -fi -if test -f $HOME/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$HOME/run_marc_defaults - fi -fi -if test -n "$value"; then - MARC_MPITYPE=$value - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - echo " " - echo " error, incorrect option for MARC_MPI" - echo " defined in $file: $MARC_MPITYPE" - echo " valid options: $MPI_DEFAULT $MPI_OTHER" - echo " " - exit - fi - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - fi -fi -# -# -# allow scratch directory to be specified with environmental variable -# MARCSCRATCH -if test $MARCSCRATCH -then - if test -d $MARCSCRATCH - then - DIRSCR=$MARCSCRATCH - else - echo "error, scratch directory '$MARCSCRATCH'" - echo " specified via environmental variable MARCSCRATCH does not exist" - exit - fi -fi -# -############################################################################## -# parse input - arguments always come in pairs # -############################################################################## - -arg=$1 -if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - shift - arg=$1 -fi -while [ -n "$arg" ] -do - shift - value=$1 - case $arg in - -al* | -AL*) - LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - $MARC_BIN/marc -alloc 1 - exit - ;; - -li* | -LI*) - justlist=yes - ;; - -fe* | -FE*) - feature=$value - ;; - -pr* | -PR*) - if test `dirname $value` = '.' - then - prog=`$BASENAME $value .marc` - progdll=`$BASENAME $value` - else - prog=`dirname $value`/`$BASENAME $value .marc` - progdll=`dirname $value`/`$BASENAME $value` - fi - prdir=`dirname $value` - case $prdir in - \/*) - ;; - *) - prog=`pwd`/$prdir/$prog - ;; - esac - ;; - -j* | -J*) - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - ;; - -r* | -R*) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - -si* | -SI*) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - -pi* | -PI*) - if test -f $value.t19 - then - pid=`$BASENAME $value .t19` - else - pid=`$BASENAME $value .t16` - fi - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - -bdf | -BDF) - makebdf=1 - ;; - -de* | -DE*) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - -vf | -VF) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - -u* | -U*) - - user=$value - - - - - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - -obj | -OBJ) - objs="$value" - ;; - -q* | -Q*) - qid=$value - ;; - -b* | -B*) - case $value in - y* | Y*) - qid=background - ;; - n* | N*) - qid=foreground - ;; - *) - ;; - esac - ;; - -at | -AT) - att=$value - ;; - -cpu* | -CPU*) - cpu=$value - ;; - -pq | -PQ*) - priority=$value - ;; - -v* | -V*) - verify=$value - ;; - -sa* | -SA*) - prgsav=$value - ;; - -np* | -NP*) - nprocdddm=$value - nprocdddmprint=$value - case $arg in - -nps* | -NPS* | -nprocds* | -NPROCDS*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - case $arg in - -np | -NP | -nprocd | -NPROCD) - icreated=0 - nprocdarg=-nprocd - ;; - esac - ;; - -ns* | -NS*) - nsolver=$value - ;; - -nt* | -NT*) - nthread=$value - ;; - -gp* | -GP*) - gpuids=$value - ;; - -it* | -IT*) - itree=$value - ;; - -iam | -IAM) - iam=$value - ;; - -au* | -AU*) - nauto=$value - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -me | -ME ) - mesh=$value - ;; - -ml | -ML ) - memlimit=$value - ;; - -mo | -MO ) - ;; - -mpi | -MPI ) - mpioption=true - MARC_MPITYPE=$value - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - fi - fi - ;; - -dir* | -DIR*) - DIRJOB=$value - case $DIRJOB in - \/*) - ;; - *) - DIRJOB=`pwd`/$DIRJOB - ;; - esac - if test -z "$DIRSCRSET" - then - DIRSCR=$DIRJOB - fi - ;; - -sd* | -SD*) - DIRSCR=$value - DIRSCRSET=yes - case $DIRSCR in - \/*) - ;; - *) - DIRSCR=`pwd`/$DIRSCR - ;; - esac - ;; - -ho* | -HO*) - host=$value - ;; - -co* | -CO*) - compatible=$value - ;; - -ci* | -CI*) - cpinput=$value - ;; - -cr* | -CR*) - cpresults=$value - ;; - *) - error="$error -$arg: invalid option" - break - ;; - esac - case $value in - -*) - error="$error -$arg: invalid name $value" - break - ;; - esac - shift - arg=$1 - if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - shift - arg=$1 - fi -done -argc=`expr $# % 2` -if test $argc -eq 1 -then -# -# odd number of arguments -# - error="$error -argument list incomplete" -fi - -if test $nprocdddm -gt 0 -then -nprocd=$nprocdddm -fi - -if test $nsolver -gt 0 -then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi -fi - -if test $nthread -eq -1 -then -nthread=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nthread -lt 0 -then -nthread=0 -fi - -nthreadprint=$nthread -if test $nthreadprint -eq 0 -then -nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi -fi - -nthread=$nthreadprint - -gpuoption= -if test "$gpuids" = "" ; then - gpuoption= -else - gpuoption="-gp $gpuids" -fi - -if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH -else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH -fi -# Linux 64 + HPMPI, Below code is taken from include_linux64 -if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" -then -export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" -fi - -if test $nprocd -gt 1; then - if test -f $jid$dotdefhost; then - if test "$host" = ""; then - host=$jid$dotdefhost - fi - fi - if test -f hostfile_qa_$nprocd; then - if test "$host" = ""; then - host=hostfile_qa_$nprocd - fi - fi -fi - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then - dotdat=.inp - fi - - if test "$progdll"; then - /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll - rmdll=yes - pathdll=yes - progdll=${progdll}_$marcdll - else - progdll=$marcdll - fi - - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - pathdll=yes - fi -fi - -############################################################################## -# check parameter validity # -############################################################################## - -while test forever; do - -# -# check for input file existence -# -if test $nprocdddm -gt 1 -a $icreated -eq 0; then - if test ! -f $DIRJID/1$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/1$jid$dotdat not accessible" - fi - fi -else - if test ! -f $DIRJID/$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/$jid$dotdat not accessible" - fi - fi -fi - if test $nprocd -gt 1; then - if test "$host" ; then - if test ! -f $host; then - error="$error -host name file $host not accessible" - fi - fi - fi - -# -# check if the job is already running in the background -# -if test -f $DIRJOB/$jid.pid; then - error="$error -job is already running (the file $jid.pid exists)" -fi - -# -# if the program name is other than marc, then -# assume that this is a program in the users local directory -# - -bd=$MARC_BIN/ - -case $prog in - marc | MARC | $exefile) - program=$exefile - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - if test ! -f $user - then - error="$error -user subroutine file $user not accessible" - fi - fi - if test "$objs" - then - missingobjs= - for o in $objs - do - if test ! -f "$o" - then - if test -z "$missingobjs" - then - missingobjs="$o" - else - missingobjs="$missingobjs $o" - fi - fi - done - if test -n "$missingobjs" - then - error="$error -user object/library file(s) $missingobjs not accessible" - fi - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$vid" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRVID/1$vid.vfs - then - error="$error -view factor file $DIRVID/1$vid.vfs not accessible" - fi - else - if test ! -f $DIRVID/$vid.vfs - then - error="$error -view factor file $DIRVID/$vid.vfs not accessible" - fi - fi - fi - if $mpioption - then - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" - fi - fi - ;; - *) - program=$prog.marc - case $prog in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - error="$error -program option may not be used with user subroutine" - fi - if test "$objs" - then - error="$error -program option may not be used with user objects or libraries" - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$nauto" - then - if test $nauto -gt 2 - then - error="$error -incorrect option for auto restart " - fi - fi - if test "$ndcoup" - then - if test $ndcoup -gt 3 - then - error="$error -incorrect option for contact decoupling " - fi - fi - if test "$ndytran" - then - if test $ndytran -gt 1 - then - error="$error -incorrect option for Marc-Dytran Switch " - fi - fi - if $mpioption - then - if test ! -x $MARC_BIN/$exefile - then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE " - fi - fi - ;; -esac - -############################################################################## -# check argument integrity # -############################################################################## - -if test "$jid" -then - : -else - error="$error -job id required" -fi - -if test $nprocd -gt 1 -then - if test $nauto -gt 0 - then - error="$error -cannot run DDM job with auto restart (-au) option " - fi -fi -case $qid in - S* | s*) - qid=short - ;; - L* | l*) - qid=long - ;; - V* | v*) - qid=verylong - ;; - B* | b*) - qid=background - ;; - F* | f*) - qid=foreground - ;; - A* | a*) - qid=at - ;; - *) - error="$error -bad value for queue_id option" - ;; -esac - -case $prgsav in - N* | n*) - prgsav=no - ;; - Y* | y*) - prgsav=yes - ;; - *) - error="$error -bad value for save option" - ;; -esac - -case $verify in - N* | n*) - verify=no - ;; - Y* | y*) - verify=yes - ;; - *) - error="$error -bad value for verify option" - ;; -esac - -case $nprocdddm in - -* ) - error="$error -bad value for nprocd option" - ;; -esac - -case $nthread in - -* ) - error="$error -bad value for nthread option" - ;; -esac - -case $itree in - -* ) - error="$error -bad value for itree option" - ;; -esac -case $iam in - -* ) - error="$error -bad value for iam option" - ;; -esac -case $compatible in - N* | n*) - compatible=no - ;; - Y* | y*) - compatible=yes - ;; - unknown) - ;; - *) - error="$error -bad value for comp option" - ;; -esac -case $cpinput in - N* | n*) - cpinput=no - ;; - Y* | y*) - cpinput=yes - ;; - *) - error="$error -bad value for copy input option" - ;; -esac -case $cpresults in - N* | n*) - cpresults=no - ;; - Y* | y*) - cpresults=yes - ;; - *) - error="$error -bad value for copy results option" - ;; -esac - -# -# check for external file to run -# -if test -f $MARC_TOOLS/run_marc_check -then - . $MARC_TOOLS/run_marc_check -fi - -# -# pick up version data from bin/VERSION if it exists -# -if test -f $MARC_BIN/VERSION; then - ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` - if test -n "$ppp" ;then - PRODUCT=$ppp - fi - ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` - if test -n "$ppp" ;then - REVISION=", Build $ppp" - fi -fi -############################################################################## -# interact with the user to get the required information to run marc or # -# other marc system program # -############################################################################## - -deletelog=yes -if test $qid = background -a $verify = no -then -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto " > $jid.log -deletelog=no -fi -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto" - - -case $qid in - s* | S* | l* | L* | v* | V* ) - echo \ -"Queue priority : $priority -Queue CPU limit : $cpu -Queue start time : $att" - ;; -# * ) -# echo \ -#" " -# ;; -esac - -if test "$error" -then - if test $verify = yes - then - $ECHO "$error - -Please correct or quit(correct,quit,): $ECHOTXT" - error= - read answer - case $answer in - q* | Q*) - answer=quit - ;; - *) - answer=correct - ;; - esac - else - $ECHO "$error - $ECHOTXT" - echo " " - if test "$deletelog" = no - then - $ECHO "$error - $ECHOTXT" >> $jid.log - echo " " >> $jid.log - fi - answer=quit - fi -else - if test $verify = yes - then - $ECHO " -Are these parameters correct (yes,no,quit,)? $ECHOTXT" - read answer - case $answer in - q* | Q*) - answer=quit - ;; - y* | Y*) - answer=yes - ;; - *) - answer=no - ;; - esac - else - answer=yes - fi -fi - -case $answer in - no | correct) - -############################################################################## -# prompt for each value # -############################################################################## - - $ECHO " -Program name ($prog)? $ECHOTXT" - read value - if test "$value" - then - prog=$value - fi - $ECHO "Job ID ($jid)? $ECHOTXT" - read value - if test "$value" - then - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - fi - $ECHO "User subroutine name ($user)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - user= - ;; - *) - user=$value - - - - - - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - esac - fi - $ECHO "User objects or libraries ($objs)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - objs= - ;; - *) - objs="$value" - ;; - esac - fi - $ECHO "Restart File Job ID ($rid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - rid= - ;; - *) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - esac - fi - $ECHO "Substructure File ID ($sid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - sid= - ;; - *) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - esac - fi - $ECHO "Post File Job ID ($pid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - pid= - ;; - *) - pid=$value - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - esac - fi - $ECHO "Defaults File ID ($did)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - did= - ;; - *) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - esac - fi - $ECHO "View Factor File ID ($vid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - vid= - ;; - *) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - esac - fi - $ECHO "Save generated module ($prgsav)? $ECHOTXT" - read value - if test "$value" - then - prgsav=$value - fi - $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" - read value - if test "$value" - then - nprocdddm=$value - nprocdddmprint=$value - fi - $ECHO "Run on ($nthread) threads ? $ECHOTXT" - read value - if test "$value" - then - nthread=$value - fi - $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" - read value - if test "$value" - then - nsolver=$value - fi -# - if test $nprocdddm -gt 0 - then - nprocd=$nprocdddm - fi - if test $nsolver -gt 0 - then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi - fi - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - nthreadprint=$nthread - if test $nthreadprint -eq 0 - then - nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi - fi -# - $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" - read value - if test "$value" - then - gpuids=$value - fi - if test "$gpuids" = "" ; then - gpuoption= - else - gpuoption="-gp $gpuids" - fi - if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH - fi - if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - fi -# - if test $nprocd -gt 1 - then - $ECHO "Message passing type ($itree)? $ECHOTXT" - read value - if test "$value" - then - itree=$value - fi - $ECHO "Host file name ($host)? $ECHOTXT" - read value - if test "$value" - then - host=$value - fi - if test $nprocdddm -gt 1 - then - $ECHO "Single input file? $ECHOTXT" - read value - case $value in - y* | Y*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" - read value - if test "$value" - then - compatible=$value - fi - $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" - read value - if test "$value" - then - cpinput=$value - fi - $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" - read value - if test "$value" - then - cpresults=$value - fi - fi - fi - $ECHO "Run the job in the queue ($qid)? $ECHOTXT" - read value - if test "$value" - then - qid=$value - fi - case $qid in - s* | S* | l* | L* | v* | V* ) - $ECHO "Queue priority ($priority)? $ECHOTXT" - read value - if test "$value" - then - priority=$value - fi - $ECHO "Job starts at ($att)? $ECHOTXT" - read value - if test "$value" - then - att=$value - fi - $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" - read value - if test "$value" - then - cpu=$value - fi - ;; - * ) - ;; - esac - $ECHO "Auto Restart option ($nauto)? $ECHOTXT" - read value - if test "$value" - then - nauto=$value - fi - $ECHO "Run directory ($DIRJOB)? $ECHOTXT" - read value - if test "$value" - then - DIRJOB=$value - DIRSCR=$DIRJOB - fi - $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" - read value - if test "$value" - then - DIRSCR=$value - fi - ;; - quit) - exit 1 - ;; - *) - break - ;; - -esac - - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - -done - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - pathdll=yes - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - fi - - if test "$pathdll"; then -# -# reset share lib path -# - if test $MACHINENAME = "HP" - then - SHLIB_PATH=$DIRJOB:$SHLIB_PATH - export SHLIB_PATH - fi - if test $MACHINENAME = "IBM" - then - LIBPATH=$DIRJOB:$LIBPATH - export LIBPATH - fi -# - LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH - LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH - LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH - export LD_LIBRARY_PATH - export LD_LIBRARY64_PATH - export LD_LIBRARYN32_PATH - fi -fi -# end of dllrun>0 - - -if test $program = $exefile -o $program = $prog.marc -then - -# delete the old .log file unless we run in the background -if test "$deletelog" = yes -then - /bin/rm $jid.log 2>/dev/null -else - echo - echo running the job in the background, see $jid.log - echo -fi - -# -# check if this is an autoforge or rezoning or radiation job -# -if test $nprocd -eq 1 -then - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` - if test "$line" - then - autoforge=1 - fi -fi -# -# check that jobname for restarted run is not the same -# as restart file basename -# -if test "$rid" -then - if test "$jid" = "$rid" - then - echo " " - echo "ERROR: job name of current run is the same as job name" - echo " of the restarted job" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "ERROR: job name of current run is the same as job name" >> $jid.log - echo " of the restarted job" >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi -fi - -# -# user objects/libraries used -# - - if test "$objs" - then - program="$DIRJOB/$jid.marc" - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# user subroutine used -# -# add DAMASK options for linking - DAMASK="" - - if test "$user" - then - program=$usernoext.marc - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# Special case for IBM using POE but not an SP machine -# in this case we always need a host file, also for serial jobs. -# -if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP -then - MP_HOSTFILE=${jid}.host - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $nprocd -gt 1 - then - numdom=$nprocd - while test $numdom -gt 0 - do - hostname -s >> $MP_HOSTFILE - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - else - hostname -s > $MP_HOSTFILE - fi -fi -# -# check ssh for all hosts in host file -# -if test $nprocd -gt 1 -then -if test $MPITYPE = "intelmpi" -a "$INTELMPI_VERSION" = "HYDRA" - then -# get host list - if test "$host" - then - line=`grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' | uniq` -# count failing hosts - counter=0 - for i in $line - do - $RSH -o BatchMode=yes -o ConnectTimeout=10 $i uname -n - status=$? - if [[ $status != 0 ]] ; then - counter=$((counter+1)) - if [ "$counter" = "1" ]; then - echo " " - echo " error - connection test failed... " - echo " " - fi - echo " " - echo " connection test with ssh failed on host $i" - echo " check the following command: ssh $i uname -n " - echo " " - fi - done -# echo error message and quit - if test $counter -ne 0 - then - echo " " - echo " A parallel job using IntelMPI cannot be started. " - echo " The ssh command must be working correctly between " - echo " the computers used in the analysis. Furthermore, " - echo " it must be set up such that it does not prompt the " - echo " user for a password. Note that this is the case " - echo " also for running on a single machine. " - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo " A parallel job using IntelMPI cannot be started. ">> $jid.log - echo " The ssh command must be working correctly between ">> $jid.log - echo " the computers used in the analysis. Furthermore, ">> $jid.log - echo " it must be set up such that it does not prompt the ">> $jid.log - echo " user for a password. Note that this is the case ">> $jid.log - echo " also for running on a single machine. ">> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - else - counter=1 -# test ssh `hostname` - if test $counter -ne 0 - then - line=`hostname` - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi -# test ssh `hostname` - if test $counter -ne 0 - then - line=`hostname -s` - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi -# test ssh localhost - if test $counter -ne 0 - then - line=localhost - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi - if test $counter -ne 0 - then - echo " error - connection test failed... " - echo " " - echo " ssh needs to work on the machine without asking for a password." - echo " check the following command: ssh localhost uname -n" - echo " " - echo " A parallel job using IntelMPI cannot be started. " - echo " The ssh command must be working correctly between " - echo " the computers used in the analysis. Furthermore, " - echo " it must be set up such that it does not prompt the " - echo " user for a password. Note that this is the case " - echo " also for running on a single machine. " - echo " " - if test "$deletelog" = no - then - echo " error - connection test failed... " >> $jid.log - echo " " >> $jid.log - echo " ssh needs to work on the machine without asking for a password." >> $jid.log - echo " check the following command: ssh localhost uname -n" >> $jid.log - echo " " >> $jid.log - echo " A parallel job using IntelMPI cannot be started. " >> $jid.log - echo " The ssh command must be working correctly between " >> $jid.log - echo " the computers used in the analysis. Furthermore, " >> $jid.log - echo " it must be set up such that it does not prompt the " >> $jid.log - echo " user for a password. Note that this is the case " >> $jid.log - echo " also for running on a single machine. " >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - echo $line $nprocd > $jid.hosts - host=$jid.hosts - fi - fi -fi -fi -# -# check correctness of host file; fix for user sub -# - if test $nprocd -gt 1 - then - -# construct the path name to the executable (execpath) - execpath=$MARC_BIN/$exefile - usersub=0 - if test $program = $prog.marc - then - execpath=$prog.marc - usersub=1 - fi - if test "$objs" - then - execpath="$DIRJOB/$jid.marc" - usersub=1 - fi - if test "$user" - then - execpath=$usernoext.marc - usersub=1 - fi - export execpath - execname=`$BASENAME $execpath` - - if test "$host" - then - userhost=$host - case $userhost in - \/* | \.\/*) - ;; - *) - userhost=`pwd`/$userhost - ;; - esac - -# check that the number of processes specified in the hostfile is -# equal to nprocd specified by -nprocd. - numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` - if test $nprocd -ne $numproc - then - echo " " - echo "error, the number of processes specified in the host file" - echo "must be equal to the number of processes given by -nprocd/-nsolver" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, the number of processes specified in the host file" >> $jid.log - echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - -# check for Myrinet that the number of processes per host is -# less than number of available user ports, 5 -# .gmpi directory must exist in user's home directory -# and must have write permission from remote hosts - if test $MPITYPE = "myrinet" - then - numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` - if test $numproc -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes specified " - echo "in the hostfile must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes specified " >> $jid.log - echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - if test ! -d ~/.gmpi - then - echo " " - echo "error, for Myrinet a .gmpi directory must exist " - echo "under the user's home directory" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log - echo "under the user's home directory" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - homedir=`echo ~` - for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - echo " " - echo "error, for Myrinet a shared .gmpi directory must exist " - echo "under the user's home directory " - echo "with remote write permission" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log - echo "under the user's home directory " >> $jid.log - echo "with remote write permission" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - /bin/rm tmp.$$ - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - fi - fi - done - fi - fi - -# construct the host file $jid.host which is used by mpirun -# skip lines starting with # and only consider lines with more than -# one word in them. Note that the hostfile given to this script -# has two columns: the host name and the number of shared processes -# to run on this host. mpirun wants the number of _other_ -# processes to run in addition to the one being run on the machine -# on which the job is started. hence the $2-1 for fnr == 1. - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then -# HPMPI or HP hardware MPI - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ - -v mpihpspecial="$MPIHPSPECIAL" \ -'{if ( NF > 0) {\ - fnr++ ; \ - printf("-h %s -np %s",$1,$2); \ - printf(" %s",mpihpspecial); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ - if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ - }\ - }' > $jid.host -# end HPMPI or HP hardware MPI - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then -# IBM using hardware MPI (POE) - MP_HOSTFILE=$jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host -# end IBM using hardware MPI (POE) -# for Intel MPI, need to create a machinefile for DMP - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then -# Intel MPI - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - /bin/cp $host $jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Intel MPI for DMP -# for Solaris HPC 7.1, need to create a machinefile for DMP - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then -# Solaris HPC 7.1 - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Solaris HPC 7.1 for DMP -# for Myrinet, construct a configuration file in ~/.gmpi -# this must be readable by each process -# format is (hostname) (port number) for each process - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - grep -v '^#' $host | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ -{if ( NF > 0 ) \ - for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ -}' >> ~/.gmpi/$jid.host - else -# this is for mpich-1.2.5 and later, using the -pg option -# format: host nproc executable user arguments -# the arguments are added later - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s %s\n",path,user);\ - if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ - }\ - }' > $jid.host - fi -# end Myrinet - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then -# Compaq MPI via Memory Channel - grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host -# end Compaq MPI - else -# MPICH - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ - }\ - }' > $jid.host - fi -# define the variable host and host_filt -# host_filt is used for loops over hosts -# for Myrinet we need to use a filtered variant of userhost -# for others we can use $host - if test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - host=~/.gmpi/$jid.host - host_filt=$jid.host_tMp - grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt - else - host=$jid.host - host_filt=$host - fi - else - host=$jid.host - host_filt=$host - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - host_filt=$jid.mfile - fi - fi -# figure out if the machines in the hostfile are nfs mounted -# or distributed and set the variable "dirstatus" accordingly. -# only perform the check if user subroutine is used -# or a user subroutine executable is used - - numfield=1 - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - numfield=2 - fi - DIR1=$DIRJOB - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - counter=0 - echo " " - echo "checking if local or shared directories for host" - if test "$deletelog" = no - then - echo "checking if local or shared directories for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - dirstatus[$counter]="shared" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - dirstatus[$counter]="local" - /bin/rm tmp.$$ - else - if test ! -f $jid.$$ - then - dirstatus[$counter]="local" - $RSH $i /bin/rm $DIR1/$jid.$$ - else - /bin/rm $jid.$$ - fi - fi - if test -f tmp.$$ - then - /bin/rm tmp.$$ - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - echo " ${dirstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${dirstatus[$counter]}" >> $jid.log - fi - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - fi - -# figure out if this is a compatible set of machines -# unless explicitly specified with flag -comp -# only perform the check if user subroutine is used -# or a user subroutine executable is used -# Myrinet does not support heterogeneous - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - if test $compatible = "unknown" - then - thisname=$ARCH - compatible=yes - counter=0 - echo "checking if machines are compatible for host" - if test "$deletelog" = no - then - echo "checking if machines are compatible for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]="yes" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - othername=`$RSH $i uname -a | cut -f 1 -d " "` - if test $thisname != $othername - then - compatible=no - compstatus[$counter]="no" - fi - fi - echo " ${compstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${compstatus[$counter]}" >> $jid.log - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - else - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]=$compatible - fi - done - if test $compatible = "no" - then - echo "all machines assumed incompatible" - if test "$deletelog" = no - then - echo "all machines assumed incompatible" >> $jid.log - fi - else - echo "all machines compatible" - if test "$deletelog" = no - then - echo "all machines compatible" >> $jid.log - fi - fi - fi -# error out if user objects or libraries are used on incompatible machines - if test "$compatible" = "no" -a -n "$objs" - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" - if test "$deletelog" = no - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log - fi - exit 1 - fi -# modify new host file if NFS mounted heterogeneous machine - doit= - if test $program = $prog.marc - then - doit=yes - fi - if test "$user" - then - doit=yes - fi - if test "$doit" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - $AWK -v hst=$i '{fnr++ ; \ -if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ -printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} - /bin/mv $jid.host{$$} $jid.host - host=$jid.host - fi - fi - done - fi - fi # if test $program = $prog.marc -o $user -o $obj - - else # if test $host - # assume shared memory machine if no hostfile given and - # MPITYPE is set to mpich or Myrinet - # check for Myrinet that the total number of processes is - # less than number of available user ports, 5 - if test $MPITYPE = "mpich" -o $MPITYPE = "scali" - then - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - host=$jid.host - elif test $MPITYPE = "myrinet" - then - if test $nprocd -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes " - echo "must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes " >> $jid.log - echo "must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - echo `hostname` $nprocd | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ - {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ -' >> ~/.gmpi/$jid.host - host=~/.gmpi/$jid.host - else - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - - fi - fi # if test myrinet - - fi # if test $host - - fi # if test $nprocd -gt 1 - -fi # if test $program = $exefile -o $program = $prog.marc - -############################################################################## -# construct run stream (Marc only) # -############################################################################## - -# set maximum message length for ddm to a large number -# for vendor provided mpi -if test $itree -eq 0 -a $MPITYPE = hardware -then - itree=100000000 - if test $MACHINENAME = SGI - then - itree=100000001 - fi -fi -if test $itree -eq 0 -a $MPITYPE = hpmpi -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = myrinet -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = nec -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = scali -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = intelmpi -then - itree=100000000 -fi -if test $nprocdddm -lt 2 -then - nprocdarg= -else - nprocdarg="$nprocdarg $nprocdddm" -fi -if test $nsolver -eq 0 -then - nsolverarg= -else - nsolverarg="$nsolverarg $nsolver" -fi -if test $nprocdddm -lt 2 -a $nsolver -eq 0 -then -nprocd=0 -fi -if test $nprocd -gt 0 -then - if test "$host" - then - if test -z "$RUN_JOB2" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then - RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" - RUN_JOB=" -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - numhost=`uniq $jid.mfile | wc -l` - if test "$INTELMPI_VERSION" = "HYDRA" - then - RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n $numhost -r $RSH -f $jid.mfile - RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" - fi - -# intelmpi uses configfile. format: -# -host host1 -n n1 executable marcargs -# one such line per host -# collect the marcargs in RUN_JOB and construct the config file later -# collect the run stream in RUN_JOB_TMP - RUN_JOB="-jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - - - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then - RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - if test "$userhost" - then - RUN_JOB="$RUN_JOB -mhost $userhost" - fi - if test $MPITYPE = "scali" - then -# set default working directory to /tmp to allow -# different directory names - SCAMPI_WORKING_DIRECTORY=/tmp - export SCAMPI_WORKING_DIRECTORY - fi - else - if test -z "$RUN_JOB1" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - RUNNPROCD=$nprocd - if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" - then - RUNNPROCD= - MP_PROCS=$nprocd - export MP_PROCS - fi - if test $MPITYPE = "myrinet" - then - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n 1 -f $jid.hosts - fi - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - fi -else - if test $nauto -gt 0 -o $ndcoup -gt 0 - then - RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - else -# this is for a serial job without auto restart: - RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi -fi -if test "$rid" -then - RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" -fi -if test "$pid" -then - RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" -fi -if test "$sid" -then - RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" -fi -if test "$did" -then - RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" -fi -if test "$vid" -then - RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" -fi -if test $nauto -gt 0 -then - RUN_JOB="$RUN_JOB -autorst $nauto " -fi -if test $ndcoup -gt 0 -then - RUN_JOB="$RUN_JOB -dcoup $ndcoup " -fi -if test $ndytran -gt 0 -then - RUN_JOB="$RUN_JOB -dytran $ndytran " -fi -if test $mesh -gt 0 -then - RUN_JOB="$RUN_JOB -me $mesh " -fi -if test $noutcore -gt 0 -then - RUN_JOB="$RUN_JOB -outcore $noutcore " -fi -if test "$dllrun" -gt 0 -then - RUN_JOB="$RUN_JOB -dll $dllrun " -fi -if test "$trkrun" -gt 0 -then - RUN_JOB="$RUN_JOB -trk $trkrun " -fi -if test "$iam" -then - RUN_JOB="$RUN_JOB -iam $iam " -fi -if test "$justlist" -then - RUN_JOB="$RUN_JOB -list 1 " -fi -if test "$feature" -then - RUN_JOB="$RUN_JOB -feature $feature " -fi -if test "$memlimit" -ne 0 -then - RUN_JOB="$RUN_JOB -ml $memlimit " -fi -if test "$cpinput" -then - RUN_JOB="$RUN_JOB -ci $cpinput " -fi -if test "$cpresults" -then - RUN_JOB="$RUN_JOB -cr $cpresults " -fi -if test "$DIRSCR" != "$DIRJOB" -then - RUN_JOB="$RUN_JOB -dirscr $DIRSCR" -else - DIRSCR=$DIRJOB -fi -if test "$makebdf" -then - RUN_JOB="$RUN_JOB -bdf $makebdf " -fi -if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" -then - # append $RUN_JOB to all lines of the host file - # and set RUN_JOB - $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ - /bin/mv $host.$$ $host - RUN_JOB=$RUN_JOB_TMP -fi -if test $MPITYPE = "intelmpi" -a "$host" -then - # construct config file, append $RUN_JOB to all lines of the config file - # and set RUN_JOB - if test "$INTELMPI_VERSION" = "HYDRA" - then - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - else - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-host %s -n %s",$1,$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - fi - RUN_JOB=$RUN_JOB_TMP -fi -echo " " -echo "Final run stream value" -echo " RUNJOB="$RUN_JOB -if test "$deletelog" = no -then -echo " " >> $jid.log -echo "Final run stream value" >> $jid.log -echo " RUNJOB="$RUN_JOB >> $jid.log -fi - - -############################################################################## -# run marc using valgrind # -############################################################################## -#RUN_JOB="valgrind $RUN_JOB" -#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" -############################################################################## - - -############################################################################## -# run the requested program in a queue # -############################################################################## - -if test "$deletelog" = yes -then - echo - date -else - echo >> $jid.log - date >> $jid.log -fi -if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] -then - -/bin/rm -f $jid.runmarcscript - - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - userobj=$usernoext.o - fi - cat > $jid.runmarcscript << END4 - if test "$user" - then - if test $MACHINENAME = "CRAY" - then - $DFORTHIGHMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTHIGHMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $MARCCUDALIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } -END4 -else - prgsav=yes -fi -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# - -cat >> $jid.runmarcscript << END5 - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -# first remove all .out files and incremental restart files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null - /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null -fi - -if test $nprocdddm -gt 1 -then - $RUN_JOB 2>>$jid.log -else - $RUN_JOB 2>>$jid.log -fi - -if test $dllrun -eq 0; then - if test $prgsav = no - then - /bin/rm -f $bd$program 2>/dev/null - fi -else - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes - then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -END5 - - -# Submit to marc batch queue -# -if [ $qid = at ] -then -QUENAME=at -SUBMCMD= -else -# -# Submit to qsub queue -# -QUENAME=qsub -SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" -if test "$priority" -then - SUBMCMD=$SUBMCMD" -p $priority" -fi -if test "$att" -then - SUBMCMD=$SUBMCMD" -a $att" -fi -if test "$cpu" -then - SUBMCMD=$SUBMCMD" -lt $cpu" -fi - -fi -echo $QUENAME $SUBMCMD -#cat $jid.runmarcscript -$QUENAME $SUBMCMD < $jid.runmarcscript - -/bin/rm -f $jid.runmarcscript - -############################################################################## -# run the requested program in the background # -############################################################################## - -else -if test $qid = background -then - -# -# first remove all old .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi -# -# compile user subroutine if present -# -( -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_hmp $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - echo " $PRODUCT Exit number 3" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTHIGHMP $user || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTHIGHMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - echo " $PRODUCT Exit number 3" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc - -# - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -$RUN_JOB & - -marcpid=$! -echo $marcpid > $DIRJOB/$jid.pid -wait $marcpid - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - if test "$host" - then - /bin/rm $jid.mfile 2> /dev/null - /bin/rm $jid.hosts 2> /dev/null - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.cfile 2> /dev/null - fi - fi - fi -fi - - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -) 1>>$jid.log 2>&1 & - - -############################################################################## -# run the requested program in the foreground # -############################################################################## - -else - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_hmp $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTHIGHMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTHIGHMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi -# first remove all .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi - -$RUN_JOB - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - if test "$host" - then - /bin/rm $jid.mfile 2> /dev/null - /bin/rm $jid.hosts 2> /dev/null - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.cfile 2> /dev/null - else - echo " " > /dev/null - fi - else - if test "$host" - then - mpdcleanup -a -f $jid.mfile - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.mfile 2> /dev/null - else - mpdcleanup -a -f $jid.hosts - /bin/rm $jid.hosts 2> /dev/null - fi - fi - fi -fi - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi - - -fi -fi diff --git a/installation/mods_MarcMentat/2013/Marc_tools/run_damask_l b/installation/mods_MarcMentat/2013/Marc_tools/run_damask_l deleted file mode 100644 index dec0c9c22..000000000 --- a/installation/mods_MarcMentat/2013/Marc_tools/run_damask_l +++ /dev/null @@ -1,3849 +0,0 @@ -#!/bin/ksh -############################################################################## -# # -# run_marc - run a marc job # -# ------------------------- # -# # -# usage: run_marc -j jid { options } # -# # -# where standard options are: required: defaults: # -# -------------------------- # -# # -# -j* jid job id number. ** YES ** . # -# -pr* prog program name. . marc # -# -v* y|n do or do not verify inputs. . yes # -# -q* s|l|v|b|f batch queue name or background, . short # -# foreground. # -# -b* as alternative to option -q* # -# # -# ( batch queues only : # -# -pq* intra queue priority. . . # -# -at DATE/TIME delay start of job. . . # -# format : January,1,1990,12:31 # -# or : today,5pm # -# -cpu* secs job CPU limit . . ) # -# # -# -r* rid restart file job id. . . # -# -si* sid substructure file id. . . # -# -pi* post post file job id. . . # -# -de* did defaults file . no # -# -vf vid viewfactor . no # -# # -# -u* user user subroutine. . . # -# -obj obj user objects or libraries. . . # -# -sa* y|n do or do not save load module. . no # -# -autorst auto restart flag for auto forge . no # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo selects i4 or i8 version # -# default: i4 or via defaults file run_marc_defaults # -# the -mo option will override # -# -mpi selects MPI version # -# each platform has a default MPI version and some # -# have an alternative version. see the include file # -# for the respective platform # -# MPI_DEFAULT defines the default MPI version # -# MPI_OTHER defines versions one can switch to # -# -dcoup for contact decoupling # -# currently not supported # -# -dir directory where the job i/o should take place. # -# defaults to current directory. # -# -sdir directory where scratch files are created # -# defaults to current directory. # -# # -# -alloc only perform memory allocation test, no analysis # -# -list y only list options in the input file, no analysis # -# -fe num set feature number "num" for the run. only one allowed # -# -dytran flag to switch from Dytran to Marc # -# dytran = 0, program will run w/o Marc-Dytran Switch # -# = 1, program will restart Marc after Dytran run # -# >= 2, Not supported yet. # -# currently not supported # -# -ou force analysis to use out-of-core control # -# =0, not used # -# =1, element storage out-of-core # -# -dll run marc using shared library libmarc.so and exe_marc # -# =1, used # -# =2, do not free streaming input memory # -# =3, run with marc input deck # -# -trk run marc for post-tracking # -# -gpuid run marc using GPGPU capability # -# specify gpuid on to be used in the analysis. Multiple # -# IDs may be assigned for DDM runs. # -# Separate a list of IDs with a colon. Each DMP # -# process will be assigned a GPU ID in round robin fastion# -# = 0 # -# = 0:1 etc... # -# # -# where parallel options are: # -# -------------------------- # -# # -# itree, host, and comp options are available for the domain # -# decomposition only. # -# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # -# # -# # -# -nprocd number of domains. # -# defaults to single domain solution. # -# -nprocds number of domains if single input file. # -# defaults to single domain solution. # -# -nps same as -nprocds. # -# -nsolver number of solver tasks for solver types 12 and 13 # -# these are distributed tasks operating via MPI # -# -nthread number of solver threads for solver types 6, 8, and 11 # -# also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. if both specified, nthread option# -# will be used. # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by 6, 8, and 11 # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor nthread specified. # -# -itree message passing tree type for domain decomposition. # -# for debugging purposes; should not normally be used. # -# -host hostfile name for distributed execution on network. # -# defaults to no hostfile, unless jobid.defhost exists. # -# if jobid.defhost exists, only -np(s) necessary # -# -comp* y|n to be used with user routines on a network of # -# incompatible machines. # -# if set to no, a separate executable will be created # -# for each machine on the network. # -# if set to yes, the executable located on the machine # -# from which marc is started will be used on all machines.# -# defaults to no if O/S versions different on machines. # -# # -# -ci y|n copy input files to remote hosts (default: yes) # -# if "yes", input files are automatically copied to # -# remote hosts for a network run if necessary. # -# -cr y|n copy post files from remote hosts (default: yes) # -# if "yes", post files are automatically copied back from # -# remote hosts for a network run if necessary. # -############################################################################## -# set DIR to the directory in which this script is -REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" -DIR=`dirname $REALCOM` -# make sure DIR has an absolute path -case $DIR in - \/*) - ;; - *) - DIR=`pwd`/$DIR - ;; -esac -DIRSCRIPT=$DIR -AWK=awk -ARCH=`uname -a | cut -f 1 -d " "` -# Sun has a bad awk, use nawk instead -if test $ARCH = "SunOS" -then - AWK=nawk -fi -BASENAME=basename -# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists -if test $ARCH = "SunOS" -then - if test -x /usr/ucb/basename - then - BASENAME=/usr/ucb/basename - fi -fi - -# echo command line in the case of ECHO_COMMAND is true -if test "$ECHO_COMMAND" = true ; then - echo command "$0" "$@" -fi - -# -# "mode" selects version, i4 or i8 -# default is i4 -# this can be changed by a file run_marc_defaults -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MODE i8 -# it can also be set by the environmental variable MARC_INTEGER_SIZE -# and by the command line option "-mo" -# -mode= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -f $HOME/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -n "$MARC_INTEGER_SIZE" ; then - mode=$MARC_INTEGER_SIZE -fi -if test -z "$mode" ; then - mode=i4 -fi -case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "error, version mode must be i4 or i8" - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i4 or i8" - echo " " - echo " use -mo i4 or -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - setmode=true - fi - if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - fi - if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -done - -# set to i4 version for 32 bit Linux -if test "`uname -s`" = "Linux"; then - if test "`uname -m`" = "i686"; then - mode=i4 - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -fi - - -. "$DIR/getarch" - -# Change_me -. $MARC_INCLUDE -# - -# -# Dynamically determine the echo syntax -# - -case "`echo '\c'`" in - '\c') - ECHO='echo -n' - ECHOTXT=' ' - ;; - *) - ECHO='echo' - ECHOTXT=' \c' - ;; -esac - -# -# Variables for the MARC environment -# - -PRODUCT="Marc" -EXITMSG=$MARC_TOOLS/MESSAGES -export EXITMSG -FLEXDIR=$DIR/../flexlm/licenses -export FLEXDIR -TIMCHK=3600 -export TIMCHK -BINDIR=$MARC_BIN -export BINDIR -AFMATDAT=$MARC_RUNTIME/AF_flowmat/ -export AFMATDAT -# -# define directory path to global unified material database -# -MATFILE= -export MATFILE - -# -# define memory limit -# first set to MEMLIMIT from include -# -ml option overrules if specified -memlimit=$MEMLIMIT -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -# -if test $MACHINENAME = "HP" -then - SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH - export SHLIB_PATH -fi -# the one for IBM is defined futher down - -LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH -LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH -export LD_LIBRARY_PATH -export LD_LIBRARY64_PATH -export LD_LIBRARYN32_PATH - -atexit() { -kill -15 $$ -# -if test $MPITYPE = "myrinet" -then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi -fi -} - -trap "atexit" 2 - -# -# defaults -# - -prog=marc -exefile=marc -jid= -rid= -pid= -sid= -did= -vid= -user= -usersnoext= -objs= -qid=background -cpu= -priority= -att= -trk= -verify=yes -prgsav=no -rmdll=no -cpdll=no -progdll= -pathdll= -error= -nprocd=0 -nprocdddm=1 -nprocdddmprint= -icreated=0 -nprocdarg= -nsolver=0 -nsolverarg=-ns -if test $nprocds -then - if test $nprocds -gt 1 - then - nprocdddm=$nprocds - nprocdddmprint=$nprocds - icreated=1 - nprocdarg=-nprocds - fi -fi -nthread=-1 -gpuids= -nauto=0 -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -nthreadprint=0 -itree=0 -iam= -link= -trkrun=0 -DIRJOB=`pwd` -DIRSCR=$DIRJOB -DIRSCRSET= -autoforge=0 -dotdat=.dat -dotdefhost=.defhost -host= -numhost= -mfile= -userhost= -makebdf= -cpinput=yes -cpresults=yes -marcdll=libmarc.$EXT_DLL -# define hostname and strip off extensions (alpha.aaa.com) -thishost=`hostname` -thishost=${thishost%%.*} -compatible=unknown -numfield=1 -justlist= -feature= -mpioption=false -MDSRCLIB=$MARC_LIB/mdsrc.a -# -# check run_marc_defaults file for default MPI setting -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MPI -# -value= -file= -if test -f $DIRSCRIPT/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$DIRSCRIPT/run_marc_defaults - fi -fi -if test -f $HOME/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$HOME/run_marc_defaults - fi -fi -if test -n "$value"; then - MARC_MPITYPE=$value - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - echo " " - echo " error, incorrect option for MARC_MPI" - echo " defined in $file: $MARC_MPITYPE" - echo " valid options: $MPI_DEFAULT $MPI_OTHER" - echo " " - exit - fi - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - fi -fi -# -# -# allow scratch directory to be specified with environmental variable -# MARCSCRATCH -if test $MARCSCRATCH -then - if test -d $MARCSCRATCH - then - DIRSCR=$MARCSCRATCH - else - echo "error, scratch directory '$MARCSCRATCH'" - echo " specified via environmental variable MARCSCRATCH does not exist" - exit - fi -fi -# -############################################################################## -# parse input - arguments always come in pairs # -############################################################################## - -arg=$1 -if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - shift - arg=$1 -fi -while [ -n "$arg" ] -do - shift - value=$1 - case $arg in - -al* | -AL*) - LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - $MARC_BIN/marc -alloc 1 - exit - ;; - -li* | -LI*) - justlist=yes - ;; - -fe* | -FE*) - feature=$value - ;; - -pr* | -PR*) - if test `dirname $value` = '.' - then - prog=`$BASENAME $value .marc` - progdll=`$BASENAME $value` - else - prog=`dirname $value`/`$BASENAME $value .marc` - progdll=`dirname $value`/`$BASENAME $value` - fi - prdir=`dirname $value` - case $prdir in - \/*) - ;; - *) - prog=`pwd`/$prdir/$prog - ;; - esac - ;; - -j* | -J*) - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - ;; - -r* | -R*) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - -si* | -SI*) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - -pi* | -PI*) - if test -f $value.t19 - then - pid=`$BASENAME $value .t19` - else - pid=`$BASENAME $value .t16` - fi - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - -bdf | -BDF) - makebdf=1 - ;; - -de* | -DE*) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - -vf | -VF) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - -u* | -U*) - - user=$value - - - - - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - -obj | -OBJ) - objs="$value" - ;; - -q* | -Q*) - qid=$value - ;; - -b* | -B*) - case $value in - y* | Y*) - qid=background - ;; - n* | N*) - qid=foreground - ;; - *) - ;; - esac - ;; - -at | -AT) - att=$value - ;; - -cpu* | -CPU*) - cpu=$value - ;; - -pq | -PQ*) - priority=$value - ;; - -v* | -V*) - verify=$value - ;; - -sa* | -SA*) - prgsav=$value - ;; - -np* | -NP*) - nprocdddm=$value - nprocdddmprint=$value - case $arg in - -nps* | -NPS* | -nprocds* | -NPROCDS*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - case $arg in - -np | -NP | -nprocd | -NPROCD) - icreated=0 - nprocdarg=-nprocd - ;; - esac - ;; - -ns* | -NS*) - nsolver=$value - ;; - -nt* | -NT*) - nthread=$value - ;; - -gp* | -GP*) - gpuids=$value - ;; - -it* | -IT*) - itree=$value - ;; - -iam | -IAM) - iam=$value - ;; - -au* | -AU*) - nauto=$value - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -me | -ME ) - mesh=$value - ;; - -ml | -ML ) - memlimit=$value - ;; - -mo | -MO ) - ;; - -mpi | -MPI ) - mpioption=true - MARC_MPITYPE=$value - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - fi - fi - ;; - -dir* | -DIR*) - DIRJOB=$value - case $DIRJOB in - \/*) - ;; - *) - DIRJOB=`pwd`/$DIRJOB - ;; - esac - if test -z "$DIRSCRSET" - then - DIRSCR=$DIRJOB - fi - ;; - -sd* | -SD*) - DIRSCR=$value - DIRSCRSET=yes - case $DIRSCR in - \/*) - ;; - *) - DIRSCR=`pwd`/$DIRSCR - ;; - esac - ;; - -ho* | -HO*) - host=$value - ;; - -co* | -CO*) - compatible=$value - ;; - -ci* | -CI*) - cpinput=$value - ;; - -cr* | -CR*) - cpresults=$value - ;; - *) - error="$error -$arg: invalid option" - break - ;; - esac - case $value in - -*) - error="$error -$arg: invalid name $value" - break - ;; - esac - shift - arg=$1 - if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - shift - arg=$1 - fi -done -argc=`expr $# % 2` -if test $argc -eq 1 -then -# -# odd number of arguments -# - error="$error -argument list incomplete" -fi - -if test $nprocdddm -gt 0 -then -nprocd=$nprocdddm -fi - -if test $nsolver -gt 0 -then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi -fi - -if test $nthread -eq -1 -then -nthread=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nthread -lt 0 -then -nthread=0 -fi - -nthreadprint=$nthread -if test $nthreadprint -eq 0 -then -nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi -fi - -nthread=$nthreadprint - -gpuoption= -if test "$gpuids" = "" ; then - gpuoption= -else - gpuoption="-gp $gpuids" -fi - -if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH -else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH -fi -# Linux 64 + HPMPI, Below code is taken from include_linux64 -if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" -then -export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" -fi - -if test $nprocd -gt 1; then - if test -f $jid$dotdefhost; then - if test "$host" = ""; then - host=$jid$dotdefhost - fi - fi - if test -f hostfile_qa_$nprocd; then - if test "$host" = ""; then - host=hostfile_qa_$nprocd - fi - fi -fi - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then - dotdat=.inp - fi - - if test "$progdll"; then - /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll - rmdll=yes - pathdll=yes - progdll=${progdll}_$marcdll - else - progdll=$marcdll - fi - - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - pathdll=yes - fi -fi - -############################################################################## -# check parameter validity # -############################################################################## - -while test forever; do - -# -# check for input file existence -# -if test $nprocdddm -gt 1 -a $icreated -eq 0; then - if test ! -f $DIRJID/1$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/1$jid$dotdat not accessible" - fi - fi -else - if test ! -f $DIRJID/$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/$jid$dotdat not accessible" - fi - fi -fi - if test $nprocd -gt 1; then - if test "$host" ; then - if test ! -f $host; then - error="$error -host name file $host not accessible" - fi - fi - fi - -# -# check if the job is already running in the background -# -if test -f $DIRJOB/$jid.pid; then - error="$error -job is already running (the file $jid.pid exists)" -fi - -# -# if the program name is other than marc, then -# assume that this is a program in the users local directory -# - -bd=$MARC_BIN/ - -case $prog in - marc | MARC | $exefile) - program=$exefile - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - if test ! -f $user - then - error="$error -user subroutine file $user not accessible" - fi - fi - if test "$objs" - then - missingobjs= - for o in $objs - do - if test ! -f "$o" - then - if test -z "$missingobjs" - then - missingobjs="$o" - else - missingobjs="$missingobjs $o" - fi - fi - done - if test -n "$missingobjs" - then - error="$error -user object/library file(s) $missingobjs not accessible" - fi - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$vid" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRVID/1$vid.vfs - then - error="$error -view factor file $DIRVID/1$vid.vfs not accessible" - fi - else - if test ! -f $DIRVID/$vid.vfs - then - error="$error -view factor file $DIRVID/$vid.vfs not accessible" - fi - fi - fi - if $mpioption - then - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" - fi - fi - ;; - *) - program=$prog.marc - case $prog in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - error="$error -program option may not be used with user subroutine" - fi - if test "$objs" - then - error="$error -program option may not be used with user objects or libraries" - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$nauto" - then - if test $nauto -gt 2 - then - error="$error -incorrect option for auto restart " - fi - fi - if test "$ndcoup" - then - if test $ndcoup -gt 3 - then - error="$error -incorrect option for contact decoupling " - fi - fi - if test "$ndytran" - then - if test $ndytran -gt 1 - then - error="$error -incorrect option for Marc-Dytran Switch " - fi - fi - if $mpioption - then - if test ! -x $MARC_BIN/$exefile - then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE " - fi - fi - ;; -esac - -############################################################################## -# check argument integrity # -############################################################################## - -if test "$jid" -then - : -else - error="$error -job id required" -fi - -if test $nprocd -gt 1 -then - if test $nauto -gt 0 - then - error="$error -cannot run DDM job with auto restart (-au) option " - fi -fi -case $qid in - S* | s*) - qid=short - ;; - L* | l*) - qid=long - ;; - V* | v*) - qid=verylong - ;; - B* | b*) - qid=background - ;; - F* | f*) - qid=foreground - ;; - A* | a*) - qid=at - ;; - *) - error="$error -bad value for queue_id option" - ;; -esac - -case $prgsav in - N* | n*) - prgsav=no - ;; - Y* | y*) - prgsav=yes - ;; - *) - error="$error -bad value for save option" - ;; -esac - -case $verify in - N* | n*) - verify=no - ;; - Y* | y*) - verify=yes - ;; - *) - error="$error -bad value for verify option" - ;; -esac - -case $nprocdddm in - -* ) - error="$error -bad value for nprocd option" - ;; -esac - -case $nthread in - -* ) - error="$error -bad value for nthread option" - ;; -esac - -case $itree in - -* ) - error="$error -bad value for itree option" - ;; -esac -case $iam in - -* ) - error="$error -bad value for iam option" - ;; -esac -case $compatible in - N* | n*) - compatible=no - ;; - Y* | y*) - compatible=yes - ;; - unknown) - ;; - *) - error="$error -bad value for comp option" - ;; -esac -case $cpinput in - N* | n*) - cpinput=no - ;; - Y* | y*) - cpinput=yes - ;; - *) - error="$error -bad value for copy input option" - ;; -esac -case $cpresults in - N* | n*) - cpresults=no - ;; - Y* | y*) - cpresults=yes - ;; - *) - error="$error -bad value for copy results option" - ;; -esac - -# -# check for external file to run -# -if test -f $MARC_TOOLS/run_marc_check -then - . $MARC_TOOLS/run_marc_check -fi - -# -# pick up version data from bin/VERSION if it exists -# -if test -f $MARC_BIN/VERSION; then - ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` - if test -n "$ppp" ;then - PRODUCT=$ppp - fi - ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` - if test -n "$ppp" ;then - REVISION=", Build $ppp" - fi -fi -############################################################################## -# interact with the user to get the required information to run marc or # -# other marc system program # -############################################################################## - -deletelog=yes -if test $qid = background -a $verify = no -then -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto " > $jid.log -deletelog=no -fi -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto" - - -case $qid in - s* | S* | l* | L* | v* | V* ) - echo \ -"Queue priority : $priority -Queue CPU limit : $cpu -Queue start time : $att" - ;; -# * ) -# echo \ -#" " -# ;; -esac - -if test "$error" -then - if test $verify = yes - then - $ECHO "$error - -Please correct or quit(correct,quit,): $ECHOTXT" - error= - read answer - case $answer in - q* | Q*) - answer=quit - ;; - *) - answer=correct - ;; - esac - else - $ECHO "$error - $ECHOTXT" - echo " " - if test "$deletelog" = no - then - $ECHO "$error - $ECHOTXT" >> $jid.log - echo " " >> $jid.log - fi - answer=quit - fi -else - if test $verify = yes - then - $ECHO " -Are these parameters correct (yes,no,quit,)? $ECHOTXT" - read answer - case $answer in - q* | Q*) - answer=quit - ;; - y* | Y*) - answer=yes - ;; - *) - answer=no - ;; - esac - else - answer=yes - fi -fi - -case $answer in - no | correct) - -############################################################################## -# prompt for each value # -############################################################################## - - $ECHO " -Program name ($prog)? $ECHOTXT" - read value - if test "$value" - then - prog=$value - fi - $ECHO "Job ID ($jid)? $ECHOTXT" - read value - if test "$value" - then - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - fi - $ECHO "User subroutine name ($user)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - user= - ;; - *) - user=$value - - - - - - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - esac - fi - $ECHO "User objects or libraries ($objs)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - objs= - ;; - *) - objs="$value" - ;; - esac - fi - $ECHO "Restart File Job ID ($rid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - rid= - ;; - *) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - esac - fi - $ECHO "Substructure File ID ($sid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - sid= - ;; - *) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - esac - fi - $ECHO "Post File Job ID ($pid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - pid= - ;; - *) - pid=$value - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - esac - fi - $ECHO "Defaults File ID ($did)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - did= - ;; - *) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - esac - fi - $ECHO "View Factor File ID ($vid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - vid= - ;; - *) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - esac - fi - $ECHO "Save generated module ($prgsav)? $ECHOTXT" - read value - if test "$value" - then - prgsav=$value - fi - $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" - read value - if test "$value" - then - nprocdddm=$value - nprocdddmprint=$value - fi - $ECHO "Run on ($nthread) threads ? $ECHOTXT" - read value - if test "$value" - then - nthread=$value - fi - $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" - read value - if test "$value" - then - nsolver=$value - fi -# - if test $nprocdddm -gt 0 - then - nprocd=$nprocdddm - fi - if test $nsolver -gt 0 - then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi - fi - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - nthreadprint=$nthread - if test $nthreadprint -eq 0 - then - nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi - fi -# - $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" - read value - if test "$value" - then - gpuids=$value - fi - if test "$gpuids" = "" ; then - gpuoption= - else - gpuoption="-gp $gpuids" - fi - if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH - fi - if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - fi -# - if test $nprocd -gt 1 - then - $ECHO "Message passing type ($itree)? $ECHOTXT" - read value - if test "$value" - then - itree=$value - fi - $ECHO "Host file name ($host)? $ECHOTXT" - read value - if test "$value" - then - host=$value - fi - if test $nprocdddm -gt 1 - then - $ECHO "Single input file? $ECHOTXT" - read value - case $value in - y* | Y*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" - read value - if test "$value" - then - compatible=$value - fi - $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" - read value - if test "$value" - then - cpinput=$value - fi - $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" - read value - if test "$value" - then - cpresults=$value - fi - fi - fi - $ECHO "Run the job in the queue ($qid)? $ECHOTXT" - read value - if test "$value" - then - qid=$value - fi - case $qid in - s* | S* | l* | L* | v* | V* ) - $ECHO "Queue priority ($priority)? $ECHOTXT" - read value - if test "$value" - then - priority=$value - fi - $ECHO "Job starts at ($att)? $ECHOTXT" - read value - if test "$value" - then - att=$value - fi - $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" - read value - if test "$value" - then - cpu=$value - fi - ;; - * ) - ;; - esac - $ECHO "Auto Restart option ($nauto)? $ECHOTXT" - read value - if test "$value" - then - nauto=$value - fi - $ECHO "Run directory ($DIRJOB)? $ECHOTXT" - read value - if test "$value" - then - DIRJOB=$value - DIRSCR=$DIRJOB - fi - $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" - read value - if test "$value" - then - DIRSCR=$value - fi - ;; - quit) - exit 1 - ;; - *) - break - ;; - -esac - - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - -done - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - pathdll=yes - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - fi - - if test "$pathdll"; then -# -# reset share lib path -# - if test $MACHINENAME = "HP" - then - SHLIB_PATH=$DIRJOB:$SHLIB_PATH - export SHLIB_PATH - fi - if test $MACHINENAME = "IBM" - then - LIBPATH=$DIRJOB:$LIBPATH - export LIBPATH - fi -# - LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH - LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH - LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH - export LD_LIBRARY_PATH - export LD_LIBRARY64_PATH - export LD_LIBRARYN32_PATH - fi -fi -# end of dllrun>0 - - -if test $program = $exefile -o $program = $prog.marc -then - -# delete the old .log file unless we run in the background -if test "$deletelog" = yes -then - /bin/rm $jid.log 2>/dev/null -else - echo - echo running the job in the background, see $jid.log - echo -fi - -# -# check if this is an autoforge or rezoning or radiation job -# -if test $nprocd -eq 1 -then - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` - if test "$line" - then - autoforge=1 - fi -fi -# -# check that jobname for restarted run is not the same -# as restart file basename -# -if test "$rid" -then - if test "$jid" = "$rid" - then - echo " " - echo "ERROR: job name of current run is the same as job name" - echo " of the restarted job" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "ERROR: job name of current run is the same as job name" >> $jid.log - echo " of the restarted job" >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi -fi - -# -# user objects/libraries used -# - - if test "$objs" - then - program="$DIRJOB/$jid.marc" - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# user subroutine used -# -# add DAMASK options for linking - DAMASK="" - - if test "$user" - then - program=$usernoext.marc - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# Special case for IBM using POE but not an SP machine -# in this case we always need a host file, also for serial jobs. -# -if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP -then - MP_HOSTFILE=${jid}.host - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $nprocd -gt 1 - then - numdom=$nprocd - while test $numdom -gt 0 - do - hostname -s >> $MP_HOSTFILE - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - else - hostname -s > $MP_HOSTFILE - fi -fi -# -# check ssh for all hosts in host file -# -if test $nprocd -gt 1 -then -if test $MPITYPE = "intelmpi" -a "$INTELMPI_VERSION" = "HYDRA" - then -# get host list - if test "$host" - then - line=`grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' | uniq` -# count failing hosts - counter=0 - for i in $line - do - $RSH -o BatchMode=yes -o ConnectTimeout=10 $i uname -n - status=$? - if [[ $status != 0 ]] ; then - counter=$((counter+1)) - if [ "$counter" = "1" ]; then - echo " " - echo " error - connection test failed... " - echo " " - fi - echo " " - echo " connection test with ssh failed on host $i" - echo " check the following command: ssh $i uname -n " - echo " " - fi - done -# echo error message and quit - if test $counter -ne 0 - then - echo " " - echo " A parallel job using IntelMPI cannot be started. " - echo " The ssh command must be working correctly between " - echo " the computers used in the analysis. Furthermore, " - echo " it must be set up such that it does not prompt the " - echo " user for a password. Note that this is the case " - echo " also for running on a single machine. " - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo " A parallel job using IntelMPI cannot be started. ">> $jid.log - echo " The ssh command must be working correctly between ">> $jid.log - echo " the computers used in the analysis. Furthermore, ">> $jid.log - echo " it must be set up such that it does not prompt the ">> $jid.log - echo " user for a password. Note that this is the case ">> $jid.log - echo " also for running on a single machine. ">> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - else - counter=1 -# test ssh `hostname` - if test $counter -ne 0 - then - line=`hostname` - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi -# test ssh `hostname` - if test $counter -ne 0 - then - line=`hostname -s` - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi -# test ssh localhost - if test $counter -ne 0 - then - line=localhost - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi - if test $counter -ne 0 - then - echo " error - connection test failed... " - echo " " - echo " ssh needs to work on the machine without asking for a password." - echo " check the following command: ssh localhost uname -n" - echo " " - echo " A parallel job using IntelMPI cannot be started. " - echo " The ssh command must be working correctly between " - echo " the computers used in the analysis. Furthermore, " - echo " it must be set up such that it does not prompt the " - echo " user for a password. Note that this is the case " - echo " also for running on a single machine. " - echo " " - if test "$deletelog" = no - then - echo " error - connection test failed... " >> $jid.log - echo " " >> $jid.log - echo " ssh needs to work on the machine without asking for a password." >> $jid.log - echo " check the following command: ssh localhost uname -n" >> $jid.log - echo " " >> $jid.log - echo " A parallel job using IntelMPI cannot be started. " >> $jid.log - echo " The ssh command must be working correctly between " >> $jid.log - echo " the computers used in the analysis. Furthermore, " >> $jid.log - echo " it must be set up such that it does not prompt the " >> $jid.log - echo " user for a password. Note that this is the case " >> $jid.log - echo " also for running on a single machine. " >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - echo $line $nprocd > $jid.hosts - host=$jid.hosts - fi - fi -fi -fi -# -# check correctness of host file; fix for user sub -# - if test $nprocd -gt 1 - then - -# construct the path name to the executable (execpath) - execpath=$MARC_BIN/$exefile - usersub=0 - if test $program = $prog.marc - then - execpath=$prog.marc - usersub=1 - fi - if test "$objs" - then - execpath="$DIRJOB/$jid.marc" - usersub=1 - fi - if test "$user" - then - execpath=$usernoext.marc - usersub=1 - fi - export execpath - execname=`$BASENAME $execpath` - - if test "$host" - then - userhost=$host - case $userhost in - \/* | \.\/*) - ;; - *) - userhost=`pwd`/$userhost - ;; - esac - -# check that the number of processes specified in the hostfile is -# equal to nprocd specified by -nprocd. - numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` - if test $nprocd -ne $numproc - then - echo " " - echo "error, the number of processes specified in the host file" - echo "must be equal to the number of processes given by -nprocd/-nsolver" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, the number of processes specified in the host file" >> $jid.log - echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - -# check for Myrinet that the number of processes per host is -# less than number of available user ports, 5 -# .gmpi directory must exist in user's home directory -# and must have write permission from remote hosts - if test $MPITYPE = "myrinet" - then - numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` - if test $numproc -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes specified " - echo "in the hostfile must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes specified " >> $jid.log - echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - if test ! -d ~/.gmpi - then - echo " " - echo "error, for Myrinet a .gmpi directory must exist " - echo "under the user's home directory" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log - echo "under the user's home directory" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - homedir=`echo ~` - for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - echo " " - echo "error, for Myrinet a shared .gmpi directory must exist " - echo "under the user's home directory " - echo "with remote write permission" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log - echo "under the user's home directory " >> $jid.log - echo "with remote write permission" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - /bin/rm tmp.$$ - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - fi - fi - done - fi - fi - -# construct the host file $jid.host which is used by mpirun -# skip lines starting with # and only consider lines with more than -# one word in them. Note that the hostfile given to this script -# has two columns: the host name and the number of shared processes -# to run on this host. mpirun wants the number of _other_ -# processes to run in addition to the one being run on the machine -# on which the job is started. hence the $2-1 for fnr == 1. - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then -# HPMPI or HP hardware MPI - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ - -v mpihpspecial="$MPIHPSPECIAL" \ -'{if ( NF > 0) {\ - fnr++ ; \ - printf("-h %s -np %s",$1,$2); \ - printf(" %s",mpihpspecial); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ - if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ - }\ - }' > $jid.host -# end HPMPI or HP hardware MPI - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then -# IBM using hardware MPI (POE) - MP_HOSTFILE=$jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host -# end IBM using hardware MPI (POE) -# for Intel MPI, need to create a machinefile for DMP - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then -# Intel MPI - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - /bin/cp $host $jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Intel MPI for DMP -# for Solaris HPC 7.1, need to create a machinefile for DMP - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then -# Solaris HPC 7.1 - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Solaris HPC 7.1 for DMP -# for Myrinet, construct a configuration file in ~/.gmpi -# this must be readable by each process -# format is (hostname) (port number) for each process - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - grep -v '^#' $host | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ -{if ( NF > 0 ) \ - for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ -}' >> ~/.gmpi/$jid.host - else -# this is for mpich-1.2.5 and later, using the -pg option -# format: host nproc executable user arguments -# the arguments are added later - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s %s\n",path,user);\ - if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ - }\ - }' > $jid.host - fi -# end Myrinet - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then -# Compaq MPI via Memory Channel - grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host -# end Compaq MPI - else -# MPICH - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ - }\ - }' > $jid.host - fi -# define the variable host and host_filt -# host_filt is used for loops over hosts -# for Myrinet we need to use a filtered variant of userhost -# for others we can use $host - if test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - host=~/.gmpi/$jid.host - host_filt=$jid.host_tMp - grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt - else - host=$jid.host - host_filt=$host - fi - else - host=$jid.host - host_filt=$host - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - host_filt=$jid.mfile - fi - fi -# figure out if the machines in the hostfile are nfs mounted -# or distributed and set the variable "dirstatus" accordingly. -# only perform the check if user subroutine is used -# or a user subroutine executable is used - - numfield=1 - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - numfield=2 - fi - DIR1=$DIRJOB - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - counter=0 - echo " " - echo "checking if local or shared directories for host" - if test "$deletelog" = no - then - echo "checking if local or shared directories for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - dirstatus[$counter]="shared" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - dirstatus[$counter]="local" - /bin/rm tmp.$$ - else - if test ! -f $jid.$$ - then - dirstatus[$counter]="local" - $RSH $i /bin/rm $DIR1/$jid.$$ - else - /bin/rm $jid.$$ - fi - fi - if test -f tmp.$$ - then - /bin/rm tmp.$$ - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - echo " ${dirstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${dirstatus[$counter]}" >> $jid.log - fi - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - fi - -# figure out if this is a compatible set of machines -# unless explicitly specified with flag -comp -# only perform the check if user subroutine is used -# or a user subroutine executable is used -# Myrinet does not support heterogeneous - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - if test $compatible = "unknown" - then - thisname=$ARCH - compatible=yes - counter=0 - echo "checking if machines are compatible for host" - if test "$deletelog" = no - then - echo "checking if machines are compatible for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]="yes" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - othername=`$RSH $i uname -a | cut -f 1 -d " "` - if test $thisname != $othername - then - compatible=no - compstatus[$counter]="no" - fi - fi - echo " ${compstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${compstatus[$counter]}" >> $jid.log - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - else - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]=$compatible - fi - done - if test $compatible = "no" - then - echo "all machines assumed incompatible" - if test "$deletelog" = no - then - echo "all machines assumed incompatible" >> $jid.log - fi - else - echo "all machines compatible" - if test "$deletelog" = no - then - echo "all machines compatible" >> $jid.log - fi - fi - fi -# error out if user objects or libraries are used on incompatible machines - if test "$compatible" = "no" -a -n "$objs" - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" - if test "$deletelog" = no - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log - fi - exit 1 - fi -# modify new host file if NFS mounted heterogeneous machine - doit= - if test $program = $prog.marc - then - doit=yes - fi - if test "$user" - then - doit=yes - fi - if test "$doit" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - $AWK -v hst=$i '{fnr++ ; \ -if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ -printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} - /bin/mv $jid.host{$$} $jid.host - host=$jid.host - fi - fi - done - fi - fi # if test $program = $prog.marc -o $user -o $obj - - else # if test $host - # assume shared memory machine if no hostfile given and - # MPITYPE is set to mpich or Myrinet - # check for Myrinet that the total number of processes is - # less than number of available user ports, 5 - if test $MPITYPE = "mpich" -o $MPITYPE = "scali" - then - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - host=$jid.host - elif test $MPITYPE = "myrinet" - then - if test $nprocd -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes " - echo "must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes " >> $jid.log - echo "must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - echo `hostname` $nprocd | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ - {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ -' >> ~/.gmpi/$jid.host - host=~/.gmpi/$jid.host - else - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - - fi - fi # if test myrinet - - fi # if test $host - - fi # if test $nprocd -gt 1 - -fi # if test $program = $exefile -o $program = $prog.marc - -############################################################################## -# construct run stream (Marc only) # -############################################################################## - -# set maximum message length for ddm to a large number -# for vendor provided mpi -if test $itree -eq 0 -a $MPITYPE = hardware -then - itree=100000000 - if test $MACHINENAME = SGI - then - itree=100000001 - fi -fi -if test $itree -eq 0 -a $MPITYPE = hpmpi -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = myrinet -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = nec -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = scali -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = intelmpi -then - itree=100000000 -fi -if test $nprocdddm -lt 2 -then - nprocdarg= -else - nprocdarg="$nprocdarg $nprocdddm" -fi -if test $nsolver -eq 0 -then - nsolverarg= -else - nsolverarg="$nsolverarg $nsolver" -fi -if test $nprocdddm -lt 2 -a $nsolver -eq 0 -then -nprocd=0 -fi -if test $nprocd -gt 0 -then - if test "$host" - then - if test -z "$RUN_JOB2" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then - RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" - RUN_JOB=" -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - numhost=`uniq $jid.mfile | wc -l` - if test "$INTELMPI_VERSION" = "HYDRA" - then - RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n $numhost -r $RSH -f $jid.mfile - RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" - fi - -# intelmpi uses configfile. format: -# -host host1 -n n1 executable marcargs -# one such line per host -# collect the marcargs in RUN_JOB and construct the config file later -# collect the run stream in RUN_JOB_TMP - RUN_JOB="-jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - - - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then - RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - if test "$userhost" - then - RUN_JOB="$RUN_JOB -mhost $userhost" - fi - if test $MPITYPE = "scali" - then -# set default working directory to /tmp to allow -# different directory names - SCAMPI_WORKING_DIRECTORY=/tmp - export SCAMPI_WORKING_DIRECTORY - fi - else - if test -z "$RUN_JOB1" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - RUNNPROCD=$nprocd - if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" - then - RUNNPROCD= - MP_PROCS=$nprocd - export MP_PROCS - fi - if test $MPITYPE = "myrinet" - then - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n 1 -f $jid.hosts - fi - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - fi -else - if test $nauto -gt 0 -o $ndcoup -gt 0 - then - RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - else -# this is for a serial job without auto restart: - RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi -fi -if test "$rid" -then - RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" -fi -if test "$pid" -then - RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" -fi -if test "$sid" -then - RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" -fi -if test "$did" -then - RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" -fi -if test "$vid" -then - RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" -fi -if test $nauto -gt 0 -then - RUN_JOB="$RUN_JOB -autorst $nauto " -fi -if test $ndcoup -gt 0 -then - RUN_JOB="$RUN_JOB -dcoup $ndcoup " -fi -if test $ndytran -gt 0 -then - RUN_JOB="$RUN_JOB -dytran $ndytran " -fi -if test $mesh -gt 0 -then - RUN_JOB="$RUN_JOB -me $mesh " -fi -if test $noutcore -gt 0 -then - RUN_JOB="$RUN_JOB -outcore $noutcore " -fi -if test "$dllrun" -gt 0 -then - RUN_JOB="$RUN_JOB -dll $dllrun " -fi -if test "$trkrun" -gt 0 -then - RUN_JOB="$RUN_JOB -trk $trkrun " -fi -if test "$iam" -then - RUN_JOB="$RUN_JOB -iam $iam " -fi -if test "$justlist" -then - RUN_JOB="$RUN_JOB -list 1 " -fi -if test "$feature" -then - RUN_JOB="$RUN_JOB -feature $feature " -fi -if test "$memlimit" -ne 0 -then - RUN_JOB="$RUN_JOB -ml $memlimit " -fi -if test "$cpinput" -then - RUN_JOB="$RUN_JOB -ci $cpinput " -fi -if test "$cpresults" -then - RUN_JOB="$RUN_JOB -cr $cpresults " -fi -if test "$DIRSCR" != "$DIRJOB" -then - RUN_JOB="$RUN_JOB -dirscr $DIRSCR" -else - DIRSCR=$DIRJOB -fi -if test "$makebdf" -then - RUN_JOB="$RUN_JOB -bdf $makebdf " -fi -if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" -then - # append $RUN_JOB to all lines of the host file - # and set RUN_JOB - $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ - /bin/mv $host.$$ $host - RUN_JOB=$RUN_JOB_TMP -fi -if test $MPITYPE = "intelmpi" -a "$host" -then - # construct config file, append $RUN_JOB to all lines of the config file - # and set RUN_JOB - if test "$INTELMPI_VERSION" = "HYDRA" - then - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - else - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-host %s -n %s",$1,$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - fi - RUN_JOB=$RUN_JOB_TMP -fi -echo " " -echo "Final run stream value" -echo " RUNJOB="$RUN_JOB -if test "$deletelog" = no -then -echo " " >> $jid.log -echo "Final run stream value" >> $jid.log -echo " RUNJOB="$RUN_JOB >> $jid.log -fi - - -############################################################################## -# run marc using valgrind # -############################################################################## -#RUN_JOB="valgrind $RUN_JOB" -#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" -############################################################################## - - -############################################################################## -# run the requested program in a queue # -############################################################################## - -if test "$deletelog" = yes -then - echo - date -else - echo >> $jid.log - date >> $jid.log -fi -if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] -then - -/bin/rm -f $jid.runmarcscript - - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - userobj=$usernoext.o - fi - cat > $jid.runmarcscript << END4 - if test "$user" - then - if test $MACHINENAME = "CRAY" - then - $DFORTLOW $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTLOW $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $MARCCUDALIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } -END4 -else - prgsav=yes -fi -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# - -cat >> $jid.runmarcscript << END5 - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -# first remove all .out files and incremental restart files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null - /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null -fi - -if test $nprocdddm -gt 1 -then - $RUN_JOB 2>>$jid.log -else - $RUN_JOB 2>>$jid.log -fi - -if test $dllrun -eq 0; then - if test $prgsav = no - then - /bin/rm -f $bd$program 2>/dev/null - fi -else - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes - then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -END5 - - -# Submit to marc batch queue -# -if [ $qid = at ] -then -QUENAME=at -SUBMCMD= -else -# -# Submit to qsub queue -# -QUENAME=qsub -SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" -if test "$priority" -then - SUBMCMD=$SUBMCMD" -p $priority" -fi -if test "$att" -then - SUBMCMD=$SUBMCMD" -a $att" -fi -if test "$cpu" -then - SUBMCMD=$SUBMCMD" -lt $cpu" -fi - -fi -echo $QUENAME $SUBMCMD -#cat $jid.runmarcscript -$QUENAME $SUBMCMD < $jid.runmarcscript - -/bin/rm -f $jid.runmarcscript - -############################################################################## -# run the requested program in the background # -############################################################################## - -else -if test $qid = background -then - -# -# first remove all old .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi -# -# compile user subroutine if present -# -( -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_l $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - echo " $PRODUCT Exit number 3" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTLOW $user || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTLOW $user -o $userobj || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - echo " $PRODUCT Exit number 3" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc - -# - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -$RUN_JOB & - -marcpid=$! -echo $marcpid > $DIRJOB/$jid.pid -wait $marcpid - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - if test "$host" - then - /bin/rm $jid.mfile 2> /dev/null - /bin/rm $jid.hosts 2> /dev/null - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.cfile 2> /dev/null - fi - fi - fi -fi - - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -) 1>>$jid.log 2>&1 & - - -############################################################################## -# run the requested program in the foreground # -############################################################################## - -else - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_l $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTLOW $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTLOW $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi -# first remove all .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi - -$RUN_JOB - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - if test "$host" - then - /bin/rm $jid.mfile 2> /dev/null - /bin/rm $jid.hosts 2> /dev/null - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.cfile 2> /dev/null - else - echo " " > /dev/null - fi - else - if test "$host" - then - mpdcleanup -a -f $jid.mfile - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.mfile 2> /dev/null - else - mpdcleanup -a -f $jid.hosts - /bin/rm $jid.hosts 2> /dev/null - fi - fi - fi -fi - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi - - -fi -fi diff --git a/installation/mods_MarcMentat/2013/Marc_tools/run_damask_lmp b/installation/mods_MarcMentat/2013/Marc_tools/run_damask_lmp deleted file mode 100644 index 05938be60..000000000 --- a/installation/mods_MarcMentat/2013/Marc_tools/run_damask_lmp +++ /dev/null @@ -1,3849 +0,0 @@ -#!/bin/ksh -############################################################################## -# # -# run_marc - run a marc job # -# ------------------------- # -# # -# usage: run_marc -j jid { options } # -# # -# where standard options are: required: defaults: # -# -------------------------- # -# # -# -j* jid job id number. ** YES ** . # -# -pr* prog program name. . marc # -# -v* y|n do or do not verify inputs. . yes # -# -q* s|l|v|b|f batch queue name or background, . short # -# foreground. # -# -b* as alternative to option -q* # -# # -# ( batch queues only : # -# -pq* intra queue priority. . . # -# -at DATE/TIME delay start of job. . . # -# format : January,1,1990,12:31 # -# or : today,5pm # -# -cpu* secs job CPU limit . . ) # -# # -# -r* rid restart file job id. . . # -# -si* sid substructure file id. . . # -# -pi* post post file job id. . . # -# -de* did defaults file . no # -# -vf vid viewfactor . no # -# # -# -u* user user subroutine. . . # -# -obj obj user objects or libraries. . . # -# -sa* y|n do or do not save load module. . no # -# -autorst auto restart flag for auto forge . no # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo selects i4 or i8 version # -# default: i4 or via defaults file run_marc_defaults # -# the -mo option will override # -# -mpi selects MPI version # -# each platform has a default MPI version and some # -# have an alternative version. see the include file # -# for the respective platform # -# MPI_DEFAULT defines the default MPI version # -# MPI_OTHER defines versions one can switch to # -# -dcoup for contact decoupling # -# currently not supported # -# -dir directory where the job i/o should take place. # -# defaults to current directory. # -# -sdir directory where scratch files are created # -# defaults to current directory. # -# # -# -alloc only perform memory allocation test, no analysis # -# -list y only list options in the input file, no analysis # -# -fe num set feature number "num" for the run. only one allowed # -# -dytran flag to switch from Dytran to Marc # -# dytran = 0, program will run w/o Marc-Dytran Switch # -# = 1, program will restart Marc after Dytran run # -# >= 2, Not supported yet. # -# currently not supported # -# -ou force analysis to use out-of-core control # -# =0, not used # -# =1, element storage out-of-core # -# -dll run marc using shared library libmarc.so and exe_marc # -# =1, used # -# =2, do not free streaming input memory # -# =3, run with marc input deck # -# -trk run marc for post-tracking # -# -gpuid run marc using GPGPU capability # -# specify gpuid on to be used in the analysis. Multiple # -# IDs may be assigned for DDM runs. # -# Separate a list of IDs with a colon. Each DMP # -# process will be assigned a GPU ID in round robin fastion# -# = 0 # -# = 0:1 etc... # -# # -# where parallel options are: # -# -------------------------- # -# # -# itree, host, and comp options are available for the domain # -# decomposition only. # -# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # -# # -# # -# -nprocd number of domains. # -# defaults to single domain solution. # -# -nprocds number of domains if single input file. # -# defaults to single domain solution. # -# -nps same as -nprocds. # -# -nsolver number of solver tasks for solver types 12 and 13 # -# these are distributed tasks operating via MPI # -# -nthread number of solver threads for solver types 6, 8, and 11 # -# also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. if both specified, nthread option# -# will be used. # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by 6, 8, and 11 # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor nthread specified. # -# -itree message passing tree type for domain decomposition. # -# for debugging purposes; should not normally be used. # -# -host hostfile name for distributed execution on network. # -# defaults to no hostfile, unless jobid.defhost exists. # -# if jobid.defhost exists, only -np(s) necessary # -# -comp* y|n to be used with user routines on a network of # -# incompatible machines. # -# if set to no, a separate executable will be created # -# for each machine on the network. # -# if set to yes, the executable located on the machine # -# from which marc is started will be used on all machines.# -# defaults to no if O/S versions different on machines. # -# # -# -ci y|n copy input files to remote hosts (default: yes) # -# if "yes", input files are automatically copied to # -# remote hosts for a network run if necessary. # -# -cr y|n copy post files from remote hosts (default: yes) # -# if "yes", post files are automatically copied back from # -# remote hosts for a network run if necessary. # -############################################################################## -# set DIR to the directory in which this script is -REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" -DIR=`dirname $REALCOM` -# make sure DIR has an absolute path -case $DIR in - \/*) - ;; - *) - DIR=`pwd`/$DIR - ;; -esac -DIRSCRIPT=$DIR -AWK=awk -ARCH=`uname -a | cut -f 1 -d " "` -# Sun has a bad awk, use nawk instead -if test $ARCH = "SunOS" -then - AWK=nawk -fi -BASENAME=basename -# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists -if test $ARCH = "SunOS" -then - if test -x /usr/ucb/basename - then - BASENAME=/usr/ucb/basename - fi -fi - -# echo command line in the case of ECHO_COMMAND is true -if test "$ECHO_COMMAND" = true ; then - echo command "$0" "$@" -fi - -# -# "mode" selects version, i4 or i8 -# default is i4 -# this can be changed by a file run_marc_defaults -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MODE i8 -# it can also be set by the environmental variable MARC_INTEGER_SIZE -# and by the command line option "-mo" -# -mode= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -f $HOME/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -n "$MARC_INTEGER_SIZE" ; then - mode=$MARC_INTEGER_SIZE -fi -if test -z "$mode" ; then - mode=i4 -fi -case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "error, version mode must be i4 or i8" - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i4 or i8" - echo " " - echo " use -mo i4 or -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - setmode=true - fi - if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - fi - if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -done - -# set to i4 version for 32 bit Linux -if test "`uname -s`" = "Linux"; then - if test "`uname -m`" = "i686"; then - mode=i4 - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -fi - - -. "$DIR/getarch" - -# Change_me -. $MARC_INCLUDE -# - -# -# Dynamically determine the echo syntax -# - -case "`echo '\c'`" in - '\c') - ECHO='echo -n' - ECHOTXT=' ' - ;; - *) - ECHO='echo' - ECHOTXT=' \c' - ;; -esac - -# -# Variables for the MARC environment -# - -PRODUCT="Marc" -EXITMSG=$MARC_TOOLS/MESSAGES -export EXITMSG -FLEXDIR=$DIR/../flexlm/licenses -export FLEXDIR -TIMCHK=3600 -export TIMCHK -BINDIR=$MARC_BIN -export BINDIR -AFMATDAT=$MARC_RUNTIME/AF_flowmat/ -export AFMATDAT -# -# define directory path to global unified material database -# -MATFILE= -export MATFILE - -# -# define memory limit -# first set to MEMLIMIT from include -# -ml option overrules if specified -memlimit=$MEMLIMIT -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -# -if test $MACHINENAME = "HP" -then - SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH - export SHLIB_PATH -fi -# the one for IBM is defined futher down - -LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH -LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH -export LD_LIBRARY_PATH -export LD_LIBRARY64_PATH -export LD_LIBRARYN32_PATH - -atexit() { -kill -15 $$ -# -if test $MPITYPE = "myrinet" -then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi -fi -} - -trap "atexit" 2 - -# -# defaults -# - -prog=marc -exefile=marc -jid= -rid= -pid= -sid= -did= -vid= -user= -usersnoext= -objs= -qid=background -cpu= -priority= -att= -trk= -verify=yes -prgsav=no -rmdll=no -cpdll=no -progdll= -pathdll= -error= -nprocd=0 -nprocdddm=1 -nprocdddmprint= -icreated=0 -nprocdarg= -nsolver=0 -nsolverarg=-ns -if test $nprocds -then - if test $nprocds -gt 1 - then - nprocdddm=$nprocds - nprocdddmprint=$nprocds - icreated=1 - nprocdarg=-nprocds - fi -fi -nthread=-1 -gpuids= -nauto=0 -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -nthreadprint=0 -itree=0 -iam= -link= -trkrun=0 -DIRJOB=`pwd` -DIRSCR=$DIRJOB -DIRSCRSET= -autoforge=0 -dotdat=.dat -dotdefhost=.defhost -host= -numhost= -mfile= -userhost= -makebdf= -cpinput=yes -cpresults=yes -marcdll=libmarc.$EXT_DLL -# define hostname and strip off extensions (alpha.aaa.com) -thishost=`hostname` -thishost=${thishost%%.*} -compatible=unknown -numfield=1 -justlist= -feature= -mpioption=false -MDSRCLIB=$MARC_LIB/mdsrc.a -# -# check run_marc_defaults file for default MPI setting -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MPI -# -value= -file= -if test -f $DIRSCRIPT/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$DIRSCRIPT/run_marc_defaults - fi -fi -if test -f $HOME/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$HOME/run_marc_defaults - fi -fi -if test -n "$value"; then - MARC_MPITYPE=$value - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - echo " " - echo " error, incorrect option for MARC_MPI" - echo " defined in $file: $MARC_MPITYPE" - echo " valid options: $MPI_DEFAULT $MPI_OTHER" - echo " " - exit - fi - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - fi -fi -# -# -# allow scratch directory to be specified with environmental variable -# MARCSCRATCH -if test $MARCSCRATCH -then - if test -d $MARCSCRATCH - then - DIRSCR=$MARCSCRATCH - else - echo "error, scratch directory '$MARCSCRATCH'" - echo " specified via environmental variable MARCSCRATCH does not exist" - exit - fi -fi -# -############################################################################## -# parse input - arguments always come in pairs # -############################################################################## - -arg=$1 -if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - shift - arg=$1 -fi -while [ -n "$arg" ] -do - shift - value=$1 - case $arg in - -al* | -AL*) - LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - $MARC_BIN/marc -alloc 1 - exit - ;; - -li* | -LI*) - justlist=yes - ;; - -fe* | -FE*) - feature=$value - ;; - -pr* | -PR*) - if test `dirname $value` = '.' - then - prog=`$BASENAME $value .marc` - progdll=`$BASENAME $value` - else - prog=`dirname $value`/`$BASENAME $value .marc` - progdll=`dirname $value`/`$BASENAME $value` - fi - prdir=`dirname $value` - case $prdir in - \/*) - ;; - *) - prog=`pwd`/$prdir/$prog - ;; - esac - ;; - -j* | -J*) - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - ;; - -r* | -R*) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - -si* | -SI*) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - -pi* | -PI*) - if test -f $value.t19 - then - pid=`$BASENAME $value .t19` - else - pid=`$BASENAME $value .t16` - fi - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - -bdf | -BDF) - makebdf=1 - ;; - -de* | -DE*) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - -vf | -VF) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - -u* | -U*) - - user=$value - - - - - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - -obj | -OBJ) - objs="$value" - ;; - -q* | -Q*) - qid=$value - ;; - -b* | -B*) - case $value in - y* | Y*) - qid=background - ;; - n* | N*) - qid=foreground - ;; - *) - ;; - esac - ;; - -at | -AT) - att=$value - ;; - -cpu* | -CPU*) - cpu=$value - ;; - -pq | -PQ*) - priority=$value - ;; - -v* | -V*) - verify=$value - ;; - -sa* | -SA*) - prgsav=$value - ;; - -np* | -NP*) - nprocdddm=$value - nprocdddmprint=$value - case $arg in - -nps* | -NPS* | -nprocds* | -NPROCDS*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - case $arg in - -np | -NP | -nprocd | -NPROCD) - icreated=0 - nprocdarg=-nprocd - ;; - esac - ;; - -ns* | -NS*) - nsolver=$value - ;; - -nt* | -NT*) - nthread=$value - ;; - -gp* | -GP*) - gpuids=$value - ;; - -it* | -IT*) - itree=$value - ;; - -iam | -IAM) - iam=$value - ;; - -au* | -AU*) - nauto=$value - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -me | -ME ) - mesh=$value - ;; - -ml | -ML ) - memlimit=$value - ;; - -mo | -MO ) - ;; - -mpi | -MPI ) - mpioption=true - MARC_MPITYPE=$value - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - fi - fi - ;; - -dir* | -DIR*) - DIRJOB=$value - case $DIRJOB in - \/*) - ;; - *) - DIRJOB=`pwd`/$DIRJOB - ;; - esac - if test -z "$DIRSCRSET" - then - DIRSCR=$DIRJOB - fi - ;; - -sd* | -SD*) - DIRSCR=$value - DIRSCRSET=yes - case $DIRSCR in - \/*) - ;; - *) - DIRSCR=`pwd`/$DIRSCR - ;; - esac - ;; - -ho* | -HO*) - host=$value - ;; - -co* | -CO*) - compatible=$value - ;; - -ci* | -CI*) - cpinput=$value - ;; - -cr* | -CR*) - cpresults=$value - ;; - *) - error="$error -$arg: invalid option" - break - ;; - esac - case $value in - -*) - error="$error -$arg: invalid name $value" - break - ;; - esac - shift - arg=$1 - if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - shift - arg=$1 - fi -done -argc=`expr $# % 2` -if test $argc -eq 1 -then -# -# odd number of arguments -# - error="$error -argument list incomplete" -fi - -if test $nprocdddm -gt 0 -then -nprocd=$nprocdddm -fi - -if test $nsolver -gt 0 -then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi -fi - -if test $nthread -eq -1 -then -nthread=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nthread -lt 0 -then -nthread=0 -fi - -nthreadprint=$nthread -if test $nthreadprint -eq 0 -then -nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi -fi - -nthread=$nthreadprint - -gpuoption= -if test "$gpuids" = "" ; then - gpuoption= -else - gpuoption="-gp $gpuids" -fi - -if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH -else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH -fi -# Linux 64 + HPMPI, Below code is taken from include_linux64 -if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" -then -export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" -fi - -if test $nprocd -gt 1; then - if test -f $jid$dotdefhost; then - if test "$host" = ""; then - host=$jid$dotdefhost - fi - fi - if test -f hostfile_qa_$nprocd; then - if test "$host" = ""; then - host=hostfile_qa_$nprocd - fi - fi -fi - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then - dotdat=.inp - fi - - if test "$progdll"; then - /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll - rmdll=yes - pathdll=yes - progdll=${progdll}_$marcdll - else - progdll=$marcdll - fi - - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - pathdll=yes - fi -fi - -############################################################################## -# check parameter validity # -############################################################################## - -while test forever; do - -# -# check for input file existence -# -if test $nprocdddm -gt 1 -a $icreated -eq 0; then - if test ! -f $DIRJID/1$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/1$jid$dotdat not accessible" - fi - fi -else - if test ! -f $DIRJID/$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/$jid$dotdat not accessible" - fi - fi -fi - if test $nprocd -gt 1; then - if test "$host" ; then - if test ! -f $host; then - error="$error -host name file $host not accessible" - fi - fi - fi - -# -# check if the job is already running in the background -# -if test -f $DIRJOB/$jid.pid; then - error="$error -job is already running (the file $jid.pid exists)" -fi - -# -# if the program name is other than marc, then -# assume that this is a program in the users local directory -# - -bd=$MARC_BIN/ - -case $prog in - marc | MARC | $exefile) - program=$exefile - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - if test ! -f $user - then - error="$error -user subroutine file $user not accessible" - fi - fi - if test "$objs" - then - missingobjs= - for o in $objs - do - if test ! -f "$o" - then - if test -z "$missingobjs" - then - missingobjs="$o" - else - missingobjs="$missingobjs $o" - fi - fi - done - if test -n "$missingobjs" - then - error="$error -user object/library file(s) $missingobjs not accessible" - fi - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$vid" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRVID/1$vid.vfs - then - error="$error -view factor file $DIRVID/1$vid.vfs not accessible" - fi - else - if test ! -f $DIRVID/$vid.vfs - then - error="$error -view factor file $DIRVID/$vid.vfs not accessible" - fi - fi - fi - if $mpioption - then - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" - fi - fi - ;; - *) - program=$prog.marc - case $prog in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - error="$error -program option may not be used with user subroutine" - fi - if test "$objs" - then - error="$error -program option may not be used with user objects or libraries" - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$nauto" - then - if test $nauto -gt 2 - then - error="$error -incorrect option for auto restart " - fi - fi - if test "$ndcoup" - then - if test $ndcoup -gt 3 - then - error="$error -incorrect option for contact decoupling " - fi - fi - if test "$ndytran" - then - if test $ndytran -gt 1 - then - error="$error -incorrect option for Marc-Dytran Switch " - fi - fi - if $mpioption - then - if test ! -x $MARC_BIN/$exefile - then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE " - fi - fi - ;; -esac - -############################################################################## -# check argument integrity # -############################################################################## - -if test "$jid" -then - : -else - error="$error -job id required" -fi - -if test $nprocd -gt 1 -then - if test $nauto -gt 0 - then - error="$error -cannot run DDM job with auto restart (-au) option " - fi -fi -case $qid in - S* | s*) - qid=short - ;; - L* | l*) - qid=long - ;; - V* | v*) - qid=verylong - ;; - B* | b*) - qid=background - ;; - F* | f*) - qid=foreground - ;; - A* | a*) - qid=at - ;; - *) - error="$error -bad value for queue_id option" - ;; -esac - -case $prgsav in - N* | n*) - prgsav=no - ;; - Y* | y*) - prgsav=yes - ;; - *) - error="$error -bad value for save option" - ;; -esac - -case $verify in - N* | n*) - verify=no - ;; - Y* | y*) - verify=yes - ;; - *) - error="$error -bad value for verify option" - ;; -esac - -case $nprocdddm in - -* ) - error="$error -bad value for nprocd option" - ;; -esac - -case $nthread in - -* ) - error="$error -bad value for nthread option" - ;; -esac - -case $itree in - -* ) - error="$error -bad value for itree option" - ;; -esac -case $iam in - -* ) - error="$error -bad value for iam option" - ;; -esac -case $compatible in - N* | n*) - compatible=no - ;; - Y* | y*) - compatible=yes - ;; - unknown) - ;; - *) - error="$error -bad value for comp option" - ;; -esac -case $cpinput in - N* | n*) - cpinput=no - ;; - Y* | y*) - cpinput=yes - ;; - *) - error="$error -bad value for copy input option" - ;; -esac -case $cpresults in - N* | n*) - cpresults=no - ;; - Y* | y*) - cpresults=yes - ;; - *) - error="$error -bad value for copy results option" - ;; -esac - -# -# check for external file to run -# -if test -f $MARC_TOOLS/run_marc_check -then - . $MARC_TOOLS/run_marc_check -fi - -# -# pick up version data from bin/VERSION if it exists -# -if test -f $MARC_BIN/VERSION; then - ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` - if test -n "$ppp" ;then - PRODUCT=$ppp - fi - ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` - if test -n "$ppp" ;then - REVISION=", Build $ppp" - fi -fi -############################################################################## -# interact with the user to get the required information to run marc or # -# other marc system program # -############################################################################## - -deletelog=yes -if test $qid = background -a $verify = no -then -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto " > $jid.log -deletelog=no -fi -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto" - - -case $qid in - s* | S* | l* | L* | v* | V* ) - echo \ -"Queue priority : $priority -Queue CPU limit : $cpu -Queue start time : $att" - ;; -# * ) -# echo \ -#" " -# ;; -esac - -if test "$error" -then - if test $verify = yes - then - $ECHO "$error - -Please correct or quit(correct,quit,): $ECHOTXT" - error= - read answer - case $answer in - q* | Q*) - answer=quit - ;; - *) - answer=correct - ;; - esac - else - $ECHO "$error - $ECHOTXT" - echo " " - if test "$deletelog" = no - then - $ECHO "$error - $ECHOTXT" >> $jid.log - echo " " >> $jid.log - fi - answer=quit - fi -else - if test $verify = yes - then - $ECHO " -Are these parameters correct (yes,no,quit,)? $ECHOTXT" - read answer - case $answer in - q* | Q*) - answer=quit - ;; - y* | Y*) - answer=yes - ;; - *) - answer=no - ;; - esac - else - answer=yes - fi -fi - -case $answer in - no | correct) - -############################################################################## -# prompt for each value # -############################################################################## - - $ECHO " -Program name ($prog)? $ECHOTXT" - read value - if test "$value" - then - prog=$value - fi - $ECHO "Job ID ($jid)? $ECHOTXT" - read value - if test "$value" - then - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - fi - $ECHO "User subroutine name ($user)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - user= - ;; - *) - user=$value - - - - - - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - esac - fi - $ECHO "User objects or libraries ($objs)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - objs= - ;; - *) - objs="$value" - ;; - esac - fi - $ECHO "Restart File Job ID ($rid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - rid= - ;; - *) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - esac - fi - $ECHO "Substructure File ID ($sid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - sid= - ;; - *) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - esac - fi - $ECHO "Post File Job ID ($pid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - pid= - ;; - *) - pid=$value - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - esac - fi - $ECHO "Defaults File ID ($did)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - did= - ;; - *) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - esac - fi - $ECHO "View Factor File ID ($vid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - vid= - ;; - *) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - esac - fi - $ECHO "Save generated module ($prgsav)? $ECHOTXT" - read value - if test "$value" - then - prgsav=$value - fi - $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" - read value - if test "$value" - then - nprocdddm=$value - nprocdddmprint=$value - fi - $ECHO "Run on ($nthread) threads ? $ECHOTXT" - read value - if test "$value" - then - nthread=$value - fi - $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" - read value - if test "$value" - then - nsolver=$value - fi -# - if test $nprocdddm -gt 0 - then - nprocd=$nprocdddm - fi - if test $nsolver -gt 0 - then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi - fi - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - nthreadprint=$nthread - if test $nthreadprint -eq 0 - then - nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi - fi -# - $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" - read value - if test "$value" - then - gpuids=$value - fi - if test "$gpuids" = "" ; then - gpuoption= - else - gpuoption="-gp $gpuids" - fi - if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH - fi - if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - fi -# - if test $nprocd -gt 1 - then - $ECHO "Message passing type ($itree)? $ECHOTXT" - read value - if test "$value" - then - itree=$value - fi - $ECHO "Host file name ($host)? $ECHOTXT" - read value - if test "$value" - then - host=$value - fi - if test $nprocdddm -gt 1 - then - $ECHO "Single input file? $ECHOTXT" - read value - case $value in - y* | Y*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" - read value - if test "$value" - then - compatible=$value - fi - $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" - read value - if test "$value" - then - cpinput=$value - fi - $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" - read value - if test "$value" - then - cpresults=$value - fi - fi - fi - $ECHO "Run the job in the queue ($qid)? $ECHOTXT" - read value - if test "$value" - then - qid=$value - fi - case $qid in - s* | S* | l* | L* | v* | V* ) - $ECHO "Queue priority ($priority)? $ECHOTXT" - read value - if test "$value" - then - priority=$value - fi - $ECHO "Job starts at ($att)? $ECHOTXT" - read value - if test "$value" - then - att=$value - fi - $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" - read value - if test "$value" - then - cpu=$value - fi - ;; - * ) - ;; - esac - $ECHO "Auto Restart option ($nauto)? $ECHOTXT" - read value - if test "$value" - then - nauto=$value - fi - $ECHO "Run directory ($DIRJOB)? $ECHOTXT" - read value - if test "$value" - then - DIRJOB=$value - DIRSCR=$DIRJOB - fi - $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" - read value - if test "$value" - then - DIRSCR=$value - fi - ;; - quit) - exit 1 - ;; - *) - break - ;; - -esac - - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - -done - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - pathdll=yes - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - fi - - if test "$pathdll"; then -# -# reset share lib path -# - if test $MACHINENAME = "HP" - then - SHLIB_PATH=$DIRJOB:$SHLIB_PATH - export SHLIB_PATH - fi - if test $MACHINENAME = "IBM" - then - LIBPATH=$DIRJOB:$LIBPATH - export LIBPATH - fi -# - LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH - LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH - LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH - export LD_LIBRARY_PATH - export LD_LIBRARY64_PATH - export LD_LIBRARYN32_PATH - fi -fi -# end of dllrun>0 - - -if test $program = $exefile -o $program = $prog.marc -then - -# delete the old .log file unless we run in the background -if test "$deletelog" = yes -then - /bin/rm $jid.log 2>/dev/null -else - echo - echo running the job in the background, see $jid.log - echo -fi - -# -# check if this is an autoforge or rezoning or radiation job -# -if test $nprocd -eq 1 -then - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` - if test "$line" - then - autoforge=1 - fi -fi -# -# check that jobname for restarted run is not the same -# as restart file basename -# -if test "$rid" -then - if test "$jid" = "$rid" - then - echo " " - echo "ERROR: job name of current run is the same as job name" - echo " of the restarted job" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "ERROR: job name of current run is the same as job name" >> $jid.log - echo " of the restarted job" >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi -fi - -# -# user objects/libraries used -# - - if test "$objs" - then - program="$DIRJOB/$jid.marc" - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# user subroutine used -# -# add DAMASK options for linking - DAMASK="" - - if test "$user" - then - program=$usernoext.marc - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# Special case for IBM using POE but not an SP machine -# in this case we always need a host file, also for serial jobs. -# -if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP -then - MP_HOSTFILE=${jid}.host - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $nprocd -gt 1 - then - numdom=$nprocd - while test $numdom -gt 0 - do - hostname -s >> $MP_HOSTFILE - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - else - hostname -s > $MP_HOSTFILE - fi -fi -# -# check ssh for all hosts in host file -# -if test $nprocd -gt 1 -then -if test $MPITYPE = "intelmpi" -a "$INTELMPI_VERSION" = "HYDRA" - then -# get host list - if test "$host" - then - line=`grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' | uniq` -# count failing hosts - counter=0 - for i in $line - do - $RSH -o BatchMode=yes -o ConnectTimeout=10 $i uname -n - status=$? - if [[ $status != 0 ]] ; then - counter=$((counter+1)) - if [ "$counter" = "1" ]; then - echo " " - echo " error - connection test failed... " - echo " " - fi - echo " " - echo " connection test with ssh failed on host $i" - echo " check the following command: ssh $i uname -n " - echo " " - fi - done -# echo error message and quit - if test $counter -ne 0 - then - echo " " - echo " A parallel job using IntelMPI cannot be started. " - echo " The ssh command must be working correctly between " - echo " the computers used in the analysis. Furthermore, " - echo " it must be set up such that it does not prompt the " - echo " user for a password. Note that this is the case " - echo " also for running on a single machine. " - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo " A parallel job using IntelMPI cannot be started. ">> $jid.log - echo " The ssh command must be working correctly between ">> $jid.log - echo " the computers used in the analysis. Furthermore, ">> $jid.log - echo " it must be set up such that it does not prompt the ">> $jid.log - echo " user for a password. Note that this is the case ">> $jid.log - echo " also for running on a single machine. ">> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - else - counter=1 -# test ssh `hostname` - if test $counter -ne 0 - then - line=`hostname` - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi -# test ssh `hostname` - if test $counter -ne 0 - then - line=`hostname -s` - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi -# test ssh localhost - if test $counter -ne 0 - then - line=localhost - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi - if test $counter -ne 0 - then - echo " error - connection test failed... " - echo " " - echo " ssh needs to work on the machine without asking for a password." - echo " check the following command: ssh localhost uname -n" - echo " " - echo " A parallel job using IntelMPI cannot be started. " - echo " The ssh command must be working correctly between " - echo " the computers used in the analysis. Furthermore, " - echo " it must be set up such that it does not prompt the " - echo " user for a password. Note that this is the case " - echo " also for running on a single machine. " - echo " " - if test "$deletelog" = no - then - echo " error - connection test failed... " >> $jid.log - echo " " >> $jid.log - echo " ssh needs to work on the machine without asking for a password." >> $jid.log - echo " check the following command: ssh localhost uname -n" >> $jid.log - echo " " >> $jid.log - echo " A parallel job using IntelMPI cannot be started. " >> $jid.log - echo " The ssh command must be working correctly between " >> $jid.log - echo " the computers used in the analysis. Furthermore, " >> $jid.log - echo " it must be set up such that it does not prompt the " >> $jid.log - echo " user for a password. Note that this is the case " >> $jid.log - echo " also for running on a single machine. " >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - echo $line $nprocd > $jid.hosts - host=$jid.hosts - fi - fi -fi -fi -# -# check correctness of host file; fix for user sub -# - if test $nprocd -gt 1 - then - -# construct the path name to the executable (execpath) - execpath=$MARC_BIN/$exefile - usersub=0 - if test $program = $prog.marc - then - execpath=$prog.marc - usersub=1 - fi - if test "$objs" - then - execpath="$DIRJOB/$jid.marc" - usersub=1 - fi - if test "$user" - then - execpath=$usernoext.marc - usersub=1 - fi - export execpath - execname=`$BASENAME $execpath` - - if test "$host" - then - userhost=$host - case $userhost in - \/* | \.\/*) - ;; - *) - userhost=`pwd`/$userhost - ;; - esac - -# check that the number of processes specified in the hostfile is -# equal to nprocd specified by -nprocd. - numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` - if test $nprocd -ne $numproc - then - echo " " - echo "error, the number of processes specified in the host file" - echo "must be equal to the number of processes given by -nprocd/-nsolver" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, the number of processes specified in the host file" >> $jid.log - echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - -# check for Myrinet that the number of processes per host is -# less than number of available user ports, 5 -# .gmpi directory must exist in user's home directory -# and must have write permission from remote hosts - if test $MPITYPE = "myrinet" - then - numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` - if test $numproc -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes specified " - echo "in the hostfile must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes specified " >> $jid.log - echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - if test ! -d ~/.gmpi - then - echo " " - echo "error, for Myrinet a .gmpi directory must exist " - echo "under the user's home directory" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log - echo "under the user's home directory" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - homedir=`echo ~` - for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - echo " " - echo "error, for Myrinet a shared .gmpi directory must exist " - echo "under the user's home directory " - echo "with remote write permission" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log - echo "under the user's home directory " >> $jid.log - echo "with remote write permission" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - /bin/rm tmp.$$ - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - fi - fi - done - fi - fi - -# construct the host file $jid.host which is used by mpirun -# skip lines starting with # and only consider lines with more than -# one word in them. Note that the hostfile given to this script -# has two columns: the host name and the number of shared processes -# to run on this host. mpirun wants the number of _other_ -# processes to run in addition to the one being run on the machine -# on which the job is started. hence the $2-1 for fnr == 1. - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then -# HPMPI or HP hardware MPI - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ - -v mpihpspecial="$MPIHPSPECIAL" \ -'{if ( NF > 0) {\ - fnr++ ; \ - printf("-h %s -np %s",$1,$2); \ - printf(" %s",mpihpspecial); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ - if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ - }\ - }' > $jid.host -# end HPMPI or HP hardware MPI - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then -# IBM using hardware MPI (POE) - MP_HOSTFILE=$jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host -# end IBM using hardware MPI (POE) -# for Intel MPI, need to create a machinefile for DMP - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then -# Intel MPI - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - /bin/cp $host $jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Intel MPI for DMP -# for Solaris HPC 7.1, need to create a machinefile for DMP - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then -# Solaris HPC 7.1 - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Solaris HPC 7.1 for DMP -# for Myrinet, construct a configuration file in ~/.gmpi -# this must be readable by each process -# format is (hostname) (port number) for each process - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - grep -v '^#' $host | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ -{if ( NF > 0 ) \ - for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ -}' >> ~/.gmpi/$jid.host - else -# this is for mpich-1.2.5 and later, using the -pg option -# format: host nproc executable user arguments -# the arguments are added later - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s %s\n",path,user);\ - if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ - }\ - }' > $jid.host - fi -# end Myrinet - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then -# Compaq MPI via Memory Channel - grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host -# end Compaq MPI - else -# MPICH - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ - }\ - }' > $jid.host - fi -# define the variable host and host_filt -# host_filt is used for loops over hosts -# for Myrinet we need to use a filtered variant of userhost -# for others we can use $host - if test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - host=~/.gmpi/$jid.host - host_filt=$jid.host_tMp - grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt - else - host=$jid.host - host_filt=$host - fi - else - host=$jid.host - host_filt=$host - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - host_filt=$jid.mfile - fi - fi -# figure out if the machines in the hostfile are nfs mounted -# or distributed and set the variable "dirstatus" accordingly. -# only perform the check if user subroutine is used -# or a user subroutine executable is used - - numfield=1 - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - numfield=2 - fi - DIR1=$DIRJOB - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - counter=0 - echo " " - echo "checking if local or shared directories for host" - if test "$deletelog" = no - then - echo "checking if local or shared directories for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - dirstatus[$counter]="shared" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - dirstatus[$counter]="local" - /bin/rm tmp.$$ - else - if test ! -f $jid.$$ - then - dirstatus[$counter]="local" - $RSH $i /bin/rm $DIR1/$jid.$$ - else - /bin/rm $jid.$$ - fi - fi - if test -f tmp.$$ - then - /bin/rm tmp.$$ - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - echo " ${dirstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${dirstatus[$counter]}" >> $jid.log - fi - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - fi - -# figure out if this is a compatible set of machines -# unless explicitly specified with flag -comp -# only perform the check if user subroutine is used -# or a user subroutine executable is used -# Myrinet does not support heterogeneous - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - if test $compatible = "unknown" - then - thisname=$ARCH - compatible=yes - counter=0 - echo "checking if machines are compatible for host" - if test "$deletelog" = no - then - echo "checking if machines are compatible for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]="yes" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - othername=`$RSH $i uname -a | cut -f 1 -d " "` - if test $thisname != $othername - then - compatible=no - compstatus[$counter]="no" - fi - fi - echo " ${compstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${compstatus[$counter]}" >> $jid.log - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - else - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]=$compatible - fi - done - if test $compatible = "no" - then - echo "all machines assumed incompatible" - if test "$deletelog" = no - then - echo "all machines assumed incompatible" >> $jid.log - fi - else - echo "all machines compatible" - if test "$deletelog" = no - then - echo "all machines compatible" >> $jid.log - fi - fi - fi -# error out if user objects or libraries are used on incompatible machines - if test "$compatible" = "no" -a -n "$objs" - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" - if test "$deletelog" = no - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log - fi - exit 1 - fi -# modify new host file if NFS mounted heterogeneous machine - doit= - if test $program = $prog.marc - then - doit=yes - fi - if test "$user" - then - doit=yes - fi - if test "$doit" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - $AWK -v hst=$i '{fnr++ ; \ -if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ -printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} - /bin/mv $jid.host{$$} $jid.host - host=$jid.host - fi - fi - done - fi - fi # if test $program = $prog.marc -o $user -o $obj - - else # if test $host - # assume shared memory machine if no hostfile given and - # MPITYPE is set to mpich or Myrinet - # check for Myrinet that the total number of processes is - # less than number of available user ports, 5 - if test $MPITYPE = "mpich" -o $MPITYPE = "scali" - then - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - host=$jid.host - elif test $MPITYPE = "myrinet" - then - if test $nprocd -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes " - echo "must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes " >> $jid.log - echo "must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - echo `hostname` $nprocd | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ - {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ -' >> ~/.gmpi/$jid.host - host=~/.gmpi/$jid.host - else - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - - fi - fi # if test myrinet - - fi # if test $host - - fi # if test $nprocd -gt 1 - -fi # if test $program = $exefile -o $program = $prog.marc - -############################################################################## -# construct run stream (Marc only) # -############################################################################## - -# set maximum message length for ddm to a large number -# for vendor provided mpi -if test $itree -eq 0 -a $MPITYPE = hardware -then - itree=100000000 - if test $MACHINENAME = SGI - then - itree=100000001 - fi -fi -if test $itree -eq 0 -a $MPITYPE = hpmpi -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = myrinet -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = nec -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = scali -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = intelmpi -then - itree=100000000 -fi -if test $nprocdddm -lt 2 -then - nprocdarg= -else - nprocdarg="$nprocdarg $nprocdddm" -fi -if test $nsolver -eq 0 -then - nsolverarg= -else - nsolverarg="$nsolverarg $nsolver" -fi -if test $nprocdddm -lt 2 -a $nsolver -eq 0 -then -nprocd=0 -fi -if test $nprocd -gt 0 -then - if test "$host" - then - if test -z "$RUN_JOB2" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then - RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" - RUN_JOB=" -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - numhost=`uniq $jid.mfile | wc -l` - if test "$INTELMPI_VERSION" = "HYDRA" - then - RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n $numhost -r $RSH -f $jid.mfile - RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" - fi - -# intelmpi uses configfile. format: -# -host host1 -n n1 executable marcargs -# one such line per host -# collect the marcargs in RUN_JOB and construct the config file later -# collect the run stream in RUN_JOB_TMP - RUN_JOB="-jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - - - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then - RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - if test "$userhost" - then - RUN_JOB="$RUN_JOB -mhost $userhost" - fi - if test $MPITYPE = "scali" - then -# set default working directory to /tmp to allow -# different directory names - SCAMPI_WORKING_DIRECTORY=/tmp - export SCAMPI_WORKING_DIRECTORY - fi - else - if test -z "$RUN_JOB1" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - RUNNPROCD=$nprocd - if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" - then - RUNNPROCD= - MP_PROCS=$nprocd - export MP_PROCS - fi - if test $MPITYPE = "myrinet" - then - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n 1 -f $jid.hosts - fi - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - fi -else - if test $nauto -gt 0 -o $ndcoup -gt 0 - then - RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - else -# this is for a serial job without auto restart: - RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi -fi -if test "$rid" -then - RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" -fi -if test "$pid" -then - RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" -fi -if test "$sid" -then - RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" -fi -if test "$did" -then - RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" -fi -if test "$vid" -then - RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" -fi -if test $nauto -gt 0 -then - RUN_JOB="$RUN_JOB -autorst $nauto " -fi -if test $ndcoup -gt 0 -then - RUN_JOB="$RUN_JOB -dcoup $ndcoup " -fi -if test $ndytran -gt 0 -then - RUN_JOB="$RUN_JOB -dytran $ndytran " -fi -if test $mesh -gt 0 -then - RUN_JOB="$RUN_JOB -me $mesh " -fi -if test $noutcore -gt 0 -then - RUN_JOB="$RUN_JOB -outcore $noutcore " -fi -if test "$dllrun" -gt 0 -then - RUN_JOB="$RUN_JOB -dll $dllrun " -fi -if test "$trkrun" -gt 0 -then - RUN_JOB="$RUN_JOB -trk $trkrun " -fi -if test "$iam" -then - RUN_JOB="$RUN_JOB -iam $iam " -fi -if test "$justlist" -then - RUN_JOB="$RUN_JOB -list 1 " -fi -if test "$feature" -then - RUN_JOB="$RUN_JOB -feature $feature " -fi -if test "$memlimit" -ne 0 -then - RUN_JOB="$RUN_JOB -ml $memlimit " -fi -if test "$cpinput" -then - RUN_JOB="$RUN_JOB -ci $cpinput " -fi -if test "$cpresults" -then - RUN_JOB="$RUN_JOB -cr $cpresults " -fi -if test "$DIRSCR" != "$DIRJOB" -then - RUN_JOB="$RUN_JOB -dirscr $DIRSCR" -else - DIRSCR=$DIRJOB -fi -if test "$makebdf" -then - RUN_JOB="$RUN_JOB -bdf $makebdf " -fi -if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" -then - # append $RUN_JOB to all lines of the host file - # and set RUN_JOB - $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ - /bin/mv $host.$$ $host - RUN_JOB=$RUN_JOB_TMP -fi -if test $MPITYPE = "intelmpi" -a "$host" -then - # construct config file, append $RUN_JOB to all lines of the config file - # and set RUN_JOB - if test "$INTELMPI_VERSION" = "HYDRA" - then - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - else - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-host %s -n %s",$1,$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - fi - RUN_JOB=$RUN_JOB_TMP -fi -echo " " -echo "Final run stream value" -echo " RUNJOB="$RUN_JOB -if test "$deletelog" = no -then -echo " " >> $jid.log -echo "Final run stream value" >> $jid.log -echo " RUNJOB="$RUN_JOB >> $jid.log -fi - - -############################################################################## -# run marc using valgrind # -############################################################################## -#RUN_JOB="valgrind $RUN_JOB" -#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" -############################################################################## - - -############################################################################## -# run the requested program in a queue # -############################################################################## - -if test "$deletelog" = yes -then - echo - date -else - echo >> $jid.log - date >> $jid.log -fi -if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] -then - -/bin/rm -f $jid.runmarcscript - - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - userobj=$usernoext.o - fi - cat > $jid.runmarcscript << END4 - if test "$user" - then - if test $MACHINENAME = "CRAY" - then - $DFORTLOWMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTLOWMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $MARCCUDALIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } -END4 -else - prgsav=yes -fi -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# - -cat >> $jid.runmarcscript << END5 - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -# first remove all .out files and incremental restart files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null - /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null -fi - -if test $nprocdddm -gt 1 -then - $RUN_JOB 2>>$jid.log -else - $RUN_JOB 2>>$jid.log -fi - -if test $dllrun -eq 0; then - if test $prgsav = no - then - /bin/rm -f $bd$program 2>/dev/null - fi -else - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes - then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -END5 - - -# Submit to marc batch queue -# -if [ $qid = at ] -then -QUENAME=at -SUBMCMD= -else -# -# Submit to qsub queue -# -QUENAME=qsub -SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" -if test "$priority" -then - SUBMCMD=$SUBMCMD" -p $priority" -fi -if test "$att" -then - SUBMCMD=$SUBMCMD" -a $att" -fi -if test "$cpu" -then - SUBMCMD=$SUBMCMD" -lt $cpu" -fi - -fi -echo $QUENAME $SUBMCMD -#cat $jid.runmarcscript -$QUENAME $SUBMCMD < $jid.runmarcscript - -/bin/rm -f $jid.runmarcscript - -############################################################################## -# run the requested program in the background # -############################################################################## - -else -if test $qid = background -then - -# -# first remove all old .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi -# -# compile user subroutine if present -# -( -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_lmp $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - echo " $PRODUCT Exit number 3" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTLOWMP $user || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTLOWMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - echo " $PRODUCT Exit number 3" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc - -# - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -$RUN_JOB & - -marcpid=$! -echo $marcpid > $DIRJOB/$jid.pid -wait $marcpid - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - if test "$host" - then - /bin/rm $jid.mfile 2> /dev/null - /bin/rm $jid.hosts 2> /dev/null - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.cfile 2> /dev/null - fi - fi - fi -fi - - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -) 1>>$jid.log 2>&1 & - - -############################################################################## -# run the requested program in the foreground # -############################################################################## - -else - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_lmp $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTLOWMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTLOWMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi -# first remove all .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi - -$RUN_JOB - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - if test "$host" - then - /bin/rm $jid.mfile 2> /dev/null - /bin/rm $jid.hosts 2> /dev/null - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.cfile 2> /dev/null - else - echo " " > /dev/null - fi - else - if test "$host" - then - mpdcleanup -a -f $jid.mfile - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.mfile 2> /dev/null - else - mpdcleanup -a -f $jid.hosts - /bin/rm $jid.hosts 2> /dev/null - fi - fi - fi -fi - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi - - -fi -fi diff --git a/installation/mods_MarcMentat/2013/Marc_tools/run_damask_mp b/installation/mods_MarcMentat/2013/Marc_tools/run_damask_mp deleted file mode 100644 index 7481797e4..000000000 --- a/installation/mods_MarcMentat/2013/Marc_tools/run_damask_mp +++ /dev/null @@ -1,3849 +0,0 @@ -#!/bin/ksh -############################################################################## -# # -# run_marc - run a marc job # -# ------------------------- # -# # -# usage: run_marc -j jid { options } # -# # -# where standard options are: required: defaults: # -# -------------------------- # -# # -# -j* jid job id number. ** YES ** . # -# -pr* prog program name. . marc # -# -v* y|n do or do not verify inputs. . yes # -# -q* s|l|v|b|f batch queue name or background, . short # -# foreground. # -# -b* as alternative to option -q* # -# # -# ( batch queues only : # -# -pq* intra queue priority. . . # -# -at DATE/TIME delay start of job. . . # -# format : January,1,1990,12:31 # -# or : today,5pm # -# -cpu* secs job CPU limit . . ) # -# # -# -r* rid restart file job id. . . # -# -si* sid substructure file id. . . # -# -pi* post post file job id. . . # -# -de* did defaults file . no # -# -vf vid viewfactor . no # -# # -# -u* user user subroutine. . . # -# -obj obj user objects or libraries. . . # -# -sa* y|n do or do not save load module. . no # -# -autorst auto restart flag for auto forge . no # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo selects i4 or i8 version # -# default: i4 or via defaults file run_marc_defaults # -# the -mo option will override # -# -mpi selects MPI version # -# each platform has a default MPI version and some # -# have an alternative version. see the include file # -# for the respective platform # -# MPI_DEFAULT defines the default MPI version # -# MPI_OTHER defines versions one can switch to # -# -dcoup for contact decoupling # -# currently not supported # -# -dir directory where the job i/o should take place. # -# defaults to current directory. # -# -sdir directory where scratch files are created # -# defaults to current directory. # -# # -# -alloc only perform memory allocation test, no analysis # -# -list y only list options in the input file, no analysis # -# -fe num set feature number "num" for the run. only one allowed # -# -dytran flag to switch from Dytran to Marc # -# dytran = 0, program will run w/o Marc-Dytran Switch # -# = 1, program will restart Marc after Dytran run # -# >= 2, Not supported yet. # -# currently not supported # -# -ou force analysis to use out-of-core control # -# =0, not used # -# =1, element storage out-of-core # -# -dll run marc using shared library libmarc.so and exe_marc # -# =1, used # -# =2, do not free streaming input memory # -# =3, run with marc input deck # -# -trk run marc for post-tracking # -# -gpuid run marc using GPGPU capability # -# specify gpuid on to be used in the analysis. Multiple # -# IDs may be assigned for DDM runs. # -# Separate a list of IDs with a colon. Each DMP # -# process will be assigned a GPU ID in round robin fastion# -# = 0 # -# = 0:1 etc... # -# # -# where parallel options are: # -# -------------------------- # -# # -# itree, host, and comp options are available for the domain # -# decomposition only. # -# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # -# # -# # -# -nprocd number of domains. # -# defaults to single domain solution. # -# -nprocds number of domains if single input file. # -# defaults to single domain solution. # -# -nps same as -nprocds. # -# -nsolver number of solver tasks for solver types 12 and 13 # -# these are distributed tasks operating via MPI # -# -nthread number of solver threads for solver types 6, 8, and 11 # -# also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. if both specified, nthread option# -# will be used. # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by 6, 8, and 11 # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor nthread specified. # -# -itree message passing tree type for domain decomposition. # -# for debugging purposes; should not normally be used. # -# -host hostfile name for distributed execution on network. # -# defaults to no hostfile, unless jobid.defhost exists. # -# if jobid.defhost exists, only -np(s) necessary # -# -comp* y|n to be used with user routines on a network of # -# incompatible machines. # -# if set to no, a separate executable will be created # -# for each machine on the network. # -# if set to yes, the executable located on the machine # -# from which marc is started will be used on all machines.# -# defaults to no if O/S versions different on machines. # -# # -# -ci y|n copy input files to remote hosts (default: yes) # -# if "yes", input files are automatically copied to # -# remote hosts for a network run if necessary. # -# -cr y|n copy post files from remote hosts (default: yes) # -# if "yes", post files are automatically copied back from # -# remote hosts for a network run if necessary. # -############################################################################## -# set DIR to the directory in which this script is -REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" -DIR=`dirname $REALCOM` -# make sure DIR has an absolute path -case $DIR in - \/*) - ;; - *) - DIR=`pwd`/$DIR - ;; -esac -DIRSCRIPT=$DIR -AWK=awk -ARCH=`uname -a | cut -f 1 -d " "` -# Sun has a bad awk, use nawk instead -if test $ARCH = "SunOS" -then - AWK=nawk -fi -BASENAME=basename -# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists -if test $ARCH = "SunOS" -then - if test -x /usr/ucb/basename - then - BASENAME=/usr/ucb/basename - fi -fi - -# echo command line in the case of ECHO_COMMAND is true -if test "$ECHO_COMMAND" = true ; then - echo command "$0" "$@" -fi - -# -# "mode" selects version, i4 or i8 -# default is i4 -# this can be changed by a file run_marc_defaults -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MODE i8 -# it can also be set by the environmental variable MARC_INTEGER_SIZE -# and by the command line option "-mo" -# -mode= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -f $HOME/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -n "$MARC_INTEGER_SIZE" ; then - mode=$MARC_INTEGER_SIZE -fi -if test -z "$mode" ; then - mode=i4 -fi -case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "error, version mode must be i4 or i8" - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i4 or i8" - echo " " - echo " use -mo i4 or -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - setmode=true - fi - if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - fi - if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -done - -# set to i4 version for 32 bit Linux -if test "`uname -s`" = "Linux"; then - if test "`uname -m`" = "i686"; then - mode=i4 - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -fi - - -. "$DIR/getarch" - -# Change_me -. $MARC_INCLUDE -# - -# -# Dynamically determine the echo syntax -# - -case "`echo '\c'`" in - '\c') - ECHO='echo -n' - ECHOTXT=' ' - ;; - *) - ECHO='echo' - ECHOTXT=' \c' - ;; -esac - -# -# Variables for the MARC environment -# - -PRODUCT="Marc" -EXITMSG=$MARC_TOOLS/MESSAGES -export EXITMSG -FLEXDIR=$DIR/../flexlm/licenses -export FLEXDIR -TIMCHK=3600 -export TIMCHK -BINDIR=$MARC_BIN -export BINDIR -AFMATDAT=$MARC_RUNTIME/AF_flowmat/ -export AFMATDAT -# -# define directory path to global unified material database -# -MATFILE= -export MATFILE - -# -# define memory limit -# first set to MEMLIMIT from include -# -ml option overrules if specified -memlimit=$MEMLIMIT -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -# -if test $MACHINENAME = "HP" -then - SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH - export SHLIB_PATH -fi -# the one for IBM is defined futher down - -LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH -LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH -export LD_LIBRARY_PATH -export LD_LIBRARY64_PATH -export LD_LIBRARYN32_PATH - -atexit() { -kill -15 $$ -# -if test $MPITYPE = "myrinet" -then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi -fi -} - -trap "atexit" 2 - -# -# defaults -# - -prog=marc -exefile=marc -jid= -rid= -pid= -sid= -did= -vid= -user= -usersnoext= -objs= -qid=background -cpu= -priority= -att= -trk= -verify=yes -prgsav=no -rmdll=no -cpdll=no -progdll= -pathdll= -error= -nprocd=0 -nprocdddm=1 -nprocdddmprint= -icreated=0 -nprocdarg= -nsolver=0 -nsolverarg=-ns -if test $nprocds -then - if test $nprocds -gt 1 - then - nprocdddm=$nprocds - nprocdddmprint=$nprocds - icreated=1 - nprocdarg=-nprocds - fi -fi -nthread=-1 -gpuids= -nauto=0 -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -nthreadprint=0 -itree=0 -iam= -link= -trkrun=0 -DIRJOB=`pwd` -DIRSCR=$DIRJOB -DIRSCRSET= -autoforge=0 -dotdat=.dat -dotdefhost=.defhost -host= -numhost= -mfile= -userhost= -makebdf= -cpinput=yes -cpresults=yes -marcdll=libmarc.$EXT_DLL -# define hostname and strip off extensions (alpha.aaa.com) -thishost=`hostname` -thishost=${thishost%%.*} -compatible=unknown -numfield=1 -justlist= -feature= -mpioption=false -MDSRCLIB=$MARC_LIB/mdsrc.a -# -# check run_marc_defaults file for default MPI setting -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MPI -# -value= -file= -if test -f $DIRSCRIPT/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$DIRSCRIPT/run_marc_defaults - fi -fi -if test -f $HOME/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$HOME/run_marc_defaults - fi -fi -if test -n "$value"; then - MARC_MPITYPE=$value - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - echo " " - echo " error, incorrect option for MARC_MPI" - echo " defined in $file: $MARC_MPITYPE" - echo " valid options: $MPI_DEFAULT $MPI_OTHER" - echo " " - exit - fi - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - fi -fi -# -# -# allow scratch directory to be specified with environmental variable -# MARCSCRATCH -if test $MARCSCRATCH -then - if test -d $MARCSCRATCH - then - DIRSCR=$MARCSCRATCH - else - echo "error, scratch directory '$MARCSCRATCH'" - echo " specified via environmental variable MARCSCRATCH does not exist" - exit - fi -fi -# -############################################################################## -# parse input - arguments always come in pairs # -############################################################################## - -arg=$1 -if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - shift - arg=$1 -fi -while [ -n "$arg" ] -do - shift - value=$1 - case $arg in - -al* | -AL*) - LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - $MARC_BIN/marc -alloc 1 - exit - ;; - -li* | -LI*) - justlist=yes - ;; - -fe* | -FE*) - feature=$value - ;; - -pr* | -PR*) - if test `dirname $value` = '.' - then - prog=`$BASENAME $value .marc` - progdll=`$BASENAME $value` - else - prog=`dirname $value`/`$BASENAME $value .marc` - progdll=`dirname $value`/`$BASENAME $value` - fi - prdir=`dirname $value` - case $prdir in - \/*) - ;; - *) - prog=`pwd`/$prdir/$prog - ;; - esac - ;; - -j* | -J*) - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - ;; - -r* | -R*) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - -si* | -SI*) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - -pi* | -PI*) - if test -f $value.t19 - then - pid=`$BASENAME $value .t19` - else - pid=`$BASENAME $value .t16` - fi - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - -bdf | -BDF) - makebdf=1 - ;; - -de* | -DE*) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - -vf | -VF) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - -u* | -U*) - - user=$value - - - - - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - -obj | -OBJ) - objs="$value" - ;; - -q* | -Q*) - qid=$value - ;; - -b* | -B*) - case $value in - y* | Y*) - qid=background - ;; - n* | N*) - qid=foreground - ;; - *) - ;; - esac - ;; - -at | -AT) - att=$value - ;; - -cpu* | -CPU*) - cpu=$value - ;; - -pq | -PQ*) - priority=$value - ;; - -v* | -V*) - verify=$value - ;; - -sa* | -SA*) - prgsav=$value - ;; - -np* | -NP*) - nprocdddm=$value - nprocdddmprint=$value - case $arg in - -nps* | -NPS* | -nprocds* | -NPROCDS*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - case $arg in - -np | -NP | -nprocd | -NPROCD) - icreated=0 - nprocdarg=-nprocd - ;; - esac - ;; - -ns* | -NS*) - nsolver=$value - ;; - -nt* | -NT*) - nthread=$value - ;; - -gp* | -GP*) - gpuids=$value - ;; - -it* | -IT*) - itree=$value - ;; - -iam | -IAM) - iam=$value - ;; - -au* | -AU*) - nauto=$value - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -me | -ME ) - mesh=$value - ;; - -ml | -ML ) - memlimit=$value - ;; - -mo | -MO ) - ;; - -mpi | -MPI ) - mpioption=true - MARC_MPITYPE=$value - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - fi - fi - ;; - -dir* | -DIR*) - DIRJOB=$value - case $DIRJOB in - \/*) - ;; - *) - DIRJOB=`pwd`/$DIRJOB - ;; - esac - if test -z "$DIRSCRSET" - then - DIRSCR=$DIRJOB - fi - ;; - -sd* | -SD*) - DIRSCR=$value - DIRSCRSET=yes - case $DIRSCR in - \/*) - ;; - *) - DIRSCR=`pwd`/$DIRSCR - ;; - esac - ;; - -ho* | -HO*) - host=$value - ;; - -co* | -CO*) - compatible=$value - ;; - -ci* | -CI*) - cpinput=$value - ;; - -cr* | -CR*) - cpresults=$value - ;; - *) - error="$error -$arg: invalid option" - break - ;; - esac - case $value in - -*) - error="$error -$arg: invalid name $value" - break - ;; - esac - shift - arg=$1 - if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - shift - arg=$1 - fi -done -argc=`expr $# % 2` -if test $argc -eq 1 -then -# -# odd number of arguments -# - error="$error -argument list incomplete" -fi - -if test $nprocdddm -gt 0 -then -nprocd=$nprocdddm -fi - -if test $nsolver -gt 0 -then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi -fi - -if test $nthread -eq -1 -then -nthread=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nthread -lt 0 -then -nthread=0 -fi - -nthreadprint=$nthread -if test $nthreadprint -eq 0 -then -nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi -fi - -nthread=$nthreadprint - -gpuoption= -if test "$gpuids" = "" ; then - gpuoption= -else - gpuoption="-gp $gpuids" -fi - -if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH -else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH -fi -# Linux 64 + HPMPI, Below code is taken from include_linux64 -if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" -then -export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" -fi - -if test $nprocd -gt 1; then - if test -f $jid$dotdefhost; then - if test "$host" = ""; then - host=$jid$dotdefhost - fi - fi - if test -f hostfile_qa_$nprocd; then - if test "$host" = ""; then - host=hostfile_qa_$nprocd - fi - fi -fi - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then - dotdat=.inp - fi - - if test "$progdll"; then - /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll - rmdll=yes - pathdll=yes - progdll=${progdll}_$marcdll - else - progdll=$marcdll - fi - - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - pathdll=yes - fi -fi - -############################################################################## -# check parameter validity # -############################################################################## - -while test forever; do - -# -# check for input file existence -# -if test $nprocdddm -gt 1 -a $icreated -eq 0; then - if test ! -f $DIRJID/1$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/1$jid$dotdat not accessible" - fi - fi -else - if test ! -f $DIRJID/$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/$jid$dotdat not accessible" - fi - fi -fi - if test $nprocd -gt 1; then - if test "$host" ; then - if test ! -f $host; then - error="$error -host name file $host not accessible" - fi - fi - fi - -# -# check if the job is already running in the background -# -if test -f $DIRJOB/$jid.pid; then - error="$error -job is already running (the file $jid.pid exists)" -fi - -# -# if the program name is other than marc, then -# assume that this is a program in the users local directory -# - -bd=$MARC_BIN/ - -case $prog in - marc | MARC | $exefile) - program=$exefile - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - if test ! -f $user - then - error="$error -user subroutine file $user not accessible" - fi - fi - if test "$objs" - then - missingobjs= - for o in $objs - do - if test ! -f "$o" - then - if test -z "$missingobjs" - then - missingobjs="$o" - else - missingobjs="$missingobjs $o" - fi - fi - done - if test -n "$missingobjs" - then - error="$error -user object/library file(s) $missingobjs not accessible" - fi - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$vid" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRVID/1$vid.vfs - then - error="$error -view factor file $DIRVID/1$vid.vfs not accessible" - fi - else - if test ! -f $DIRVID/$vid.vfs - then - error="$error -view factor file $DIRVID/$vid.vfs not accessible" - fi - fi - fi - if $mpioption - then - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" - fi - fi - ;; - *) - program=$prog.marc - case $prog in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - error="$error -program option may not be used with user subroutine" - fi - if test "$objs" - then - error="$error -program option may not be used with user objects or libraries" - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$nauto" - then - if test $nauto -gt 2 - then - error="$error -incorrect option for auto restart " - fi - fi - if test "$ndcoup" - then - if test $ndcoup -gt 3 - then - error="$error -incorrect option for contact decoupling " - fi - fi - if test "$ndytran" - then - if test $ndytran -gt 1 - then - error="$error -incorrect option for Marc-Dytran Switch " - fi - fi - if $mpioption - then - if test ! -x $MARC_BIN/$exefile - then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE " - fi - fi - ;; -esac - -############################################################################## -# check argument integrity # -############################################################################## - -if test "$jid" -then - : -else - error="$error -job id required" -fi - -if test $nprocd -gt 1 -then - if test $nauto -gt 0 - then - error="$error -cannot run DDM job with auto restart (-au) option " - fi -fi -case $qid in - S* | s*) - qid=short - ;; - L* | l*) - qid=long - ;; - V* | v*) - qid=verylong - ;; - B* | b*) - qid=background - ;; - F* | f*) - qid=foreground - ;; - A* | a*) - qid=at - ;; - *) - error="$error -bad value for queue_id option" - ;; -esac - -case $prgsav in - N* | n*) - prgsav=no - ;; - Y* | y*) - prgsav=yes - ;; - *) - error="$error -bad value for save option" - ;; -esac - -case $verify in - N* | n*) - verify=no - ;; - Y* | y*) - verify=yes - ;; - *) - error="$error -bad value for verify option" - ;; -esac - -case $nprocdddm in - -* ) - error="$error -bad value for nprocd option" - ;; -esac - -case $nthread in - -* ) - error="$error -bad value for nthread option" - ;; -esac - -case $itree in - -* ) - error="$error -bad value for itree option" - ;; -esac -case $iam in - -* ) - error="$error -bad value for iam option" - ;; -esac -case $compatible in - N* | n*) - compatible=no - ;; - Y* | y*) - compatible=yes - ;; - unknown) - ;; - *) - error="$error -bad value for comp option" - ;; -esac -case $cpinput in - N* | n*) - cpinput=no - ;; - Y* | y*) - cpinput=yes - ;; - *) - error="$error -bad value for copy input option" - ;; -esac -case $cpresults in - N* | n*) - cpresults=no - ;; - Y* | y*) - cpresults=yes - ;; - *) - error="$error -bad value for copy results option" - ;; -esac - -# -# check for external file to run -# -if test -f $MARC_TOOLS/run_marc_check -then - . $MARC_TOOLS/run_marc_check -fi - -# -# pick up version data from bin/VERSION if it exists -# -if test -f $MARC_BIN/VERSION; then - ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` - if test -n "$ppp" ;then - PRODUCT=$ppp - fi - ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` - if test -n "$ppp" ;then - REVISION=", Build $ppp" - fi -fi -############################################################################## -# interact with the user to get the required information to run marc or # -# other marc system program # -############################################################################## - -deletelog=yes -if test $qid = background -a $verify = no -then -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto " > $jid.log -deletelog=no -fi -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $user -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto" - - -case $qid in - s* | S* | l* | L* | v* | V* ) - echo \ -"Queue priority : $priority -Queue CPU limit : $cpu -Queue start time : $att" - ;; -# * ) -# echo \ -#" " -# ;; -esac - -if test "$error" -then - if test $verify = yes - then - $ECHO "$error - -Please correct or quit(correct,quit,): $ECHOTXT" - error= - read answer - case $answer in - q* | Q*) - answer=quit - ;; - *) - answer=correct - ;; - esac - else - $ECHO "$error - $ECHOTXT" - echo " " - if test "$deletelog" = no - then - $ECHO "$error - $ECHOTXT" >> $jid.log - echo " " >> $jid.log - fi - answer=quit - fi -else - if test $verify = yes - then - $ECHO " -Are these parameters correct (yes,no,quit,)? $ECHOTXT" - read answer - case $answer in - q* | Q*) - answer=quit - ;; - y* | Y*) - answer=yes - ;; - *) - answer=no - ;; - esac - else - answer=yes - fi -fi - -case $answer in - no | correct) - -############################################################################## -# prompt for each value # -############################################################################## - - $ECHO " -Program name ($prog)? $ECHOTXT" - read value - if test "$value" - then - prog=$value - fi - $ECHO "Job ID ($jid)? $ECHOTXT" - read value - if test "$value" - then - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - fi - $ECHO "User subroutine name ($user)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - user= - ;; - *) - user=$value - - - - - - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - usernoext=$user - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for` - usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90` - ;; - esac - fi - $ECHO "User objects or libraries ($objs)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - objs= - ;; - *) - objs="$value" - ;; - esac - fi - $ECHO "Restart File Job ID ($rid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - rid= - ;; - *) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - esac - fi - $ECHO "Substructure File ID ($sid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - sid= - ;; - *) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - esac - fi - $ECHO "Post File Job ID ($pid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - pid= - ;; - *) - pid=$value - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - esac - fi - $ECHO "Defaults File ID ($did)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - did= - ;; - *) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - esac - fi - $ECHO "View Factor File ID ($vid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - vid= - ;; - *) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - esac - fi - $ECHO "Save generated module ($prgsav)? $ECHOTXT" - read value - if test "$value" - then - prgsav=$value - fi - $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" - read value - if test "$value" - then - nprocdddm=$value - nprocdddmprint=$value - fi - $ECHO "Run on ($nthread) threads ? $ECHOTXT" - read value - if test "$value" - then - nthread=$value - fi - $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" - read value - if test "$value" - then - nsolver=$value - fi -# - if test $nprocdddm -gt 0 - then - nprocd=$nprocdddm - fi - if test $nsolver -gt 0 - then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi - fi - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - nthreadprint=$nthread - if test $nthreadprint -eq 0 - then - nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi - fi -# - $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" - read value - if test "$value" - then - gpuids=$value - fi - if test "$gpuids" = "" ; then - gpuoption= - else - gpuoption="-gp $gpuids" - fi - if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH - fi - if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - fi -# - if test $nprocd -gt 1 - then - $ECHO "Message passing type ($itree)? $ECHOTXT" - read value - if test "$value" - then - itree=$value - fi - $ECHO "Host file name ($host)? $ECHOTXT" - read value - if test "$value" - then - host=$value - fi - if test $nprocdddm -gt 1 - then - $ECHO "Single input file? $ECHOTXT" - read value - case $value in - y* | Y*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" - read value - if test "$value" - then - compatible=$value - fi - $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" - read value - if test "$value" - then - cpinput=$value - fi - $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" - read value - if test "$value" - then - cpresults=$value - fi - fi - fi - $ECHO "Run the job in the queue ($qid)? $ECHOTXT" - read value - if test "$value" - then - qid=$value - fi - case $qid in - s* | S* | l* | L* | v* | V* ) - $ECHO "Queue priority ($priority)? $ECHOTXT" - read value - if test "$value" - then - priority=$value - fi - $ECHO "Job starts at ($att)? $ECHOTXT" - read value - if test "$value" - then - att=$value - fi - $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" - read value - if test "$value" - then - cpu=$value - fi - ;; - * ) - ;; - esac - $ECHO "Auto Restart option ($nauto)? $ECHOTXT" - read value - if test "$value" - then - nauto=$value - fi - $ECHO "Run directory ($DIRJOB)? $ECHOTXT" - read value - if test "$value" - then - DIRJOB=$value - DIRSCR=$DIRJOB - fi - $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" - read value - if test "$value" - then - DIRSCR=$value - fi - ;; - quit) - exit 1 - ;; - *) - break - ;; - -esac - - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - -done - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - pathdll=yes - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - fi - - if test "$pathdll"; then -# -# reset share lib path -# - if test $MACHINENAME = "HP" - then - SHLIB_PATH=$DIRJOB:$SHLIB_PATH - export SHLIB_PATH - fi - if test $MACHINENAME = "IBM" - then - LIBPATH=$DIRJOB:$LIBPATH - export LIBPATH - fi -# - LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH - LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH - LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH - export LD_LIBRARY_PATH - export LD_LIBRARY64_PATH - export LD_LIBRARYN32_PATH - fi -fi -# end of dllrun>0 - - -if test $program = $exefile -o $program = $prog.marc -then - -# delete the old .log file unless we run in the background -if test "$deletelog" = yes -then - /bin/rm $jid.log 2>/dev/null -else - echo - echo running the job in the background, see $jid.log - echo -fi - -# -# check if this is an autoforge or rezoning or radiation job -# -if test $nprocd -eq 1 -then - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` - if test "$line" - then - autoforge=1 - fi -fi -# -# check that jobname for restarted run is not the same -# as restart file basename -# -if test "$rid" -then - if test "$jid" = "$rid" - then - echo " " - echo "ERROR: job name of current run is the same as job name" - echo " of the restarted job" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "ERROR: job name of current run is the same as job name" >> $jid.log - echo " of the restarted job" >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi -fi - -# -# user objects/libraries used -# - - if test "$objs" - then - program="$DIRJOB/$jid.marc" - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# user subroutine used -# -# add DAMASK options for linking - DAMASK="" - - if test "$user" - then - program=$usernoext.marc - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# Special case for IBM using POE but not an SP machine -# in this case we always need a host file, also for serial jobs. -# -if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP -then - MP_HOSTFILE=${jid}.host - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $nprocd -gt 1 - then - numdom=$nprocd - while test $numdom -gt 0 - do - hostname -s >> $MP_HOSTFILE - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - else - hostname -s > $MP_HOSTFILE - fi -fi -# -# check ssh for all hosts in host file -# -if test $nprocd -gt 1 -then -if test $MPITYPE = "intelmpi" -a "$INTELMPI_VERSION" = "HYDRA" - then -# get host list - if test "$host" - then - line=`grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' | uniq` -# count failing hosts - counter=0 - for i in $line - do - $RSH -o BatchMode=yes -o ConnectTimeout=10 $i uname -n - status=$? - if [[ $status != 0 ]] ; then - counter=$((counter+1)) - if [ "$counter" = "1" ]; then - echo " " - echo " error - connection test failed... " - echo " " - fi - echo " " - echo " connection test with ssh failed on host $i" - echo " check the following command: ssh $i uname -n " - echo " " - fi - done -# echo error message and quit - if test $counter -ne 0 - then - echo " " - echo " A parallel job using IntelMPI cannot be started. " - echo " The ssh command must be working correctly between " - echo " the computers used in the analysis. Furthermore, " - echo " it must be set up such that it does not prompt the " - echo " user for a password. Note that this is the case " - echo " also for running on a single machine. " - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo " A parallel job using IntelMPI cannot be started. ">> $jid.log - echo " The ssh command must be working correctly between ">> $jid.log - echo " the computers used in the analysis. Furthermore, ">> $jid.log - echo " it must be set up such that it does not prompt the ">> $jid.log - echo " user for a password. Note that this is the case ">> $jid.log - echo " also for running on a single machine. ">> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - else - counter=1 -# test ssh `hostname` - if test $counter -ne 0 - then - line=`hostname` - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi -# test ssh `hostname` - if test $counter -ne 0 - then - line=`hostname -s` - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi -# test ssh localhost - if test $counter -ne 0 - then - line=localhost - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi - if test $counter -ne 0 - then - echo " error - connection test failed... " - echo " " - echo " ssh needs to work on the machine without asking for a password." - echo " check the following command: ssh localhost uname -n" - echo " " - echo " A parallel job using IntelMPI cannot be started. " - echo " The ssh command must be working correctly between " - echo " the computers used in the analysis. Furthermore, " - echo " it must be set up such that it does not prompt the " - echo " user for a password. Note that this is the case " - echo " also for running on a single machine. " - echo " " - if test "$deletelog" = no - then - echo " error - connection test failed... " >> $jid.log - echo " " >> $jid.log - echo " ssh needs to work on the machine without asking for a password." >> $jid.log - echo " check the following command: ssh localhost uname -n" >> $jid.log - echo " " >> $jid.log - echo " A parallel job using IntelMPI cannot be started. " >> $jid.log - echo " The ssh command must be working correctly between " >> $jid.log - echo " the computers used in the analysis. Furthermore, " >> $jid.log - echo " it must be set up such that it does not prompt the " >> $jid.log - echo " user for a password. Note that this is the case " >> $jid.log - echo " also for running on a single machine. " >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - echo $line $nprocd > $jid.hosts - host=$jid.hosts - fi - fi -fi -fi -# -# check correctness of host file; fix for user sub -# - if test $nprocd -gt 1 - then - -# construct the path name to the executable (execpath) - execpath=$MARC_BIN/$exefile - usersub=0 - if test $program = $prog.marc - then - execpath=$prog.marc - usersub=1 - fi - if test "$objs" - then - execpath="$DIRJOB/$jid.marc" - usersub=1 - fi - if test "$user" - then - execpath=$usernoext.marc - usersub=1 - fi - export execpath - execname=`$BASENAME $execpath` - - if test "$host" - then - userhost=$host - case $userhost in - \/* | \.\/*) - ;; - *) - userhost=`pwd`/$userhost - ;; - esac - -# check that the number of processes specified in the hostfile is -# equal to nprocd specified by -nprocd. - numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` - if test $nprocd -ne $numproc - then - echo " " - echo "error, the number of processes specified in the host file" - echo "must be equal to the number of processes given by -nprocd/-nsolver" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, the number of processes specified in the host file" >> $jid.log - echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - -# check for Myrinet that the number of processes per host is -# less than number of available user ports, 5 -# .gmpi directory must exist in user's home directory -# and must have write permission from remote hosts - if test $MPITYPE = "myrinet" - then - numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` - if test $numproc -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes specified " - echo "in the hostfile must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes specified " >> $jid.log - echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - if test ! -d ~/.gmpi - then - echo " " - echo "error, for Myrinet a .gmpi directory must exist " - echo "under the user's home directory" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log - echo "under the user's home directory" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - homedir=`echo ~` - for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - echo " " - echo "error, for Myrinet a shared .gmpi directory must exist " - echo "under the user's home directory " - echo "with remote write permission" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log - echo "under the user's home directory " >> $jid.log - echo "with remote write permission" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - /bin/rm tmp.$$ - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - fi - fi - done - fi - fi - -# construct the host file $jid.host which is used by mpirun -# skip lines starting with # and only consider lines with more than -# one word in them. Note that the hostfile given to this script -# has two columns: the host name and the number of shared processes -# to run on this host. mpirun wants the number of _other_ -# processes to run in addition to the one being run on the machine -# on which the job is started. hence the $2-1 for fnr == 1. - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then -# HPMPI or HP hardware MPI - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ - -v mpihpspecial="$MPIHPSPECIAL" \ -'{if ( NF > 0) {\ - fnr++ ; \ - printf("-h %s -np %s",$1,$2); \ - printf(" %s",mpihpspecial); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ - if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ - }\ - }' > $jid.host -# end HPMPI or HP hardware MPI - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then -# IBM using hardware MPI (POE) - MP_HOSTFILE=$jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host -# end IBM using hardware MPI (POE) -# for Intel MPI, need to create a machinefile for DMP - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then -# Intel MPI - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - /bin/cp $host $jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Intel MPI for DMP -# for Solaris HPC 7.1, need to create a machinefile for DMP - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then -# Solaris HPC 7.1 - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Solaris HPC 7.1 for DMP -# for Myrinet, construct a configuration file in ~/.gmpi -# this must be readable by each process -# format is (hostname) (port number) for each process - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - grep -v '^#' $host | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ -{if ( NF > 0 ) \ - for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ -}' >> ~/.gmpi/$jid.host - else -# this is for mpich-1.2.5 and later, using the -pg option -# format: host nproc executable user arguments -# the arguments are added later - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s %s\n",path,user);\ - if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ - }\ - }' > $jid.host - fi -# end Myrinet - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then -# Compaq MPI via Memory Channel - grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host -# end Compaq MPI - else -# MPICH - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ - }\ - }' > $jid.host - fi -# define the variable host and host_filt -# host_filt is used for loops over hosts -# for Myrinet we need to use a filtered variant of userhost -# for others we can use $host - if test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - host=~/.gmpi/$jid.host - host_filt=$jid.host_tMp - grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt - else - host=$jid.host - host_filt=$host - fi - else - host=$jid.host - host_filt=$host - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - host_filt=$jid.mfile - fi - fi -# figure out if the machines in the hostfile are nfs mounted -# or distributed and set the variable "dirstatus" accordingly. -# only perform the check if user subroutine is used -# or a user subroutine executable is used - - numfield=1 - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - numfield=2 - fi - DIR1=$DIRJOB - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - counter=0 - echo " " - echo "checking if local or shared directories for host" - if test "$deletelog" = no - then - echo "checking if local or shared directories for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - dirstatus[$counter]="shared" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - dirstatus[$counter]="local" - /bin/rm tmp.$$ - else - if test ! -f $jid.$$ - then - dirstatus[$counter]="local" - $RSH $i /bin/rm $DIR1/$jid.$$ - else - /bin/rm $jid.$$ - fi - fi - if test -f tmp.$$ - then - /bin/rm tmp.$$ - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - echo " ${dirstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${dirstatus[$counter]}" >> $jid.log - fi - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - fi - -# figure out if this is a compatible set of machines -# unless explicitly specified with flag -comp -# only perform the check if user subroutine is used -# or a user subroutine executable is used -# Myrinet does not support heterogeneous - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - if test $compatible = "unknown" - then - thisname=$ARCH - compatible=yes - counter=0 - echo "checking if machines are compatible for host" - if test "$deletelog" = no - then - echo "checking if machines are compatible for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]="yes" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - othername=`$RSH $i uname -a | cut -f 1 -d " "` - if test $thisname != $othername - then - compatible=no - compstatus[$counter]="no" - fi - fi - echo " ${compstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${compstatus[$counter]}" >> $jid.log - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - else - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]=$compatible - fi - done - if test $compatible = "no" - then - echo "all machines assumed incompatible" - if test "$deletelog" = no - then - echo "all machines assumed incompatible" >> $jid.log - fi - else - echo "all machines compatible" - if test "$deletelog" = no - then - echo "all machines compatible" >> $jid.log - fi - fi - fi -# error out if user objects or libraries are used on incompatible machines - if test "$compatible" = "no" -a -n "$objs" - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" - if test "$deletelog" = no - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log - fi - exit 1 - fi -# modify new host file if NFS mounted heterogeneous machine - doit= - if test $program = $prog.marc - then - doit=yes - fi - if test "$user" - then - doit=yes - fi - if test "$doit" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - $AWK -v hst=$i '{fnr++ ; \ -if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ -printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} - /bin/mv $jid.host{$$} $jid.host - host=$jid.host - fi - fi - done - fi - fi # if test $program = $prog.marc -o $user -o $obj - - else # if test $host - # assume shared memory machine if no hostfile given and - # MPITYPE is set to mpich or Myrinet - # check for Myrinet that the total number of processes is - # less than number of available user ports, 5 - if test $MPITYPE = "mpich" -o $MPITYPE = "scali" - then - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - host=$jid.host - elif test $MPITYPE = "myrinet" - then - if test $nprocd -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes " - echo "must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes " >> $jid.log - echo "must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - echo `hostname` $nprocd | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ - {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ -' >> ~/.gmpi/$jid.host - host=~/.gmpi/$jid.host - else - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - - fi - fi # if test myrinet - - fi # if test $host - - fi # if test $nprocd -gt 1 - -fi # if test $program = $exefile -o $program = $prog.marc - -############################################################################## -# construct run stream (Marc only) # -############################################################################## - -# set maximum message length for ddm to a large number -# for vendor provided mpi -if test $itree -eq 0 -a $MPITYPE = hardware -then - itree=100000000 - if test $MACHINENAME = SGI - then - itree=100000001 - fi -fi -if test $itree -eq 0 -a $MPITYPE = hpmpi -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = myrinet -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = nec -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = scali -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = intelmpi -then - itree=100000000 -fi -if test $nprocdddm -lt 2 -then - nprocdarg= -else - nprocdarg="$nprocdarg $nprocdddm" -fi -if test $nsolver -eq 0 -then - nsolverarg= -else - nsolverarg="$nsolverarg $nsolver" -fi -if test $nprocdddm -lt 2 -a $nsolver -eq 0 -then -nprocd=0 -fi -if test $nprocd -gt 0 -then - if test "$host" - then - if test -z "$RUN_JOB2" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then - RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" - RUN_JOB=" -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - numhost=`uniq $jid.mfile | wc -l` - if test "$INTELMPI_VERSION" = "HYDRA" - then - RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n $numhost -r $RSH -f $jid.mfile - RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" - fi - -# intelmpi uses configfile. format: -# -host host1 -n n1 executable marcargs -# one such line per host -# collect the marcargs in RUN_JOB and construct the config file later -# collect the run stream in RUN_JOB_TMP - RUN_JOB="-jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - - - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then - RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - if test "$userhost" - then - RUN_JOB="$RUN_JOB -mhost $userhost" - fi - if test $MPITYPE = "scali" - then -# set default working directory to /tmp to allow -# different directory names - SCAMPI_WORKING_DIRECTORY=/tmp - export SCAMPI_WORKING_DIRECTORY - fi - else - if test -z "$RUN_JOB1" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - RUNNPROCD=$nprocd - if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" - then - RUNNPROCD= - MP_PROCS=$nprocd - export MP_PROCS - fi - if test $MPITYPE = "myrinet" - then - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n 1 -f $jid.hosts - fi - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - fi -else - if test $nauto -gt 0 -o $ndcoup -gt 0 - then - RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - else -# this is for a serial job without auto restart: - RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi -fi -if test "$rid" -then - RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" -fi -if test "$pid" -then - RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" -fi -if test "$sid" -then - RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" -fi -if test "$did" -then - RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" -fi -if test "$vid" -then - RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" -fi -if test $nauto -gt 0 -then - RUN_JOB="$RUN_JOB -autorst $nauto " -fi -if test $ndcoup -gt 0 -then - RUN_JOB="$RUN_JOB -dcoup $ndcoup " -fi -if test $ndytran -gt 0 -then - RUN_JOB="$RUN_JOB -dytran $ndytran " -fi -if test $mesh -gt 0 -then - RUN_JOB="$RUN_JOB -me $mesh " -fi -if test $noutcore -gt 0 -then - RUN_JOB="$RUN_JOB -outcore $noutcore " -fi -if test "$dllrun" -gt 0 -then - RUN_JOB="$RUN_JOB -dll $dllrun " -fi -if test "$trkrun" -gt 0 -then - RUN_JOB="$RUN_JOB -trk $trkrun " -fi -if test "$iam" -then - RUN_JOB="$RUN_JOB -iam $iam " -fi -if test "$justlist" -then - RUN_JOB="$RUN_JOB -list 1 " -fi -if test "$feature" -then - RUN_JOB="$RUN_JOB -feature $feature " -fi -if test "$memlimit" -ne 0 -then - RUN_JOB="$RUN_JOB -ml $memlimit " -fi -if test "$cpinput" -then - RUN_JOB="$RUN_JOB -ci $cpinput " -fi -if test "$cpresults" -then - RUN_JOB="$RUN_JOB -cr $cpresults " -fi -if test "$DIRSCR" != "$DIRJOB" -then - RUN_JOB="$RUN_JOB -dirscr $DIRSCR" -else - DIRSCR=$DIRJOB -fi -if test "$makebdf" -then - RUN_JOB="$RUN_JOB -bdf $makebdf " -fi -if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" -then - # append $RUN_JOB to all lines of the host file - # and set RUN_JOB - $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ - /bin/mv $host.$$ $host - RUN_JOB=$RUN_JOB_TMP -fi -if test $MPITYPE = "intelmpi" -a "$host" -then - # construct config file, append $RUN_JOB to all lines of the config file - # and set RUN_JOB - if test "$INTELMPI_VERSION" = "HYDRA" - then - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - else - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-host %s -n %s",$1,$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - fi - RUN_JOB=$RUN_JOB_TMP -fi -echo " " -echo "Final run stream value" -echo " RUNJOB="$RUN_JOB -if test "$deletelog" = no -then -echo " " >> $jid.log -echo "Final run stream value" >> $jid.log -echo " RUNJOB="$RUN_JOB >> $jid.log -fi - - -############################################################################## -# run marc using valgrind # -############################################################################## -#RUN_JOB="valgrind $RUN_JOB" -#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" -############################################################################## - - -############################################################################## -# run the requested program in a queue # -############################################################################## - -if test "$deletelog" = yes -then - echo - date -else - echo >> $jid.log - date >> $jid.log -fi -if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] -then - -/bin/rm -f $jid.runmarcscript - - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - userobj=$usernoext.o - fi - cat > $jid.runmarcscript << END4 - if test "$user" - then - if test $MACHINENAME = "CRAY" - then - $DFORTRANMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTRANMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $MARCCUDALIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } -END4 -else - prgsav=yes -fi -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# - -cat >> $jid.runmarcscript << END5 - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -# first remove all .out files and incremental restart files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null - /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null -fi - -if test $nprocdddm -gt 1 -then - $RUN_JOB 2>>$jid.log -else - $RUN_JOB 2>>$jid.log -fi - -if test $dllrun -eq 0; then - if test $prgsav = no - then - /bin/rm -f $bd$program 2>/dev/null - fi -else - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes - then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -END5 - - -# Submit to marc batch queue -# -if [ $qid = at ] -then -QUENAME=at -SUBMCMD= -else -# -# Submit to qsub queue -# -QUENAME=qsub -SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" -if test "$priority" -then - SUBMCMD=$SUBMCMD" -p $priority" -fi -if test "$att" -then - SUBMCMD=$SUBMCMD" -a $att" -fi -if test "$cpu" -then - SUBMCMD=$SUBMCMD" -lt $cpu" -fi - -fi -echo $QUENAME $SUBMCMD -#cat $jid.runmarcscript -$QUENAME $SUBMCMD < $jid.runmarcscript - -/bin/rm -f $jid.runmarcscript - -############################################################################## -# run the requested program in the background # -############################################################################## - -else -if test $qid = background -then - -# -# first remove all old .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi -# -# compile user subroutine if present -# -( -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_mp $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - echo " $PRODUCT Exit number 3" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTRANMP $user || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTRANMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - echo " $PRODUCT Exit number 3" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc - -# - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -$RUN_JOB & - -marcpid=$! -echo $marcpid > $DIRJOB/$jid.pid -wait $marcpid - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - if test "$host" - then - /bin/rm $jid.mfile 2> /dev/null - /bin/rm $jid.hosts 2> /dev/null - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.cfile 2> /dev/null - fi - fi - fi -fi - - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -) 1>>$jid.log 2>&1 & - - -############################################################################## -# run the requested program in the foreground # -############################################################################## - -else - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_damask_mp $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user on host $i" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user on host `hostname`" - fi - userobj=$usernoext.o - if test $MACHINENAME = "CRAY" - then - $DFORTRANMP $user || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $DFORTRANMP $user -o $userobj || \ - { - echo "$0: compile failed for $user" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $DAMASK \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null -/bin/rm $DIRJOB/*.mod 2>/dev/null - -# -# run marc -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi -# first remove all .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi - -$RUN_JOB - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - if test "$host" - then - /bin/rm $jid.mfile 2> /dev/null - /bin/rm $jid.hosts 2> /dev/null - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.cfile 2> /dev/null - else - echo " " > /dev/null - fi - else - if test "$host" - then - mpdcleanup -a -f $jid.mfile - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.mfile 2> /dev/null - else - mpdcleanup -a -f $jid.hosts - /bin/rm $jid.hosts 2> /dev/null - fi - fi - fi -fi - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=$usernoext - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi - - -fi -fi diff --git a/installation/mods_MarcMentat/2013/Marc_tools/run_marc.original b/installation/mods_MarcMentat/2013/Marc_tools/run_marc.original deleted file mode 100644 index 3185b3573..000000000 --- a/installation/mods_MarcMentat/2013/Marc_tools/run_marc.original +++ /dev/null @@ -1,3890 +0,0 @@ -#!/bin/ksh -############################################################################## -# # -# run_marc - run a marc job # -# ------------------------- # -# # -# usage: run_marc -j jid { options } # -# # -# where standard options are: required: defaults: # -# -------------------------- # -# # -# -j* jid job id number. ** YES ** . # -# -pr* prog program name. . marc # -# -v* y|n do or do not verify inputs. . yes # -# -q* s|l|v|b|f batch queue name or background, . short # -# foreground. # -# -b* as alternative to option -q* # -# # -# ( batch queues only : # -# -pq* intra queue priority. . . # -# -at DATE/TIME delay start of job. . . # -# format : January,1,1990,12:31 # -# or : today,5pm # -# -cpu* secs job CPU limit . . ) # -# # -# -r* rid restart file job id. . . # -# -si* sid substructure file id. . . # -# -pi* post post file job id. . . # -# -de* did defaults file . no # -# -vf vid viewfactor . no # -# # -# -u* user user subroutine. . . # -# -obj obj user objects or libraries. . . # -# -sa* y|n do or do not save load module. . no # -# -autorst auto restart flag for auto forge . no # -# -me manual remeshing control . no # -# -ml memory limit in Mbyte # -# -mo selects i4 or i8 version # -# default: i4 or via defaults file run_marc_defaults # -# the -mo option will override # -# -mpi selects MPI version # -# each platform has a default MPI version and some # -# have an alternative version. see the include file # -# for the respective platform # -# MPI_DEFAULT defines the default MPI version # -# MPI_OTHER defines versions one can switch to # -# -dcoup for contact decoupling # -# currently not supported # -# -dir directory where the job i/o should take place. # -# defaults to current directory. # -# -sdir directory where scratch files are created # -# defaults to current directory. # -# # -# -alloc only perform memory allocation test, no analysis # -# -list y only list options in the input file, no analysis # -# -fe num set feature number "num" for the run. only one allowed # -# -dytran flag to switch from Dytran to Marc # -# dytran = 0, program will run w/o Marc-Dytran Switch # -# = 1, program will restart Marc after Dytran run # -# >= 2, Not supported yet. # -# currently not supported # -# -ou force analysis to use out-of-core control # -# =0, not used # -# =1, element storage out-of-core # -# -dll run marc using shared library libmarc.so and exe_marc # -# =1, used # -# =2, do not free streaming input memory # -# =3, run with marc input deck # -# -trk run marc for post-tracking # -# -gpuid run marc using GPGPU capability # -# specify gpuid on to be used in the analysis. Multiple # -# IDs may be assigned for DDM runs. # -# Separate a list of IDs with a colon. Each DMP # -# process will be assigned a GPU ID in round robin fastion# -# = 0 # -# = 0:1 etc... # -# # -# where parallel options are: # -# -------------------------- # -# # -# itree, host, and comp options are available for the domain # -# decomposition only. # -# MARC_NUMBER_OF_THREADS, nthread, and dir options always available. # -# # -# # -# -nprocd number of domains. # -# defaults to single domain solution. # -# -nprocds number of domains if single input file. # -# defaults to single domain solution. # -# -nps same as -nprocds. # -# -nsolver number of solver tasks for solver types 12 and 13 # -# these are distributed tasks operating via MPI # -# -nthread number of solver threads for solver types 6, 8, and 11 # -# also can be set through MARC_NUMBER_OF_THREADS # -# environment variable. if both specified, nthread option# -# will be used. # -# = 0: use defaults. # -# defaults to 1 for single domain solution. # -# defaults to number of domains for multi-domain # -# solution. # -# > 1: number of threads to be used by 6, 8, and 11 # -# defaults if neither MARC_NUMBER_OF_THREADS environment # -# variable set nor nthread specified. # -# -itree message passing tree type for domain decomposition. # -# for debugging purposes; should not normally be used. # -# -host hostfile name for distributed execution on network. # -# defaults to no hostfile, unless jobid.defhost exists. # -# if jobid.defhost exists, only -np(s) necessary # -# -comp* y|n to be used with user routines on a network of # -# incompatible machines. # -# if set to no, a separate executable will be created # -# for each machine on the network. # -# if set to yes, the executable located on the machine # -# from which marc is started will be used on all machines.# -# defaults to no if O/S versions different on machines. # -# # -# -ci y|n copy input files to remote hosts (default: yes) # -# if "yes", input files are automatically copied to # -# remote hosts for a network run if necessary. # -# -cr y|n copy post files from remote hosts (default: yes) # -# if "yes", post files are automatically copied back from # -# remote hosts for a network run if necessary. # -############################################################################## -# set DIR to the directory in which this script is -REALCOM="`/bin/ls -l $0 |awk '{ print $NF; }'`" -DIR=`dirname $REALCOM` -# make sure DIR has an absolute path -case $DIR in - \/*) - ;; - *) - DIR=`pwd`/$DIR - ;; -esac -DIRSCRIPT=$DIR -AWK=awk -ARCH=`uname -a | cut -f 1 -d " "` -# Sun has a bad awk, use nawk instead -if test $ARCH = "SunOS" -then - AWK=nawk -fi -BASENAME=basename -# Sun has an incorrect /bin/basename, check if /usr/ucb/basename exists -if test $ARCH = "SunOS" -then - if test -x /usr/ucb/basename - then - BASENAME=/usr/ucb/basename - fi -fi - -# echo command line in the case of ECHO_COMMAND is true -if test "$ECHO_COMMAND" = true ; then - echo command "$0" "$@" -fi - -# -# "mode" selects version, i4 or i8 -# default is i4 -# this can be changed by a file run_marc_defaults -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MODE i8 -# it can also be set by the environmental variable MARC_INTEGER_SIZE -# and by the command line option "-mo" -# -mode= -if test -f $DIRSCRIPT/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -f $HOME/run_marc_defaults; then - line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $HOME/run_marc_defaults` - line=`echo $line | $AWK '{print $NF}'` - if test "$line" = "i4"; then - mode=i4 - fi - if test "$line" = "i8"; then - mode=i8 - fi -fi -if test -n "$MARC_INTEGER_SIZE" ; then - mode=$MARC_INTEGER_SIZE -fi -if test -z "$mode" ; then - mode=i8 -fi -case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo "error, version mode must be i4 or i8" - exit - ;; -esac - -setmode=false -for arg in $* ; do - if $setmode ; then - mode=$arg - case $mode in - i4) - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - ;; - i8) - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - ;; - *) - echo " " - echo "error, version mode must be i4 or i8" - echo " " - echo " use -mo i4 or -mo i8 " - echo " " - exit - ;; - esac - setmode=false - fi - if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then - setmode=true - fi - if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - MARC_INTEGER_SIZE=i8 - export MARC_INTEGER_SIZE - fi - if [ ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -done - -# set to i4 version for 32 bit Linux -if test "`uname -s`" = "Linux"; then - if test "`uname -m`" = "i686"; then - mode=i4 - MARC_INTEGER_SIZE=i4 - export MARC_INTEGER_SIZE - fi -fi - - -. "$DIR/getarch" - -. $MARC_INCLUDE -# - -# -# Dynamically determine the echo syntax -# - -case "`echo '\c'`" in - '\c') - ECHO='echo -n' - ECHOTXT=' ' - ;; - *) - ECHO='echo' - ECHOTXT=' \c' - ;; -esac - -# -# Variables for the MARC environment -# - -PRODUCT="Marc" -EXITMSG=$MARC_TOOLS/MESSAGES -export EXITMSG -FLEXDIR=$DIR/../flexlm/licenses -export FLEXDIR -TIMCHK=3600 -export TIMCHK -BINDIR=$MARC_BIN -export BINDIR -AFMATDAT=$MARC_RUNTIME/AF_flowmat/ -export AFMATDAT -# -# define directory path to global unified material database -# -MATFILE= -export MATFILE - -# -# define memory limit -# first set to MEMLIMIT from include -# -ml option overrules if specified -memlimit=$MEMLIMIT -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -# -if test $MACHINENAME = "HP" -then - SHLIB_PATH=$MARC_LIB:$MARC_LIB_SHARED:$SHLIB_PATH - export SHLIB_PATH -fi -# the one for IBM is defined futher down - -LD_LIBRARY_PATH=$MARC_LIB_SHARED:$LD_LIBRARY_PATH -LD_LIBRARY_PATH=$MARC_LIB:$LD_LIBRARY_PATH -LD_LIBRARY64_PATH=$MARC_LIB:$LD_LIBRARY64_PATH -LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH -export LD_LIBRARY_PATH -export LD_LIBRARY64_PATH -export LD_LIBRARYN32_PATH - -atexit() { -kill -15 $$ -# -if test $MPITYPE = "myrinet" -then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi -fi -} - -trap "atexit" 2 - -# -# defaults -# - -prog=marc -exefile=marc -jid= -rid= -pid= -sid= -did= -vid= -user= -usersubname= -objs= -qid=background -cpu= -priority= -att= -trk= -verify=yes -prgsav=no -rmdll=no -cpdll=no -progdll= -pathdll= -error= -nprocd=0 -nprocdddm=1 -nprocdddmprint= -icreated=0 -nprocdarg= -nsolver=0 -nsolverarg=-ns -if test $nprocds -then - if test $nprocds -gt 1 - then - nprocdddm=$nprocds - nprocdddmprint=$nprocds - icreated=1 - nprocdarg=-nprocds - fi -fi -nthread=-1 -gpuids= -nauto=0 -ndcoup=0 -ndytran=0 -noutcore=0 -dllrun=0 -mesh=0 -nthreadprint=0 -itree=0 -iam= -link= -trkrun=0 -DIRJOB=`pwd` -DIRSCR=$DIRJOB -DIRSCRSET= -autoforge=0 -dotdat=.dat -dotdefhost=.defhost -host= -numhost= -mfile= -userhost= -makebdf= -cpinput=yes -cpresults=yes -marcdll=libmarc.$EXT_DLL -# define hostname and strip off extensions (alpha.aaa.com) -thishost=`hostname` -thishost=${thishost%%.*} -compatible=unknown -numfield=1 -justlist= -feature= -mpioption=false -MDSRCLIB=$MARC_LIB/mdsrc.a -# -# check run_marc_defaults file for default MPI setting -# located in the tools directory of the Marc installation -# or in the user's home directory -# format: -# MARC_MPI -# -value= -file= -if test -f $DIRSCRIPT/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $DIRSCRIPT/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$DIRSCRIPT/run_marc_defaults - fi -fi -if test -f $HOME/run_marc_defaults; then - value=`$AWK '{if ($1 == "MARC_MPI") {print $2}}' $HOME/run_marc_defaults` - value=`echo $value | $AWK '{print $NF}'` - if test -n "$value"; then - file=$HOME/run_marc_defaults - fi -fi -if test -n "$value"; then - MARC_MPITYPE=$value - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - echo " " - echo " error, incorrect option for MARC_MPI" - echo " defined in $file: $MARC_MPITYPE" - echo " valid options: $MPI_DEFAULT $MPI_OTHER" - echo " " - exit - fi - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - fi -fi -# -# -# allow scratch directory to be specified with environmental variable -# MARCSCRATCH -if test $MARCSCRATCH -then - if test -d $MARCSCRATCH - then - DIRSCR=$MARCSCRATCH - else - echo "error, scratch directory '$MARCSCRATCH'" - echo " specified via environmental variable MARCSCRATCH does not exist" - exit - fi -fi -# -############################################################################## -# parse input - arguments always come in pairs # -############################################################################## - -arg=$1 -if [ ${arg}X = -i8X -o ${arg}X = -I8X ] ; then - shift - arg=$1 -fi -while [ -n "$arg" ] -do - shift - value=$1 - case $arg in - -al* | -AL*) - LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - export LD_LIBRARY_PATH - $MARC_BIN/marc -alloc 1 - exit - ;; - -li* | -LI*) - justlist=yes - ;; - -fe* | -FE*) - feature=$value - ;; - -pr* | -PR*) - if test `dirname $value` = '.' - then - prog=`$BASENAME $value .marc` - progdll=`$BASENAME $value` - else - prog=`dirname $value`/`$BASENAME $value .marc` - progdll=`dirname $value`/`$BASENAME $value` - fi - prdir=`dirname $value` - case $prdir in - \/*) - ;; - *) - prog=`pwd`/$prdir/$prog - ;; - esac - ;; - -j* | -J*) - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - ;; - -r* | -R*) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - -si* | -SI*) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - -pi* | -PI*) - if test -f $value.t19 - then - pid=`$BASENAME $value .t19` - else - pid=`$BASENAME $value .t16` - fi - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - -bdf | -BDF) - makebdf=1 - ;; - -de* | -DE*) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - -vf | -VF) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - -u* | -U*) - user=`dirname $value`/`$BASENAME $value .f` - basefile=`$BASENAME $value` - if test ${basefile##*.} = F - then - user=`dirname $value`/`$BASENAME $value .F` - fi - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - if test -f $user.f - then - usersubname=$user.f - elif test -f $user.F - then - usersubname=$user.F - else - usersubname=$user - fi - ;; - -obj | -OBJ) - objs="$value" - ;; - -q* | -Q*) - qid=$value - ;; - -b* | -B*) - case $value in - y* | Y*) - qid=background - ;; - n* | N*) - qid=foreground - ;; - *) - ;; - esac - ;; - -at | -AT) - att=$value - ;; - -cpu* | -CPU*) - cpu=$value - ;; - -pq | -PQ*) - priority=$value - ;; - -v* | -V*) - verify=$value - ;; - -sa* | -SA*) - prgsav=$value - ;; - -np* | -NP*) - nprocdddm=$value - nprocdddmprint=$value - case $arg in - -nps* | -NPS* | -nprocds* | -NPROCDS*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - case $arg in - -np | -NP | -nprocd | -NPROCD) - icreated=0 - nprocdarg=-nprocd - ;; - esac - ;; - -ns* | -NS*) - nsolver=$value - ;; - -nt* | -NT*) - nthread=$value - ;; - -gp* | -GP*) - gpuids=$value - ;; - -it* | -IT*) - itree=$value - ;; - -iam | -IAM) - iam=$value - ;; - -au* | -AU*) - nauto=$value - ;; - -dc* | -DC*) - ndcoup=$value - ;; - -dy* | -DY*) - ndytran=$value - ;; - -ou* | -OU*) - noutcore=$value - ;; - -dll | -DLL) - dllrun=$value - ;; - -trk | -TRK) - trkrun=$value - ;; - -me | -ME ) - mesh=$value - ;; - -ml | -ML ) - memlimit=$value - ;; - -mo | -MO ) - ;; - -mpi | -MPI ) - mpioption=true - MARC_MPITYPE=$value - if test "$value" != "$MPI_DEFAULT"; then - exefile=marc_$value - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a_$value - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a_$value" - fi - else - exefile=marc - . $MARC_INCLUDE - MDSRCLIB=$MARC_LIB/mdsrc.a - if test "$MUMPSSOLVER" = MUMPS; then - MUMPSSOLVERLIBS="$MARC_LIB/libmumps.a" - fi - fi - ;; - -dir* | -DIR*) - DIRJOB=$value - case $DIRJOB in - \/*) - ;; - *) - DIRJOB=`pwd`/$DIRJOB - ;; - esac - if test -z "$DIRSCRSET" - then - DIRSCR=$DIRJOB - fi - ;; - -sd* | -SD*) - DIRSCR=$value - DIRSCRSET=yes - case $DIRSCR in - \/*) - ;; - *) - DIRSCR=`pwd`/$DIRSCR - ;; - esac - ;; - -ho* | -HO*) - host=$value - ;; - -co* | -CO*) - compatible=$value - ;; - -ci* | -CI*) - cpinput=$value - ;; - -cr* | -CR*) - cpresults=$value - ;; - *) - error="$error -$arg: invalid option" - break - ;; - esac - case $value in - -*) - error="$error -$arg: invalid name $value" - break - ;; - esac - shift - arg=$1 - if [ ${arg}X = -i8X -o ${arg}X = -I8X -o ${arg}X = -i4X -o ${arg}X = -I4X ] ; then - shift - arg=$1 - fi -done -argc=`expr $# % 2` -if test $argc -eq 1 -then -# -# odd number of arguments -# - error="$error -argument list incomplete" -fi - -if test $nprocdddm -gt 0 -then -nprocd=$nprocdddm -fi - -if test $nsolver -gt 0 -then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi -fi - -if test $nthread -eq -1 -then -nthread=${MARC_NUMBER_OF_THREADS:-0} -fi -if test $nthread -lt 0 -then -nthread=0 -fi - -nthreadprint=$nthread -if test $nthreadprint -eq 0 -then -nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi -fi - -nthread=$nthreadprint - -gpuoption= -if test "$gpuids" = "" ; then - gpuoption= -else - gpuoption="-gp $gpuids" -fi - -if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH -else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH -fi -# Linux 64 + HPMPI, Below code is taken from include_linux64 -if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" -then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" -fi - -if test $nprocd -gt 1; then - if test -f $jid$dotdefhost; then - if test "$host" = ""; then - host=$jid$dotdefhost - fi - fi - if test -f hostfile_qa_$nprocd; then - if test "$host" = ""; then - host=hostfile_qa_$nprocd - fi - fi -fi - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$dllrun" -eq 1 || test "$dllrun" -eq 2; then - dotdat=.inp - fi - - if test "$progdll"; then - /bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll - rmdll=yes - pathdll=yes - progdll=${progdll}_$marcdll - else - progdll=$marcdll - fi - - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - pathdll=yes - fi -fi - -############################################################################## -# check parameter validity # -############################################################################## - -while test forever; do - -# -# check for input file existence -# -if test $nprocdddm -gt 1 -a $icreated -eq 0; then - if test ! -f $DIRJID/1$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/1$jid$dotdat not accessible" - fi - fi -else - if test ! -f $DIRJID/$jid$dotdat; then - if test "$jid" != "" ; then - error="$error -input file $DIRJID/$jid$dotdat not accessible" - fi - fi -fi - if test $nprocd -gt 1; then - if test "$host" ; then - if test ! -f $host; then - error="$error -host name file $host not accessible" - fi - fi - fi - -# -# check if the job is already running in the background -# -if test -f $DIRJOB/$jid.pid; then - error="$error -job is already running (the file $jid.pid exists)" -fi - -# -# if the program name is other than marc, then -# assume that this is a program in the users local directory -# - -bd=$MARC_BIN/ - -case $prog in - marc | MARC | $exefile) - program=$exefile - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 or $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$usersubname" - then - if test ! -f $usersubname - then - error="$error -user subroutine file $usersubname not accessible" - fi - fi - if test "$objs" - then - missingobjs= - for o in $objs - do - if test ! -f "$o" - then - if test -z "$missingobjs" - then - missingobjs="$o" - else - missingobjs="$missingobjs $o" - fi - fi - done - if test -n "$missingobjs" - then - error="$error -user object/library file(s) $missingobjs not accessible" - fi - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$vid" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRVID/1$vid.vfs - then - error="$error -view factor file $DIRVID/1$vid.vfs not accessible" - fi - else - if test ! -f $DIRVID/$vid.vfs - then - error="$error -view factor file $DIRVID/$vid.vfs not accessible" - fi - fi - fi - if $mpioption - then - notok=true - for i in "$MPI_OTHER"; do - if test "$MARC_MPITYPE" = "$i"; then - notok=false - fi - done - if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then - notok=false - fi - if $notok; then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)" - fi - fi - ;; - *) - program=$prog.marc - case $prog in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - if test "$rid" - then - if test ! -f $DIRRID/$rid.t08 - then - error="$error -restart file $DIRRID/$rid.t08 not accessible" - fi - fi - if test "$pid" - then - if test ! -f $DIRPID/$pid.t16 - then - if test ! -f $DIRPID/$pid.t19 - then - error="$error -post file $DIRPID/$pid.t16 and $DIRPID/$pid.t19 not accessible" - fi - fi - fi - if test "$user" - then - error="$error -program option may not be used with user subroutine" - fi - if test "$objs" - then - error="$error -program option may not be used with user objects or libraries" - fi - if test "$did" - then - if test $nprocdddm -gt 1 -a $icreated -eq 0 - then - if test ! -f $DIRDID/1$did$dotdat - then - error="$error -defaults file $DIRDID/1$did$dotdat not accessible" - fi - else - if test ! -f $DIRDID/$did$dotdat - then - error="$error -defaults file $DIRDID/$did$dotdat not accessible" - fi - fi - fi - if test "$nauto" - then - if test $nauto -gt 2 - then - error="$error -incorrect option for auto restart " - fi - fi - if test "$ndcoup" - then - if test $ndcoup -gt 3 - then - error="$error -incorrect option for contact decoupling " - fi - fi - if test "$ndytran" - then - if test $ndytran -gt 1 - then - error="$error -incorrect option for Marc-Dytran Switch " - fi - fi - if $mpioption - then - if test ! -x $MARC_BIN/$exefile - then - error="$error -incorrect option for -mpi option: $MARC_MPITYPE " - fi - fi - ;; -esac - -############################################################################## -# check argument integrity # -############################################################################## - -if test "$jid" -then - : -else - error="$error -job id required" -fi - -if test $nprocd -gt 1 -then - if test $nauto -gt 0 - then - error="$error -cannot run DDM job with auto restart (-au) option " - fi -fi -case $qid in - S* | s*) - qid=short - ;; - L* | l*) - qid=long - ;; - V* | v*) - qid=verylong - ;; - B* | b*) - qid=background - ;; - F* | f*) - qid=foreground - ;; - A* | a*) - qid=at - ;; - *) - error="$error -bad value for queue_id option" - ;; -esac - -case $prgsav in - N* | n*) - prgsav=no - ;; - Y* | y*) - prgsav=yes - ;; - *) - error="$error -bad value for save option" - ;; -esac - -case $verify in - N* | n*) - verify=no - ;; - Y* | y*) - verify=yes - ;; - *) - error="$error -bad value for verify option" - ;; -esac - -case $nprocdddm in - -* ) - error="$error -bad value for nprocd option" - ;; -esac - -case $nthread in - -* ) - error="$error -bad value for nthread option" - ;; -esac - -case $itree in - -* ) - error="$error -bad value for itree option" - ;; -esac -case $iam in - -* ) - error="$error -bad value for iam option" - ;; -esac -case $compatible in - N* | n*) - compatible=no - ;; - Y* | y*) - compatible=yes - ;; - unknown) - ;; - *) - error="$error -bad value for comp option" - ;; -esac -case $cpinput in - N* | n*) - cpinput=no - ;; - Y* | y*) - cpinput=yes - ;; - *) - error="$error -bad value for copy input option" - ;; -esac -case $cpresults in - N* | n*) - cpresults=no - ;; - Y* | y*) - cpresults=yes - ;; - *) - error="$error -bad value for copy results option" - ;; -esac - -# -# check for external file to run -# -if test -f $MARC_TOOLS/run_marc_check -then - . $MARC_TOOLS/run_marc_check -fi - -# -# pick up version data from bin/VERSION if it exists -# -if test -f $MARC_BIN/VERSION; then - ppp=`grep "version" $MARC_BIN/VERSION | cut -f 2- -d ":"` - if test -n "$ppp" ;then - PRODUCT=$ppp - fi - ppp=`grep "built at changelist" $MARC_BIN/VERSION | cut -f 2 -d ":"` - if test -n "$ppp" ;then - REVISION=", Build $ppp" - fi -fi -############################################################################## -# interact with the user to get the required information to run marc or # -# other marc system program # -############################################################################## - -deletelog=yes -if test $qid = background -a $verify = no -then -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $usersubname -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto " > $jid.log -deletelog=no -fi -echo \ -" -$PRODUCT $REVISION $MACHINE version ------------------------------ -Program name : $prog -Marc shared lib : $progdll -Version type : $mode -Job ID : $DIRJID/$jid -User subroutine name : $usersubname -User objects/libs : $objs -Restart file job ID : $rid -Substructure file ID : $sid -Post file job ID : $pid -Defaults file ID : $did -View Factor file ID : $vid -Save generated module: $prgsav -MPI library : $MPITYPE -DDM processes : $nprocdddmprint -Solver processes : $nthreadprint -GPGPU option : $gpuids -Host file name : $host -Message passing type : $itree -Run job in queue : $qid -Run directory : $DIRJOB -Scratch directory : $DIRSCR -Memory limit in Mbyte: $memlimit -Auto Restart : $nauto" - - -case $qid in - s* | S* | l* | L* | v* | V* ) - echo \ -"Queue priority : $priority -Queue CPU limit : $cpu -Queue start time : $att" - ;; -# * ) -# echo \ -#" " -# ;; -esac - -if test "$error" -then - if test $verify = yes - then - $ECHO "$error - -Please correct or quit(correct,quit,): $ECHOTXT" - error= - read answer - case $answer in - q* | Q*) - answer=quit - ;; - *) - answer=correct - ;; - esac - else - $ECHO "$error - $ECHOTXT" - echo " " - if test "$deletelog" = no - then - $ECHO "$error - $ECHOTXT" >> $jid.log - echo " " >> $jid.log - fi - answer=quit - fi -else - if test $verify = yes - then - $ECHO " -Are these parameters correct (yes,no,quit,)? $ECHOTXT" - read answer - case $answer in - q* | Q*) - answer=quit - ;; - y* | Y*) - answer=yes - ;; - *) - answer=no - ;; - esac - else - answer=yes - fi -fi - -case $answer in - no | correct) - -############################################################################## -# prompt for each value # -############################################################################## - - $ECHO " -Program name ($prog)? $ECHOTXT" - read value - if test "$value" - then - prog=$value - fi - $ECHO "Job ID ($jid)? $ECHOTXT" - read value - if test "$value" - then - jid=`$BASENAME $value $dotdat` - DIRJID=`dirname $value` - case $DIRJID in - \/*) - ;; - *) - DIRJID=`pwd`/$DIRJID - ;; - esac - fi - $ECHO "User subroutine name ($user)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - user= - ;; - *) - user=`dirname $value`/`$BASENAME $value .f` - basefile=`$BASENAME $value` - if test ${basefile##*.} = F - then - user=`dirname $value`/`$BASENAME $value .F` - fi - case $user in - \/*) - ;; - *) - user=`pwd`/$user - ;; - esac - if test -f $user.f - then - usersubname=$user.f - elif test -f $user.F - then - usersubname=$user.F - else - usersubname=$user - fi - ;; - esac - fi - $ECHO "User objects or libraries ($objs)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - objs= - ;; - *) - objs="$value" - ;; - esac - fi - $ECHO "Restart File Job ID ($rid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - rid= - ;; - *) - rid=`$BASENAME $value .t08` - DIRRID=`dirname $value` - case $DIRRID in - \/*) - ;; - *) - DIRRID=`pwd`/$DIRRID - ;; - esac - ;; - esac - fi - $ECHO "Substructure File ID ($sid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - sid= - ;; - *) - sid=$value - DIRSID=`dirname $value` - case $DIRSID in - \/*) - ;; - *) - DIRSID=`pwd`/$DIRSID - ;; - esac - ;; - esac - fi - $ECHO "Post File Job ID ($pid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - pid= - ;; - *) - pid=$value - DIRPID=`dirname $value` - case $DIRPID in - \/*) - ;; - *) - DIRPID=`pwd`/$DIRPID - ;; - esac - ;; - esac - fi - $ECHO "Defaults File ID ($did)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - did= - ;; - *) - did=`$BASENAME $value $dotdat` - DIRDID=`dirname $value` - case $DIRDID in - \/*) - ;; - *) - DIRDID=`pwd`/$DIRDID - ;; - esac - ;; - esac - fi - $ECHO "View Factor File ID ($vid)? $ECHOTXT" - read value - if test "$value" - then - case $value in - -*) - vid= - ;; - *) - vid=`$BASENAME $value .vfs` - DIRVID=`dirname $value` - case $DIRVID in - \/*) - ;; - *) - DIRVID=`pwd`/$DIRVID - ;; - esac - ;; - esac - fi - $ECHO "Save generated module ($prgsav)? $ECHOTXT" - read value - if test "$value" - then - prgsav=$value - fi - $ECHO "Run on tasks ($nprocdddm) tasks? $ECHOTXT" - read value - if test "$value" - then - nprocdddm=$value - nprocdddmprint=$value - fi - $ECHO "Run on ($nthread) threads ? $ECHOTXT" - read value - if test "$value" - then - nthread=$value - fi - $ECHO "Run on ($nsolver) solvers ? $ECHOTXT" - read value - if test "$value" - then - nsolver=$value - fi -# - if test $nprocdddm -gt 0 - then - nprocd=$nprocdddm - fi - if test $nsolver -gt 0 - then - if test $nsolver -gt $nprocd - then - nprocd=$nsolver - fi - fi - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - nthreadprint=$nthread - if test $nthreadprint -eq 0 - then - nthreadprint=1 - if test $nprocd -gt 1 - then - nthreadprint=$nprocd - fi - if test $nsolver -gt 1 - then - nthreadprint=$nsolver - fi - fi -# - $ECHO "GPGPU id option ($gpuids)? $ECHOTXT" - read value - if test "$value" - then - gpuids=$value - fi - if test "$gpuids" = "" ; then - gpuoption= - else - gpuoption="-gp $gpuids" - fi - if test "$gpuids" = "" ; then - export LD_LIBRARY_PATH=$CUDALIB1:$LD_LIBRARY_PATH - else - MARCCUDALIBS=$MARCCUDALIBS2 - export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH - fi - if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64" - then - export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH" - fi -# - if test $nprocd -gt 1 - then - $ECHO "Message passing type ($itree)? $ECHOTXT" - read value - if test "$value" - then - itree=$value - fi - $ECHO "Host file name ($host)? $ECHOTXT" - read value - if test "$value" - then - host=$value - fi - if test $nprocdddm -gt 1 - then - $ECHO "Single input file? $ECHOTXT" - read value - case $value in - y* | Y*) - icreated=1 - nprocdarg=-nprocds - ;; - esac - $ECHO "Compatible machines for DDM ($compatible)? $ECHOTXT" - read value - if test "$value" - then - compatible=$value - fi - $ECHO "Copy input files to remote hosts ($cpinput)? $ECHOTXT" - read value - if test "$value" - then - cpinput=$value - fi - $ECHO "Copy post files from remote hosts ($cpresults)? $ECHOTXT" - read value - if test "$value" - then - cpresults=$value - fi - fi - fi - $ECHO "Run the job in the queue ($qid)? $ECHOTXT" - read value - if test "$value" - then - qid=$value - fi - case $qid in - s* | S* | l* | L* | v* | V* ) - $ECHO "Queue priority ($priority)? $ECHOTXT" - read value - if test "$value" - then - priority=$value - fi - $ECHO "Job starts at ($att)? $ECHOTXT" - read value - if test "$value" - then - att=$value - fi - $ECHO "Queue CPU limit ($cpu)? $ECHOTXT" - read value - if test "$value" - then - cpu=$value - fi - ;; - * ) - ;; - esac - $ECHO "Auto Restart option ($nauto)? $ECHOTXT" - read value - if test "$value" - then - nauto=$value - fi - $ECHO "Run directory ($DIRJOB)? $ECHOTXT" - read value - if test "$value" - then - DIRJOB=$value - DIRSCR=$DIRJOB - fi - $ECHO "Scratch directory ($DIRSCR)? $ECHOTXT" - read value - if test "$value" - then - DIRSCR=$value - fi - ;; - quit) - exit 1 - ;; - *) - break - ;; - -esac - - if test $nthread -eq -1 - then - nthread=${MARC_NUMBER_OF_THREADS:-0} - fi - if test $nthread -lt 0 - then - nthread=0 - fi - -done - -if test "$dllrun" -gt 0; then - exefile=exe_marc - prog=exe_marc - program=$exefile - bd=$MARC_BIN/ - if test "$user"; then - . $MARC_TOOLS/make_marc_user_dll $DIRJOB $user - user= - pathdll=yes - if test $prgsav = no; then - rmdll=yes - fi - if test $prgsav = yes; then - cpdll=yes - rmdll=yes - fi - fi - - if test "$pathdll"; then -# -# reset share lib path -# - if test $MACHINENAME = "HP" - then - SHLIB_PATH=$DIRJOB:$SHLIB_PATH - export SHLIB_PATH - fi - if test $MACHINENAME = "IBM" - then - LIBPATH=$DIRJOB:$LIBPATH - export LIBPATH - fi -# - LD_LIBRARY_PATH=$DIRJOB:$LD_LIBRARY_PATH - LD_LIBRARY64_PATH=$DIRJOB:$LD_LIBRARY64_PATH - LD_LIBRARYN32_PATH=$DIRJOB:$LD_LIBRARYN32_PATH - export LD_LIBRARY_PATH - export LD_LIBRARY64_PATH - export LD_LIBRARYN32_PATH - fi -fi -# end of dllrun>0 - - -if test $program = $exefile -o $program = $prog.marc -then - -# delete the old .log file unless we run in the background -if test "$deletelog" = yes -then - /bin/rm $jid.log 2>/dev/null -else - echo - echo running the job in the background, see $jid.log - echo -fi - -# -# check if this is an autoforge or rezoning or radiation job -# -if test $nprocd -eq 1 -then - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^autoforge"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^rezoning"` - if test "$line" - then - autoforge=1 - fi - line=`$AWK '/^[eE][nN][dD]/ {exit} ; {print}' $DIRJID/${jid}$dotdat | grep -i "^radiation"` - if test "$line" - then - autoforge=1 - fi -fi -# -# check that jobname for restarted run is not the same -# as restart file basename -# -if test "$rid" -then - if test "$jid" = "$rid" - then - echo " " - echo "ERROR: job name of current run is the same as job name" - echo " of the restarted job" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "ERROR: job name of current run is the same as job name" >> $jid.log - echo " of the restarted job" >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi -fi - -# -# user objects/libraries used -# - - if test "$objs" - then - program="$DIRJOB/$jid.marc" - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# user subroutine used -# - - if test "$user" - then -# program=$user.marc - program=$DIRJOB/`$BASENAME $user .f`.marc - case $program in - \/* | \.\/*) - bd= - ;; - *) - bd=`pwd`/ - ;; - esac - link=yes - fi - -# -# Special case for IBM using POE but not an SP machine -# in this case we always need a host file, also for serial jobs. -# -if test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP -then - MP_HOSTFILE=${jid}.host - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $nprocd -gt 1 - then - numdom=$nprocd - while test $numdom -gt 0 - do - hostname -s >> $MP_HOSTFILE - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - else - hostname -s > $MP_HOSTFILE - fi -fi -# -# check ssh for all hosts in host file -# -if test $nprocd -gt 1 -then -if test $MPITYPE = "intelmpi" -a "$INTELMPI_VERSION" = "HYDRA" - then -# get host list - if test "$host" - then - line=`grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' | uniq` -# count failing hosts - counter=0 - for i in $line - do - $RSH -o BatchMode=yes -o ConnectTimeout=10 $i uname -n - status=$? - if [[ $status != 0 ]] ; then - counter=$((counter+1)) - if [ "$counter" = "1" ]; then - echo " " - echo " error - connection test failed... " - echo " " - fi - echo " " - echo " connection test with ssh failed on host $i" - echo " check the following command: ssh $i uname -n " - echo " " - fi - done -# echo error message and quit - if test $counter -ne 0 - then - echo " " - echo " A parallel job using IntelMPI cannot be started. " - echo " The ssh command must be working correctly between " - echo " the computers used in the analysis. Furthermore, " - echo " it must be set up such that it does not prompt the " - echo " user for a password. Note that this is the case " - echo " also for running on a single machine. " - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo " A parallel job using IntelMPI cannot be started. ">> $jid.log - echo " The ssh command must be working correctly between ">> $jid.log - echo " the computers used in the analysis. Furthermore, ">> $jid.log - echo " it must be set up such that it does not prompt the ">> $jid.log - echo " user for a password. Note that this is the case ">> $jid.log - echo " also for running on a single machine. ">> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - else - counter=1 -# test ssh `hostname` - if test $counter -ne 0 - then - line=`hostname` - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi -# test ssh `hostname` - if test $counter -ne 0 - then - line=`hostname -s` - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi -# test ssh localhost - if test $counter -ne 0 - then - line=localhost - $RSH -o BatchMode=yes -o ConnectTimeout=10 $line uname -n - status=$? - if [[ $status != 0 ]] ; then - echo ssh login failed for $line machine. > /dev/null - else - counter=0 - fi - fi - if test $counter -ne 0 - then - echo " error - connection test failed... " - echo " " - echo " ssh needs to work on the machine without asking for a password." - echo " check the following command: ssh localhost uname -n" - echo " " - echo " A parallel job using IntelMPI cannot be started. " - echo " The ssh command must be working correctly between " - echo " the computers used in the analysis. Furthermore, " - echo " it must be set up such that it does not prompt the " - echo " user for a password. Note that this is the case " - echo " also for running on a single machine. " - echo " " - if test "$deletelog" = no - then - echo " error - connection test failed... " >> $jid.log - echo " " >> $jid.log - echo " ssh needs to work on the machine without asking for a password." >> $jid.log - echo " check the following command: ssh localhost uname -n" >> $jid.log - echo " " >> $jid.log - echo " A parallel job using IntelMPI cannot be started. " >> $jid.log - echo " The ssh command must be working correctly between " >> $jid.log - echo " the computers used in the analysis. Furthermore, " >> $jid.log - echo " it must be set up such that it does not prompt the " >> $jid.log - echo " user for a password. Note that this is the case " >> $jid.log - echo " also for running on a single machine. " >> $jid.log - echo " " >> $jid.log - echo " Exit number 8" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - echo $line $nprocd > $jid.hosts - host=$jid.hosts - fi - fi -fi -fi -# -# check correctness of host file; fix for user sub -# - if test $nprocd -gt 1 - then - -# construct the path name to the executable (execpath) - execpath=$MARC_BIN/$exefile - usersub=0 - if test $program = $prog.marc - then - execpath=$prog.marc - usersub=1 - fi - if test "$objs" - then - execpath="$DIRJOB/$jid.marc" - usersub=1 - fi - if test "$user" - then - execpath=$DIRJOB/`$BASENAME $user .f`.marc - usersub=1 - fi - export execpath - execname=`$BASENAME $execpath` - - if test "$host" - then - userhost=$host - case $userhost in - \/* | \.\/*) - ;; - *) - userhost=`pwd`/$userhost - ;; - esac - -# check that the number of processes specified in the hostfile is -# equal to nprocd specified by -nprocd. - numproc=`grep -v '^#' $host | $AWK -v sum=0 '{sum=sum+$2}; END {print sum}'` - if test $nprocd -ne $numproc - then - echo " " - echo "error, the number of processes specified in the host file" - echo "must be equal to the number of processes given by -nprocd/-nsolver" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, the number of processes specified in the host file" >> $jid.log - echo "must be equal to the number of processes given by -nprocd/-nsolver" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - -# check for Myrinet that the number of processes per host is -# less than number of available user ports, 5 -# .gmpi directory must exist in user's home directory -# and must have write permission from remote hosts - if test $MPITYPE = "myrinet" - then - numproc=`grep -v '^#' $host | $AWK -v sum=1 '{if( $2 > 5) sum=6}; END {print sum}'` - if test $numproc -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes specified " - echo "in the hostfile must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes specified " >> $jid.log - echo "in the hostfile must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - if test ! -d ~/.gmpi - then - echo " " - echo "error, for Myrinet a .gmpi directory must exist " - echo "under the user's home directory" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a .gmpi directory must exist " >> $jid.log - echo "under the user's home directory" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - homedir=`echo ~` - for i in `grep -v '^#' $host | $AWK '{if (NF > 0) print $1}'` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - $RSH $i /bin/touch $homedir/.gmpi/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - echo " " - echo "error, for Myrinet a shared .gmpi directory must exist " - echo "under the user's home directory " - echo "with remote write permission" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet a shared .gmpi directory must exist " >> $jid.log - echo "under the user's home directory " >> $jid.log - echo "with remote write permission" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - else - /bin/rm tmp.$$ - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - fi - fi - done - fi - fi - -# construct the host file $jid.host which is used by mpirun -# skip lines starting with # and only consider lines with more than -# one word in them. Note that the hostfile given to this script -# has two columns: the host name and the number of shared processes -# to run on this host. mpirun wants the number of _other_ -# processes to run in addition to the one being run on the machine -# on which the job is started. hence the $2-1 for fnr == 1. - if test -f $jid.host - then - /bin/rm $jid.host 2> /dev/null - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then -# HPMPI or HP hardware MPI - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ - -v mpihpspecial="$MPIHPSPECIAL" \ -'{if ( NF > 0) {\ - fnr++ ; \ - printf("-h %s -np %s",$1,$2); \ - printf(" %s",mpihpspecial); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF >= 3 ) printf(" -e MPI_WORKDIR=%s", $3);\ - if ( NF >= 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) \ - }\ - }' > $jid.host -# end HPMPI or HP hardware MPI - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then -# IBM using hardware MPI (POE) - MP_HOSTFILE=$jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.host -# end IBM using hardware MPI (POE) -# for Intel MPI, need to create a machinefile for DMP - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then -# Intel MPI - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - /bin/cp $host $jid.host - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Intel MPI for DMP -# for Solaris HPC 7.1, need to create a machinefile for DMP - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then -# Solaris HPC 7.1 - if test -f $jid.mfile - then - /bin/rm $jid.mfile 2> /dev/null - fi - grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile -# end Solaris HPC 7.1 for DMP -# for Myrinet, construct a configuration file in ~/.gmpi -# this must be readable by each process -# format is (hostname) (port number) for each process - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - grep -v '^#' $host | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ -{if ( NF > 0 ) \ - for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc]); \ -}' >> ~/.gmpi/$jid.host - else -# this is for mpich-1.2.5 and later, using the -pg option -# format: host nproc executable user arguments -# the arguments are added later - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub -v user=`whoami` \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s %s\n",path,user);\ - if ( NF == 3 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s %s\n",path,user) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s %s\n",$3,en,user); else printf(" %s/bin/%s %s\n",$4,en,user) \ - }\ - }' > $jid.host - fi -# end Myrinet - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then -# Compaq MPI via Memory Channel - grep -v '^#' $host | $AWK '{if (NF > 0) print $1}' > $jid.host -# end Compaq MPI - else -# MPICH - grep -v '^#' $host | $AWK -v path=$execpath -v en=$execname -v us=$usersub \ -'{if ( NF > 0) {\ - fnr++ ; \ - if ( fnr == 1 ) printf("%s %d",$1,$2-1); \ - else printf("%s %s",$1,$2); \ - if ( NF == 2 ) printf(" %s\n",path);\ - if ( NF == 3 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s\n",path) ;\ - if ( NF == 4 ) if (us) printf(" %s/%s\n",$3,en); else printf(" %s/bin/%s\n",$4,en) \ - }\ - }' > $jid.host - fi -# define the variable host and host_filt -# host_filt is used for loops over hosts -# for Myrinet we need to use a filtered variant of userhost -# for others we can use $host - if test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - host=~/.gmpi/$jid.host - host_filt=$jid.host_tMp - grep -v '^#' $userhost | $AWK '{if (NF > 0) print $1}' > $host_filt - else - host=$jid.host - host_filt=$host - fi - else - host=$jid.host - host_filt=$host - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - host_filt=$jid.mfile - fi - fi -# figure out if the machines in the hostfile are nfs mounted -# or distributed and set the variable "dirstatus" accordingly. -# only perform the check if user subroutine is used -# or a user subroutine executable is used - - numfield=1 - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - numfield=2 - fi - DIR1=$DIRJOB - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - counter=0 - echo " " - echo "checking if local or shared directories for host" - if test "$deletelog" = no - then - echo "checking if local or shared directories for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - dirstatus[$counter]="shared" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - $RSH $i /bin/touch $DIR1/$jid.$$ 2> tmp.$$ - if test -s tmp.$$ - then - dirstatus[$counter]="local" - /bin/rm tmp.$$ - else - if test ! -f $jid.$$ - then - dirstatus[$counter]="local" - $RSH $i /bin/rm $DIR1/$jid.$$ - else - /bin/rm $jid.$$ - fi - fi - if test -f tmp.$$ - then - /bin/rm tmp.$$ - fi - if test -f $jid.$$ - then - /bin/rm $jid.$$ - fi - echo " ${dirstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${dirstatus[$counter]}" >> $jid.log - fi - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - fi - -# figure out if this is a compatible set of machines -# unless explicitly specified with flag -comp -# only perform the check if user subroutine is used -# or a user subroutine executable is used -# Myrinet does not support heterogeneous - if test $program = $prog.marc -o -n "$user" -o -n "$objs" - then - if test $compatible = "unknown" - then - thisname=$ARCH - compatible=yes - counter=0 - echo "checking if machines are compatible for host" - if test "$deletelog" = no - then - echo "checking if machines are compatible for host" >> $jid.log - fi - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]="yes" - $ECHO " $i $ECHOTXT" - if test "$deletelog" = no - then - $ECHO " $i $ECHOTXT" >> $jid.log - fi - othername=`$RSH $i uname -a | cut -f 1 -d " "` - if test $thisname != $othername - then - compatible=no - compstatus[$counter]="no" - fi - fi - echo " ${compstatus[$counter]}" - if test "$deletelog" = no - then - echo " ${compstatus[$counter]}" >> $jid.log - fi - done - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - fi - else - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - compstatus[$counter]=$compatible - fi - done - if test $compatible = "no" - then - echo "all machines assumed incompatible" - if test "$deletelog" = no - then - echo "all machines assumed incompatible" >> $jid.log - fi - else - echo "all machines compatible" - if test "$deletelog" = no - then - echo "all machines compatible" >> $jid.log - fi - fi - fi -# error out if user objects or libraries are used on incompatible machines - if test "$compatible" = "no" -a -n "$objs" - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" - if test "$deletelog" = no - then - echo "User object/libraries cannot be used in a parallel job on incompatible machines" >> $jid.log - fi - exit 1 - fi -# modify new host file if NFS mounted heterogeneous machine - doit= - if test $program = $prog.marc - then - doit=yes - fi - if test "$user" - then - doit=yes - fi - if test "$doit" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - $AWK -v hst=$i '{fnr++ ; \ -if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \ -printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$} - /bin/mv $jid.host{$$} $jid.host - host=$jid.host - fi - fi - done - fi - fi # if test $program = $prog.marc -o $user -o $obj - - else # if test $host - # assume shared memory machine if no hostfile given and - # MPITYPE is set to mpich or Myrinet - # check for Myrinet that the total number of processes is - # less than number of available user ports, 5 - if test $MPITYPE = "mpich" -o $MPITYPE = "scali" - then - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - host=$jid.host - elif test $MPITYPE = "myrinet" - then - if test $nprocd -gt 5 - then - echo " " - echo "error, for Myrinet the number of processes " - echo "must not exceed 5 for a hostname" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error, for Myrinet the number of processes " >> $jid.log - echo "must not exceed 5 for a hostname" >> $jid.log - echo " " >> $jid.log - fi - exit 1 - fi - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - echo $nprocd > ~/.gmpi/$jid.host - echo `hostname` $nprocd | $AWK \ -'BEGIN {iport[0] = 2; \ - iport[1] = 4; \ - iport[2] = 5; \ - iport[3] = 6; \ - iport[4] = 7 \ - } \ - {for(iproc = 0; iproc < $2; iproc++) printf("%s %d\n",$1,iport[iproc])} \ -' >> ~/.gmpi/$jid.host - host=~/.gmpi/$jid.host - else - numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'` - echo `hostname` $numproc $execpath > $jid.host - - fi - fi # if test myrinet - - fi # if test $host - - fi # if test $nprocd -gt 1 - -fi # if test $program = $exefile -o $program = $prog.marc - -############################################################################## -# construct run stream (Marc only) # -############################################################################## - -# set maximum message length for ddm to a large number -# for vendor provided mpi -if test $itree -eq 0 -a $MPITYPE = hardware -then - itree=100000000 - if test $MACHINENAME = SGI - then - itree=100000001 - fi -fi -if test $itree -eq 0 -a $MPITYPE = hpmpi -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = myrinet -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = nec -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = scali -then - itree=100000000 -fi -if test $itree -eq 0 -a $MPITYPE = intelmpi -then - itree=100000000 -fi -if test $nprocdddm -lt 2 -then - nprocdarg= -else - nprocdarg="$nprocdarg $nprocdddm" -fi -if test $nsolver -eq 0 -then - nsolverarg= -else - nsolverarg="$nsolverarg $nsolver" -fi -if test $nprocdddm -lt 2 -a $nsolver -eq 0 -then -nprocd=0 -fi -if test $nprocd -gt 0 -then - if test "$host" - then - if test -z "$RUN_JOB2" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $host -- -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = IBM -a $MPITYPE = hardware -a "$MACHINETYPE" = NONSP - then - RUN_JOB="$RUN_JOB2 $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MPITYPE = "myrinet" - then - if test $MPIVERSION = "MPICH-GM1.2.1..7" - then - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB_TMP="$RUN_JOB2 $host $bd$program" - RUN_JOB=" -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - elif test $MACHINENAME = DEC -a $MPITYPE = hardware - then - RUN_JOB="$RUN_JOB2 $nprocd -hf $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - elif test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - numhost=`uniq $jid.mfile | wc -l` - if test "$INTELMPI_VERSION" = "HYDRA" - then - RUN_JOB_TMP="$RUN_JOB2 -machinefile $jid.mfile -configfile $jid.cfile" - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n $numhost -r $RSH -f $jid.mfile - RUN_JOB_TMP="$RUN_JOB2 $jid.cfile" - fi - -# intelmpi uses configfile. format: -# -host host1 -n n1 executable marcargs -# one such line per host -# collect the marcargs in RUN_JOB and construct the config file later -# collect the run stream in RUN_JOB_TMP - RUN_JOB="-jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - - - elif test $MACHINENAME = "SUN" -a $MPITYPE = "hardware" - then - RUN_JOB="$RUN_JOB2 $jid.mfile -n $nprocd $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB2 $host $bd$program -jid $jid -dirjid $DIRJID \ -$nprocdarg \ -$nsolverarg \ --maxnum $MAXNUM -itree $itree \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - if test "$userhost" - then - RUN_JOB="$RUN_JOB -mhost $userhost" - fi - if test $MPITYPE = "scali" - then -# set default working directory to /tmp to allow -# different directory names - SCAMPI_WORKING_DIRECTORY=/tmp - export SCAMPI_WORKING_DIRECTORY - fi - else - if test -z "$RUN_JOB1" - then - echo " " - echo "error: parallel job attempted on non-parallel version," - echo " or, if parallel version is installed, the include " - echo " file is probably corrupted" - echo " " - if test "$deletelog" = no - then - echo " " >> $jid.log - echo "error: parallel job attempted on non-parallel version," >> $jid.log - echo " or, if parallel version is installed, the include " >> $jid.log - echo " file is probably corrupted" >> $jid.log - echo " " >> $jid.log - fi - exit - fi - RUNNPROCD=$nprocd - if test $MACHINENAME = "IBM" -a $MPITYPE = "hardware" - then - RUNNPROCD= - MP_PROCS=$nprocd - export MP_PROCS - fi - if test $MPITYPE = "myrinet" - then - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - else - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - echo " " > /dev/null - else - export I_MPI_JOB_CONTEXT=$$ - mpdboot -n 1 -f $jid.hosts - fi - RUN_JOB="$RUN_JOB1 $RUNNPROCD $bd$program -jid $jid -dirjid $DIRJID \ - $nprocdarg \ - $nsolverarg \ - -maxnum $MAXNUM -itree $itree \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - fi - fi -else - if test $nauto -gt 0 -o $ndcoup -gt 0 - then - RUN_JOB="$RUN_JOB0 $BINDIR/exe_auto $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ - -nthread $nthread $gpuoption -dirjob $DIRJOB " - else -# this is for a serial job without auto restart: - RUN_JOB="$RUN_JOB0 $bd$program -jid $jid -dirjid $DIRJID \ --maxnum $MAXNUM \ --nthread $nthread $gpuoption -dirjob $DIRJOB " - fi -fi -if test "$rid" -then - RUN_JOB="$RUN_JOB -rid $rid -dirrid $DIRRID" -fi -if test "$pid" -then - RUN_JOB="$RUN_JOB -pid $pid -dirpid $DIRPID" -fi -if test "$sid" -then - RUN_JOB="$RUN_JOB -sid $sid -dirsid $DIRSID" -fi -if test "$did" -then - RUN_JOB="$RUN_JOB -def $did -dirdid $DIRDID" -fi -if test "$vid" -then - RUN_JOB="$RUN_JOB -vf $vid -dirvid $DIRVID" -fi -if test $nauto -gt 0 -then - RUN_JOB="$RUN_JOB -autorst $nauto " -fi -if test $ndcoup -gt 0 -then - RUN_JOB="$RUN_JOB -dcoup $ndcoup " -fi -if test $ndytran -gt 0 -then - RUN_JOB="$RUN_JOB -dytran $ndytran " -fi -if test $mesh -gt 0 -then - RUN_JOB="$RUN_JOB -me $mesh " -fi -if test $noutcore -gt 0 -then - RUN_JOB="$RUN_JOB -outcore $noutcore " -fi -if test "$dllrun" -gt 0 -then - RUN_JOB="$RUN_JOB -dll $dllrun " -fi -if test "$trkrun" -gt 0 -then - RUN_JOB="$RUN_JOB -trk $trkrun " -fi -if test "$iam" -then - RUN_JOB="$RUN_JOB -iam $iam " -fi -if test "$justlist" -then - RUN_JOB="$RUN_JOB -list 1 " -fi -if test "$feature" -then - RUN_JOB="$RUN_JOB -feature $feature " -fi -if test "$memlimit" -ne 0 -then - RUN_JOB="$RUN_JOB -ml $memlimit " -fi -if test "$cpinput" -then - RUN_JOB="$RUN_JOB -ci $cpinput " -fi -if test "$cpresults" -then - RUN_JOB="$RUN_JOB -cr $cpresults " -fi -if test "$DIRSCR" != "$DIRJOB" -then - RUN_JOB="$RUN_JOB -dirscr $DIRSCR" -else - DIRSCR=$DIRJOB -fi -if test "$makebdf" -then - RUN_JOB="$RUN_JOB -bdf $makebdf " -fi -if test $MPITYPE = "myrinet" -a "$host" -a "$MPIVERSION" != "MPICH-GM1.2.1..7" -then - # append $RUN_JOB to all lines of the host file - # and set RUN_JOB - $AWK -v args="$RUN_JOB" '{print $0,args}' $host > $host.$$ - /bin/mv $host.$$ $host - RUN_JOB=$RUN_JOB_TMP -fi -if test $MPITYPE = "intelmpi" -a "$host" -then - # construct config file, append $RUN_JOB to all lines of the config file - # and set RUN_JOB - if test "$INTELMPI_VERSION" = "HYDRA" - then - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-n %s",$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - else - grep -v '^#' $host | $AWK -v args="$RUN_JOB" -v path=$execpath -v en=$execname -v us=$usersub \ - '{if ( NF > 0) {\ - printf("-host %s -n %s",$1,$2); \ - if ( NF == 2 ) printf(" %s",path);\ - if ( NF >= 3 ) if (us) printf(" %s/%s",$3,en); else printf(" %s",path); \ - printf(" %s\n",args); \ - }\ - }' > $jid.cfile - fi - RUN_JOB=$RUN_JOB_TMP -fi -echo " " -echo "Final run stream value" -echo " RUNJOB="$RUN_JOB -if test "$deletelog" = no -then -echo " " >> $jid.log -echo "Final run stream value" >> $jid.log -echo " RUNJOB="$RUN_JOB >> $jid.log -fi - - -############################################################################## -# run marc using valgrind # -############################################################################## -#RUN_JOB="valgrind $RUN_JOB" -#RUN_JOB="valgrind --read-var-info=yes --gen-suppressions=yes $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=all -v $RUN_JOB" -#RUN_JOB="valgrind --gen-suppressions=yes --error-limit=no $RUN_JOB" -############################################################################## - - -############################################################################## -# run the requested program in a queue # -############################################################################## - -if test "$deletelog" = yes -then - echo - date -else - echo >> $jid.log - date >> $jid.log -fi -if [ $qid = short -o $qid = long -o $qid = verylong -o $qid = at ] -then - -/bin/rm -f $jid.runmarcscript - - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - userobj=$DIRJOB/`$BASENAME $user .f`.o - basefile=`$BASENAME $usersubname` - if test ${basefile##*.} = f - then - usersub=$DIRJOB/`$BASENAME $user .f`.F - ln -sf "$user.f" "$usersub" - else - usersub=$usersubname - fi - - fi - cat > $jid.runmarcscript << END4 - if test "$user" - then - if test ${basefile##*.} = f - then - ln -sf "$user.f" "$usersub" - fi - if test $MACHINENAME = "CRAY" - then - $FORTRAN $usersub || \ - { - echo "$0: compile failed for $user.f" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $FORTRAN $usersub -o $userobj || \ - { - echo "$0: compile failed for $user.f" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - if test ${basefile##*.} = f - then - /bin/rm -f "$usersub" - fi - fi - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - $SOLVERLIBS \ - $MARCCUDALIBS \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } -END4 -else - prgsav=yes -fi -/bin/rm $userobj 2>/dev/null - -# -# run marc -# - -cat >> $jid.runmarcscript << END5 - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -# first remove all .out files and incremental restart files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - /bin/rm $DIRJOB/$numdom${jid}_i_*.t08 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null - /bin/rm $DIRJOB/${jid}_i_*.t08 2>/dev/null -fi - -if test $nprocdddm -gt 1 -then - $RUN_JOB 2>>$jid.log -else - $RUN_JOB 2>>$jid.log -fi - -if test $dllrun -eq 0; then - if test $prgsav = no - then - /bin/rm -f $bd$program 2>/dev/null - fi -else - if test $cpdll = yes; then - filename=`basename $usersubname .f` - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes - then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test \$numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=\`echo \$numdom | $AWK '{sum=\$1-1}; {print sum}'\` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -END5 - - -# Submit to marc batch queue -# -if [ $qid = at ] -then -QUENAME=at -SUBMCMD= -else -# -# Submit to qsub queue -# -QUENAME=qsub -SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid" -if test "$priority" -then - SUBMCMD=$SUBMCMD" -p $priority" -fi -if test "$att" -then - SUBMCMD=$SUBMCMD" -a $att" -fi -if test "$cpu" -then - SUBMCMD=$SUBMCMD" -lt $cpu" -fi - -fi -echo $QUENAME $SUBMCMD -#cat $jid.runmarcscript -$QUENAME $SUBMCMD < $jid.runmarcscript - -/bin/rm -f $jid.runmarcscript - -############################################################################## -# run the requested program in the background # -############################################################################## - -else -if test $qid = background -then - -# -# first remove all old .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi -# -# compile user subroutine if present -# -( -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user.f $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_user $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user.f on host $i" - echo " $PRODUCT Exit number 3" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser.f 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user.f on host `hostname`" - fi - userobj=$DIRJOB/`$BASENAME $user .f`.o - basefile=`$BASENAME $usersubname` - if test ${basefile##*.} = f - then - usersub=$DIRJOB/`$BASENAME $user .f`.F - ln -sf "$user.f" "$usersub" - else - usersub=$usersubname - fi - if test $MACHINENAME = "CRAY" - then - $FORTRAN $usersub || \ - { - echo "$0: compile failed for $user.f" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $FORTRAN $usersub -o $userobj || \ - { - echo "$0: compile failed for $user.f" - echo " $PRODUCT Exit number 3" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - if test ${basefile##*.} = f - then - /bin/rm -f "$usersub" - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - echo " $PRODUCT Exit number 3" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null - -# -# run marc - -# - -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi - -$RUN_JOB & - -marcpid=$! -echo $marcpid > $DIRJOB/$jid.pid -wait $marcpid - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - if test "$host" - then - /bin/rm $jid.mfile 2> /dev/null - /bin/rm $jid.hosts 2> /dev/null - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.cfile 2> /dev/null - fi - fi - fi -fi - - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=`basename $usersubname .f` - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi -) 1>>$jid.log 2>&1 & - - -############################################################################## -# run the requested program in the foreground # -############################################################################## - -else - -# -# compile user subroutine if present -# -if test "$link" -then - if test "$user" - then - # compile and link on other hosts in $host if compstatus=no - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${compstatus[$counter]} = "no" - then - DIR1=$DIRJOB - DIR2=$DIR - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - marcdir=`echo $line | $AWK '{print $4}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - if test -n "$marcdir" - then - DIR2=$marcdir - fi - # first copy over the user sub if local directories - if test ${dirstatus[$counter]} = "local" - then - $RCP $user.f $i:$DIR1/ - fi - # do the compilation on the other machine - if test ${dirstatus[$counter]} = "shared" - then - hname=_$ibase - else - hname= - fi - remoteprog=$DIR1/${execname}$hname - remoteuser=$DIR1/`$BASENAME $user` - $RSH $i /bin/rm $remoteprog 2> /dev/null - echo - $RSH $i $DIR2/tools/comp_user $DIR2 $DIR1 $remoteuser $remoteprog - # check if successful, the new executable should be there - line=`$RSH $i /bin/ls $remoteprog 2> /dev/null` - if test "$line" - then - echo compilation and linking successful on host $i - else - echo "$0: compile failed for $user.f on host $i" - exit 1 - fi - # remove the user subroutine on remote machine - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $remoteuser.f 2> /dev/null - fi - fi - fi - done - fi - fi - if test "$userhost" - then - echo - echo "Compiling and linking user subroutine $user.f on host `hostname`" - fi - userobj=$DIRJOB/`$BASENAME $user .f`.o - basefile=`$BASENAME $usersubname` - if test ${basefile##*.} = f - then - usersub=$DIRJOB/`$BASENAME $user .f`.F - ln -sf "$user.f" "$usersub" - else - usersub=$usersubname - fi - if test $MACHINENAME = "CRAY" - then - $FORTRAN $usersub || \ - { - echo "$0: compile failed for $user.f" - exit 1 - } - /bin/rm $program 2>/dev/null - else - $FORTRAN $usersub -o $userobj || \ - { - echo "$0: compile failed for $user.f" - exit 1 - } - /bin/rm $program 2>/dev/null - fi - if test ${basefile##*.} = f - then - /bin/rm -f "$usersub" - fi - fi # if test $user - - - $LOAD $bd${program} $MARC_LIB/main.o \ - $MARC_LIB/blkdta.o $MARC_LIB/comm?.o \ - ${userobj-} \ - $objs \ - $MARC_LIB/srclib.a \ - $MNFLIBS \ - $MDUSER \ - ${MUMPSSOLVERLIBS} \ - $MDSRCLIB \ - $MARC_LIB/mcvfit.a \ - $STUBS \ - ${SOLVERLIBS} \ - ${MARCCUDALIBS} \ - $TKLIBS \ - $MRCLIBS \ - $METISLIBS \ - $SYSLIBS \ - $SECLIBS || \ - { - echo "$0: link failed for ${user:+$userobj }$objs" - exit 1 - } - # copy user subroutine executable for hosts using local working dir - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes" - then - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - echo "Copying executable to host ${i}" - $RCP $program ${i}:${DIR1}/ - fi - fi - done - fi - fi -else # if test $link - prgsav=yes -fi # if test $link -/bin/rm $userobj 2>/dev/null - -# -# run marc -# -# Define share library path based on platforms -# This is required for using the Patran Mesher -if test $MACHINENAME = "IBM" -then - LIBPATH=$MARC_LIB:$MARC_LIB_SHARED:$LIBPATH - export LIBPATH -fi -# first remove all .out files -# the ones for ddm are removed in the code -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRJOB/$numdom$jid.out 2>/dev/null - /bin/rm $DIRJOB/$numdom$jid.log 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done -else - /bin/rm $DIRJOB/$jid.out 2>/dev/null -fi - -$RUN_JOB - -if test $nprocd -gt 1 -then - if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi" - then - if test "$INTELMPI_VERSION" = "HYDRA" - then - if test "$host" - then - /bin/rm $jid.mfile 2> /dev/null - /bin/rm $jid.hosts 2> /dev/null - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.cfile 2> /dev/null - else - echo " " > /dev/null - fi - else - if test "$host" - then - mpdcleanup -a -f $jid.mfile - /bin/rm $jid.host 2> /dev/null - /bin/rm $jid.mfile 2> /dev/null - else - mpdcleanup -a -f $jid.hosts - /bin/rm $jid.hosts 2> /dev/null - fi - fi - fi -fi - -if test $dllrun -eq 0; then -if test $prgsav = no -then - /bin/rm -f $bd$program 2>/dev/null - # for network run, remove executable on remote machines - # and executables with modified name - if test $nprocd -gt 1 - then - if test "$userhost" - then - counter=0 - for i in `$AWK -v n=$numfield '{print $n}' $host_filt` - do - ibase=${i%%.*} - if test $ibase != $thishost - then - counter=$((counter+1)) - DIR1=$DIRJOB - line=`grep -v '^#' $userhost | grep "^$ibase "` - workdir=`echo $line | $AWK '{print $3}'` - if test -n "$workdir" - then - DIR1=$workdir - fi - # if an incompatible host uses shared directory, - # then the root machine deletes the executable - if test ${dirstatus[$counter]} = "shared" -a ${compstatus[$counter]} = "no" - then - hname=_$ibase - /bin/rm ${execname}$hname - fi - # if local directory used, the remote machine - # deletes the executable - if test ${dirstatus[$counter]} = "local" - then - $RSH $i /bin/rm $DIR1/${execname} 2>/dev/null - fi - fi - done - fi - fi -fi -else -#dllrun >0 - if test $cpdll = yes; then - filename=`basename $usersubname .f` - /bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null - fi - if test $rmdll = yes;then - /bin/rm -f $DIRJOB/$marcdll 2>/dev/null - fi -fi - -if test $nprocdddm -gt 1 -then - numdom=$nprocdddm - while test $numdom -gt 0 - do - /bin/rm $DIRSCR/$numdom$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t74 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t75 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t76 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t77 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t78 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t79 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t84 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t85 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t86 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t87 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t88 2>/dev/null - /bin/rm $DIRSCR/$numdom$jid.t90 2>/dev/null - numdom=`echo $numdom | $AWK '{sum=$1-1}; {print sum}'` - done - /bin/rm $DIRJOB/$jid.pid 2>/dev/null - if test $MPITYPE = "myrinet" - then - if test -f "$host_filt" - then - /bin/rm $host_filt - fi - fi -else - /bin/rm $DIRSCR/$jid.t02 2>/dev/null - /bin/rm $DIRSCR/$jid.t03 2>/dev/null - /bin/rm $DIRSCR/$jid.t11 2>/dev/null - /bin/rm $DIRSCR/$jid.t12 2>/dev/null - /bin/rm $DIRSCR/$jid.t13 2>/dev/null - /bin/rm $DIRSCR/$jid.t14 2>/dev/null - /bin/rm $DIRSCR/$jid.t15 2>/dev/null - /bin/rm $DIRSCR/$jid.t22 2>/dev/null - /bin/rm $DIRSCR/$jid.t23 2>/dev/null - /bin/rm $DIRSCR/$jid.t32 2>/dev/null - /bin/rm $DIRSCR/$jid.t33 2>/dev/null - /bin/rm $DIRSCR/$jid.t81 2>/dev/null - /bin/rm $DIRSCR/$jid.t82 2>/dev/null - /bin/rm $DIRSCR/$jid.t83 2>/dev/null - /bin/rm $DIRSCR/$jid.t84 2>/dev/null - /bin/rm $DIRJOB/$jid.pid 2>/dev/null -fi - - -fi -fi diff --git a/installation/mods_MarcMentat/2013/Mentat_bin/edit_window b/installation/mods_MarcMentat/2013/Mentat_bin/edit_window deleted file mode 100644 index b732a7694..000000000 --- a/installation/mods_MarcMentat/2013/Mentat_bin/edit_window +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -# This script opens a window running an editor. -# The command to invoke the editor is specified during DAMASK installation - -%EDITOR% $* \ No newline at end of file diff --git a/installation/mods_MarcMentat/2013/Mentat_bin/edit_window.org b/installation/mods_MarcMentat/2013/Mentat_bin/edit_window.org deleted file mode 100644 index 64c0a68d0..000000000 --- a/installation/mods_MarcMentat/2013/Mentat_bin/edit_window.org +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# This script opens a window running an editor. The default window is an -# xterm, and the default editor is vi. These may be customized. - -dir= -for d in /usr/bin /usr/bin/X11; do - if test -x "$d/xterm"; then - dir="$d" - break - fi -done - -if test -z "$dir"; then - echo "$0: Could not find xterm" - exit 1 -fi - -"$dir/xterm" -T "vi $*" -n "vi $*" -e vi $* diff --git a/installation/mods_MarcMentat/2013/Mentat_bin/kill4 b/installation/mods_MarcMentat/2013/Mentat_bin/kill4 deleted file mode 100644 index 6d1ff84bf..000000000 --- a/installation/mods_MarcMentat/2013/Mentat_bin/kill4 +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "usage: $0 job_name" - exit 1 -fi - -echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2013/Mentat_bin/kill5 b/installation/mods_MarcMentat/2013/Mentat_bin/kill5 deleted file mode 100644 index 6d1ff84bf..000000000 --- a/installation/mods_MarcMentat/2013/Mentat_bin/kill5 +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "usage: $0 job_name" - exit 1 -fi - -echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2013/Mentat_bin/kill6 b/installation/mods_MarcMentat/2013/Mentat_bin/kill6 deleted file mode 100644 index 6d1ff84bf..000000000 --- a/installation/mods_MarcMentat/2013/Mentat_bin/kill6 +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "usage: $0 job_name" - exit 1 -fi - -echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2013/Mentat_bin/kill7 b/installation/mods_MarcMentat/2013/Mentat_bin/kill7 deleted file mode 100644 index 6d1ff84bf..000000000 --- a/installation/mods_MarcMentat/2013/Mentat_bin/kill7 +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "usage: $0 job_name" - exit 1 -fi - -echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2013/Mentat_bin/kill8 b/installation/mods_MarcMentat/2013/Mentat_bin/kill8 deleted file mode 100644 index 6d1ff84bf..000000000 --- a/installation/mods_MarcMentat/2013/Mentat_bin/kill8 +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "usage: $0 job_name" - exit 1 -fi - -echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2013/Mentat_bin/kill9 b/installation/mods_MarcMentat/2013/Mentat_bin/kill9 deleted file mode 100644 index 6d1ff84bf..000000000 --- a/installation/mods_MarcMentat/2013/Mentat_bin/kill9 +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "$1" = "" ]; then - echo "usage: $0 job_name" - exit 1 -fi - -echo STOP > $1.cnt diff --git a/installation/mods_MarcMentat/2013/Mentat_bin/submit1.org b/installation/mods_MarcMentat/2013/Mentat_bin/submit1.org deleted file mode 100644 index b54b2ee56..000000000 --- a/installation/mods_MarcMentat/2013/Mentat_bin/submit1.org +++ /dev/null @@ -1,163 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=ls -if test $MARCDIR1 -then - DIR=$MARCDIR1 -fi - -SRCEXT=.f -RSTEXT=.t08 -PSTEXT=.t19 -PSTEXTB=.t16 -VWFCEXT=.vfs - -slv=$1 -version=$2 -ndom_fea_solver=$3 -ndom_preprocessor=$4 -hostfile=$5 -compat=$6 -job=$7 -srcfile=$8 -srcmeth=$9 -shift 9 # cannot use $10, $11, ... -restart=$1 -postfile=$2 -viewfactorsfile=$3 -autorst=$4 -copy_datfile="-ci $5" -copy_postfile="-cr $6" -scr_dir=$7 -dcoup=$8 -nthread=$9 -shift 9 # cannot use $10, $11, ... -nsolver=$1 -mode=$2 -gpu=$3 - -if [ "$slv" != "" -a "$slv" != "marc" ]; then - slv="-iam sfm" -else - slv="" -fi - -if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then - nprocds="-nprocds $ndom_fea_solver" -else - nprocd="" - if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then - nprocd="-nprocd $ndom_preprocessor" - else - nprocd="" - fi -fi - -if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then - srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` - case "$srcmeth" in - -) - srcfile="-u $srcfile" - ;; - compsave) - srcfile="-u $srcfile -save y" - ;; - runsaved) - srcfile="-prog $srcfile" - ;; - esac -else - srcfile="" -fi - -if [ "$restart" != "" -a "$restart" != "-" ]; then - restart=`echo $restart | sed "s/$RSTEXT$//"` - restart="-r $restart" -else - restart="" -fi - -if [ "$postfile" != "" -a "$postfile" != "-" ]; then - postfile=`echo $postfile | sed "s/$PSTEXT$//"` - postfile=`echo $postfile | sed "s/$PSTEXTB$//"` - postfile="-pid $postfile" -else - postfile="" -fi - -if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then - viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` - viewfactorsfile="-vf $viewfactorsfile" -else - viewfactorsfile="" -fi - -if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then - hostfile="-ho $hostfile" -else - hostfile="" -fi - -if [ "$compat" != "" -a "$compat" != "-" ]; then - compat="-co $compat" -else - compat="" -fi - -if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then - scr_dir="-sd $scr_dir" -else - scr_dir="" -fi - -if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then - dcoup="-dcoup $dcoup" -else - dcoup="" -fi - -if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then - nthread="-nthread $nthread" -else - nthread="" -fi - -if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then - nsolver="-nsolver $nsolver" -else - nsolver="" -fi - -case "$mode" in - 4) mode="-mo i4" ;; - 8) mode="-mo i8" ;; - *) mode= ;; -esac - -if [ "$gpu" != "" -a "$gpu" != "-" ]; then - gpu="-gpu $gpu" -else - gpu="" -fi - -rm -f $job.cnt -rm -f $job.sts -rm -f $job.out -rm -f $job.log - -# To prevent a mismatch with the python version used by the solver -# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH -# unset environment variables PYTHONHOME and PYTHONPATH -unset PYTHONHOME -unset PYTHONPATH - -"${DIR}/tools/run_marc" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ - $srcfile $restart $postfile $viewfactorsfile $hostfile \ - $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ - $nthread $nsolver $mode $gpu > /dev/null 2>&1 -sleep 1 -exit 0 diff --git a/installation/mods_MarcMentat/2013/Mentat_bin/submit4 b/installation/mods_MarcMentat/2013/Mentat_bin/submit4 deleted file mode 100644 index dda98f475..000000000 --- a/installation/mods_MarcMentat/2013/Mentat_bin/submit4 +++ /dev/null @@ -1,164 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=%INSTALLDIR%/marc%VERSION% -if test $MARCDIR1 -then - DIR=$MARCDIR1 -fi - -SRCEXT=.f -RSTEXT=.t08 -PSTEXT=.t19 -PSTEXTB=.t16 -VWFCEXT=.vfs - -slv=$1 -version=$2 -ndom_fea_solver=$3 -ndom_preprocessor=$4 -hostfile=$5 -compat=$6 -job=$7 -srcfile=$8 -srcmeth=$9 -shift 9 # cannot use $10, $11, ... -restart=$1 -postfile=$2 -viewfactorsfile=$3 -autorst=$4 -copy_datfile="-ci $5" -copy_postfile="-cr $6" -scr_dir=$7 -dcoup=$8 -nthread=$9 -shift 9 # cannot use $10, $11, ... -nsolver=$1 -mode=$2 -gpu=$3 - -if [ "$slv" != "" -a "$slv" != "marc" ]; then - slv="-iam sfm" -else - slv="" -fi - -if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then - nprocds="-nprocds $ndom_fea_solver" -else - nprocd="" - if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then - nprocd="-nprocd $ndom_preprocessor" - else - nprocd="" - fi -fi - -if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then -# srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` - case "$srcmeth" in - -) - srcfile="-u $srcfile" - ;; - compsave) - srcfile="-u $srcfile -save y" - ;; - runsaved) - srcfile=${srcfile%.*}".marc" - srcfile="-prog $srcfile" - ;; - esac -else - srcfile="" -fi - -if [ "$restart" != "" -a "$restart" != "-" ]; then - restart=`echo $restart | sed "s/$RSTEXT$//"` - restart="-r $restart" -else - restart="" -fi - -if [ "$postfile" != "" -a "$postfile" != "-" ]; then - postfile=`echo $postfile | sed "s/$PSTEXT$//"` - postfile=`echo $postfile | sed "s/$PSTEXTB$//"` - postfile="-pid $postfile" -else - postfile="" -fi - -if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then - viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` - viewfactorsfile="-vf $viewfactorsfile" -else - viewfactorsfile="" -fi - -if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then - hostfile="-ho $hostfile" -else - hostfile="" -fi - -if [ "$compat" != "" -a "$compat" != "-" ]; then - compat="-co $compat" -else - compat="" -fi - -if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then - scr_dir="-sd $scr_dir" -else - scr_dir="" -fi - -if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then - dcoup="-dcoup $dcoup" -else - dcoup="" -fi - -if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then - nthread="-nthread $nthread" -else - nthread="" -fi - -if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then - nsolver="-nsolver $nsolver" -else - nsolver="" -fi - -case "$mode" in - 4) mode="-mo i4" ;; - 8) mode="-mo i8" ;; - *) mode= ;; -esac - -if [ "$gpu" != "" -a "$gpu" != "-" ]; then - gpu="-gpu $gpu" -else - gpu="" -fi - -rm -f $job.cnt -rm -f $job.sts -rm -f $job.out -rm -f $job.log - -# To prevent a mismatch with the python version used by the solver -# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH -# unset environment variables PYTHONHOME and PYTHONPATH -unset PYTHONHOME -unset PYTHONPATH - -"${DIR}/tools/run_damask_hmp" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ - $srcfile $restart $postfile $viewfactorsfile $hostfile \ - $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ - $nthread $nsolver $mode $gpu > /dev/null 2>&1 -sleep 1 -exit 0 diff --git a/installation/mods_MarcMentat/2013/Mentat_bin/submit5 b/installation/mods_MarcMentat/2013/Mentat_bin/submit5 deleted file mode 100644 index 1f96942d2..000000000 --- a/installation/mods_MarcMentat/2013/Mentat_bin/submit5 +++ /dev/null @@ -1,164 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=%INSTALLDIR%/marc%VERSION% -if test $MARCDIR1 -then - DIR=$MARCDIR1 -fi - -SRCEXT=.f -RSTEXT=.t08 -PSTEXT=.t19 -PSTEXTB=.t16 -VWFCEXT=.vfs - -slv=$1 -version=$2 -ndom_fea_solver=$3 -ndom_preprocessor=$4 -hostfile=$5 -compat=$6 -job=$7 -srcfile=$8 -srcmeth=$9 -shift 9 # cannot use $10, $11, ... -restart=$1 -postfile=$2 -viewfactorsfile=$3 -autorst=$4 -copy_datfile="-ci $5" -copy_postfile="-cr $6" -scr_dir=$7 -dcoup=$8 -nthread=$9 -shift 9 # cannot use $10, $11, ... -nsolver=$1 -mode=$2 -gpu=$3 - -if [ "$slv" != "" -a "$slv" != "marc" ]; then - slv="-iam sfm" -else - slv="" -fi - -if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then - nprocds="-nprocds $ndom_fea_solver" -else - nprocd="" - if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then - nprocd="-nprocd $ndom_preprocessor" - else - nprocd="" - fi -fi - -if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then -# srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` - case "$srcmeth" in - -) - srcfile="-u $srcfile" - ;; - compsave) - srcfile="-u $srcfile -save y" - ;; - runsaved) - srcfile=${srcfile%.*}".marc" - srcfile="-prog $srcfile" - ;; - esac -else - srcfile="" -fi - -if [ "$restart" != "" -a "$restart" != "-" ]; then - restart=`echo $restart | sed "s/$RSTEXT$//"` - restart="-r $restart" -else - restart="" -fi - -if [ "$postfile" != "" -a "$postfile" != "-" ]; then - postfile=`echo $postfile | sed "s/$PSTEXT$//"` - postfile=`echo $postfile | sed "s/$PSTEXTB$//"` - postfile="-pid $postfile" -else - postfile="" -fi - -if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then - viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` - viewfactorsfile="-vf $viewfactorsfile" -else - viewfactorsfile="" -fi - -if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then - hostfile="-ho $hostfile" -else - hostfile="" -fi - -if [ "$compat" != "" -a "$compat" != "-" ]; then - compat="-co $compat" -else - compat="" -fi - -if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then - scr_dir="-sd $scr_dir" -else - scr_dir="" -fi - -if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then - dcoup="-dcoup $dcoup" -else - dcoup="" -fi - -if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then - nthread="-nthread $nthread" -else - nthread="" -fi - -if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then - nsolver="-nsolver $nsolver" -else - nsolver="" -fi - -case "$mode" in - 4) mode="-mo i4" ;; - 8) mode="-mo i8" ;; - *) mode= ;; -esac - -if [ "$gpu" != "" -a "$gpu" != "-" ]; then - gpu="-gpu $gpu" -else - gpu="" -fi - -rm -f $job.cnt -rm -f $job.sts -rm -f $job.out -rm -f $job.log - -# To prevent a mismatch with the python version used by the solver -# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH -# unset environment variables PYTHONHOME and PYTHONPATH -unset PYTHONHOME -unset PYTHONPATH - -"${DIR}/tools/run_damask_mp" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ - $srcfile $restart $postfile $viewfactorsfile $hostfile \ - $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ - $nthread $nsolver $mode $gpu > /dev/null 2>&1 -sleep 1 -exit 0 diff --git a/installation/mods_MarcMentat/2013/Mentat_bin/submit6 b/installation/mods_MarcMentat/2013/Mentat_bin/submit6 deleted file mode 100644 index a9a74f4f3..000000000 --- a/installation/mods_MarcMentat/2013/Mentat_bin/submit6 +++ /dev/null @@ -1,164 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=%INSTALLDIR%/marc%VERSION% -if test $MARCDIR1 -then - DIR=$MARCDIR1 -fi - -SRCEXT=.f -RSTEXT=.t08 -PSTEXT=.t19 -PSTEXTB=.t16 -VWFCEXT=.vfs - -slv=$1 -version=$2 -ndom_fea_solver=$3 -ndom_preprocessor=$4 -hostfile=$5 -compat=$6 -job=$7 -srcfile=$8 -srcmeth=$9 -shift 9 # cannot use $10, $11, ... -restart=$1 -postfile=$2 -viewfactorsfile=$3 -autorst=$4 -copy_datfile="-ci $5" -copy_postfile="-cr $6" -scr_dir=$7 -dcoup=$8 -nthread=$9 -shift 9 # cannot use $10, $11, ... -nsolver=$1 -mode=$2 -gpu=$3 - -if [ "$slv" != "" -a "$slv" != "marc" ]; then - slv="-iam sfm" -else - slv="" -fi - -if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then - nprocds="-nprocds $ndom_fea_solver" -else - nprocd="" - if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then - nprocd="-nprocd $ndom_preprocessor" - else - nprocd="" - fi -fi - -if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then -# srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` - case "$srcmeth" in - -) - srcfile="-u $srcfile" - ;; - compsave) - srcfile="-u $srcfile -save y" - ;; - runsaved) - srcfile=${srcfile%.*}".marc" - srcfile="-prog $srcfile" - ;; - esac -else - srcfile="" -fi - -if [ "$restart" != "" -a "$restart" != "-" ]; then - restart=`echo $restart | sed "s/$RSTEXT$//"` - restart="-r $restart" -else - restart="" -fi - -if [ "$postfile" != "" -a "$postfile" != "-" ]; then - postfile=`echo $postfile | sed "s/$PSTEXT$//"` - postfile=`echo $postfile | sed "s/$PSTEXTB$//"` - postfile="-pid $postfile" -else - postfile="" -fi - -if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then - viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` - viewfactorsfile="-vf $viewfactorsfile" -else - viewfactorsfile="" -fi - -if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then - hostfile="-ho $hostfile" -else - hostfile="" -fi - -if [ "$compat" != "" -a "$compat" != "-" ]; then - compat="-co $compat" -else - compat="" -fi - -if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then - scr_dir="-sd $scr_dir" -else - scr_dir="" -fi - -if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then - dcoup="-dcoup $dcoup" -else - dcoup="" -fi - -if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then - nthread="-nthread $nthread" -else - nthread="" -fi - -if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then - nsolver="-nsolver $nsolver" -else - nsolver="" -fi - -case "$mode" in - 4) mode="-mo i4" ;; - 8) mode="-mo i8" ;; - *) mode= ;; -esac - -if [ "$gpu" != "" -a "$gpu" != "-" ]; then - gpu="-gpu $gpu" -else - gpu="" -fi - -rm -f $job.cnt -rm -f $job.sts -rm -f $job.out -rm -f $job.log - -# To prevent a mismatch with the python version used by the solver -# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH -# unset environment variables PYTHONHOME and PYTHONPATH -unset PYTHONHOME -unset PYTHONPATH - -"${DIR}/tools/run_damask_lmp" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ - $srcfile $restart $postfile $viewfactorsfile $hostfile \ - $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ - $nthread $nsolver $mode $gpu > /dev/null 2>&1 -sleep 1 -exit 0 diff --git a/installation/mods_MarcMentat/2013/Mentat_bin/submit7 b/installation/mods_MarcMentat/2013/Mentat_bin/submit7 deleted file mode 100644 index edbc1701c..000000000 --- a/installation/mods_MarcMentat/2013/Mentat_bin/submit7 +++ /dev/null @@ -1,164 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=%INSTALLDIR%/marc%VERSION% -if test $MARCDIR1 -then - DIR=$MARCDIR1 -fi - -SRCEXT=.f -RSTEXT=.t08 -PSTEXT=.t19 -PSTEXTB=.t16 -VWFCEXT=.vfs - -slv=$1 -version=$2 -ndom_fea_solver=$3 -ndom_preprocessor=$4 -hostfile=$5 -compat=$6 -job=$7 -srcfile=$8 -srcmeth=$9 -shift 9 # cannot use $10, $11, ... -restart=$1 -postfile=$2 -viewfactorsfile=$3 -autorst=$4 -copy_datfile="-ci $5" -copy_postfile="-cr $6" -scr_dir=$7 -dcoup=$8 -nthread=$9 -shift 9 # cannot use $10, $11, ... -nsolver=$1 -mode=$2 -gpu=$3 - -if [ "$slv" != "" -a "$slv" != "marc" ]; then - slv="-iam sfm" -else - slv="" -fi - -if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then - nprocds="-nprocds $ndom_fea_solver" -else - nprocd="" - if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then - nprocd="-nprocd $ndom_preprocessor" - else - nprocd="" - fi -fi - -if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then -# srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` - case "$srcmeth" in - -) - srcfile="-u $srcfile" - ;; - compsave) - srcfile="-u $srcfile -save y" - ;; - runsaved) - srcfile=${srcfile%.*}".marc" - srcfile="-prog $srcfile" - ;; - esac -else - srcfile="" -fi - -if [ "$restart" != "" -a "$restart" != "-" ]; then - restart=`echo $restart | sed "s/$RSTEXT$//"` - restart="-r $restart" -else - restart="" -fi - -if [ "$postfile" != "" -a "$postfile" != "-" ]; then - postfile=`echo $postfile | sed "s/$PSTEXT$//"` - postfile=`echo $postfile | sed "s/$PSTEXTB$//"` - postfile="-pid $postfile" -else - postfile="" -fi - -if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then - viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` - viewfactorsfile="-vf $viewfactorsfile" -else - viewfactorsfile="" -fi - -if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then - hostfile="-ho $hostfile" -else - hostfile="" -fi - -if [ "$compat" != "" -a "$compat" != "-" ]; then - compat="-co $compat" -else - compat="" -fi - -if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then - scr_dir="-sd $scr_dir" -else - scr_dir="" -fi - -if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then - dcoup="-dcoup $dcoup" -else - dcoup="" -fi - -if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then - nthread="-nthread $nthread" -else - nthread="" -fi - -if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then - nsolver="-nsolver $nsolver" -else - nsolver="" -fi - -case "$mode" in - 4) mode="-mo i4" ;; - 8) mode="-mo i8" ;; - *) mode= ;; -esac - -if [ "$gpu" != "" -a "$gpu" != "-" ]; then - gpu="-gpu $gpu" -else - gpu="" -fi - -rm -f $job.cnt -rm -f $job.sts -rm -f $job.out -rm -f $job.log - -# To prevent a mismatch with the python version used by the solver -# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH -# unset environment variables PYTHONHOME and PYTHONPATH -unset PYTHONHOME -unset PYTHONPATH - -"${DIR}/tools/run_damask_h" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ - $srcfile $restart $postfile $viewfactorsfile $hostfile \ - $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ - $nthread $nsolver $mode $gpu > /dev/null 2>&1 -sleep 1 -exit 0 diff --git a/installation/mods_MarcMentat/2013/Mentat_bin/submit8 b/installation/mods_MarcMentat/2013/Mentat_bin/submit8 deleted file mode 100644 index 872125981..000000000 --- a/installation/mods_MarcMentat/2013/Mentat_bin/submit8 +++ /dev/null @@ -1,164 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=%INSTALLDIR%/marc%VERSION% -if test $MARCDIR1 -then - DIR=$MARCDIR1 -fi - -SRCEXT=.f -RSTEXT=.t08 -PSTEXT=.t19 -PSTEXTB=.t16 -VWFCEXT=.vfs - -slv=$1 -version=$2 -ndom_fea_solver=$3 -ndom_preprocessor=$4 -hostfile=$5 -compat=$6 -job=$7 -srcfile=$8 -srcmeth=$9 -shift 9 # cannot use $10, $11, ... -restart=$1 -postfile=$2 -viewfactorsfile=$3 -autorst=$4 -copy_datfile="-ci $5" -copy_postfile="-cr $6" -scr_dir=$7 -dcoup=$8 -nthread=$9 -shift 9 # cannot use $10, $11, ... -nsolver=$1 -mode=$2 -gpu=$3 - -if [ "$slv" != "" -a "$slv" != "marc" ]; then - slv="-iam sfm" -else - slv="" -fi - -if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then - nprocds="-nprocds $ndom_fea_solver" -else - nprocd="" - if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then - nprocd="-nprocd $ndom_preprocessor" - else - nprocd="" - fi -fi - -if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then -# srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` - case "$srcmeth" in - -) - srcfile="-u $srcfile" - ;; - compsave) - srcfile="-u $srcfile -save y" - ;; - runsaved) - srcfile=${srcfile%.*}".marc" - srcfile="-prog $srcfile" - ;; - esac -else - srcfile="" -fi - -if [ "$restart" != "" -a "$restart" != "-" ]; then - restart=`echo $restart | sed "s/$RSTEXT$//"` - restart="-r $restart" -else - restart="" -fi - -if [ "$postfile" != "" -a "$postfile" != "-" ]; then - postfile=`echo $postfile | sed "s/$PSTEXT$//"` - postfile=`echo $postfile | sed "s/$PSTEXTB$//"` - postfile="-pid $postfile" -else - postfile="" -fi - -if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then - viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` - viewfactorsfile="-vf $viewfactorsfile" -else - viewfactorsfile="" -fi - -if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then - hostfile="-ho $hostfile" -else - hostfile="" -fi - -if [ "$compat" != "" -a "$compat" != "-" ]; then - compat="-co $compat" -else - compat="" -fi - -if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then - scr_dir="-sd $scr_dir" -else - scr_dir="" -fi - -if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then - dcoup="-dcoup $dcoup" -else - dcoup="" -fi - -if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then - nthread="-nthread $nthread" -else - nthread="" -fi - -if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then - nsolver="-nsolver $nsolver" -else - nsolver="" -fi - -case "$mode" in - 4) mode="-mo i4" ;; - 8) mode="-mo i8" ;; - *) mode= ;; -esac - -if [ "$gpu" != "" -a "$gpu" != "-" ]; then - gpu="-gpu $gpu" -else - gpu="" -fi - -rm -f $job.cnt -rm -f $job.sts -rm -f $job.out -rm -f $job.log - -# To prevent a mismatch with the python version used by the solver -# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH -# unset environment variables PYTHONHOME and PYTHONPATH -unset PYTHONHOME -unset PYTHONPATH - -"${DIR}/tools/run_damask" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ - $srcfile $restart $postfile $viewfactorsfile $hostfile \ - $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ - $nthread $nsolver $mode $gpu > /dev/null 2>&1 -sleep 1 -exit 0 diff --git a/installation/mods_MarcMentat/2013/Mentat_bin/submit9 b/installation/mods_MarcMentat/2013/Mentat_bin/submit9 deleted file mode 100644 index 44a4865fb..000000000 --- a/installation/mods_MarcMentat/2013/Mentat_bin/submit9 +++ /dev/null @@ -1,164 +0,0 @@ -#!/bin/sh -# -# The exit status of this script is read by Mentat. -# Normal exit status is 0. -# - -DIR=%INSTALLDIR%/marc%VERSION% -if test $MARCDIR1 -then - DIR=$MARCDIR1 -fi - -SRCEXT=.f -RSTEXT=.t08 -PSTEXT=.t19 -PSTEXTB=.t16 -VWFCEXT=.vfs - -slv=$1 -version=$2 -ndom_fea_solver=$3 -ndom_preprocessor=$4 -hostfile=$5 -compat=$6 -job=$7 -srcfile=$8 -srcmeth=$9 -shift 9 # cannot use $10, $11, ... -restart=$1 -postfile=$2 -viewfactorsfile=$3 -autorst=$4 -copy_datfile="-ci $5" -copy_postfile="-cr $6" -scr_dir=$7 -dcoup=$8 -nthread=$9 -shift 9 # cannot use $10, $11, ... -nsolver=$1 -mode=$2 -gpu=$3 - -if [ "$slv" != "" -a "$slv" != "marc" ]; then - slv="-iam sfm" -else - slv="" -fi - -if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then - nprocds="-nprocds $ndom_fea_solver" -else - nprocd="" - if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then - nprocd="-nprocd $ndom_preprocessor" - else - nprocd="" - fi -fi - -if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then -# srcfile=`echo $srcfile | sed "s/$SRCEXT$//"` - case "$srcmeth" in - -) - srcfile="-u $srcfile" - ;; - compsave) - srcfile="-u $srcfile -save y" - ;; - runsaved) - srcfile=${srcfile%.*}".marc" - srcfile="-prog $srcfile" - ;; - esac -else - srcfile="" -fi - -if [ "$restart" != "" -a "$restart" != "-" ]; then - restart=`echo $restart | sed "s/$RSTEXT$//"` - restart="-r $restart" -else - restart="" -fi - -if [ "$postfile" != "" -a "$postfile" != "-" ]; then - postfile=`echo $postfile | sed "s/$PSTEXT$//"` - postfile=`echo $postfile | sed "s/$PSTEXTB$//"` - postfile="-pid $postfile" -else - postfile="" -fi - -if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then - viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"` - viewfactorsfile="-vf $viewfactorsfile" -else - viewfactorsfile="" -fi - -if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then - hostfile="-ho $hostfile" -else - hostfile="" -fi - -if [ "$compat" != "" -a "$compat" != "-" ]; then - compat="-co $compat" -else - compat="" -fi - -if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then - scr_dir="-sd $scr_dir" -else - scr_dir="" -fi - -if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then - dcoup="-dcoup $dcoup" -else - dcoup="" -fi - -if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then - nthread="-nthread $nthread" -else - nthread="" -fi - -if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then - nsolver="-nsolver $nsolver" -else - nsolver="" -fi - -case "$mode" in - 4) mode="-mo i4" ;; - 8) mode="-mo i8" ;; - *) mode= ;; -esac - -if [ "$gpu" != "" -a "$gpu" != "-" ]; then - gpu="-gpu $gpu" -else - gpu="" -fi - -rm -f $job.cnt -rm -f $job.sts -rm -f $job.out -rm -f $job.log - -# To prevent a mismatch with the python version used by the solver -# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH -# unset environment variables PYTHONHOME and PYTHONPATH -unset PYTHONHOME -unset PYTHONPATH - -"${DIR}/tools/run_damask_l" $slv -j $job -v n -b y $nprocds $nprocd -autorst $autorst \ - $srcfile $restart $postfile $viewfactorsfile $hostfile \ - $compat $copy_datfile $copy_postfile $scr_dir $dcoup \ - $nthread $nsolver $mode $gpu > /dev/null 2>&1 -sleep 1 -exit 0 diff --git a/installation/mods_MarcMentat/2013/Mentat_menus/job_run.ms b/installation/mods_MarcMentat/2013/Mentat_menus/job_run.ms deleted file mode 100644 index cea791ed3..000000000 --- a/installation/mods_MarcMentat/2013/Mentat_menus/job_run.ms +++ /dev/null @@ -1,3206 +0,0 @@ -#ifndef AUTOFORGE -popmenu job_title_pm file jobs.ms -popdown job_title_ok file jobs.ms -#ifndef QT_MENTAT -popmenu marc_input_style_pm file job_common.ms -popmenu marc_input_style_run_adv_pm file job_common.ms -popmenu marc_version_run_pm file job_common.ms -#endif - -group job_solver_gr file job_common.ms -group user_domains_gr file domain_decomposition.ms -group user_domains_generate_gr file domain_decomposition.ms -group user_domains_tail_gr file domain_decomposition.ms -group job_solver_opts_gr file job_common.ms -popmenu ddm_options file job_common.ms - -#ifdef QT_MENTAT -browser edit_browser file file.ms -browser directory_browser file file.ms -screen domains file domain_decomposition.ms -#else -popmenu edit_browser_popmenu file file.ms -popmenu directory_browser_popmenu file file.ms -#endif - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu usersub_file_browser_pm { - - group { -#endif - - browser usersub_file_browser { - position 0 0 - size 82 72 - text "$usersub_file_browser_label" ($usersub_file_browser_label) - filter "*.f *.f90" - nvisible 10 - select_files true - cancel_action popdown - ok_action popdown - command "$usersub_file_browser_command" ($usersub_file_browser_command) - } -#ifndef QT_MENTAT - } - - window { - title " Select MARC User Subroutine File" - origin 30 30 - size 82 72 - } - - mode dialog - disable_right_mouse_button -} -#endif - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu host_file_browser_pm { - - group { -#endif - - browser host_file_browser { - position 0 0 - size 82 72 - text "$host_file_browser_label" ($host_file_browser_label) - filter "*" - nvisible 10 - select_files true - cancel_action popdown - ok_action popdown - command "$host_file_browser_command" ($host_file_browser_command) - } -#ifndef QT_MENTAT - } - - window { - title " Select MARC Host File" - origin 30 30 - size 82 72 - } - - mode dialog - disable_right_mouse_button -} -#endif - - -#-------------------------------------------------------------------------------------------------- -popmenu job_run_popmenu { - -#ifdef QT_MENTAT - text "RUN JOB" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 50 4 - text "RUN JOB" - } -#endif - -#ifdef QT_MENTAT - label { - position 0 0 - size 6 4 - text "NAME" - } - - display { - position +6 = - size 26 4 - display "job_name" - } - - label { - position 0 +4 - size 6 4 - text "TYPE" - } - - display { - position +6 = - size 26 4 - display job_class_label - } -#endif - - button { -#ifdef QT_MENTAT - position 1 9 -#else - position 1 5 -#endif - size 24 4 - text "USER SUBROUTINE FILE" -#ifdef QT_MENTAT - browser usersub_file_browser -#else - popmenu usersub_file_browser_pm -#endif - settext $usersub_file_browser_label "SELECT USER SUBROUTINE FILE" - set $usersub_file_browser_command "*job_usersub_file" - help job_usersub_file - } - - toggle { - position +26 = - size 22 4 - text "SELECTED USER SUBS" - toggle job_usersubs - help job_run_seluser - visible job_usersubs - popmenu job_usersub_pm - } - - display { - position 1 +4 - size 48 4 - display job_usersub_file - } - - button { - position 1 +4 - size 12 4 - text "EDIT" - command "*job_edit_usersub_file" - visible job_usersub_file - } - - button { - position +12 = - size 12 4 - text "CLEAR" - command "*job_clear_usersub_file" - visible job_usersub_file - } - - roller { - position +12 = - size 24 4 - nvalues 3 - texts "COMPILE / NO SAVE" - "COMPILE AND SAVE" - "RUN SAVED EXECUTABLE" - help job_run_compile - roller "job_option user_source" - visible job_usersub_file -#ifdef QT_MENTAT - commands "*job_option user_source:compile_nosave" - "*job_option user_source:compile_save" - "*job_option user_source:run_saved" -#else - popmenu job_user_source_pm -#endif - } - - frame { - position 1 +6 - size 48 14 - border_width 1 - border_color black - - group { - - toggle { - position 1 1 - size 23 4 - text "PARALLELIZATION/\{GPU}" - help job_run_parallel - toggle "or(*job_option parallel:on, \ - solver_multi_procs, \ - solver_multi_threads, \ - and(job_solver_mfront_sparse,\ - job_nonsym_off,\ - *job_option solver_use_gpu:on))" - popmenu job_run_parallelization_pm - set $popname2 "job_run_parallelization_pm" - } - - frame { - position +23 = - size 23 12 - border_width 1 - border_color black - - group { - - display { - position 0 0 - size 23 4 - display job_ddm_domains - } - - display { - position = +4 - size 23 4 - display job_solver_procs - visible solver_allows_multi_procs - } - - display { - position = = - size 23 4 - display job_solver_threads - visible "and(solver_allows_multi_threads,\ - not(and(job_solver_mfront_sparse,\ - *job_option parallel:on)))" - } - - display { - position = +4 - size 23 4 - display job_solver_gpu - visible "and(job_solver_mfront_sparse,job_nonsym_off)" - } - } - } - } - } - - button { - position 1 +16 - size 8 4 - text "TITLE" - popmenu job_title_pm - command "*job_title" - } - -# see also job_common.ms -# see also the ADVANCED JOB SUBMISSION popmenu in this file - - label { - position +10 = - size 7 4 - text "STYLE" - border_width 1 - border_color black - } - - roller { - position +7 = - size 16 4 - nvalues 3 - texts "TABLE-DRIVEN" - "MULTI-PHYSICS" - "OLD" - rollers "job_input_style_table_driven" - "job_input_style_multi_physics" - "job_input_style_old" -#ifdef QT_MENTAT - commands "*job_option input_style:new *job_option input_physics_style:old" - "*job_option input_physics_style:new *job_option input_style:new" - "*job_option input_style:old *job_option input_physics_style:old" - visibles "job_allows_input_style_table_driven" - "job_allows_input_style_multi_physics" - "job_allows_input_style_old" -#else - popmenu marc_input_style_pm -#endif - help job_option_input_style - } - - button { - position +18 = - size 13 4 - text "SAVE MODEL" - command "*save_model" - } - - button { - position 1 +6 - size 16 6 - text "SUBMIT (1)" - command "*submit_job 1 *monitor_job" - } - - button { - position +16 = - size 16 6 - text "ADV. JOB SUBM." - popmenu job_submit_adv_pm - } - - button { - position +16 = - size 16 6 - text "DAMASK" - popmenu damask - } - - button { - position 1 +6 - size 16 6 - text "UPDATE" - command "*update_job" - } - - button { - position +16 = - size 16 6 - text "MONITOR" - command "*monitor_job" - } - - button { - position +16 = - size 16 6 - text "KILL" - command "*kill_job *monitor_job" - } - - label { - position 1 +7 - size 32 4 - text "STATUS" - border_width 1 - border_color black - } - - display { - position +32 = - size 16 4 - display "job_status" - } - - label { - position -32 +4 - size 32 4 - text "CURRENT INCREMENT (CYCLE)" - border_width 1 - border_color black - } - - display { - position +32 = - size 16 4 - display "job_increment" - } - - label { - position -32 +4 - size 32 4 - text "SINGULARITY RATIO" - border_width 1 - border_color black - } - - float { - position +32 = - size 16 4 - display "job_singularity_ratio" - } - - label { - position -32 +4 - size 32 4 - text "CONVERGENCE RATIO" - border_width 1 - border_color black - } - - float { - position +32 = - size 16 4 - display "job_convergence_ratio" - } - - - label { - position 1 +4 - size 32 4 - text "ANALYSIS TIME" - border_width 1 - border_color black - } - - float { - position +32 = - size 16 4 - display "job_analysis_time" - } - - label { - position -32 +4 - size 32 4 - text "WALL TIME" - border_width 1 - border_color black - } - - float { - position +32 = - size 16 4 - display "job_time" - } - - frame { - position 1 +4 - size 48 8 - - group { - - frame { - position 0 0 - size 48 8 - text "TOTAL" - border_width 1 - border_color black - group { - - label { - position +6 = - size 12 4 - text "CYCLES" - border_width 1 - border_color black - } - - integer { - position +12 = - size 10 4 - display "acc_job_cycles" - border_width 1 - border_color black - } - - label { - position -12 +4 - size 12 4 - text "SEPARATIONS" - border_width 1 - border_color black - } - - integer { - position +12 = - size 10 4 - display "acc_job_separations" - border_width 1 - border_color black - } - - label { - position +10 -4 - size 10 4 - text "CUT BACKS" - border_width 1 - border_color black - } - - integer { - position +10 = - size 10 4 - display "acc_job_cut_backs" - border_width 1 - border_color black - } - - label { - position -10 +4 - size 10 4 - text "REMESHES" - border_width 1 - border_color black - } - - integer { - position +10 = - size 10 4 - display "acc_job_remeshes" - border_width 1 - border_color black - } - } - } - } - } - - label { - position 1 +8 - size 18 4 - text "EXIT NUMBER" - border_width 1 - border_color black - } - - integer { - position +18 = - size 10 4 - display "job_exit" - } - - button { - position +10 = - size 20 4 - text "EXIT MESSAGE" - popmenu job_exit_msg_pm - help exit_message - } - - label { - position 1 +6 - size 5 4 - text "EDIT" - border_width 1 - border_color black - } - - button { - position +5 = - size 12 4 - text "OUTPUT FILE" - command "*job_edit_output" - } - - button { - position +12 = - size 9 4 - text "LOG FILE" - command "*job_edit_log_file" - } - - button { - position +9 = - size 12 4 - text "STATUS FILE" - command "*job_edit_status_file" - } - - button { - position +12 = - size 10 4 - text "ANY FILE" - settext $edit_browser_label "EDIT FILE" - set $edit_browser_command "*edit_file" -#ifdef QT_MENTAT - browser edit_browser -#else - popmenu edit_browser_popmenu -#endif - help edit_file - } - - popdown { - position 1 +6 - size 32 4 - text "OPEN POST FILE (RESULTS MENU)" - screen results - command "*post_open_default" - } - - button { - position 1 +6 - size 12 8 - text "RESET" - command "*job_submit_reset" - } - - popdown { - position +36 = - size 12 8 - text "OK" - } - } - - window job_run_wi { - parent mentat - origin 35 4 - size 50 113 - background_color body - border_width 1 - border_color border - buffering single - } - -#ifdef QT_MENTAT - mode permanent -#else - mode dialog -#endif -} - - -#-------------------------------------------------------------------------------------------------- -popmenu job_usersub_pm { - -#ifdef QT_MENTAT - text "CURRENTLY SELECTED USER SUBROUTINES" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 66 4 - text "CURRENTLY SELECTED USER SUBROUTINES" - } -#endif - - display { - position 1 +5 - size 64 86 - display "job_usersubs" - } - - popdown { - position 27 +88 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 38 8 - size 66 102 - background_color body - border_width 1 - border_color border - buffering single - } - - mode dialog -} - - -#-------------------------------------------------------------------------------------------------- -popmenu job_submit_adv_pm { - -#ifdef QT_MENTAT - text "ADVANCED JOB SUBMISSION" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 50 4 - text "ADVANCED JOB SUBMISSION" - } -#endif - -#ifdef QT_MENTAT - label { - position 0 0 - size 6 4 - text "NAME" - } - - display { - position +6 = - size 26 4 - display "job_name" - } - - label { - position 0 +4 - size 6 4 - text "TYPE" - } - - display { - position +6 = - size 26 4 - display job_class_label - } -#endif - - label { -#ifdef QT_MENTAT - position 1 9 -#else - position 1 5 -#endif - size 19 4 - text "INITIAL ALLOCATION" - border_width 1 - border_color black - } -#ifdef QT_MENTAT - label { - position +19 = - size 15 4 - text "GENERAL MEMORY" - help job_param_general_init_allocation - } -#else - button { - position +19 = - size 15 4 - text "GENERAL MEMORY" - help job_param_general_init_allocation - command "*job_param general_init_allocation" - } -#endif - text { - position +15 = - size 10 4 - display "job_param_value_general_init_allocation" - command "*job_param general_init_allocation" - help job_param_general_init_allocation - } - - label { - position +10 = - size 4 4 - text "MB" - border_width 1 - border_color black - } - - toggle { - position 1 +5 - size 32 4 - text "OUT-OF-CORE ELEMENT STORAGE" - help job_param_elsto - toggle "*job_option elsto:on" - true_command "*job_option elsto:on" - false_command "*job_option elsto:off" - } - - toggle { - position 1 +4 - size 32 4 - text "OUT-OF-CORE INCREMENTAL BACKUP" - help job_param_inc_backup_storage - toggle "*job_option inc_backup_storage:out_of_core" - true_command "*job_option inc_backup_storage:out_of_core" - false_command "*job_option inc_backup_storage:in_core" - } - - toggle { - position +34 = - size 14 4 - text "CHECK SIZES" - help job_run_check - toggle "*job_option check:on" - true_command "*job_option check:on" - false_command "*job_option check:off" - } - - label { - position 1 +6 - size 16 4 - text "INTEGER SIZE" - border_width 1 - border_color black - } - - roller { - position +16 = - size 32 4 - nvalues 3 - texts "DEFAULT" - "4-BYTE INTEGERS" - "8-BYTE INTEGERS" -#ifdef QT_MENTAT - commands "*job_option marc_integer_size:default" - "*job_option marc_integer_size:i4" - "*job_option marc_integer_size:i8" -#else - popmenu marc_integer_size_pm -#endif - help job_run_intsize - roller "job_option marc_integer_size" - } - - frame { - position 1 +6 - size 48 12 - text "MARC INPUT FILE" - border_width 1 - border_color black - - group { - - label { - position 0 4 - size 9 4 - text "VERSION" - border_width 1 - border_color black - } - - roller { - position +9 = - size 14 4 - nvalues 16 - nvisible 16 - texts "DEFAULT" -#if 0 - "2013" -#endif - "2012" - "2011" - "2010.2" - "2010" - "2008" - "2007" - "2005R3" - "2005" - "2003" - "2001" - "2000" -#if 0 - "8" -#endif - "K7" - "K6.2" - "K5" - "K4" - help job_param_version - rollers "job_input_version_default" -#if 0 - "job_input_version_2013" -#endif - "job_input_version_2012" - "job_input_version_2011" - "job_input_version_2010.2" - "job_input_version_2010" - "job_input_version_2008" - "job_input_version_2007" - "job_input_version_2005r3" - "job_input_version_2005" - "job_input_version_2003" - "job_input_version_2001" - "job_input_version_2000" -#if 0 - "job_input_version_8" -#endif - "job_input_version_k7" - "job_input_version_k6" - "job_input_version_k5" - "job_input_version_k4" -#ifdef QT_MENTAT - commands "*job_option version:default" -#if 0 - "*job_option version:2013" -#endif - "*job_option version:2012" - "*job_option version:2011" - "*job_option version:2010.2" - "*job_option version:2010" - "*job_option version:2008" - "*job_option version:2007" - "*job_option version:2005r3" - "*job_option version:2005" - "*job_option version:2003" - "*job_option version:2001" - "*job_option version:2000" -#if 0 - "*job_option version:8" -#endif - "*job_option version:k7" - "*job_option version:k6" - "*job_option version:k5" - "*job_option version:k4" - visibles "job_allows_input_version_default" -#if 0 - "job_allows_input_version_2013" -#endif - "job_allows_input_version_2012" - "job_allows_input_version_2011" - "job_allows_input_version_2010.2" - "job_allows_input_version_2010" - "job_allows_input_version_2008" - "job_allows_input_version_2007" - "job_allows_input_version_2005r3" - "job_allows_input_version_2005" - "job_allows_input_version_2003" - "job_allows_input_version_2001" - "job_allows_input_version_2000" -#if 0 - "job_allows_input_version_8" -#endif - "job_allows_input_version_k7" - "job_allows_input_version_k6" - "job_allows_input_version_k5" - "job_allows_input_version_k4" -#else - popmenu marc_version_run_pm -#endif - } - -# see also job_common.ms -# see also the RUN JOB popmenu in this file - - label { - position +14 = - size 7 4 - text "STYLE" - border_width 1 - border_color black - } - - roller { - position +7 = - size 18 4 - nvalues 3 - texts "TABLE-DRIVEN" - "MULTI-PHYSICS" - "OLD" - rollers "job_input_style_table_driven" - "job_input_style_multi_physics" - "job_input_style_old" -#ifdef QT_MENTAT - commands "*job_option input_style:new *job_option input_physics_style:old" - "*job_option input_physics_style:new *job_option input_style:new" - "*job_option input_style:old *job_option input_physics_style:old" - visibles "job_allows_input_style_table_driven" - "job_allows_input_style_multi_physics" - "job_allows_input_style_old" -#else - popmenu marc_input_style_run_adv_pm -#endif - help job_option_input_style - } - - toggle { - position 0 +4 - size 48 4 - text "EXTENDED PRECISION" - help job_run_precision - toggle "*job_option inp_file_prec:extended" - true_command "*job_option inp_file_prec:extended" - false_command "*job_option inp_file_prec:normal" - } - } - } - - button { - position 1 +14 - size 24 4 - text "SCRATCH DIRECTORY" - settext $directory_browser_label "JOB SCRATCH DIRECTORY" - set $directory_browser_command "*job_scratch_directory" -#ifdef QT_MENTAT - browser directory_browser -#else - popmenu directory_browser_popmenu -#endif - help job_scratch_directory - } - - button { - position +24 = - size 24 4 - text "CLEAR" - command "*job_clear_scratch_directory" - visible job_scratch_directory - } - - text { - position 1 +4 - size 48 4 - display job_scratch_dir - command "*job_scratch_directory" - } - -#ifdef DCOM - toggle { - position 1 +6 - size 8 4 - text "\{DCOM}" - toggle "*job_option dcom:on" - help job_run_dcom - true_command "*job_option dcom:on" - false_command "*job_option dcom:off" - visible win32_available - } - - button { - position +8 = - size 12 4 - text "HOSTNAME" - command "*job_dcom_hostname" - visible "and(win32_available, *job_option dcom:on)" - } - - text job_dcom_hostname { - position +12 = - size 28 4 - display "job_dcom_hostname" - command "*job_dcom_hostname" - visible "and(win32_available, *job_option dcom:on)" - } -#endif - - button { - position 1 +6 - size 24 4 - text "TITLE" - popmenu job_title_pm - command "*job_title" - } - - button { - position +24 = - size 24 4 - text "SAVE MODEL" - command "*save_model" - } - - button { - position +4 +6 - size 20 4 - text "WRITE INPUT FILE" - command "*job_write_input" - } - - button { - position = +4 - size 20 4 - text "EDIT INPUT FILE" - command "*job_edit_input" - } - - popdown { - position 1 +5 - size 20 6 - text "SUBMIT 1" - command "*submit_job 1 *monitor_job" - } - - popdown { - position +28 = - size 20 6 - text "EXECUTE 1" - command "*execute_job 1 *monitor_job" - } - - popdown { - position -28 +6 - size 20 6 - text "SUBMIT 2" - command "*submit_job 2 *monitor_job" - } - - popdown { - position +28 = - size 20 6 - text "EXECUTE 2" - command "*execute_job 2 *monitor_job" - } - - popdown { - position -28 +6 - size 20 6 - text "SUBMIT 3" - command "*submit_job 3 *monitor_job" - } - - popdown { - position +28 = - size 20 6 - text "EXECUTE 3" - command "*execute_job 3 *monitor_job" - } - - popdown { - position 19 +8 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 38 8 -#ifdef DCOM - size 50 100 -#else - size 50 94 -#endif - background_color body - border_width 1 - border_color border - buffering single - } - -#ifdef QT_MENTAT - mode permanent -#else - mode dialog -#endif -} - -#-------------------------------------------------------------------------------------------------- -popmenu damask { - -#ifdef QT_MENTAT - text "DAMASK.MPIE.DE" -#endif - - group { -#ifndef QT_MENTAT - label { - position 0 0 - size 50 4 - text "DAMASK.MPIE.DE" - } -#endif - - label { - position 1 6 - size 13 6 - text "Optimzation" - border_width 1 - border_color black - } - - label { - position +13 = - size 20 6 - text "write Input" - border_width 1 - border_color black - } - - label { - position +18 = - size 30 6 - text "do not write Inp." - border_width 1 - border_color black - } - - label { - position -32 +6 - size 12 6 - text "O2 / OpenMP" - border_width 1 - border_color black - } - - popdown { - position +12 = - size 20 6 - text "Submit" - command "*submit_job 4 *monitor_job" - } - - popdown { - position +20 = - size 20 6 - text "Execute" - command "*execute_job 4 *monitor_job" - } - - label { - position -32 +6 - size 12 6 - text "O1 / OpenMP" - border_width 1 - border_color black - } - - popdown { - position +12 = - size 20 6 - text "Submit" - command "*submit_job 5 *monitor_job" - } - - popdown { - position +20 = - size 20 6 - text "Execute" - command "*execute_job 5 *monitor_job" - } - - label { - position -32 +6 - size 12 6 - text "O0 / OpenMP" - border_width 1 - border_color black - } - - popdown { - position +12 = - size 20 6 - text "Submit" - command "*submit_job 6 *monitor_job" - } - - popdown { - position +20 = - size 20 6 - text "Execute" - command "*execute_job 6 *monitor_job" - } - - label { - position -29 +8 - size 9 6 - text "O2" - border_width 1 - border_color black - } - - popdown { - position +9 = - size 20 6 - text "Submit" - command "*submit_job 7 *monitor_job" - } - - popdown { - position +20 = - size 20 6 - text "Execute" - command "*execute_job 7 *monitor_job" - } - - label { - position -29 +6 - size 9 6 - text "O1" - border_width 1 - border_color black - } - - popdown { - position +9 = - size 20 6 - text "Submit" - command "*submit_job 8 *monitor_job" - } - - popdown { - position +20 = - size 20 6 - text "Execute" - command "*execute_job 8 *monitor_job" - } - - label { - position -29 +6 - size 9 6 - text "O0" - border_width 1 - border_color black - } - - popdown { - position +9 = - size 20 6 - text "Submit" - command "*submit_job 9 *monitor_job" - } - - popdown { - position +20 = - size 20 6 - text "Execute" - command "*execute_job 9 *monitor_job" - } - - popdown { - position 19 +8 - size 12 8 - text "CANCEL" - } -} - - - - window { - parent mentat - origin 38 8 -#ifdef DCOM - size 50 100 -#else - size 50 94 -#endif - background_color body - border_width 1 - border_color border - buffering single - } - mode dialog -} - -#-------------------------------------------------------------------------------------------------- -popmenu job_exit_msg_pm { - -#ifdef QT_MENTAT - text "EXIT MESSAGE" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 86 4 - text "EXIT MESSAGE" - } - - display { - position 1 5 - size 84 74 - display "job_exit_msg" - } -#endif - -#ifdef QT_MENTAT - - text { - position 1 5 - size 84 74 - multiline - readonly - display "job_exit_msg" - } - -#endif - popdown { - position 37 +76 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 38 8 - size 86 90 - background_color body - border_width 1 - border_color border - buffering single - } - - mode dialog -} - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu job_user_source_pm { - - window { - parent job_run_wi - origin 25 17 - size 24 17 - border_width 1 - border_color border - background_color body - } - mode dialog - - group job_user_source_gr -} - - -#-------------------------------------------------------------------------------------------------- -group job_user_source_gr { - popdown { - position 0 0 - size 24 4 - text "COMPILE / NO SAVE" - command "*job_option user_source:compile_nosave" - } - - popdown { - position = +4 - size 24 4 - text "COMPILE AND SAVE" - command "*job_option user_source:compile_save" - } - - popdown { - position = +4 - size 24 4 - text "RUN SAVED EXECUTABLE" - command "*job_option user_source:run_saved" - } - - popdown { - position = +5 - size 24 4 - text "CANCEL" - } -} -#endif - - -#-------------------------------------------------------------------------------------------------- -popmenu job_run_parallelization_pm { - -#ifdef QT_MENTAT - text "PARALLELIZATION/\{GPU}" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 50 4 - text "PARALLELIZATION/GPU" - } -#endif - -#ifdef QT_MENTAT - label { - position 0 0 - size 6 4 - text "NAME" - } - - display { - position +6 = - size 26 4 - display "job_name" - } - - label { - position 0 +4 - size 6 4 - text "TYPE" - } - - display { - position +6 = - size 26 4 - display job_class_label - } -#endif - - frame { -#ifdef QT_MENTAT - position 1 9 -#else - position 1 5 -#endif - size 48 28 - group job_ddm_gr - text "DOMAIN DECOMPOSITION" - border_width 1 - border_color black - } - - frame { - position 1 +29 - size 48 35 - group job_parallel_matrix_solver_gr - text "MATRIX SOLVER" - border_width 1 - border_color black - } - - frame { - position 1 +36 - size 48 28 - group job_parallel_env_gr - text "PARALLELIZATION ENVIRONMENT" - border_width 1 - border_color black - visible "or(*job_option parallel:on, \ - solver_multi_procs)" - } - - popdown { - position 19 +30 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 38 8 - size 50 109 - background_color body - border_width 1 - border_color border - buffering single - } -#ifdef QT_MENTAT - mode permanent -#else - mode dialog -#endif -} - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_gr { - - toggle { - position 1 4 - size 30 4 - text "USE \{DDM}" - toggle "*job_option parallel:on" - help job_run_ddm_use - true_command "*job_option parallel:on" - false_command "*job_option parallel:off" - } - - frame { - position +2 +5 - size 44 18 - group job_ddm_use_gr - visible "*job_option parallel:on" - } -} - -group job_ddm_use_gr { - roller { - position 0 0 - size 30 4 - nvalues 2 - texts "DECOMPOSITION IN MARC" - "DECOMPOSITION IN MENTAT" - roller "job_option ddm_generator" -#ifdef QT_MENTAT - commands "*job_option ddm_generator:fea_solver" - "*job_option ddm_generator:preprocessor" -#else - popmenu job_ddm_generator_pm -#endif - help job_run_ddm_generator - } - - frame { - position 0 +5 - size 44 8 - group job_ddm_fea_solver_gr - visible "*job_option ddm_generator:fea_solver" - } - - frame { - position = = - size 44 8 - group job_ddm_preprocessor_gr - visible "*job_option ddm_generator:preprocessor" - } - - text { - position 0 +9 - size 22 4 - text "SINGLE INPUT FILE" - readonly - visible "*job_option ddm_generator:fea_solver" - } - - roller { - position = = - size 22 4 - nvalues 2 - texts "MULTIPLE INPUT FILES" - "SINGLE INPUT FILE" - roller "job_option ddm_single_input" - commands "*job_option ddm_single_input:off" - "*job_option ddm_single_input:on" - visible "*job_option ddm_generator:preprocessor" - help job_run_ddm_single_input - } - - roller { - position +23 = - size 21 4 - nvalues 2 - texts "MULTIPLE POST FILES" - "SINGLE POST FILE" - roller "job_option ddm_single_post" - commands "*job_option ddm_single_post:off" - "*job_option ddm_single_post:on" - help job_run_ddm_single_post - } -} - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu job_ddm_generator_pm { - - window { - parent mentat - origin 42 26 - size 30 13 - border_width 1 - border_color border - background_color body - } - - mode dialog - - group job_ddm_generator_gr -} - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_generator_gr { - - popdown { - position 0 0 - size 30 4 - text "DECOMPOSITION IN MARC" - command "*job_option ddm_generator:fea_solver" - help job_run_ddm_generator - } - - popdown { - position = +4 - size 30 4 - text "DECOMPOSITION IN MENTAT" - command "*job_option ddm_generator:preprocessor" - help job_run_ddm_generator - } - - popdown { - position = +5 - size 30 4 - text "CANCEL" - help job_run_ddm_generator - } -} -#endif - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_fea_solver_gr { - -#ifdef QT_MENTAT - label { - position 0 0 - size 10 4 - text "# DOMAINS" - help job_param - } -#else - button { - position 0 0 - size 10 4 - text "# DOMAINS" - command "*job_param ndomains" - } -#endif - - text { - position +10 = - size 4 4 - display "job_param_value_ndomains" - command "*job_param ndomains" - } - - label { - position +4 = - size 7 4 - text "METHOD" - border_width 1 - border_color black - } - - roller { - position +7 = - size 23 4 - nvalues 7 - texts "METIS BEST" - "METIS ELEMENT" - "METIS NODE" - "REC. COORD. BISECTION" - "VECTOR" - "RADIAL" - "ANGULAR" - help set_job_decomp_type - rollers "*job_option ddm_method:metis_best" - "*job_option ddm_method:metis_element_based" - "*job_option ddm_method:metis_node_based" - "*job_option ddm_method:recur_coord_bisect" - "*job_option ddm_method:vector" - "*job_option ddm_method:radial" - "*job_option ddm_method:angular" -#ifdef QT_MENTAT - commands "*job_option ddm_method:metis_best" - "*job_option ddm_method:metis_element_based" - "*job_option ddm_method:metis_node_based" - "*job_option ddm_method:recur_coord_bisect" - "*job_option ddm_method:vector" - "*job_option ddm_method:radial" - "*job_option ddm_method:angular" -#else - popmenu job_ddm_method_pm -#endif - } - - button { - position +4 +4 - size 19 4 - text "ADVANCED SETTINGS" -#ifdef QT_MENTAT - popmenu job_ddm_fea_solver_pm -#else - screen job_ddm_fea_solver_sc - command "@popdown($popname2) @popdown($popname1)" ($popname2, $popname1) -#endif - } -} - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu job_ddm_method_pm { - - window { - parent mentat - origin 56 31 - size 30 33 - border_width 1 - border_color border - background_color body - } - - mode dialog - - group job_ddm_method_gr -} - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_method_gr { - - popdown { - position 0 0 - size 30 4 - text "METIS BEST" - command "*job_option ddm_method:metis_best" - } - - popdown { - position = +4 - size 30 4 - text "METIS ELEMENT BASED" - command "*job_option ddm_method:metis_element_based" - } - - popdown { - position = +4 - size 30 4 - text "METIS NODE BASED" - command "*job_option ddm_method:metis_node_based" - } - - popdown { - position = +4 - size 30 4 - text "RECURSIVE COORDINATE BISECTION" - command "*job_option ddm_method:recur_coord_bisect" - } - - popdown { - position = +4 - size 30 4 - text "VECTOR" - command "*job_option ddm_method:vector" - } - - popdown { - position = +4 - size 30 4 - text "RADIAL" - command "*job_option ddm_method:radial" - } - - popdown { - position = +4 - size 30 4 - text "ANGULAR" - command "*job_option ddm_method:angular" - } - - popdown { - position = +5 - size 30 4 - text "CANCEL" - } -} -#endif - - -#ifdef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu job_ddm_fea_solver_pm { - - text "JOB PARALLELIZATION" -#else -screen job_ddm_fea_solver_sc { - - menu { -#endif - - group { - units 32 120 - -#ifndef QT_MENTAT - label { - position 0 0 - size 32 4 - text "JOB PARALLELIZATION" - } -#endif - - label { - position 0 5 - size 6 4 - text "NAME" - } - - display { - position +6 = - size 26 4 - display "job_name" - } - -#ifdef QT_MENTAT - label { - position 0 +4 - size 6 4 - text "TYPE" - } - - display { - position +6 = - size 26 4 - display job_class_label - } -#endif - - frame { - -#ifdef QT_MENTAT - position 0 +9 -#else - position 0 +5 -#endif - size 32 76 - text "ADVANCED DECOMPOSITION IN MARC" - border_width 1 - border_color black - - group { - -#ifdef QT_MENTAT - label { - position 1 4 - size 16 4 - text "# DOMAINS" - help job_param - } -#else - button { - position 1 4 - size 16 4 - text "# DOMAINS" - command "*job_param ndomains" - } -#endif - - text { - position +16 = - size 14 4 - display "job_param_value_ndomains" - command "*job_param ndomains" - } - - label { - position 1 +4 - size 7 4 - text "METHOD" - border_width 1 - border_color black - } - - roller { - position +7 = - size 23 4 - nvalues 7 - texts "METIS BEST" - "METIS ELEMENT" - "METIS NODE" - "REC. COORD. BISECTION" - "VECTOR" - "RADIAL" - "ANGULAR" - help set_job_decomp_type - rollers "*job_option ddm_method:metis_best" - "*job_option ddm_method:metis_element_based" - "*job_option ddm_method:metis_node_based" - "*job_option ddm_method:recur_coord_bisect" - "*job_option ddm_method:vector" - "*job_option ddm_method:radial" - "*job_option ddm_method:angular" -#ifdef QT_MENTAT - commands "*job_option ddm_method:metis_best" - "*job_option ddm_method:metis_element_based" - "*job_option ddm_method:metis_node_based" - "*job_option ddm_method:recur_coord_bisect" - "*job_option ddm_method:vector" - "*job_option ddm_method:radial" - "*job_option ddm_method:angular" -#else - popmenu job_ddm_method2_pm -#endif - } - - frame { - position 1 +5 - size 30 20 - group job_ddm_direction_gr - visible "or(*job_option ddm_method:vector, \ - *job_option ddm_method:radial, \ - *job_option ddm_method:angular)" - } - - toggle { - position 1 +21 - size 30 4 - text "DOMAIN ISLAND REMOVAL" - toggle "*job_option ddm_island_removal:on" - true_command "*job_option ddm_island_removal:on" - false_command "*job_option ddm_island_removal:off" - } - - label { - position 1 +4 - size 15 4 - border_width 1 - border_color black - text "GRAPH" - } - - roller { - position +15 = - size 15 4 - nvalues 2 - texts "COARSE" - "FINE" - help ddm_decomp_coarse_graph - rollers "*job_option ddm_graph:coarse" - "*job_option ddm_graph:fine" - commands "*job_option ddm_graph:coarse" - "*job_option ddm_graph:fine" - visible "or(*job_option ddm_method:metis_best, \ - *job_option ddm_method:metis_element_based, \ - *job_option ddm_method:metis_node_based)" - } - - label { - position 1 +4 - size 15 4 - border_width 1 - border_color black - text "QUADRATIC ELEMENTS" - } - - roller { - position +15 = - size 15 4 - nvalues 2 - texts "GENUINE" - "LINEARIZED" - help job_run_ddm_decomp_linearized - rollers "*job_option ddm_quadr_elems:genuine" - "*job_option ddm_quadr_elems:linearized" - commands "*job_option ddm_quadr_elems:genuine" - "*job_option ddm_quadr_elems:linearized" - } - -#ifdef QT_MENTAT - label { - position 1 +5 - size 15 4 - text "ELEMENT WEIGHT FACTOR" - help job_param - } -#else - button { - position 1 +5 - size 15 4 - text "ELEMENT WEIGHT FACTOR" - command "*job_param ddm_elem_weight_factor" - help job_run_ddm_decomp_element_weight_factor - } -#endif - - text { - position +15 = - size 15 4 - display "job_param_value_ddm_elem_weight_factor" - command "*job_param ddm_elem_weight_factor" - help job_run_ddm_decomp_element_weight_factor - } - - toggle { - position 1 +5 - size 30 4 - text "DETECT CONTACT" - toggle "*job_option ddm_detect_contact:on" - true_command "*job_option ddm_detect_contact:on" - false_command "*job_option ddm_detect_contact:off" - visible "or(*job_option ddm_method:metis_best, \ - *job_option ddm_method:metis_element_based, \ - *job_option ddm_method:metis_node_based)" - help job_run_ddm_decomp_detect_contact - } - -#ifdef QT_MENTAT - label { - position = +5 - size 15 4 - text "CONTACT TOLERANCE" - visible "*job_option ddm_detect_contact:on" - } -#else - button { - position = +5 - size 15 4 - text "CONTACT TOLERANCE" - command "*job_param ddm_contact_tolerance" - visible "*job_option ddm_detect_contact:on" - help job_run_ddm_decomp_contact_tolerance - } -#endif - - text { - position +15 = - size 15 4 - command "*set_ddm_contact_tolerance" - display "job_param_value_ddm_contact_tolerance" - command "*job_param ddm_contact_tolerance" - visible "*job_option ddm_detect_contact:on" - help job_run_ddm_decomp_contact_tolerance - } - -#ifdef QT_MENTAT - label { - position -15 +4 - size 15 4 - text "CONTACT CONSTR FACTOR" - visible "*job_option ddm_detect_contact:on" - } -#else - button { - position -15 +4 - size 15 4 - text "CONTACT CONSTR FACTOR" - command "*job_param ddm_contact_constr_factor" - visible "*job_option ddm_detect_contact:on" - help job_run_ddm_decomp_contact_constraint_factor - } -#endif - - text { - position +15 = - size 15 4 - display "job_param_value_ddm_contact_constr_factor" - command "*job_param ddm_contact_constr_factor" - visible "*job_option ddm_detect_contact:on" - help job_run_ddm_decomp_contact_constraint_factor - } - } - } - -#ifdef QT_MENTAT - popdown { - position 0 +77 - size 32 8 - text "OK" - } -#else - frame { - position 0 +77 - size 32 8 - group ok2_gr - } - - frame select_frame - frame inactive_return -#endif - } -#ifndef QT_MENTAT - window main_window - disable_right_mouse_button - } - - menu transform -} # job_ddm_fea_solver_sc -#else - mode permanent -} # job_ddm_fea_solver_pm -#endif - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu job_ddm_method2_pm { - - window { - parent mentat - origin 1 22 - size 30 33 - border_width 1 - border_color border - background_color body - } - - mode dialog - - group job_ddm_method_gr -} -#endif - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_direction_gr { - - button { - position 0 0 - size 15 4 - text "DIRECTION" - command "*job_vector ddm_sort_direction_x" - visible "*job_option ddm_method:vector" - } - - button { - position = = - size 15 4 - text "DIRECTION" - command "*job_vector ddm_sort_direction_x" - visible "not(*job_option ddm_method:vector)" - } - - button { - position +15 = - size 15 4 - text "FROM / TO" - command "*job_vector_from_to ddm_sort_direction_x" - } - - text { - position -15 +4 - size 10 4 - command "*job_param ddm_sort_direction_x" - display "job_param_value_ddm_sort_direction_x" - help ddm_job_decomp_user_direction_x - } - - text { - position +10 = - size 10 4 - command "*job_param ddm_sort_direction_y" - display "job_param_value_ddm_sort_direction_y" - } - - text { - position +10 = - size 10 4 - command "*job_param ddm_sort_direction_z" - display "job_param_value_ddm_sort_direction_z" - } - - frame { - position 0 +4 - size 30 8 - group job_ddm_sort_point_gr - visible "not(*job_option ddm_method:vector)" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_sort_point_gr { - - label { - position 0 0 - size 14 4 - border_width 1 - border_color black - text "POINT ON AXIS" - } - - roller { - position +14 = - size 10 4 - nvalues 2 - texts "DEFAULT" - "USER" - roller "job_option ddm_sort_point" -#ifdef QT_MENTAT - commands "*job_option ddm_sort_point:default" - "*job_option ddm_sort_point:user" -#else - popmenu job_ddm_sort_point_meth_pm -#endif - } - - button { - position +10 = - size 6 4 - text "SET" - command "*job_position ddm_sort_point_x" - visible "*job_option ddm_sort_point:user" - } - - text { - position 0 +4 - size 10 4 - command "*job_param ddm_sort_point_x" - display "job_param_value_ddm_sort_point_x" - visible "*job_option ddm_sort_point:user" - } - - text { - position +10 = - size 10 4 - command "*job_param ddm_sort_point_y" - display "job_param_value_ddm_sort_point_y" - visible "*job_option ddm_sort_point:user" - } - - text { - position +10 = - size 10 4 - command "*job_param ddm_sort_point_z" - display "job_param_value_ddm_sort_point_z" - visible "*job_option ddm_sort_point:user" - } -} - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu job_ddm_sort_point_meth_pm { - - window { - parent mentat - origin 15 35 - size 14 13 - border_width 1 - border_color border - background_color body - } - - mode dialog - - group job_ddm_sort_point_meth_gr -} - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_sort_point_meth_gr { - - popdown { - position 0 0 - size 14 4 - text "DEFAULT" - command "*job_option ddm_sort_point:default" - } - - popdown { - position = +4 - size 14 4 - text "USER DEFINED" - command "*job_option ddm_sort_point:user" - } - - popdown { - position = +5 - size 14 4 - text "CANCEL" - } -} -#endif - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_preprocessor_gr { - - label { - position 0 0 - size 10 4 - text "# DOMAINS" - border_width 1 - border_color black - } - - integer { - position +10 = - size 4 4 - display valid_domains - } - - button { - position +4 = - size 30 4 - text "USER DOMAINS" -#ifdef QT_MENTAT - screen domains -#else - screen job_ddm_user_domains_sc - command "@popdown($popname2) @popdown($popname1)" ($popname2, $popname1) -#endif - help job_run_ddm_user_domains - } -} - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -screen job_ddm_user_domains_sc { - - menu { - - group { - units 32 120 - - label { - position 0 0 - size 32 4 - text "USER DOMAINS" - } - - frame { - position 0 5 - size 32 28 - group user_domains_gr - } - - frame { - position 0 +29 - size 32 49 - group user_domains_generate_gr - } - - frame { - position 0 +50 - size 32 8 - group user_domains_tail_gr - } - - frame { - position 0 92 - size 32 8 - group ok2_gr - } - - frame select_frame - frame inactive_return - } - window main_window - disable_right_mouse_button - - } - - menu transform - -} # job_ddm_user_domains_sc -#endif - - -#-------------------------------------------------------------------------------------------------- -group job_parallel_matrix_solver_gr { - - label { - position 3 4 - size 12 4 - text "SOLUTION" - border_width 1 - border_color black - } - - roller { - position +12 = - size 18 4 - nvalues 2 - texts "SYMMETRIC" - "NONSYMMETRIC" - rollers job_nonsym_off - job_nonsym_on - commands "*job_option solver_nonsym:off" - "*job_option solver_nonsym:on" - help job_param_solver_method - } - - label { - position -12 +4 - size 6 4 - text "TYPE" - border_width 1 - border_color black - } - - roller { - position +6 = - size 24 4 - nvalues 9 - help job_param_solver_method - texts "MULTIFRONTAL SPARSE" - "MIXED DIRECT-ITERATIVE" - "CASI ITERATIVE" - "PARDISO DIRECT SPARSE" - "MUMPS PARALLEL DIRECT" - "HARDWARE SPARSE" - "ITERATIVE SPARSE" - "DIRECT PROFILE" - "DIRECT SPARSE" - rollers job_solver_mfront_sparse - job_solver_mixed_direct_iterative - job_solver_it_ext - job_solver_pardiso - job_solver_mumps - job_solver_sparse - job_solver_it_sparse - job_solver_dir_profile - job_solver_dir_sparse -#ifdef QT_MENTAT - commands "*job_option solver:mfront_sparse" - "*job_option solver:mixed_direct_iterative" - "*job_option solver:it_ext" - "*job_option solver:pardiso" - "*job_option solver:mumps" - "*job_option solver:sparse" - "*job_option solver:it_sparse" - "*job_option solver:dir_profile" - "*job_option solver:dir_sparse" - visibles job_allows_solver_mfront_sparse - job_allows_solver_mixed_direct_iterative - job_allows_solver_it_ext - job_allows_solver_pardiso - job_allows_solver_mumps - job_allows_solver_sparse - job_allows_solver_it_sparse - job_allows_solver_dir_profile - job_allows_solver_dir_sparse - help job_param_solver_method -#else - popmenu job_set_parallel_matrix_solver_pm -#endif - } - - button { - position +24 = - size 14 4 - text "OPTIONS" - popmenu job_parallel_matrix_solver_opt_pm - } - - frame { - position = +4 - size 14 4 - group job_run_solver_ddm_opts_gr - visible "*job_option parallel:on" - } - - frame { - position 1 +5 - size 46 8 - group job_solver_multi_procs_gr - visible solver_allows_multi_procs - } - - frame { - position = = - size 46 8 - group job_solver_multi_threads_gr - visible solver_allows_multi_threads - } - - frame { - position 1 +9 - size 46 8 - group job_solver_gpu_gr - visible "and(job_solver_mfront_sparse,job_nonsym_off)" - } -} - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu job_set_parallel_matrix_solver_pm { - window { - parent mentat - origin 48 54 - size 24 42 - border_width 1 - border_color border - background_color body - } - mode dialog - - group job_solver_gr -} -#endif - - -#-------------------------------------------------------------------------------------------------- -popmenu job_parallel_matrix_solver_opt_pm { - -#ifdef QT_MENTAT - text "MATRIX SOLVER OPTIONS" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 38 4 - text "MATRIX SOLVER OPTIONS" - } -#endif - - frame { - position 1 5 - size 36 23 - group job_solver_opts_gr - } - - popdown { - position 13 +25 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 41 12 - size 38 39 - border_width 1 - border_color border - background_color body - } - mode dialog -} - - -#-------------------------------------------------------------------------------------------------- -group job_run_solver_ddm_opts_gr { - - button { - position 0 0 - size 14 4 - text "\{DDM} OPTIONS" - popmenu ddm_options -# see also job_common.ms! - visible "not(or(job_solver_it_sparse, \ - job_solver_it_ext, \ - job_solver_mixed_direct_iterative, \ - job_solver_pardiso, \ - job_solver_mumps))" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_procs_gr { - frame { - position 0 0 - size 46 8 - group job_solver_multi_procs_parallel_off_gr - visible "*job_option parallel:off" - } - - frame { - position = = - size 46 8 - group job_solver_multi_procs_parallel_on_gr - visible "*job_option parallel:on" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_procs_parallel_off_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - true_command "*job_option nsolver_procs_serial:on" - false_command "*job_option nsolver_procs_serial:off" - toggle "*job_option nsolver_procs_serial:on" - help job_run_multithreading - } - -#ifdef QT_MENTAT - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - visible "*job_option nsolver_procs_serial:on" - help job_param - } -#else - button { - position +2 +4 - size 14 4 - text "# PROCESSES" - command "*job_param nsolver_procs" - visible "*job_option nsolver_procs_serial:on" - } -#endif - - text { - position +14 = - size 14 4 - display "job_param_value_nsolver_procs" - command "*job_param nsolver_procs" - visible "*job_option nsolver_procs_serial:on" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_procs_parallel_on_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - help job_run_multithreading - toggle true -#ifdef QT_MENTAT - set $dummy dummy -#endif - } - - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - border_width 1 - border_color black - } - - roller { - position +14 = - size 14 4 - nvalues 2 - texts "AUTOMATIC" - "USER" - commands "*job_option nsolver_procs_ddm:automatic" - "*job_option nsolver_procs_ddm:user" - help job_run_multithreading - rollers "*job_option nsolver_procs_ddm:automatic" - "*job_option nsolver_procs_ddm:user" - } - - frame { - position +14 = - size 16 4 - group job_nsolver_procs_ddm_automatic_gr - visible "*job_option nsolver_procs_ddm:automatic" - } - - frame { - position = = - size 16 4 - group job_nsolver_procs_ddm_user_gr - visible "*job_option nsolver_procs_ddm:user" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_nsolver_procs_ddm_automatic_gr { - - label { - position 0 0 - size 8 4 - text "VALUE" - border_width 1 - border_color black - } - - integer { - position +8 = - size 8 4 - display valid_domains - visible "*job_option ddm_generator:preprocessor" - } - - integer { - position = = - size 8 4 - display "job_param_ndomains" - visible "*job_option ddm_generator:fea_solver" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_nsolver_procs_ddm_user_gr { - -#ifdef QT_MENTAT - label { - position 0 0 - size 8 4 - text "VALUE" - help job_param - } -#else - button { - position 0 0 - size 8 4 - text "VALUE" - command "*job_param nsolver_procs" - } -#endif - - text { - position +8 = - size 8 4 - display "job_param_value_nsolver_procs" - command "*job_param nsolver_procs" - } -} - -group job_solver_multi_threads_gr { - frame { - position 0 0 - size 30 8 - group job_solver_multi_threads_mfront_sparse_gr - visible "and(job_solver_mfront_sparse,*job_option parallel:off)" - } - - frame { - position = = - size 46 8 - group job_solver_multi_threads_pardiso_parallel_off_gr - visible "and(job_solver_pardiso,*job_option parallel:off)" - } - - frame { - position = = - size 46 8 - group job_solver_multi_threads_pardiso_parallel_on_gr - visible "and(job_solver_pardiso,*job_option parallel:on)" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_threads_mfront_sparse_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - toggle "*job_option mfront_sparse_multi_threading:on" - true_command "*job_option mfront_sparse_multi_threading:on" - false_command "*job_option mfront_sparse_multi_threading:off" - help job_run_multithreading - } - -#ifdef QT_MENTAT - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - visible "*job_option mfront_sparse_multi_threading:on" - help job_param - } -#else - button { - position +2 +4 - size 14 4 - text "# PROCESSES" - command "*job_param nthreads" - visible "*job_option mfront_sparse_multi_threading:on" - } -#endif - - text { - position +14 = - size 14 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - visible "*job_option mfront_sparse_multi_threading:on" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_gpu_gr { - - toggle { - position 0 0 - size 30 4 - text "USE \{GPU(s)}" - toggle "*job_option solver_use_gpu:on" - true_command "*job_option solver_use_gpu:on" - false_command "*job_option solver_use_gpu:off" - help job_solver_gpu - } - - label { - position +2 +4 - size 16 4 - text "\{GPU} SELECTION" - border_width 1 - border_color black - visible "*job_option solver_use_gpu:on" - } - - roller { - position +16 = - size 12 4 - nvalues 2 - texts "AUTOMATIC" - "USER" - commands "*job_option solver_gpus:automatic" - "*job_option solver_gpus:user" - rollers "*job_option solver_gpus:automatic" - "*job_option solver_gpus:user" - visible "*job_option solver_use_gpu:on" - help job_solver_gpu - } - - text { - position +12 = - size 16 4 - display job_solver_gpus - command "*clear_job_solver_gpus *job_solver_gpus" - visible "and(*job_option solver_use_gpu:on,*job_option solver_gpus:user)" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_threads_pardiso_parallel_off_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - toggle "*job_option pardiso_multi_threading:on" - true_command "*job_option pardiso_multi_threading:on" - false_command "*job_option pardiso_multi_threading:off" - help job_run_multithreading - } - -#ifdef QT_MENTAT - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - visible "*job_option pardiso_multi_threading:on" - help job_param - } -#else - button { - position +2 +4 - size 14 4 - text "# PROCESSES" - command "*job_param nthreads" - visible "*job_option pardiso_multi_threading:on" - } -#endif - - text { - position +14 = - size 14 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - visible "*job_option pardiso_multi_threading:on" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_threads_pardiso_parallel_on_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - help job_run_multithreading - toggle true -#ifdef QT_MENTAT - set $dummy dummy -#endif - } - - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - border_color black - border_width 1 - } - - roller { - position +14 = - size 14 4 - nvalues 2 - texts "AUTOMATIC" - "USER" - commands "*job_option pardiso_multi_threading_ddm:automatic" - "*job_option pardiso_multi_threading_ddm:user" - help job_run_multithreading - rollers "*job_option pardiso_multi_threading_ddm:automatic" - "*job_option pardiso_multi_threading_ddm:user" - } - - frame { - position +14 = - size 16 4 - group job_pardiso_multi_threads_ddm_automatic_gr - visible "*job_option pardiso_multi_threading_ddm:automatic" - } - - frame { - position = = - size 16 4 - group job_pardiso_multi_threads_ddm_user_gr - visible "*job_option pardiso_multi_threading_ddm:user" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_pardiso_multi_threads_ddm_automatic_gr { - - label { - position 0 0 - size 8 4 - text "VALUE" - border_width 1 - border_color black - } - - integer { - position +8 = - size 8 4 - display valid_domains - visible "*job_option ddm_generator:preprocessor" - } - - integer { - position = = - size 8 4 - display "job_param_ndomains" - visible "*job_option ddm_generator:fea_solver" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_pardiso_multi_threads_ddm_user_gr { - -#ifdef QT_MENTAT - label { - position 0 0 - size 8 4 - text "VALUE" - help job_param - } -#else - button { - position 0 0 - size 8 4 - text "VALUE" - command "*job_param nthreads" - } -#endif - - text { - position +8 = - size 8 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_parallel_env_gr { - - roller { - position 1 4 - size 30 4 - nvalues 2 - texts "SINGLE MACHINE" - "NETWORK" - help job_run_ddm_setup - roller "job_option parallel_setup" - commands "*job_option parallel_setup:single" - "*job_option parallel_setup:network" - } - - frame { - position +2 +5 - size 44 18 - group job_parallel_env_network_gr - visible "*job_option parallel_setup:network" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_parallel_env_network_gr { - - button { - position 0 0 - size 28 4 - text "HOST FILE" -#ifdef QT_MENTAT - browser host_file_browser -#else - popmenu host_file_browser_pm -#endif - settext $host_file_browser_label "SELECT HOST FILE" - set $host_file_browser_command "*job_host_file" - help job_host_file - } - - button { - position +28 = - size 8 4 - text "EDIT" - command "*job_edit_host_file" - help job_edit_host_file - visible job_host_file - } - - button { - position +8 = - size 8 4 - text "CLEAR" - command "*job_clear_host_file" - help job_clear_host_file - visible job_host_file - } - - display { - position 0 +4 - size 44 4 - display job_host_file - } - - frame { - position 0 +5 - size 44 9 - group job_parallel_env_network_ddm_gr - visible "*job_option parallel:on" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_parallel_env_network_ddm_gr { - - toggle { - position 0 0 - size 22 4 - text "COPY INPUT FILE" - toggle "*job_option copy_input_file:on" - true_command "*job_option copy_input_file:on" - false_command "*job_option copy_input_file:off" - help job_host_copy_inputfile - } - - toggle { - position +23 = - size 21 4 - text "COPY POST FILE" - toggle "*job_option copy_post_file:on" - true_command "*job_option copy_post_file:on" - false_command "*job_option copy_post_file:off" - help job_host_copy_inputfile - } - - label { - position 0 +5 - size 10 4 - text "HOSTS" - border_width 1 - border_color black - visible job_usersub_file - } - - roller { - position +10 = - size 18 4 - nvalues 2 - texts "COMPATIBLE" - "INCOMPATIBLE" - roller "job_option network_hosts" - commands "*job_option network_hosts:compatible" - "*job_option network_hosts:incompatible" - help job_host_comp - visible job_usersub_file - } -} - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu marc_integer_size_pm { - - window { - parent mentat - origin 55 32 - size 32 17 - border_width 1 - border_color border - background_color body - } - mode dialog - - group marc_integer_size_gr -} - - -#-------------------------------------------------------------------------------------------------- -group marc_integer_size_gr { - - popdown { - position 0 0 - size 32 4 - text "DEFAULT" - command "*job_option marc_integer_size:default" - help job_run_intsize - } - - popdown { - position = +4 - size 32 4 - text "4-BYTE INTEGERS" - command "*job_option marc_integer_size:i4" - help job_run_intsize - } - - popdown { - position = +4 - size 32 4 - text "8-BYTE INTEGERS" - command "*job_option marc_integer_size:i8" - help job_run_intsize - } - - popdown { - position = +5 - size 32 4 - text "CANCEL" - help job_run_intsize - } -} -#endif -#endif diff --git a/installation/mods_MarcMentat/2013/Mentat_menus/job_run.ms.org b/installation/mods_MarcMentat/2013/Mentat_menus/job_run.ms.org deleted file mode 100644 index 4b7a8f2c1..000000000 --- a/installation/mods_MarcMentat/2013/Mentat_menus/job_run.ms.org +++ /dev/null @@ -1,3003 +0,0 @@ -#ifndef AUTOFORGE -popmenu job_title_pm file jobs.ms -popdown job_title_ok file jobs.ms -#ifndef QT_MENTAT -popmenu marc_input_style_pm file job_common.ms -popmenu marc_input_style_run_adv_pm file job_common.ms -popmenu marc_version_run_pm file job_common.ms -#endif - -group job_solver_gr file job_common.ms -group user_domains_gr file domain_decomposition.ms -group user_domains_generate_gr file domain_decomposition.ms -group user_domains_tail_gr file domain_decomposition.ms -group job_solver_opts_gr file job_common.ms -popmenu ddm_options file job_common.ms - -#ifdef QT_MENTAT -browser edit_browser file file.ms -browser directory_browser file file.ms -screen domains file domain_decomposition.ms -#else -popmenu edit_browser_popmenu file file.ms -popmenu directory_browser_popmenu file file.ms -#endif - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu usersub_file_browser_pm { - - group { -#endif - - browser usersub_file_browser { - position 0 0 - size 82 72 - text "$usersub_file_browser_label" ($usersub_file_browser_label) - filter "*.f *.F" - nvisible 10 - select_files true - cancel_action popdown - ok_action popdown - command "$usersub_file_browser_command" ($usersub_file_browser_command) - } -#ifndef QT_MENTAT - } - - window { - title " Select MARC User Subroutine File" - origin 30 30 - size 82 72 - } - - mode dialog - disable_right_mouse_button -} -#endif - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu host_file_browser_pm { - - group { -#endif - - browser host_file_browser { - position 0 0 - size 82 72 - text "$host_file_browser_label" ($host_file_browser_label) - filter "*" - nvisible 10 - select_files true - cancel_action popdown - ok_action popdown - command "$host_file_browser_command" ($host_file_browser_command) - } -#ifndef QT_MENTAT - } - - window { - title " Select MARC Host File" - origin 30 30 - size 82 72 - } - - mode dialog - disable_right_mouse_button -} -#endif - - -#-------------------------------------------------------------------------------------------------- -popmenu job_run_popmenu { - -#ifdef QT_MENTAT - text "RUN JOB" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 50 4 - text "RUN JOB" - } -#endif - -#ifdef QT_MENTAT - label { - position 0 0 - size 6 4 - text "NAME" - } - - display { - position +6 = - size 26 4 - display "job_name" - } - - label { - position 0 +4 - size 6 4 - text "TYPE" - } - - display { - position +6 = - size 26 4 - display job_class_label - } -#endif - - button { -#ifdef QT_MENTAT - position 1 9 -#else - position 1 5 -#endif - size 24 4 - text "USER SUBROUTINE FILE" -#ifdef QT_MENTAT - browser usersub_file_browser -#else - popmenu usersub_file_browser_pm -#endif - settext $usersub_file_browser_label "SELECT USER SUBROUTINE FILE" - set $usersub_file_browser_command "*job_usersub_file" - help job_usersub_file - } - - toggle { - position +26 = - size 22 4 - text "SELECTED USER SUBS" - toggle job_usersubs - help job_run_seluser - visible job_usersubs - popmenu job_usersub_pm - } - - display { - position 1 +4 - size 48 4 - display job_usersub_file - } - - button { - position 1 +4 - size 12 4 - text "EDIT" - command "*job_edit_usersub_file" - visible job_usersub_file - } - - button { - position +12 = - size 12 4 - text "CLEAR" - command "*job_clear_usersub_file" - visible job_usersub_file - } - - roller { - position +12 = - size 24 4 - nvalues 3 - texts "COMPILE / NO SAVE" - "COMPILE AND SAVE" - "RUN SAVED EXECUTABLE" - help job_run_compile - roller "job_option user_source" - visible job_usersub_file -#ifdef QT_MENTAT - commands "*job_option user_source:compile_nosave" - "*job_option user_source:compile_save" - "*job_option user_source:run_saved" -#else - popmenu job_user_source_pm -#endif - } - - frame { - position 1 +6 - size 48 14 - border_width 1 - border_color black - - group { - - toggle { - position 1 1 - size 23 4 - text "PARALLELIZATION/\{GPU}" - help job_run_parallel - toggle "or(*job_option parallel:on, \ - solver_multi_procs, \ - solver_multi_threads, \ - and(job_solver_mfront_sparse,\ - job_nonsym_off,\ - *job_option solver_use_gpu:on))" - popmenu job_run_parallelization_pm - set $popname2 "job_run_parallelization_pm" - } - - frame { - position +23 = - size 23 12 - border_width 1 - border_color black - - group { - - display { - position 0 0 - size 23 4 - display job_ddm_domains - } - - display { - position = +4 - size 23 4 - display job_solver_procs - visible solver_allows_multi_procs - } - - display { - position = = - size 23 4 - display job_solver_threads - visible "and(solver_allows_multi_threads,\ - not(and(job_solver_mfront_sparse,\ - *job_option parallel:on)))" - } - - display { - position = +4 - size 23 4 - display job_solver_gpu - visible "and(job_solver_mfront_sparse,job_nonsym_off)" - } - } - } - } - } - - button { - position 1 +16 - size 8 4 - text "TITLE" - popmenu job_title_pm - command "*job_title" - } - -# see also job_common.ms -# see also the ADVANCED JOB SUBMISSION popmenu in this file - - label { - position +10 = - size 7 4 - text "STYLE" - border_width 1 - border_color black - } - - roller { - position +7 = - size 16 4 - nvalues 3 - texts "TABLE-DRIVEN" - "MULTI-PHYSICS" - "OLD" - rollers "job_input_style_table_driven" - "job_input_style_multi_physics" - "job_input_style_old" -#ifdef QT_MENTAT - commands "*job_option input_style:new *job_option input_physics_style:old" - "*job_option input_physics_style:new *job_option input_style:new" - "*job_option input_style:old *job_option input_physics_style:old" - visibles "job_allows_input_style_table_driven" - "job_allows_input_style_multi_physics" - "job_allows_input_style_old" -#else - popmenu marc_input_style_pm -#endif - help job_option_input_style - } - - button { - position +18 = - size 13 4 - text "SAVE MODEL" - command "*save_model" - } - - button { - position 1 +6 - size 16 6 - text "SUBMIT (1)" - command "*submit_job 1 *monitor_job" - } - - button { - position +16 = - size 32 6 - text "ADVANCED JOB SUBMISSION" - popmenu job_submit_adv_pm - } - - button { - position 1 +6 - size 16 6 - text "UPDATE" - command "*update_job" - } - - button { - position +16 = - size 16 6 - text "MONITOR" - command "*monitor_job" - } - - button { - position +16 = - size 16 6 - text "KILL" - command "*kill_job *monitor_job" - } - - label { - position 1 +7 - size 32 4 - text "STATUS" - border_width 1 - border_color black - } - - display { - position +32 = - size 16 4 - display "job_status" - } - - label { - position -32 +4 - size 32 4 - text "CURRENT INCREMENT (CYCLE)" - border_width 1 - border_color black - } - - display { - position +32 = - size 16 4 - display "job_increment" - } - - label { - position -32 +4 - size 32 4 - text "SINGULARITY RATIO" - border_width 1 - border_color black - } - - float { - position +32 = - size 16 4 - display "job_singularity_ratio" - } - - label { - position -32 +4 - size 32 4 - text "CONVERGENCE RATIO" - border_width 1 - border_color black - } - - float { - position +32 = - size 16 4 - display "job_convergence_ratio" - } - - - label { - position 1 +4 - size 32 4 - text "ANALYSIS TIME" - border_width 1 - border_color black - } - - float { - position +32 = - size 16 4 - display "job_analysis_time" - } - - label { - position -32 +4 - size 32 4 - text "WALL TIME" - border_width 1 - border_color black - } - - float { - position +32 = - size 16 4 - display "job_time" - } - - frame { - position 1 +4 - size 48 8 - - group { - - frame { - position 0 0 - size 48 8 - text "TOTAL" - border_width 1 - border_color black - group { - - label { - position +6 = - size 12 4 - text "CYCLES" - border_width 1 - border_color black - } - - integer { - position +12 = - size 10 4 - display "acc_job_cycles" - border_width 1 - border_color black - } - - label { - position -12 +4 - size 12 4 - text "SEPARATIONS" - border_width 1 - border_color black - } - - integer { - position +12 = - size 10 4 - display "acc_job_separations" - border_width 1 - border_color black - } - - label { - position +10 -4 - size 10 4 - text "CUT BACKS" - border_width 1 - border_color black - } - - integer { - position +10 = - size 10 4 - display "acc_job_cut_backs" - border_width 1 - border_color black - } - - label { - position -10 +4 - size 10 4 - text "REMESHES" - border_width 1 - border_color black - } - - integer { - position +10 = - size 10 4 - display "acc_job_remeshes" - border_width 1 - border_color black - } - } - } - } - } - - label { - position 1 +8 - size 18 4 - text "EXIT NUMBER" - border_width 1 - border_color black - } - - integer { - position +18 = - size 10 4 - display "job_exit" - } - - button { - position +10 = - size 20 4 - text "EXIT MESSAGE" - popmenu job_exit_msg_pm - help exit_message - } - - label { - position 1 +6 - size 5 4 - text "EDIT" - border_width 1 - border_color black - } - - button { - position +5 = - size 12 4 - text "OUTPUT FILE" - command "*job_edit_output" - } - - button { - position +12 = - size 9 4 - text "LOG FILE" - command "*job_edit_log_file" - } - - button { - position +9 = - size 12 4 - text "STATUS FILE" - command "*job_edit_status_file" - } - - button { - position +12 = - size 10 4 - text "ANY FILE" - settext $edit_browser_label "EDIT FILE" - set $edit_browser_command "*edit_file" -#ifdef QT_MENTAT - browser edit_browser -#else - popmenu edit_browser_popmenu -#endif - help edit_file - } - - popdown { - position 1 +6 - size 32 4 - text "OPEN POST FILE (RESULTS MENU)" - screen results - command "*post_open_default" - } - - button { - position 1 +6 - size 12 8 - text "RESET" - command "*job_submit_reset" - } - - popdown { - position +36 = - size 12 8 - text "OK" - } - } - - window job_run_wi { - parent mentat - origin 35 4 - size 50 113 - background_color body - border_width 1 - border_color border - buffering single - } - -#ifdef QT_MENTAT - mode permanent -#else - mode dialog -#endif -} - - -#-------------------------------------------------------------------------------------------------- -popmenu job_usersub_pm { - -#ifdef QT_MENTAT - text "CURRENTLY SELECTED USER SUBROUTINES" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 66 4 - text "CURRENTLY SELECTED USER SUBROUTINES" - } -#endif - - display { - position 1 +5 - size 64 86 - display "job_usersubs" - } - - popdown { - position 27 +88 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 38 8 - size 66 102 - background_color body - border_width 1 - border_color border - buffering single - } - - mode dialog -} - - -#-------------------------------------------------------------------------------------------------- -popmenu job_submit_adv_pm { - -#ifdef QT_MENTAT - text "ADVANCED JOB SUBMISSION" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 50 4 - text "ADVANCED JOB SUBMISSION" - } -#endif - -#ifdef QT_MENTAT - label { - position 0 0 - size 6 4 - text "NAME" - } - - display { - position +6 = - size 26 4 - display "job_name" - } - - label { - position 0 +4 - size 6 4 - text "TYPE" - } - - display { - position +6 = - size 26 4 - display job_class_label - } -#endif - - label { -#ifdef QT_MENTAT - position 1 9 -#else - position 1 5 -#endif - size 19 4 - text "INITIAL ALLOCATION" - border_width 1 - border_color black - } -#ifdef QT_MENTAT - label { - position +19 = - size 15 4 - text "GENERAL MEMORY" - help job_param_general_init_allocation - } -#else - button { - position +19 = - size 15 4 - text "GENERAL MEMORY" - help job_param_general_init_allocation - command "*job_param general_init_allocation" - } -#endif - text { - position +15 = - size 10 4 - display "job_param_value_general_init_allocation" - command "*job_param general_init_allocation" - help job_param_general_init_allocation - } - - label { - position +10 = - size 4 4 - text "MB" - border_width 1 - border_color black - } - - toggle { - position 1 +5 - size 32 4 - text "OUT-OF-CORE ELEMENT STORAGE" - help job_param_elsto - toggle "*job_option elsto:on" - true_command "*job_option elsto:on" - false_command "*job_option elsto:off" - } - - toggle { - position 1 +4 - size 32 4 - text "OUT-OF-CORE INCREMENTAL BACKUP" - help job_param_inc_backup_storage - toggle "*job_option inc_backup_storage:out_of_core" - true_command "*job_option inc_backup_storage:out_of_core" - false_command "*job_option inc_backup_storage:in_core" - } - - toggle { - position +34 = - size 14 4 - text "CHECK SIZES" - help job_run_check - toggle "*job_option check:on" - true_command "*job_option check:on" - false_command "*job_option check:off" - } - - label { - position 1 +6 - size 16 4 - text "INTEGER SIZE" - border_width 1 - border_color black - } - - roller { - position +16 = - size 32 4 - nvalues 3 - texts "DEFAULT" - "4-BYTE INTEGERS" - "8-BYTE INTEGERS" -#ifdef QT_MENTAT - commands "*job_option marc_integer_size:default" - "*job_option marc_integer_size:i4" - "*job_option marc_integer_size:i8" -#else - popmenu marc_integer_size_pm -#endif - help job_run_intsize - roller "job_option marc_integer_size" - } - - frame { - position 1 +6 - size 48 12 - text "MARC INPUT FILE" - border_width 1 - border_color black - - group { - - label { - position 0 4 - size 9 4 - text "VERSION" - border_width 1 - border_color black - } - - roller { - position +9 = - size 14 4 - nvalues 16 - nvisible 16 - texts "DEFAULT" -#if 0 - "2013" -#endif - "2012" - "2011" - "2010.2" - "2010" - "2008" - "2007" - "2005R3" - "2005" - "2003" - "2001" - "2000" -#if 0 - "8" -#endif - "K7" - "K6.2" - "K5" - "K4" - help job_param_version - rollers "job_input_version_default" -#if 0 - "job_input_version_2013" -#endif - "job_input_version_2012" - "job_input_version_2011" - "job_input_version_2010.2" - "job_input_version_2010" - "job_input_version_2008" - "job_input_version_2007" - "job_input_version_2005r3" - "job_input_version_2005" - "job_input_version_2003" - "job_input_version_2001" - "job_input_version_2000" -#if 0 - "job_input_version_8" -#endif - "job_input_version_k7" - "job_input_version_k6" - "job_input_version_k5" - "job_input_version_k4" -#ifdef QT_MENTAT - commands "*job_option version:default" -#if 0 - "*job_option version:2013" -#endif - "*job_option version:2012" - "*job_option version:2011" - "*job_option version:2010.2" - "*job_option version:2010" - "*job_option version:2008" - "*job_option version:2007" - "*job_option version:2005r3" - "*job_option version:2005" - "*job_option version:2003" - "*job_option version:2001" - "*job_option version:2000" -#if 0 - "*job_option version:8" -#endif - "*job_option version:k7" - "*job_option version:k6" - "*job_option version:k5" - "*job_option version:k4" - visibles "job_allows_input_version_default" -#if 0 - "job_allows_input_version_2013" -#endif - "job_allows_input_version_2012" - "job_allows_input_version_2011" - "job_allows_input_version_2010.2" - "job_allows_input_version_2010" - "job_allows_input_version_2008" - "job_allows_input_version_2007" - "job_allows_input_version_2005r3" - "job_allows_input_version_2005" - "job_allows_input_version_2003" - "job_allows_input_version_2001" - "job_allows_input_version_2000" -#if 0 - "job_allows_input_version_8" -#endif - "job_allows_input_version_k7" - "job_allows_input_version_k6" - "job_allows_input_version_k5" - "job_allows_input_version_k4" -#else - popmenu marc_version_run_pm -#endif - } - -# see also job_common.ms -# see also the RUN JOB popmenu in this file - - label { - position +14 = - size 7 4 - text "STYLE" - border_width 1 - border_color black - } - - roller { - position +7 = - size 18 4 - nvalues 3 - texts "TABLE-DRIVEN" - "MULTI-PHYSICS" - "OLD" - rollers "job_input_style_table_driven" - "job_input_style_multi_physics" - "job_input_style_old" -#ifdef QT_MENTAT - commands "*job_option input_style:new *job_option input_physics_style:old" - "*job_option input_physics_style:new *job_option input_style:new" - "*job_option input_style:old *job_option input_physics_style:old" - visibles "job_allows_input_style_table_driven" - "job_allows_input_style_multi_physics" - "job_allows_input_style_old" -#else - popmenu marc_input_style_run_adv_pm -#endif - help job_option_input_style - } - - toggle { - position 0 +4 - size 48 4 - text "EXTENDED PRECISION" - help job_run_precision - toggle "*job_option inp_file_prec:extended" - true_command "*job_option inp_file_prec:extended" - false_command "*job_option inp_file_prec:normal" - } - } - } - - button { - position 1 +14 - size 24 4 - text "SCRATCH DIRECTORY" - settext $directory_browser_label "JOB SCRATCH DIRECTORY" - set $directory_browser_command "*job_scratch_directory" -#ifdef QT_MENTAT - browser directory_browser -#else - popmenu directory_browser_popmenu -#endif - help job_scratch_directory - } - - button { - position +24 = - size 24 4 - text "CLEAR" - command "*job_clear_scratch_directory" - visible job_scratch_directory - } - - text { - position 1 +4 - size 48 4 - display job_scratch_dir - command "*job_scratch_directory" - } - -#ifdef DCOM - toggle { - position 1 +6 - size 8 4 - text "\{DCOM}" - toggle "*job_option dcom:on" - help job_run_dcom - true_command "*job_option dcom:on" - false_command "*job_option dcom:off" - visible win32_available - } - - button { - position +8 = - size 12 4 - text "HOSTNAME" - command "*job_dcom_hostname" - visible "and(win32_available, *job_option dcom:on)" - } - - text job_dcom_hostname { - position +12 = - size 28 4 - display "job_dcom_hostname" - command "*job_dcom_hostname" - visible "and(win32_available, *job_option dcom:on)" - } -#endif - - button { - position 1 +6 - size 24 4 - text "TITLE" - popmenu job_title_pm - command "*job_title" - } - - button { - position +24 = - size 24 4 - text "SAVE MODEL" - command "*save_model" - } - - button { - position +4 +6 - size 20 4 - text "WRITE INPUT FILE" - command "*job_write_input" - } - - button { - position = +4 - size 20 4 - text "EDIT INPUT FILE" - command "*job_edit_input" - } - - popdown { - position 1 +5 - size 20 6 - text "SUBMIT 1" - command "*submit_job 1 *monitor_job" - } - - popdown { - position +28 = - size 20 6 - text "EXECUTE 1" - command "*execute_job 1 *monitor_job" - } - - popdown { - position -28 +6 - size 20 6 - text "SUBMIT 2" - command "*submit_job 2 *monitor_job" - } - - popdown { - position +28 = - size 20 6 - text "EXECUTE 2" - command "*execute_job 2 *monitor_job" - } - - popdown { - position -28 +6 - size 20 6 - text "SUBMIT 3" - command "*submit_job 3 *monitor_job" - } - - popdown { - position +28 = - size 20 6 - text "EXECUTE 3" - command "*execute_job 3 *monitor_job" - } - - popdown { - position 19 +8 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 38 8 -#ifdef DCOM - size 50 100 -#else - size 50 94 -#endif - background_color body - border_width 1 - border_color border - buffering single - } - -#ifdef QT_MENTAT - mode permanent -#else - mode dialog -#endif -} - - -#-------------------------------------------------------------------------------------------------- -popmenu job_exit_msg_pm { - -#ifdef QT_MENTAT - text "EXIT MESSAGE" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 86 4 - text "EXIT MESSAGE" - } - - display { - position 1 5 - size 84 74 - display "job_exit_msg" - } -#endif - -#ifdef QT_MENTAT - - text { - position 1 5 - size 84 74 - multiline - readonly - display "job_exit_msg" - } - -#endif - popdown { - position 37 +76 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 38 8 - size 86 90 - background_color body - border_width 1 - border_color border - buffering single - } - - mode dialog -} - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu job_user_source_pm { - - window { - parent job_run_wi - origin 25 17 - size 24 17 - border_width 1 - border_color border - background_color body - } - mode dialog - - group job_user_source_gr -} - - -#-------------------------------------------------------------------------------------------------- -group job_user_source_gr { - popdown { - position 0 0 - size 24 4 - text "COMPILE / NO SAVE" - command "*job_option user_source:compile_nosave" - } - - popdown { - position = +4 - size 24 4 - text "COMPILE AND SAVE" - command "*job_option user_source:compile_save" - } - - popdown { - position = +4 - size 24 4 - text "RUN SAVED EXECUTABLE" - command "*job_option user_source:run_saved" - } - - popdown { - position = +5 - size 24 4 - text "CANCEL" - } -} -#endif - - -#-------------------------------------------------------------------------------------------------- -popmenu job_run_parallelization_pm { - -#ifdef QT_MENTAT - text "PARALLELIZATION/\{GPU}" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 50 4 - text "PARALLELIZATION/GPU" - } -#endif - -#ifdef QT_MENTAT - label { - position 0 0 - size 6 4 - text "NAME" - } - - display { - position +6 = - size 26 4 - display "job_name" - } - - label { - position 0 +4 - size 6 4 - text "TYPE" - } - - display { - position +6 = - size 26 4 - display job_class_label - } -#endif - - frame { -#ifdef QT_MENTAT - position 1 9 -#else - position 1 5 -#endif - size 48 28 - group job_ddm_gr - text "DOMAIN DECOMPOSITION" - border_width 1 - border_color black - } - - frame { - position 1 +29 - size 48 35 - group job_parallel_matrix_solver_gr - text "MATRIX SOLVER" - border_width 1 - border_color black - } - - frame { - position 1 +36 - size 48 28 - group job_parallel_env_gr - text "PARALLELIZATION ENVIRONMENT" - border_width 1 - border_color black - visible "or(*job_option parallel:on, \ - solver_multi_procs)" - } - - popdown { - position 19 +30 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 38 8 - size 50 109 - background_color body - border_width 1 - border_color border - buffering single - } -#ifdef QT_MENTAT - mode permanent -#else - mode dialog -#endif -} - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_gr { - - toggle { - position 1 4 - size 30 4 - text "USE \{DDM}" - toggle "*job_option parallel:on" - help job_run_ddm_use - true_command "*job_option parallel:on" - false_command "*job_option parallel:off" - } - - frame { - position +2 +5 - size 44 18 - group job_ddm_use_gr - visible "*job_option parallel:on" - } -} - -group job_ddm_use_gr { - roller { - position 0 0 - size 30 4 - nvalues 2 - texts "DECOMPOSITION IN MARC" - "DECOMPOSITION IN MENTAT" - roller "job_option ddm_generator" -#ifdef QT_MENTAT - commands "*job_option ddm_generator:fea_solver" - "*job_option ddm_generator:preprocessor" -#else - popmenu job_ddm_generator_pm -#endif - help job_run_ddm_generator - } - - frame { - position 0 +5 - size 44 8 - group job_ddm_fea_solver_gr - visible "*job_option ddm_generator:fea_solver" - } - - frame { - position = = - size 44 8 - group job_ddm_preprocessor_gr - visible "*job_option ddm_generator:preprocessor" - } - - text { - position 0 +9 - size 22 4 - text "SINGLE INPUT FILE" - readonly - visible "*job_option ddm_generator:fea_solver" - } - - roller { - position = = - size 22 4 - nvalues 2 - texts "MULTIPLE INPUT FILES" - "SINGLE INPUT FILE" - roller "job_option ddm_single_input" - commands "*job_option ddm_single_input:off" - "*job_option ddm_single_input:on" - visible "*job_option ddm_generator:preprocessor" - help job_run_ddm_single_input - } - - roller { - position +23 = - size 21 4 - nvalues 2 - texts "MULTIPLE POST FILES" - "SINGLE POST FILE" - roller "job_option ddm_single_post" - commands "*job_option ddm_single_post:off" - "*job_option ddm_single_post:on" - help job_run_ddm_single_post - } -} - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu job_ddm_generator_pm { - - window { - parent mentat - origin 42 26 - size 30 13 - border_width 1 - border_color border - background_color body - } - - mode dialog - - group job_ddm_generator_gr -} - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_generator_gr { - - popdown { - position 0 0 - size 30 4 - text "DECOMPOSITION IN MARC" - command "*job_option ddm_generator:fea_solver" - help job_run_ddm_generator - } - - popdown { - position = +4 - size 30 4 - text "DECOMPOSITION IN MENTAT" - command "*job_option ddm_generator:preprocessor" - help job_run_ddm_generator - } - - popdown { - position = +5 - size 30 4 - text "CANCEL" - help job_run_ddm_generator - } -} -#endif - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_fea_solver_gr { - -#ifdef QT_MENTAT - label { - position 0 0 - size 10 4 - text "# DOMAINS" - help job_param - } -#else - button { - position 0 0 - size 10 4 - text "# DOMAINS" - command "*job_param ndomains" - } -#endif - - text { - position +10 = - size 4 4 - display "job_param_value_ndomains" - command "*job_param ndomains" - } - - label { - position +4 = - size 7 4 - text "METHOD" - border_width 1 - border_color black - } - - roller { - position +7 = - size 23 4 - nvalues 7 - texts "METIS BEST" - "METIS ELEMENT" - "METIS NODE" - "REC. COORD. BISECTION" - "VECTOR" - "RADIAL" - "ANGULAR" - help set_job_decomp_type - rollers "*job_option ddm_method:metis_best" - "*job_option ddm_method:metis_element_based" - "*job_option ddm_method:metis_node_based" - "*job_option ddm_method:recur_coord_bisect" - "*job_option ddm_method:vector" - "*job_option ddm_method:radial" - "*job_option ddm_method:angular" -#ifdef QT_MENTAT - commands "*job_option ddm_method:metis_best" - "*job_option ddm_method:metis_element_based" - "*job_option ddm_method:metis_node_based" - "*job_option ddm_method:recur_coord_bisect" - "*job_option ddm_method:vector" - "*job_option ddm_method:radial" - "*job_option ddm_method:angular" -#else - popmenu job_ddm_method_pm -#endif - } - - button { - position +4 +4 - size 19 4 - text "ADVANCED SETTINGS" -#ifdef QT_MENTAT - popmenu job_ddm_fea_solver_pm -#else - screen job_ddm_fea_solver_sc - command "@popdown($popname2) @popdown($popname1)" ($popname2, $popname1) -#endif - } -} - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu job_ddm_method_pm { - - window { - parent mentat - origin 56 31 - size 30 33 - border_width 1 - border_color border - background_color body - } - - mode dialog - - group job_ddm_method_gr -} - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_method_gr { - - popdown { - position 0 0 - size 30 4 - text "METIS BEST" - command "*job_option ddm_method:metis_best" - } - - popdown { - position = +4 - size 30 4 - text "METIS ELEMENT BASED" - command "*job_option ddm_method:metis_element_based" - } - - popdown { - position = +4 - size 30 4 - text "METIS NODE BASED" - command "*job_option ddm_method:metis_node_based" - } - - popdown { - position = +4 - size 30 4 - text "RECURSIVE COORDINATE BISECTION" - command "*job_option ddm_method:recur_coord_bisect" - } - - popdown { - position = +4 - size 30 4 - text "VECTOR" - command "*job_option ddm_method:vector" - } - - popdown { - position = +4 - size 30 4 - text "RADIAL" - command "*job_option ddm_method:radial" - } - - popdown { - position = +4 - size 30 4 - text "ANGULAR" - command "*job_option ddm_method:angular" - } - - popdown { - position = +5 - size 30 4 - text "CANCEL" - } -} -#endif - - -#ifdef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu job_ddm_fea_solver_pm { - - text "JOB PARALLELIZATION" -#else -screen job_ddm_fea_solver_sc { - - menu { -#endif - - group { - units 32 120 - -#ifndef QT_MENTAT - label { - position 0 0 - size 32 4 - text "JOB PARALLELIZATION" - } -#endif - - label { - position 0 5 - size 6 4 - text "NAME" - } - - display { - position +6 = - size 26 4 - display "job_name" - } - -#ifdef QT_MENTAT - label { - position 0 +4 - size 6 4 - text "TYPE" - } - - display { - position +6 = - size 26 4 - display job_class_label - } -#endif - - frame { - -#ifdef QT_MENTAT - position 0 +9 -#else - position 0 +5 -#endif - size 32 76 - text "ADVANCED DECOMPOSITION IN MARC" - border_width 1 - border_color black - - group { - -#ifdef QT_MENTAT - label { - position 1 4 - size 16 4 - text "# DOMAINS" - help job_param - } -#else - button { - position 1 4 - size 16 4 - text "# DOMAINS" - command "*job_param ndomains" - } -#endif - - text { - position +16 = - size 14 4 - display "job_param_value_ndomains" - command "*job_param ndomains" - } - - label { - position 1 +4 - size 7 4 - text "METHOD" - border_width 1 - border_color black - } - - roller { - position +7 = - size 23 4 - nvalues 7 - texts "METIS BEST" - "METIS ELEMENT" - "METIS NODE" - "REC. COORD. BISECTION" - "VECTOR" - "RADIAL" - "ANGULAR" - help set_job_decomp_type - rollers "*job_option ddm_method:metis_best" - "*job_option ddm_method:metis_element_based" - "*job_option ddm_method:metis_node_based" - "*job_option ddm_method:recur_coord_bisect" - "*job_option ddm_method:vector" - "*job_option ddm_method:radial" - "*job_option ddm_method:angular" -#ifdef QT_MENTAT - commands "*job_option ddm_method:metis_best" - "*job_option ddm_method:metis_element_based" - "*job_option ddm_method:metis_node_based" - "*job_option ddm_method:recur_coord_bisect" - "*job_option ddm_method:vector" - "*job_option ddm_method:radial" - "*job_option ddm_method:angular" -#else - popmenu job_ddm_method2_pm -#endif - } - - frame { - position 1 +5 - size 30 20 - group job_ddm_direction_gr - visible "or(*job_option ddm_method:vector, \ - *job_option ddm_method:radial, \ - *job_option ddm_method:angular)" - } - - toggle { - position 1 +21 - size 30 4 - text "DOMAIN ISLAND REMOVAL" - toggle "*job_option ddm_island_removal:on" - true_command "*job_option ddm_island_removal:on" - false_command "*job_option ddm_island_removal:off" - } - - label { - position 1 +4 - size 15 4 - border_width 1 - border_color black - text "GRAPH" - } - - roller { - position +15 = - size 15 4 - nvalues 2 - texts "COARSE" - "FINE" - help ddm_decomp_coarse_graph - rollers "*job_option ddm_graph:coarse" - "*job_option ddm_graph:fine" - commands "*job_option ddm_graph:coarse" - "*job_option ddm_graph:fine" - visible "or(*job_option ddm_method:metis_best, \ - *job_option ddm_method:metis_element_based, \ - *job_option ddm_method:metis_node_based)" - } - - label { - position 1 +4 - size 15 4 - border_width 1 - border_color black - text "QUADRATIC ELEMENTS" - } - - roller { - position +15 = - size 15 4 - nvalues 2 - texts "GENUINE" - "LINEARIZED" - help job_run_ddm_decomp_linearized - rollers "*job_option ddm_quadr_elems:genuine" - "*job_option ddm_quadr_elems:linearized" - commands "*job_option ddm_quadr_elems:genuine" - "*job_option ddm_quadr_elems:linearized" - } - -#ifdef QT_MENTAT - label { - position 1 +5 - size 15 4 - text "ELEMENT WEIGHT FACTOR" - help job_param - } -#else - button { - position 1 +5 - size 15 4 - text "ELEMENT WEIGHT FACTOR" - command "*job_param ddm_elem_weight_factor" - help job_run_ddm_decomp_element_weight_factor - } -#endif - - text { - position +15 = - size 15 4 - display "job_param_value_ddm_elem_weight_factor" - command "*job_param ddm_elem_weight_factor" - help job_run_ddm_decomp_element_weight_factor - } - - toggle { - position 1 +5 - size 30 4 - text "DETECT CONTACT" - toggle "*job_option ddm_detect_contact:on" - true_command "*job_option ddm_detect_contact:on" - false_command "*job_option ddm_detect_contact:off" - visible "or(*job_option ddm_method:metis_best, \ - *job_option ddm_method:metis_element_based, \ - *job_option ddm_method:metis_node_based)" - help job_run_ddm_decomp_detect_contact - } - -#ifdef QT_MENTAT - label { - position = +5 - size 15 4 - text "CONTACT TOLERANCE" - visible "*job_option ddm_detect_contact:on" - } -#else - button { - position = +5 - size 15 4 - text "CONTACT TOLERANCE" - command "*job_param ddm_contact_tolerance" - visible "*job_option ddm_detect_contact:on" - help job_run_ddm_decomp_contact_tolerance - } -#endif - - text { - position +15 = - size 15 4 - command "*set_ddm_contact_tolerance" - display "job_param_value_ddm_contact_tolerance" - command "*job_param ddm_contact_tolerance" - visible "*job_option ddm_detect_contact:on" - help job_run_ddm_decomp_contact_tolerance - } - -#ifdef QT_MENTAT - label { - position -15 +4 - size 15 4 - text "CONTACT CONSTR FACTOR" - visible "*job_option ddm_detect_contact:on" - } -#else - button { - position -15 +4 - size 15 4 - text "CONTACT CONSTR FACTOR" - command "*job_param ddm_contact_constr_factor" - visible "*job_option ddm_detect_contact:on" - help job_run_ddm_decomp_contact_constraint_factor - } -#endif - - text { - position +15 = - size 15 4 - display "job_param_value_ddm_contact_constr_factor" - command "*job_param ddm_contact_constr_factor" - visible "*job_option ddm_detect_contact:on" - help job_run_ddm_decomp_contact_constraint_factor - } - } - } - -#ifdef QT_MENTAT - popdown { - position 0 +77 - size 32 8 - text "OK" - } -#else - frame { - position 0 +77 - size 32 8 - group ok2_gr - } - - frame select_frame - frame inactive_return -#endif - } -#ifndef QT_MENTAT - window main_window - disable_right_mouse_button - } - - menu transform -} # job_ddm_fea_solver_sc -#else - mode permanent -} # job_ddm_fea_solver_pm -#endif - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu job_ddm_method2_pm { - - window { - parent mentat - origin 1 22 - size 30 33 - border_width 1 - border_color border - background_color body - } - - mode dialog - - group job_ddm_method_gr -} -#endif - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_direction_gr { - - button { - position 0 0 - size 15 4 - text "DIRECTION" - command "*job_vector ddm_sort_direction_x" - visible "*job_option ddm_method:vector" - } - - button { - position = = - size 15 4 - text "DIRECTION" - command "*job_vector ddm_sort_direction_x" - visible "not(*job_option ddm_method:vector)" - } - - button { - position +15 = - size 15 4 - text "FROM / TO" - command "*job_vector_from_to ddm_sort_direction_x" - } - - text { - position -15 +4 - size 10 4 - command "*job_param ddm_sort_direction_x" - display "job_param_value_ddm_sort_direction_x" - help ddm_job_decomp_user_direction_x - } - - text { - position +10 = - size 10 4 - command "*job_param ddm_sort_direction_y" - display "job_param_value_ddm_sort_direction_y" - } - - text { - position +10 = - size 10 4 - command "*job_param ddm_sort_direction_z" - display "job_param_value_ddm_sort_direction_z" - } - - frame { - position 0 +4 - size 30 8 - group job_ddm_sort_point_gr - visible "not(*job_option ddm_method:vector)" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_sort_point_gr { - - label { - position 0 0 - size 14 4 - border_width 1 - border_color black - text "POINT ON AXIS" - } - - roller { - position +14 = - size 10 4 - nvalues 2 - texts "DEFAULT" - "USER" - roller "job_option ddm_sort_point" -#ifdef QT_MENTAT - commands "*job_option ddm_sort_point:default" - "*job_option ddm_sort_point:user" -#else - popmenu job_ddm_sort_point_meth_pm -#endif - } - - button { - position +10 = - size 6 4 - text "SET" - command "*job_position ddm_sort_point_x" - visible "*job_option ddm_sort_point:user" - } - - text { - position 0 +4 - size 10 4 - command "*job_param ddm_sort_point_x" - display "job_param_value_ddm_sort_point_x" - visible "*job_option ddm_sort_point:user" - } - - text { - position +10 = - size 10 4 - command "*job_param ddm_sort_point_y" - display "job_param_value_ddm_sort_point_y" - visible "*job_option ddm_sort_point:user" - } - - text { - position +10 = - size 10 4 - command "*job_param ddm_sort_point_z" - display "job_param_value_ddm_sort_point_z" - visible "*job_option ddm_sort_point:user" - } -} - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu job_ddm_sort_point_meth_pm { - - window { - parent mentat - origin 15 35 - size 14 13 - border_width 1 - border_color border - background_color body - } - - mode dialog - - group job_ddm_sort_point_meth_gr -} - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_sort_point_meth_gr { - - popdown { - position 0 0 - size 14 4 - text "DEFAULT" - command "*job_option ddm_sort_point:default" - } - - popdown { - position = +4 - size 14 4 - text "USER DEFINED" - command "*job_option ddm_sort_point:user" - } - - popdown { - position = +5 - size 14 4 - text "CANCEL" - } -} -#endif - - -#-------------------------------------------------------------------------------------------------- -group job_ddm_preprocessor_gr { - - label { - position 0 0 - size 10 4 - text "# DOMAINS" - border_width 1 - border_color black - } - - integer { - position +10 = - size 4 4 - display valid_domains - } - - button { - position +4 = - size 30 4 - text "USER DOMAINS" -#ifdef QT_MENTAT - screen domains -#else - screen job_ddm_user_domains_sc - command "@popdown($popname2) @popdown($popname1)" ($popname2, $popname1) -#endif - help job_run_ddm_user_domains - } -} - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -screen job_ddm_user_domains_sc { - - menu { - - group { - units 32 120 - - label { - position 0 0 - size 32 4 - text "USER DOMAINS" - } - - frame { - position 0 5 - size 32 28 - group user_domains_gr - } - - frame { - position 0 +29 - size 32 49 - group user_domains_generate_gr - } - - frame { - position 0 +50 - size 32 8 - group user_domains_tail_gr - } - - frame { - position 0 92 - size 32 8 - group ok2_gr - } - - frame select_frame - frame inactive_return - } - window main_window - disable_right_mouse_button - - } - - menu transform - -} # job_ddm_user_domains_sc -#endif - - -#-------------------------------------------------------------------------------------------------- -group job_parallel_matrix_solver_gr { - - label { - position 3 4 - size 12 4 - text "SOLUTION" - border_width 1 - border_color black - } - - roller { - position +12 = - size 18 4 - nvalues 2 - texts "SYMMETRIC" - "NONSYMMETRIC" - rollers job_nonsym_off - job_nonsym_on - commands "*job_option solver_nonsym:off" - "*job_option solver_nonsym:on" - help job_param_solver_method - } - - label { - position -12 +4 - size 6 4 - text "TYPE" - border_width 1 - border_color black - } - - roller { - position +6 = - size 24 4 - nvalues 9 - help job_param_solver_method - texts "MULTIFRONTAL SPARSE" - "MIXED DIRECT-ITERATIVE" - "CASI ITERATIVE" - "PARDISO DIRECT SPARSE" - "MUMPS PARALLEL DIRECT" - "HARDWARE SPARSE" - "ITERATIVE SPARSE" - "DIRECT PROFILE" - "DIRECT SPARSE" - rollers job_solver_mfront_sparse - job_solver_mixed_direct_iterative - job_solver_it_ext - job_solver_pardiso - job_solver_mumps - job_solver_sparse - job_solver_it_sparse - job_solver_dir_profile - job_solver_dir_sparse -#ifdef QT_MENTAT - commands "*job_option solver:mfront_sparse" - "*job_option solver:mixed_direct_iterative" - "*job_option solver:it_ext" - "*job_option solver:pardiso" - "*job_option solver:mumps" - "*job_option solver:sparse" - "*job_option solver:it_sparse" - "*job_option solver:dir_profile" - "*job_option solver:dir_sparse" - visibles job_allows_solver_mfront_sparse - job_allows_solver_mixed_direct_iterative - job_allows_solver_it_ext - job_allows_solver_pardiso - job_allows_solver_mumps - job_allows_solver_sparse - job_allows_solver_it_sparse - job_allows_solver_dir_profile - job_allows_solver_dir_sparse - help job_param_solver_method -#else - popmenu job_set_parallel_matrix_solver_pm -#endif - } - - button { - position +24 = - size 14 4 - text "OPTIONS" - popmenu job_parallel_matrix_solver_opt_pm - } - - frame { - position = +4 - size 14 4 - group job_run_solver_ddm_opts_gr - visible "*job_option parallel:on" - } - - frame { - position 1 +5 - size 46 8 - group job_solver_multi_procs_gr - visible solver_allows_multi_procs - } - - frame { - position = = - size 46 8 - group job_solver_multi_threads_gr - visible solver_allows_multi_threads - } - - frame { - position 1 +9 - size 46 8 - group job_solver_gpu_gr - visible "and(job_solver_mfront_sparse,job_nonsym_off)" - } -} - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu job_set_parallel_matrix_solver_pm { - window { - parent mentat - origin 48 54 - size 24 42 - border_width 1 - border_color border - background_color body - } - mode dialog - - group job_solver_gr -} -#endif - - -#-------------------------------------------------------------------------------------------------- -popmenu job_parallel_matrix_solver_opt_pm { - -#ifdef QT_MENTAT - text "MATRIX SOLVER OPTIONS" -#endif - - group { - -#ifndef QT_MENTAT - label { - position 0 0 - size 38 4 - text "MATRIX SOLVER OPTIONS" - } -#endif - - frame { - position 1 5 - size 36 23 - group job_solver_opts_gr - } - - popdown { - position 13 +25 - size 12 8 - text "OK" - } - } - - window { - parent mentat - origin 41 12 - size 38 39 - border_width 1 - border_color border - background_color body - } - mode dialog -} - - -#-------------------------------------------------------------------------------------------------- -group job_run_solver_ddm_opts_gr { - - button { - position 0 0 - size 14 4 - text "\{DDM} OPTIONS" - popmenu ddm_options -# see also job_common.ms! - visible "not(or(job_solver_it_sparse, \ - job_solver_it_ext, \ - job_solver_mixed_direct_iterative, \ - job_solver_pardiso, \ - job_solver_mumps))" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_procs_gr { - frame { - position 0 0 - size 46 8 - group job_solver_multi_procs_parallel_off_gr - visible "*job_option parallel:off" - } - - frame { - position = = - size 46 8 - group job_solver_multi_procs_parallel_on_gr - visible "*job_option parallel:on" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_procs_parallel_off_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - true_command "*job_option nsolver_procs_serial:on" - false_command "*job_option nsolver_procs_serial:off" - toggle "*job_option nsolver_procs_serial:on" - help job_run_multithreading - } - -#ifdef QT_MENTAT - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - visible "*job_option nsolver_procs_serial:on" - help job_param - } -#else - button { - position +2 +4 - size 14 4 - text "# PROCESSES" - command "*job_param nsolver_procs" - visible "*job_option nsolver_procs_serial:on" - } -#endif - - text { - position +14 = - size 14 4 - display "job_param_value_nsolver_procs" - command "*job_param nsolver_procs" - visible "*job_option nsolver_procs_serial:on" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_procs_parallel_on_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - help job_run_multithreading - toggle true -#ifdef QT_MENTAT - set $dummy dummy -#endif - } - - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - border_width 1 - border_color black - } - - roller { - position +14 = - size 14 4 - nvalues 2 - texts "AUTOMATIC" - "USER" - commands "*job_option nsolver_procs_ddm:automatic" - "*job_option nsolver_procs_ddm:user" - help job_run_multithreading - rollers "*job_option nsolver_procs_ddm:automatic" - "*job_option nsolver_procs_ddm:user" - } - - frame { - position +14 = - size 16 4 - group job_nsolver_procs_ddm_automatic_gr - visible "*job_option nsolver_procs_ddm:automatic" - } - - frame { - position = = - size 16 4 - group job_nsolver_procs_ddm_user_gr - visible "*job_option nsolver_procs_ddm:user" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_nsolver_procs_ddm_automatic_gr { - - label { - position 0 0 - size 8 4 - text "VALUE" - border_width 1 - border_color black - } - - integer { - position +8 = - size 8 4 - display valid_domains - visible "*job_option ddm_generator:preprocessor" - } - - integer { - position = = - size 8 4 - display "job_param_ndomains" - visible "*job_option ddm_generator:fea_solver" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_nsolver_procs_ddm_user_gr { - -#ifdef QT_MENTAT - label { - position 0 0 - size 8 4 - text "VALUE" - help job_param - } -#else - button { - position 0 0 - size 8 4 - text "VALUE" - command "*job_param nsolver_procs" - } -#endif - - text { - position +8 = - size 8 4 - display "job_param_value_nsolver_procs" - command "*job_param nsolver_procs" - } -} - -group job_solver_multi_threads_gr { - frame { - position 0 0 - size 30 8 - group job_solver_multi_threads_mfront_sparse_gr - visible "and(job_solver_mfront_sparse,*job_option parallel:off)" - } - - frame { - position = = - size 46 8 - group job_solver_multi_threads_pardiso_parallel_off_gr - visible "and(job_solver_pardiso,*job_option parallel:off)" - } - - frame { - position = = - size 46 8 - group job_solver_multi_threads_pardiso_parallel_on_gr - visible "and(job_solver_pardiso,*job_option parallel:on)" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_threads_mfront_sparse_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - toggle "*job_option mfront_sparse_multi_threading:on" - true_command "*job_option mfront_sparse_multi_threading:on" - false_command "*job_option mfront_sparse_multi_threading:off" - help job_run_multithreading - } - -#ifdef QT_MENTAT - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - visible "*job_option mfront_sparse_multi_threading:on" - help job_param - } -#else - button { - position +2 +4 - size 14 4 - text "# PROCESSES" - command "*job_param nthreads" - visible "*job_option mfront_sparse_multi_threading:on" - } -#endif - - text { - position +14 = - size 14 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - visible "*job_option mfront_sparse_multi_threading:on" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_gpu_gr { - - toggle { - position 0 0 - size 30 4 - text "USE \{GPU(s)}" - toggle "*job_option solver_use_gpu:on" - true_command "*job_option solver_use_gpu:on" - false_command "*job_option solver_use_gpu:off" - help job_solver_gpu - } - - label { - position +2 +4 - size 16 4 - text "\{GPU} SELECTION" - border_width 1 - border_color black - visible "*job_option solver_use_gpu:on" - } - - roller { - position +16 = - size 12 4 - nvalues 2 - texts "AUTOMATIC" - "USER" - commands "*job_option solver_gpus:automatic" - "*job_option solver_gpus:user" - rollers "*job_option solver_gpus:automatic" - "*job_option solver_gpus:user" - visible "*job_option solver_use_gpu:on" - help job_solver_gpu - } - - text { - position +12 = - size 16 4 - display job_solver_gpus - command "*clear_job_solver_gpus *job_solver_gpus" - visible "and(*job_option solver_use_gpu:on,*job_option solver_gpus:user)" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_threads_pardiso_parallel_off_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - toggle "*job_option pardiso_multi_threading:on" - true_command "*job_option pardiso_multi_threading:on" - false_command "*job_option pardiso_multi_threading:off" - help job_run_multithreading - } - -#ifdef QT_MENTAT - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - visible "*job_option pardiso_multi_threading:on" - help job_param - } -#else - button { - position +2 +4 - size 14 4 - text "# PROCESSES" - command "*job_param nthreads" - visible "*job_option pardiso_multi_threading:on" - } -#endif - - text { - position +14 = - size 14 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - visible "*job_option pardiso_multi_threading:on" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_solver_multi_threads_pardiso_parallel_on_gr { - - toggle { - position 0 0 - size 30 4 - text "MULTIPLE SOLVER PROCESSES" - help job_run_multithreading - toggle true -#ifdef QT_MENTAT - set $dummy dummy -#endif - } - - label { - position +2 +4 - size 14 4 - text "# PROCESSES" - border_color black - border_width 1 - } - - roller { - position +14 = - size 14 4 - nvalues 2 - texts "AUTOMATIC" - "USER" - commands "*job_option pardiso_multi_threading_ddm:automatic" - "*job_option pardiso_multi_threading_ddm:user" - help job_run_multithreading - rollers "*job_option pardiso_multi_threading_ddm:automatic" - "*job_option pardiso_multi_threading_ddm:user" - } - - frame { - position +14 = - size 16 4 - group job_pardiso_multi_threads_ddm_automatic_gr - visible "*job_option pardiso_multi_threading_ddm:automatic" - } - - frame { - position = = - size 16 4 - group job_pardiso_multi_threads_ddm_user_gr - visible "*job_option pardiso_multi_threading_ddm:user" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_pardiso_multi_threads_ddm_automatic_gr { - - label { - position 0 0 - size 8 4 - text "VALUE" - border_width 1 - border_color black - } - - integer { - position +8 = - size 8 4 - display valid_domains - visible "*job_option ddm_generator:preprocessor" - } - - integer { - position = = - size 8 4 - display "job_param_ndomains" - visible "*job_option ddm_generator:fea_solver" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_pardiso_multi_threads_ddm_user_gr { - -#ifdef QT_MENTAT - label { - position 0 0 - size 8 4 - text "VALUE" - help job_param - } -#else - button { - position 0 0 - size 8 4 - text "VALUE" - command "*job_param nthreads" - } -#endif - - text { - position +8 = - size 8 4 - display "job_param_value_nthreads" - command "*job_param nthreads" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_parallel_env_gr { - - roller { - position 1 4 - size 30 4 - nvalues 2 - texts "SINGLE MACHINE" - "NETWORK" - help job_run_ddm_setup - roller "job_option parallel_setup" - commands "*job_option parallel_setup:single" - "*job_option parallel_setup:network" - } - - frame { - position +2 +5 - size 44 18 - group job_parallel_env_network_gr - visible "*job_option parallel_setup:network" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_parallel_env_network_gr { - - button { - position 0 0 - size 28 4 - text "HOST FILE" -#ifdef QT_MENTAT - browser host_file_browser -#else - popmenu host_file_browser_pm -#endif - settext $host_file_browser_label "SELECT HOST FILE" - set $host_file_browser_command "*job_host_file" - help job_host_file - } - - button { - position +28 = - size 8 4 - text "EDIT" - command "*job_edit_host_file" - help job_edit_host_file - visible job_host_file - } - - button { - position +8 = - size 8 4 - text "CLEAR" - command "*job_clear_host_file" - help job_clear_host_file - visible job_host_file - } - - display { - position 0 +4 - size 44 4 - display job_host_file - } - - frame { - position 0 +5 - size 44 9 - group job_parallel_env_network_ddm_gr - visible "*job_option parallel:on" - } -} - - -#-------------------------------------------------------------------------------------------------- -group job_parallel_env_network_ddm_gr { - - toggle { - position 0 0 - size 22 4 - text "COPY INPUT FILE" - toggle "*job_option copy_input_file:on" - true_command "*job_option copy_input_file:on" - false_command "*job_option copy_input_file:off" - help job_host_copy_inputfile - } - - toggle { - position +23 = - size 21 4 - text "COPY POST FILE" - toggle "*job_option copy_post_file:on" - true_command "*job_option copy_post_file:on" - false_command "*job_option copy_post_file:off" - help job_host_copy_inputfile - } - - label { - position 0 +5 - size 10 4 - text "HOSTS" - border_width 1 - border_color black - visible job_usersub_file - } - - roller { - position +10 = - size 18 4 - nvalues 2 - texts "COMPATIBLE" - "INCOMPATIBLE" - roller "job_option network_hosts" - commands "*job_option network_hosts:compatible" - "*job_option network_hosts:incompatible" - help job_host_comp - visible job_usersub_file - } -} - - -#ifndef QT_MENTAT -#-------------------------------------------------------------------------------------------------- -popmenu marc_integer_size_pm { - - window { - parent mentat - origin 55 32 - size 32 17 - border_width 1 - border_color border - background_color body - } - mode dialog - - group marc_integer_size_gr -} - - -#-------------------------------------------------------------------------------------------------- -group marc_integer_size_gr { - - popdown { - position 0 0 - size 32 4 - text "DEFAULT" - command "*job_option marc_integer_size:default" - help job_run_intsize - } - - popdown { - position = +4 - size 32 4 - text "4-BYTE INTEGERS" - command "*job_option marc_integer_size:i4" - help job_run_intsize - } - - popdown { - position = +4 - size 32 4 - text "8-BYTE INTEGERS" - command "*job_option marc_integer_size:i8" - help job_run_intsize - } - - popdown { - position = +5 - size 32 4 - text "CANCEL" - help job_run_intsize - } -} -#endif -#endif diff --git a/installation/symlink_Code.py b/installation/symlink_Code.py index bf5df1d49..c215a841e 100755 --- a/installation/symlink_Code.py +++ b/installation/symlink_Code.py @@ -12,10 +12,6 @@ bin_link = { \ } MarcReleases =[ \ - '2011', - '2012', - '2013', - '2013.1', '2014', '2014.2', '2015', From 873c52ccebdd306ee862a4a8af4f3553c3d3d405 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 7 Nov 2016 09:49:53 +0100 Subject: [PATCH 362/412] using 3 way merge to have syntax as similar as possible --- processing/post/addCurl.py | 16 ++++++++-------- processing/post/addDivergence.py | 16 ++++++++-------- processing/post/addGradient.py | 14 +++++++------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/processing/post/addCurl.py b/processing/post/addCurl.py index bec3e3a81..98a00197c 100755 --- a/processing/post/addCurl.py +++ b/processing/post/addCurl.py @@ -12,8 +12,8 @@ scriptID = ' '.join([scriptName,damask.version]) def curlFFT(geomdim,field): shapeFFT = np.array(np.shape(field))[0:3] grid = np.array(np.shape(field)[2::-1]) - N = grid.prod() # field size - n = np.array(np.shape(field)[3:]).prod() # data size + N = grid.prod() # field size + n = np.array(np.shape(field)[3:]).prod() # data size if n == 3: dataType = 'vector' elif n == 9: dataType = 'tensor' @@ -24,23 +24,23 @@ def curlFFT(geomdim,field): # differentiation in Fourier space TWOPIIMG = 2.0j*math.pi k_sk = np.where(np.arange(grid[2])>grid[2]//2,np.arange(grid[2])-grid[2],np.arange(grid[2]))/geomdim[0] - if grid[2]%2 == 0: k_sk[grid[2]//2] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) + if grid[2]%2 == 0: k_sk[grid[2]//2] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) k_sj = np.where(np.arange(grid[1])>grid[1]//2,np.arange(grid[1])-grid[1],np.arange(grid[1]))/geomdim[1] - if grid[1]%2 == 0: k_sj[grid[1]//2] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) - + if grid[1]%2 == 0: k_sj[grid[1]//2] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) + k_si = np.arange(grid[0]//2+1)/geomdim[2] kk, kj, ki = np.meshgrid(k_sk,k_sj,k_si,indexing = 'ij') k_s = np.concatenate((ki[:,:,:,None],kj[:,:,:,None],kk[:,:,:,None]),axis = 3).astype('c16') e = np.zeros((3, 3, 3)) - e[0, 1, 2] = e[1, 2, 0] = e[2, 0, 1] = 1.0 # Levi-Civita symbols + e[0, 1, 2] = e[1, 2, 0] = e[2, 0, 1] = 1.0 # Levi-Civita symbols e[0, 2, 1] = e[2, 1, 0] = e[1, 0, 2] = -1.0 - if dataType == 'tensor': # tensor, 3x3 -> 3x3 + if dataType == 'tensor': # tensor, 3x3 -> 3x3 curl_fourier = np.einsum('slm,ijkl,ijknm->ijksn',e,k_s,field_fourier)*TWOPIIMG - elif dataType == 'vector': # vector, 3 -> 3 + elif dataType == 'vector': # vector, 3 -> 3 curl_fourier = np.einsum('slm,ijkl,ijkm->ijks',e,k_s,field_fourier)*TWOPIIMG return np.fft.irfftn(curl_fourier,axes=(0,1,2),s=shapeFFT).reshape([N,n]) diff --git a/processing/post/addDivergence.py b/processing/post/addDivergence.py index 84cdf4593..232b5bc21 100755 --- a/processing/post/addDivergence.py +++ b/processing/post/addDivergence.py @@ -12,30 +12,30 @@ scriptID = ' '.join([scriptName,damask.version]) def divFFT(geomdim,field): shapeFFT = np.array(np.shape(field))[0:3] grid = np.array(np.shape(field)[2::-1]) - N = grid.prod() # field size - n = np.array(np.shape(field)[3:]).prod() # data size + N = grid.prod() # field size + n = np.array(np.shape(field)[3:]).prod() # data size if n == 3: dataType = 'vector' elif n == 9: dataType = 'tensor' - + field_fourier = np.fft.rfftn(field,axes=(0,1,2),s=shapeFFT) - div_fourier = np.empty(field_fourier.shape[0:len(np.shape(field))-1],'c16') # size depents on whether tensor or vector + div_fourier = np.empty(field_fourier.shape[0:len(np.shape(field))-1],'c16') # differentiation in Fourier space TWOPIIMG = 2.0j*math.pi k_sk = np.where(np.arange(grid[2])>grid[2]//2,np.arange(grid[2])-grid[2],np.arange(grid[2]))/geomdim[0] - if grid[2]%2 == 0: k_sk[grid[2]//2] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) + if grid[2]%2 == 0: k_sk[grid[2]//2] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) k_sj = np.where(np.arange(grid[1])>grid[1]//2,np.arange(grid[1])-grid[1],np.arange(grid[1]))/geomdim[1] - if grid[1]%2 == 0: k_sj[grid[1]//2] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) + if grid[1]%2 == 0: k_sj[grid[1]//2] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) k_si = np.arange(grid[0]//2+1)/geomdim[2] kk, kj, ki = np.meshgrid(k_sk,k_sj,k_si,indexing = 'ij') k_s = np.concatenate((ki[:,:,:,None],kj[:,:,:,None],kk[:,:,:,None]),axis = 3).astype('c16') - if dataType == 'tensor': # tensor, 3x3 -> 3 + if dataType == 'tensor': # tensor, 3x3 -> 3 div_fourier = np.einsum('ijklm,ijkm->ijkl',field_fourier,k_s)*TWOPIIMG - elif dataType == 'vector': # vector, 3 -> 1 + elif dataType == 'vector': # vector, 3 -> 1 div_fourier = np.einsum('ijkl,ijkl->ijk',field_fourier,k_s)*TWOPIIMG return np.fft.irfftn(div_fourier,axes=(0,1,2),s=shapeFFT).reshape([N,n/3]) diff --git a/processing/post/addGradient.py b/processing/post/addGradient.py index 5ac784c01..fefe8f84e 100755 --- a/processing/post/addGradient.py +++ b/processing/post/addGradient.py @@ -12,8 +12,8 @@ scriptID = ' '.join([scriptName,damask.version]) def gradFFT(geomdim,field): shapeFFT = np.array(np.shape(field))[0:3] grid = np.array(np.shape(field)[2::-1]) - N = grid.prod() # field size - n = np.array(np.shape(field)[3:]).prod() # data size + N = grid.prod() # field size + n = np.array(np.shape(field)[3:]).prod() # data size if n == 3: dataType = 'vector' elif n == 1: dataType = 'scalar' @@ -24,18 +24,18 @@ def gradFFT(geomdim,field): # differentiation in Fourier space TWOPIIMG = 2.0j*math.pi k_sk = np.where(np.arange(grid[2])>grid[2]//2,np.arange(grid[2])-grid[2],np.arange(grid[2]))/geomdim[0] - if grid[2]%2 == 0: k_sk[grid[2]//2] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) + if grid[2]%2 == 0: k_sk[grid[2]//2] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) k_sj = np.where(np.arange(grid[1])>grid[1]//2,np.arange(grid[1])-grid[1],np.arange(grid[1]))/geomdim[1] - if grid[1]%2 == 0: k_sj[grid[1]//2] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) - + if grid[1]%2 == 0: k_sj[grid[1]//2] = 0 # for even grid, set Nyquist freq to 0 (Johnson, MIT, 2011) + k_si = np.arange(grid[0]//2+1)/geomdim[2] kk, kj, ki = np.meshgrid(k_sk,k_sj,k_si,indexing = 'ij') k_s = np.concatenate((ki[:,:,:,None],kj[:,:,:,None],kk[:,:,:,None]),axis = 3).astype('c16') - if dataType == 'vector': # vector, 3 -> 3x3 + if dataType == 'vector': # vector, 3 -> 3x3 grad_fourier = np.einsum('ijkl,ijkm->ijklm',field_fourier,k_s)*TWOPIIMG - elif dataType == 'scalar': # scalar, 1 -> 3 + elif dataType == 'scalar': # scalar, 1 -> 3 grad_fourier = np.einsum('ijkl,ijkl->ijkl',field_fourier,k_s)*TWOPIIMG return np.fft.irfftn(grad_fourier,axes=(0,1,2),s=shapeFFT).reshape([N,3*n]) From 2d0193e29c590e724d6cc891ed04fdf3bc9cef64 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 7 Nov 2016 21:26:06 +0100 Subject: [PATCH 363/412] removed no longer supported marc 2011 --- lib/damask/solver/marc.py | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/damask/solver/marc.py b/lib/damask/solver/marc.py index a4168f709..873d08cdb 100644 --- a/lib/damask/solver/marc.py +++ b/lib/damask/solver/marc.py @@ -16,7 +16,6 @@ class Marc(Solver): '2013.1':['linux64',''], '2013': ['linux64',''], '2012': ['linux64',''], - '2011': ['linux64',''], } From 20755e897bdf784d692ed95e9a3a7ea8a3d45586 Mon Sep 17 00:00:00 2001 From: Test User Date: Tue, 8 Nov 2016 04:32:58 +0100 Subject: [PATCH 364/412] updated version information after successful test of v2.0.1-306-g2d0193e --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 02b19f674..8e45698bd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-298-g8179a70 +v2.0.1-306-g2d0193e From 0f2e22805a7d7c3fdd70a363d89faa26b3a99b77 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 10 Nov 2016 06:53:47 +0100 Subject: [PATCH 365/412] deallocate "axes" shuffling of orientation information --- code/material.f90 | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/code/material.f90 b/code/material.f90 index e1a48bc1c..bd2bf3cda 100644 --- a/code/material.f90 +++ b/code/material.f90 @@ -1586,13 +1586,8 @@ subroutine material_populateGrains deallocate(phaseOfGrain) deallocate(textureOfGrain) deallocate(orientationOfGrain) + deallocate(texture_transformation) deallocate(Nelems) - !> @todo - causing segmentation fault: needs looking into - !do homog = 1,material_Nhomogenization - ! do micro = 1,material_Nmicrostructure - ! if (Nelems(homog,micro) > 0_pInt) deallocate(elemsOfHomogMicro(homog,micro)%p) - ! enddo - !enddo deallocate(elemsOfHomogMicro) end subroutine material_populateGrains From 08d9f0a4f351f0192534906e443e24c7ced3921e Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 16 Nov 2016 22:08:19 +0100 Subject: [PATCH 366/412] texture transformation should be a proper rotation at least, until the implications of using improper rotations are clear... --- code/material.f90 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/material.f90 b/code/material.f90 index bd2bf3cda..cd1d21808 100644 --- a/code/material.f90 +++ b/code/material.f90 @@ -1051,6 +1051,8 @@ end subroutine material_parsePhase !> @brief parses the texture part in the material configuration file !-------------------------------------------------------------------------------------------------- subroutine material_parseTexture(fileUnit,myPart) + use prec, only: & + dNeq use IO, only: & IO_read, & IO_globalTagInPart, & @@ -1069,6 +1071,7 @@ subroutine material_parseTexture(fileUnit,myPart) inRad, & math_sampleRandomOri, & math_I3, & + math_det33, & math_inv33 implicit none @@ -1154,6 +1157,9 @@ subroutine material_parseTexture(fileUnit,myPart) end select enddo + if(dNeq(math_det33(texture_transformation(1:3,1:3,section)),1.0_pReal)) & + call IO_error(157_pInt,section) + case ('hybridia') textureType texture_ODFfile(section) = IO_stringValue(line,chunkPos,2_pInt) From 1346efbef00e78ae2b62528843acc60802728232 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 16 Nov 2016 12:15:01 +0100 Subject: [PATCH 367/412] pyeuclid moved from google code to github --- lib/damask/orientation.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/damask/orientation.py b/lib/damask/orientation.py index ef1d8be22..101841ce4 100644 --- a/lib/damask/orientation.py +++ b/lib/damask/orientation.py @@ -744,27 +744,27 @@ class Symmetry: if self.lattice == 'cubic': basis = {'improper':np.array([ [-1. , 0. , 1. ], - [ np.sqrt(2.) , -np.sqrt(2.) , 0. ], - [ 0. , np.sqrt(3.) , 0. ] ]), + [ np.sqrt(2.) , -np.sqrt(2.) , 0. ], + [ 0. , np.sqrt(3.) , 0. ] ]), 'proper':np.array([ [ 0. , -1. , 1. ], - [-np.sqrt(2.) , np.sqrt(2.) , 0. ], - [ np.sqrt(3. ) , 0. , 0. ] ]), + [-np.sqrt(2.) , np.sqrt(2.) , 0. ], + [ np.sqrt(3.) , 0. , 0. ] ]), } elif self.lattice == 'hexagonal': basis = {'improper':np.array([ [ 0. , 0. , 1. ], - [ 1. , -np.sqrt(3.) , 0. ], - [ 0. , 2. , 0. ] ]), - 'proper':np.array([ [ 0. , 0. , 1. ], - [-1. , np.sqrt(3.) , 0. ], - [ np.sqrt(3) , -1. , 0. ] ]), + [ 1. , -np.sqrt(3.) , 0. ], + [ 0. , 2. , 0. ] ]), + 'proper':np.array([ [ 0. , 0. , 1. ], + [-1. , np.sqrt(3.) , 0. ], + [ np.sqrt(3.) , -1. , 0. ] ]), } elif self.lattice == 'tetragonal': basis = {'improper':np.array([ [ 0. , 0. , 1. ], - [ 1. , -1. , 0. ], - [ 0. , np.sqrt(2.) , 0. ] ]), - 'proper':np.array([ [ 0. , 0. , 1. ], - [-1. , 1. , 0. ], - [ np.sqrt(2.) , 0. , 0. ] ]), + [ 1. , -1. , 0. ], + [ 0. , np.sqrt(2.) , 0. ] ]), + 'proper':np.array([ [ 0. , 0. , 1. ], + [-1. , 1. , 0. ], + [ np.sqrt(2.) , 0. , 0. ] ]), } elif self.lattice == 'orthorhombic': basis = {'improper':np.array([ [ 0., 0., 1.], @@ -806,7 +806,7 @@ class Symmetry: else: return inSST -# code derived from http://pyeuclid.googlecode.com/svn/trunk/euclid.py +# code derived from https://github.com/ezag/pyeuclid # suggested reading: http://web.mit.edu/2.998/www/QuaternionReport1.pdf From b128b15abf4f2e5c6a82c172bb851d83692837c5 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 16 Nov 2016 12:28:38 +0100 Subject: [PATCH 368/412] fixed strange behavior for inSST without given symmetry np.all() on dict (with keys 'proper' and 'improper') always returns 'False', and not, as (most likely) intended 'True' in the case of no symmetry. Removed this comparison and simply setting inSST=False for no symmetry, color will be (0,0,0) in that case --- lib/damask/orientation.py | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/lib/damask/orientation.py b/lib/damask/orientation.py index 101841ce4..655f5cbba 100644 --- a/lib/damask/orientation.py +++ b/lib/damask/orientation.py @@ -774,26 +774,23 @@ class Symmetry: [-1., 0., 0.], [ 0., 1., 0.] ]), } - else: - basis = {'improper': np.zeros((3,3),dtype=float), - 'proper': np.zeros((3,3),dtype=float), - } + else: # direct exit for unspecified symmetry + if color: + return (True,np.zeros(3,'d')) + else: + return True - if np.all(basis == 0.0): - theComponents = -np.ones(3,'d') + v = np.array(vector,dtype = float) + if proper: # check both improper ... + theComponents = np.dot(basis['improper'],v) inSST = np.all(theComponents >= 0.0) - else: - v = np.array(vector,dtype = float) - if proper: # check both improper ... - theComponents = np.dot(basis['improper'],v) - inSST = np.all(theComponents >= 0.0) - if not inSST: # ... and proper SST - theComponents = np.dot(basis['proper'],v) - inSST = np.all(theComponents >= 0.0) - else: - v[2] = abs(v[2]) # z component projects identical - theComponents = np.dot(basis['improper'],v) # for positive and negative values + if not inSST: # ... and proper SST + theComponents = np.dot(basis['proper'],v) inSST = np.all(theComponents >= 0.0) + else: + v[2] = abs(v[2]) # z component projects identical + theComponents = np.dot(basis['improper'],v) # for positive and negative values + inSST = np.all(theComponents >= 0.0) if color: # have to return color array if inSST: From ad14f527565c87d3c0a350560344cd68953f17bc Mon Sep 17 00:00:00 2001 From: Test User Date: Thu, 17 Nov 2016 04:40:12 +0100 Subject: [PATCH 369/412] updated version information after successful test of v2.0.1-311-gb128b15 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 8e45698bd..db558a42a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-306-g2d0193e +v2.0.1-311-gb128b15 From 1c68cf1fd31b28001ab480a9898cc99f3982b256 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 21 Nov 2016 21:06:52 +0100 Subject: [PATCH 370/412] using cubic symmetry as default for orientation relationships --- lib/damask/orientation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/damask/orientation.py b/lib/damask/orientation.py index 655f5cbba..0ef6725cf 100644 --- a/lib/damask/orientation.py +++ b/lib/damask/orientation.py @@ -993,7 +993,7 @@ class Orientation: def related(self, relationModel, direction, - targetSymmetry = None): + targetSymmetry = 'cubic'): """ Orientation relationship @@ -1241,4 +1241,4 @@ class Orientation: rot=np.dot(otherMatrix,myMatrix.T) - return Orientation(matrix=np.dot(rot,self.asMatrix())) # no symmetry information ?? + return Orientation(matrix=np.dot(rot,self.asMatrix()),symmetry=targetSymmetry) From 03262429a7885781b9d7dbd4b08d07dd3306ba08 Mon Sep 17 00:00:00 2001 From: Test User Date: Tue, 22 Nov 2016 04:34:05 +0100 Subject: [PATCH 371/412] updated version information after successful test of v2.0.1-313-g1c68cf1 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index db558a42a..08b2fee0c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-311-gb128b15 +v2.0.1-313-g1c68cf1 From dc988dd6b1f3a5d8d060e0ab5ec658ef62c7faf6 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Thu, 24 Nov 2016 09:37:27 -0500 Subject: [PATCH 372/412] removed unneccesary line continuation --- lib/damask/asciitable.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/damask/asciitable.py b/lib/damask/asciitable.py index 4710686b2..947a5a2e0 100644 --- a/lib/damask/asciitable.py +++ b/lib/damask/asciitable.py @@ -513,14 +513,15 @@ class ASCIItable(): columns = [] for i,(c,d) in enumerate(zip(indices[present],dimensions[present])): # for all valid labels ... # ... transparently add all components unless column referenced by number or with explicit dimension - columns += list(range(c,c + \ - (d if str(c) != str(labels[present[i]]) else \ + columns += list(range(c,c + + (d if str(c) != str(labels[present[i]]) else 1))) use = np.array(columns) if len(columns) > 0 else None self.tags = list(np.array(self.tags)[use]) # update labels with valid subset self.data = np.loadtxt(self.__IO__['in'],usecols=use,ndmin=2) +# self.data = np.genfromtxt(self.__IO__['in'],dtype=None,names=self.tags,usecols=use) return labels_missing From c3f58fd208ae48c70be404ba694743abcae56a27 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Thu, 24 Nov 2016 09:37:57 -0500 Subject: [PATCH 373/412] unified processing order of quaternion properties to w,x,y,z --- lib/damask/orientation.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/damask/orientation.py b/lib/damask/orientation.py index 0ef6725cf..7d97d2c81 100644 --- a/lib/damask/orientation.py +++ b/lib/damask/orientation.py @@ -137,18 +137,18 @@ class Quaternion: def __imul__(self, other): """In-place multiplication""" try: # Quaternion + Aw = self.w Ax = self.x Ay = self.y Az = self.z - Aw = self.w + Bw = other.w Bx = other.x By = other.y Bz = other.z - Bw = other.w - self.x = Ax * Bw + Ay * Bz - Az * By + Aw * Bx - self.y = -Ax * Bz + Ay * Bw + Az * Bx + Aw * By - self.z = Ax * By - Ay * Bx + Az * Bw + Aw * Bz - self.w = -Ax * Bx - Ay * By - Az * Bz + Aw * Bw + self.w = - Ax * Bx - Ay * By - Az * Bz + Aw * Bw + self.x = + Ax * Bw + Ay * Bz - Az * By + Aw * Bx + self.y = - Ax * Bz + Ay * Bw + Az * Bx + Aw * By + self.z = + Ax * By - Ay * Bx + Az * Bw + Aw * Bz except: pass return self From d6baa71ee4957d52e045a16ed0c0b43a5e6fc253 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Thu, 24 Nov 2016 09:51:21 -0500 Subject: [PATCH 374/412] added temporary patch for PETSc 3.7.x compatibility apply with "patch -p1 < installation/patch/petsc3.7" --- installation/patch/petsc3.7 | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 installation/patch/petsc3.7 diff --git a/installation/patch/petsc3.7 b/installation/patch/petsc3.7 new file mode 100644 index 000000000..b5fd696fb --- /dev/null +++ b/installation/patch/petsc3.7 @@ -0,0 +1,22 @@ +diff --git a/code/spectral_utilities.f90 b/code/spectral_utilities.f90 +index 34eb0ea..a33c7a9 100644 +--- a/code/spectral_utilities.f90 ++++ b/code/spectral_utilities.f90 +@@ -227,12 +227,13 @@ subroutine utilities_init() + trim(PETScDebug), & + ' add more using the PETSc_Options keyword in numerics.config '; flush(6) + +- call PetscOptionsClear(ierr); CHKERRQ(ierr) +- if(debugPETSc) call PetscOptionsInsertString(trim(PETSCDEBUG),ierr) ++ call PetscOptionsClear(PETSC_NULL_OBJECT,ierr) + CHKERRQ(ierr) +- call PetscOptionsInsertString(trim(petsc_defaultOptions),ierr) ++ if(debugPETSc) call PetscOptionsInsertString(PETSC_NULL_OBJECT,trim(PETSCDEBUG),ierr) + CHKERRQ(ierr) +- call PetscOptionsInsertString(trim(petsc_options),ierr) ++ call PetscOptionsInsertString(PETSC_NULL_OBJECT,trim(petsc_defaultOptions),ierr) ++ CHKERRQ(ierr) ++ call PetscOptionsInsertString(PETSC_NULL_OBJECT,trim(petsc_options),ierr) + CHKERRQ(ierr) + + grid1Red = grid(1)/2_pInt + 1_pInt From 3fd8fb9f14c881bb6d8e8ee6b828a7f5a977350f Mon Sep 17 00:00:00 2001 From: Test User Date: Fri, 25 Nov 2016 04:40:34 +0100 Subject: [PATCH 375/412] updated version information after successful test of v2.0.1-317-gd6baa71 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 08b2fee0c..badc23c91 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-313-g1c68cf1 +v2.0.1-317-gd6baa71 From c9ec2e0f460cb624613a8936f9eaabfc1a798d23 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Tue, 29 Nov 2016 09:29:26 -0500 Subject: [PATCH 376/412] New table mapping based on shared column values renamed old addMapped to addRowMapped to better reflect true functionality. --- .../post/{addMapped.py => addRowMapped.py} | 11 +- processing/post/addValueMapped.py | 108 ++++++++++++++++++ 2 files changed, 113 insertions(+), 6 deletions(-) rename processing/post/{addMapped.py => addRowMapped.py} (92%) create mode 100755 processing/post/addValueMapped.py diff --git a/processing/post/addMapped.py b/processing/post/addRowMapped.py similarity index 92% rename from processing/post/addMapped.py rename to processing/post/addRowMapped.py index f67d88d15..16250aa1f 100755 --- a/processing/post/addMapped.py +++ b/processing/post/addRowMapped.py @@ -14,14 +14,14 @@ scriptID = ' '.join([scriptName,damask.version]) # -------------------------------------------------------------------- parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ -Add data in column(s) of second ASCIItable selected from row that is given by the value in a mapping column. +Add data in column(s) of second ASCIItable selected from the row indexed by the value in a mapping column. """, version = scriptID) parser.add_option('-c','--map', dest = 'map', type = 'string', metavar = 'string', - help = 'heading of column containing row mapping') + help = 'column label containing row mapping') parser.add_option('-o','--offset', dest = 'offset', type = 'int', metavar = 'int', @@ -29,11 +29,11 @@ parser.add_option('-o','--offset', parser.add_option('-l','--label', dest = 'label', action = 'extend', metavar = '', - help='column label(s) to be mapped') + help='column label(s) to be appended') parser.add_option('-a','--asciitable', dest = 'asciitable', type = 'string', metavar = 'string', - help = 'mapped ASCIItable') + help = 'indexed ASCIItable') parser.set_defaults(offset = 0, ) @@ -54,6 +54,7 @@ if options.asciitable is not None and os.path.isfile(options.asciitable): readonly = True) mappedTable.head_read() # read ASCII header info of mapped table missing_labels = mappedTable.data_readArray(options.label) + mappedTable.close() # close mapped input ASCII table if len(missing_labels) > 0: damask.util.croak('column{} {} not found...'.format('s' if len(missing_labels) > 1 else '',', '.join(missing_labels))) @@ -106,5 +107,3 @@ for name in filenames: # ------------------------------------------ output finalization ----------------------------------- table.close() # close ASCII tables - -mappedTable.close() # close mapped input ASCII table diff --git a/processing/post/addValueMapped.py b/processing/post/addValueMapped.py new file mode 100755 index 000000000..cd0f50d0d --- /dev/null +++ b/processing/post/addValueMapped.py @@ -0,0 +1,108 @@ +#!/usr/bin/env python2.7 +# -*- coding: UTF-8 no BOM -*- + +import os,sys +import numpy as np +from optparse import OptionParser +import damask + +scriptName = os.path.splitext(os.path.basename(__file__))[0] +scriptID = ' '.join([scriptName,damask.version]) + +# -------------------------------------------------------------------- +# MAIN +# -------------------------------------------------------------------- + +parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ +Add data of selected column(s) from (first) row of second ASCIItable that shares the mapping column value. + +""", version = scriptID) + +parser.add_option('-c','--map', + dest = 'map', nargs = 2, + type = 'string', metavar = 'string string', + help = 'column labels containing linked values') +parser.add_option('-l','--label', + dest = 'label', + action = 'extend', metavar = '', + help='column label(s) to be appended') +parser.add_option('-a','--asciitable', + dest = 'asciitable', + type = 'string', metavar = 'string', + help = 'indexed ASCIItable') + +parser.set_defaults() + +(options,filenames) = parser.parse_args() + +if options.label is None: + parser.error('no data columns specified.') +if options.map is None: + parser.error('no mapping columns given.') + +# ------------------------------------------ process mapping ASCIItable --------------------------- + +if options.asciitable is not None and os.path.isfile(options.asciitable): + + mappedTable = damask.ASCIItable(name = options.asciitable, + buffered = False, + readonly = True) + mappedTable.head_read() # read ASCII header info of mapped table + if mappedTable.label_dimension(options.map[1]) != 1: + parser.error('mapping column {} needs to be scalar valued.'.format(options.map[1])) + + missing_labels = mappedTable.data_readArray([options.map[1]]+options.label) + mappedTable.close() # close mapped input ASCII table + + if len(missing_labels) > 0: + damask.util.croak('column{} {} not found...'.format('s' if len(missing_labels) > 1 else '',', '.join(missing_labels))) + +else: + parser.error('no indexed ASCIItable given.') + +# --- loop over input files ------------------------------------------------------------------------- + +if filenames == []: filenames = [None] + +for name in filenames: + try: table = damask.ASCIItable(name = name, + buffered = False) + except: continue + damask.util.report(scriptName,name) + +# ------------------------------------------ read header ------------------------------------------ + + table.head_read() + +# ------------------------------------------ sanity checks ---------------------------------------- + + errors = [] + + mappedColumn = table.label_index(options.map[0]) + if mappedColumn < 0: errors.append('mapping column {} not found.'.format(options.map[0])) + + if errors != []: + damask.util.croak(errors) + table.close(dismiss = True) + continue + +# ------------------------------------------ assemble header -------------------------------------- + + table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) + table.labels_append(mappedTable.labels(raw = True)[1:]) # extend with new labels (except for mapped column) + table.head_write() + +# ------------------------------------------ process data ------------------------------------------ + + outputAlive = True + while outputAlive and table.data_read(): # read next data line of ASCII table + try: + table.data_append(mappedTable.data[np.argwhere(mappedTable.data[:,0] == + float(table.data[mappedColumn]))[0]]) # add data from first matching line + except IndexError: + table.data_append(np.nan*np.ones_like(mappedTable.data[0])) # or add NaNs + outputAlive = table.data_write() # output processed line + +# ------------------------------------------ output finalization ----------------------------------- + + table.close() # close ASCII tables From 94c934c8bdd0964f25334146e4eeb5881357513d Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Tue, 29 Nov 2016 09:52:14 -0500 Subject: [PATCH 377/412] added patch to switch to fwbw_derivative --- installation/patch/README.md | 17 +++++++++++++++++ installation/patch/fwbw_derivative | 13 +++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 installation/patch/README.md create mode 100644 installation/patch/fwbw_derivative diff --git a/installation/patch/README.md b/installation/patch/README.md new file mode 100644 index 000000000..17fe041c4 --- /dev/null +++ b/installation/patch/README.md @@ -0,0 +1,17 @@ +# DAMASK patching + +This folder contains patches that modify the functionality of the current version of DAMASK prior to the corresponding inclusion in the official release. + +## Usage + +```bash +cd DAMASK_ROOT +patch -p1 installation/patch/nameOfPatch +``` + +## Available patches + + * **fwbw_derivative** switches the default spatial derivative from continuous to forward/backward difference. + This generally reduces spurious oscillations in the result as the spatial accuracy of the derivative is then compatible with the underlying solution grid. + * **petsc3.7** adapts to API changes introduced between PETSc 3.6.x and 3.7.x for setting PETSc options. + Use this patch if your system runs PETSc 3.7.x. diff --git a/installation/patch/fwbw_derivative b/installation/patch/fwbw_derivative new file mode 100644 index 000000000..03d5be1c6 --- /dev/null +++ b/installation/patch/fwbw_derivative @@ -0,0 +1,13 @@ +diff --git a/code/numerics.f90 b/code/numerics.f90 +index 24bd190..c968c70 100644 +--- a/code/numerics.f90 ++++ b/code/numerics.f90 +@@ -110,7 +110,7 @@ module numerics + fftw_plan_mode = 'FFTW_PATIENT' !< reads the planing-rigor flag, see manual on www.fftw.org, Default FFTW_PATIENT: use patient planner flag + character(len=64), protected, public :: & + spectral_solver = 'basicpetsc' , & !< spectral solution method +- spectral_derivative = 'continuous' !< spectral spatial derivative method ++ spectral_derivative = 'fwbw_difference' !< spectral spatial derivative method + character(len=1024), protected, public :: & + petsc_defaultOptions = '-mech_snes_type ngmres & + &-damage_snes_type ngmres & From 20c5ccc112c392ef32dbe76bd575e5fa4c792468 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Tue, 29 Nov 2016 10:02:07 -0500 Subject: [PATCH 378/412] corrected (my standard) mistake in README --- installation/patch/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installation/patch/README.md b/installation/patch/README.md index 17fe041c4..86ed44f0d 100644 --- a/installation/patch/README.md +++ b/installation/patch/README.md @@ -6,7 +6,7 @@ This folder contains patches that modify the functionality of the current versio ```bash cd DAMASK_ROOT -patch -p1 installation/patch/nameOfPatch +patch -p1 < installation/patch/nameOfPatch ``` ## Available patches From 231f05e1429c9e74269752740acd4e6263c8864d Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Tue, 29 Nov 2016 11:16:50 -0500 Subject: [PATCH 379/412] corrected bug that added index column values as first output --- processing/post/addValueMapped.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/processing/post/addValueMapped.py b/processing/post/addValueMapped.py index cd0f50d0d..852ce10b0 100755 --- a/processing/post/addValueMapped.py +++ b/processing/post/addValueMapped.py @@ -57,6 +57,8 @@ if options.asciitable is not None and os.path.isfile(options.asciitable): if len(missing_labels) > 0: damask.util.croak('column{} {} not found...'.format('s' if len(missing_labels) > 1 else '',', '.join(missing_labels))) + index = mappedTable.data[:,0] + data = mappedTable.data[:,1:] else: parser.error('no indexed ASCIItable given.') @@ -90,6 +92,7 @@ for name in filenames: table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) table.labels_append(mappedTable.labels(raw = True)[1:]) # extend with new labels (except for mapped column) + table.head_write() # ------------------------------------------ process data ------------------------------------------ @@ -97,10 +100,9 @@ for name in filenames: outputAlive = True while outputAlive and table.data_read(): # read next data line of ASCII table try: - table.data_append(mappedTable.data[np.argwhere(mappedTable.data[:,0] == - float(table.data[mappedColumn]))[0]]) # add data from first matching line + table.data_append(data[np.argwhere(index == float(table.data[mappedColumn]))[0]]) # add data from first matching line except IndexError: - table.data_append(np.nan*np.ones_like(mappedTable.data[0])) # or add NaNs + table.data_append(np.nan*np.ones_like(data[0])) # or add NaNs outputAlive = table.data_write() # output processed line # ------------------------------------------ output finalization ----------------------------------- From 7ebd688885039562570493aa4ed697b2af728d39 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Tue, 29 Nov 2016 14:35:30 -0500 Subject: [PATCH 380/412] return type-safe indexrange (for invalid queries) --- lib/damask/asciitable.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/damask/asciitable.py b/lib/damask/asciitable.py index 947a5a2e0..771ae76a5 100644 --- a/lib/damask/asciitable.py +++ b/lib/damask/asciitable.py @@ -427,8 +427,8 @@ class ASCIItable(): start = self.label_index(labels) dim = self.label_dimension(labels) - return np.hstack([range(c[0],c[0]+c[1]) for c in zip(start,dim)]) \ - if isinstance(labels, Iterable) and not isinstance(labels, str) \ + return np.hstack([range(s,s+d) for s,d in zip(start,dim)]).astype(int) \ + if isinstance(labels, Iterable) and not isinstance(labels, str) \ else range(start,start+dim) # ------------------------------------------------------------------ From 43c18801954693e0130f27b708e48812725131f5 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Tue, 29 Nov 2016 14:37:43 -0500 Subject: [PATCH 381/412] fixed periodic averaging to work with multi-dimensional data option --periodic now takes list of labels that undergo periodoc domain averaging, i.e. incompatible to former API! --- processing/post/groupTable.py | 42 +++++++++++++++++------------------ 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/processing/post/groupTable.py b/processing/post/groupTable.py index a1205eff4..67d07a7d1 100755 --- a/processing/post/groupTable.py +++ b/processing/post/groupTable.py @@ -7,14 +7,11 @@ import numpy as np from optparse import OptionParser, OptionGroup import damask -#"https://en.wikipedia.org/wiki/Center_of_mass#Systems_with_periodic_boundary_conditions" -def periodicAverage(Points, Box): - theta = (Points/Box[1]) * (2.0*np.pi) - xi = np.cos(theta) - zeta = np.sin(theta) - theta_avg = np.arctan2(-1.0*zeta.mean(), -1.0*xi.mean()) + np.pi - Pmean = Box[1] * theta_avg/(2.0*np.pi) - return Pmean +def periodicAverage(coords, limits): + """Centroid in periodic domain, see https://en.wikipedia.org/wiki/Center_of_mass#Systems_with_periodic_boundary_conditions""" + theta = 2.0*np.pi * (coords - limits[0])/(limits[1] - limits[0]) + theta_avg = np.pi + np.arctan2(-np.sin(theta).mean(axis=0), -np.cos(theta).mean(axis=0)) + return limits[0] + theta_avg * (limits[1] - limits[0])/2.0/np.pi scriptName = os.path.splitext(os.path.basename(__file__))[0] scriptID = ' '.join([scriptName,damask.version]) @@ -26,6 +23,7 @@ scriptID = ' '.join([scriptName,damask.version]) parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ Apply a user-specified function to condense all rows for which column 'label' has identical values into a single row. Output table will contain as many rows as there are different (unique) values in the grouping column. +Periodic domain averaging of coordinate values is supported. Examples: For grain averaged values, replace all rows of particular 'texture' with a single row containing their average. @@ -43,23 +41,22 @@ parser.add_option('-a','--all', dest = 'all', action = 'store_true', help = 'apply mapping function also to grouping column') - + group = OptionGroup(parser, "periodic averaging", "") -group.add_option('-p','--periodic', - dest = 'periodic', - action = 'store_true', - help = 'calculate average in periodic space defined by periodic length [%default]') -group.add_option('--boundary', - dest = 'boundary', metavar = 'MIN MAX', - type = 'float', nargs = 2, - help = 'define periodic box end points %default') +group.add_option ('-p','--periodic', + dest = 'periodic', + action = 'extend', metavar = '', + help = 'coordinate label(s) to average across periodic domain') +group.add_option ('--limits', + dest = 'boundary', + type = 'float', metavar = 'float float', nargs = 2, + help = 'min and max of periodic domain %default') parser.add_option_group(group) parser.set_defaults(function = 'np.average', all = False, - periodic = False, boundary = [0.0, 1.0]) (options,filenames) = parser.parse_args() @@ -108,6 +105,7 @@ for name in filenames: # ------------------------------------------ process data -------------------------------- table.data_readArray() + indexrange = table.label_indexrange(options.periodic) if options.periodic is not None else [] rows,cols = table.data.shape table.data = table.data[np.lexsort([table.data[:,grpColumn]])] # sort data by grpColumn @@ -117,10 +115,10 @@ for name in filenames: grpTable = np.empty((len(values), cols)) # initialize output for i in range(len(values)): # iterate over groups (unique values in grpColumn) - if options.periodic : - grpTable[i] = periodicAverage(table.data[index[i]:index[i+1]],options.boundary) # apply periodicAverage mapping function - else : - grpTable[i] = np.apply_along_axis(mapFunction,0,table.data[index[i]:index[i+1]]) # apply mapping function + grpTable[i] = np.apply_along_axis(mapFunction,0,table.data[index[i]:index[i+1]]) # apply (general) mapping function + grpTable[i,indexrange] = \ + periodicAverage(table.data[index[i]:index[i+1],indexrange],options.boundary) # apply periodicAverage mapping function + if not options.all: grpTable[i,grpColumn] = table.data[index[i],grpColumn] # restore grouping column value table.data = grpTable From 0f04ddd88ea1eba43427648c69e971a05fc3eccf Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Tue, 29 Nov 2016 14:44:34 -0500 Subject: [PATCH 382/412] polishing of whitespace, usage help, etc. --- processing/post/addRowMapped.py | 4 ++-- processing/post/addValueMapped.py | 2 +- processing/post/filterTable.py | 5 ++--- processing/post/vtk_pointcloud.py | 7 +++---- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/processing/post/addRowMapped.py b/processing/post/addRowMapped.py index 16250aa1f..d9d51e2aa 100755 --- a/processing/post/addRowMapped.py +++ b/processing/post/addRowMapped.py @@ -29,7 +29,7 @@ parser.add_option('-o','--offset', parser.add_option('-l','--label', dest = 'label', action = 'extend', metavar = '', - help='column label(s) to be appended') + help = 'column label(s) to be appended') parser.add_option('-a','--asciitable', dest = 'asciitable', type = 'string', metavar = 'string', @@ -60,7 +60,7 @@ if options.asciitable is not None and os.path.isfile(options.asciitable): damask.util.croak('column{} {} not found...'.format('s' if len(missing_labels) > 1 else '',', '.join(missing_labels))) else: - parser.error('no mapped ASCIItable given.') + parser.error('no indexed ASCIItable given.') # --- loop over input files ------------------------------------------------------------------------- diff --git a/processing/post/addValueMapped.py b/processing/post/addValueMapped.py index 852ce10b0..65568b2c7 100755 --- a/processing/post/addValueMapped.py +++ b/processing/post/addValueMapped.py @@ -25,7 +25,7 @@ parser.add_option('-c','--map', parser.add_option('-l','--label', dest = 'label', action = 'extend', metavar = '', - help='column label(s) to be appended') + help = 'column label(s) to be appended') parser.add_option('-a','--asciitable', dest = 'asciitable', type = 'string', metavar = 'string', diff --git a/processing/post/filterTable.py b/processing/post/filterTable.py index 231c52960..52d23194b 100755 --- a/processing/post/filterTable.py +++ b/processing/post/filterTable.py @@ -61,9 +61,8 @@ parser.set_defaults(condition = '', if filenames == []: filenames = [None] for name in filenames: - try: - table = damask.ASCIItable(name = name, - buffered = False) + try: table = damask.ASCIItable(name = name, + buffered = False) except: continue damask.util.report(scriptName,name) diff --git a/processing/post/vtk_pointcloud.py b/processing/post/vtk_pointcloud.py index 339ff2c17..5779b7540 100755 --- a/processing/post/vtk_pointcloud.py +++ b/processing/post/vtk_pointcloud.py @@ -34,10 +34,9 @@ parser.set_defaults(pos = 'pos', if filenames == []: filenames = [None] for name in filenames: - try: - table = damask.ASCIItable(name = name, - buffered = False, - readonly = True) + try: table = damask.ASCIItable(name = name, + buffered = False, + readonly = True) except: continue damask.util.report(scriptName,name) From 814b05e2f625b4a76fdd51b47fb5b657847a16a3 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Tue, 29 Nov 2016 16:30:07 -0500 Subject: [PATCH 383/412] renamed to hopefully clearer express functionality --- .../post/{addRowMapped.py => addIndexed.py} | 39 ++++++++--------- .../post/{addValueMapped.py => addLinked.py} | 42 +++++++++---------- 2 files changed, 41 insertions(+), 40 deletions(-) rename processing/post/{addRowMapped.py => addIndexed.py} (70%) rename processing/post/{addValueMapped.py => addLinked.py} (72%) diff --git a/processing/post/addRowMapped.py b/processing/post/addIndexed.py similarity index 70% rename from processing/post/addRowMapped.py rename to processing/post/addIndexed.py index d9d51e2aa..a713ac4f5 100755 --- a/processing/post/addRowMapped.py +++ b/processing/post/addIndexed.py @@ -14,18 +14,19 @@ scriptID = ' '.join([scriptName,damask.version]) # -------------------------------------------------------------------- parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ -Add data in column(s) of second ASCIItable selected from the row indexed by the value in a mapping column. +Add data in column(s) of mapped ASCIItable selected from the row indexed by the value in a mapping column. +Row numbers start at 1. """, version = scriptID) -parser.add_option('-c','--map', - dest = 'map', +parser.add_option('--index', + dest = 'index', type = 'string', metavar = 'string', - help = 'column label containing row mapping') + help = 'column label containing row index') parser.add_option('-o','--offset', dest = 'offset', type = 'int', metavar = 'int', - help = 'offset between mapping column value and actual row in mapped table [%default]') + help = 'constant offset for index column value [%default]') parser.add_option('-l','--label', dest = 'label', action = 'extend', metavar = '', @@ -42,19 +43,19 @@ parser.set_defaults(offset = 0, if options.label is None: parser.error('no data columns specified.') -if options.map is None: - parser.error('no mapping column given.') +if options.index is None: + parser.error('no index column given.') -# ------------------------------------------ process mapping ASCIItable --------------------------- +# ------------------------------------------ process indexed ASCIItable --------------------------- if options.asciitable is not None and os.path.isfile(options.asciitable): - mappedTable = damask.ASCIItable(name = options.asciitable, - buffered = False, - readonly = True) - mappedTable.head_read() # read ASCII header info of mapped table - missing_labels = mappedTable.data_readArray(options.label) - mappedTable.close() # close mapped input ASCII table + indexedTable = damask.ASCIItable(name = options.asciitable, + buffered = False, + readonly = True) + indexedTable.head_read() # read ASCII header info of indexed table + missing_labels = indexedTable.data_readArray(options.label) + indexedTable.close() # close input ASCII table if len(missing_labels) > 0: damask.util.croak('column{} {} not found...'.format('s' if len(missing_labels) > 1 else '',', '.join(missing_labels))) @@ -80,8 +81,8 @@ for name in filenames: errors = [] - mappedColumn = table.label_index(options.map) - if mappedColumn < 0: errors.append('mapping column {} not found.'.format(options.map)) + indexColumn = table.label_index(options.index) + if indexColumn < 0: errors.append('index column {} not found.'.format(options.index)) if errors != []: damask.util.croak(errors) @@ -91,7 +92,7 @@ for name in filenames: # ------------------------------------------ assemble header -------------------------------------- table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) - table.labels_append(mappedTable.labels(raw = True)) # extend ASCII header with new labels + table.labels_append(indexedTable.labels(raw = True)) # extend ASCII header with new labels table.head_write() # ------------------------------------------ process data ------------------------------------------ @@ -99,9 +100,9 @@ for name in filenames: outputAlive = True while outputAlive and table.data_read(): # read next data line of ASCII table try: - table.data_append(mappedTable.data[int(round(float(table.data[mappedColumn])))+options.offset-1]) # add all mapped data types + table.data_append(indexedTable.data[int(round(float(table.data[indexColumn])))+options.offset-1]) # add all mapped data types except IndexError: - table.data_append(np.nan*np.ones_like(mappedTable.data[0])) + table.data_append(np.nan*np.ones_like(indexedTable.data[0])) outputAlive = table.data_write() # output processed line # ------------------------------------------ output finalization ----------------------------------- diff --git a/processing/post/addValueMapped.py b/processing/post/addLinked.py similarity index 72% rename from processing/post/addValueMapped.py rename to processing/post/addLinked.py index 65568b2c7..5ea9abe43 100755 --- a/processing/post/addValueMapped.py +++ b/processing/post/addLinked.py @@ -14,12 +14,12 @@ scriptID = ' '.join([scriptName,damask.version]) # -------------------------------------------------------------------- parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ -Add data of selected column(s) from (first) row of second ASCIItable that shares the mapping column value. +Add data of selected column(s) from (first) row of second ASCIItable that shares the linking column value. """, version = scriptID) -parser.add_option('-c','--map', - dest = 'map', nargs = 2, +parser.add_option('--link', + dest = 'link', nargs = 2, type = 'string', metavar = 'string string', help = 'column labels containing linked values') parser.add_option('-l','--label', @@ -29,7 +29,7 @@ parser.add_option('-l','--label', parser.add_option('-a','--asciitable', dest = 'asciitable', type = 'string', metavar = 'string', - help = 'indexed ASCIItable') + help = 'linked ASCIItable') parser.set_defaults() @@ -37,32 +37,32 @@ parser.set_defaults() if options.label is None: parser.error('no data columns specified.') -if options.map is None: - parser.error('no mapping columns given.') +if options.link is None: + parser.error('no linking columns given.') -# ------------------------------------------ process mapping ASCIItable --------------------------- +# -------------------------------------- process linked ASCIItable -------------------------------- if options.asciitable is not None and os.path.isfile(options.asciitable): - mappedTable = damask.ASCIItable(name = options.asciitable, + linkedTable = damask.ASCIItable(name = options.asciitable, buffered = False, readonly = True) - mappedTable.head_read() # read ASCII header info of mapped table - if mappedTable.label_dimension(options.map[1]) != 1: - parser.error('mapping column {} needs to be scalar valued.'.format(options.map[1])) + linkedTable.head_read() # read ASCII header info of linked table + if linkedTable.label_dimension(options.link[1]) != 1: + parser.error('linking column {} needs to be scalar valued.'.format(options.link[1])) - missing_labels = mappedTable.data_readArray([options.map[1]]+options.label) - mappedTable.close() # close mapped input ASCII table + missing_labels = linkedTable.data_readArray([options.link[1]]+options.label) + linkedTable.close() # close linked ASCII table if len(missing_labels) > 0: damask.util.croak('column{} {} not found...'.format('s' if len(missing_labels) > 1 else '',', '.join(missing_labels))) - index = mappedTable.data[:,0] - data = mappedTable.data[:,1:] + index = linkedTable.data[:,0] + data = linkedTable.data[:,1:] else: - parser.error('no indexed ASCIItable given.') + parser.error('no linked ASCIItable given.') -# --- loop over input files ------------------------------------------------------------------------- +# --- loop over input files ----------------------------------------------------------------------- if filenames == []: filenames = [None] @@ -80,8 +80,8 @@ for name in filenames: errors = [] - mappedColumn = table.label_index(options.map[0]) - if mappedColumn < 0: errors.append('mapping column {} not found.'.format(options.map[0])) + linkColumn = table.label_index(options.link[0]) + if linkColumn < 0: errors.append('linking column {} not found.'.format(options.link[0])) if errors != []: damask.util.croak(errors) @@ -91,7 +91,7 @@ for name in filenames: # ------------------------------------------ assemble header -------------------------------------- table.info_append(scriptID + '\t' + ' '.join(sys.argv[1:])) - table.labels_append(mappedTable.labels(raw = True)[1:]) # extend with new labels (except for mapped column) + table.labels_append(linkedTable.labels(raw = True)[1:]) # extend with new labels (except for linked column) table.head_write() @@ -100,7 +100,7 @@ for name in filenames: outputAlive = True while outputAlive and table.data_read(): # read next data line of ASCII table try: - table.data_append(data[np.argwhere(index == float(table.data[mappedColumn]))[0]]) # add data from first matching line + table.data_append(data[np.argwhere(index == float(table.data[linkColumn]))[0]]) # add data from first matching line except IndexError: table.data_append(np.nan*np.ones_like(data[0])) # or add NaNs outputAlive = table.data_write() # output processed line From 40de6910b88987c5bd1f9da1ddab46b066d8e225 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Tue, 29 Nov 2016 23:59:13 -0500 Subject: [PATCH 384/412] added --float option to translate real-valued grid data --- processing/pre/geom_check.sh | 11 +++++++++-- processing/pre/geom_toTable.py | 11 ++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/processing/pre/geom_check.sh b/processing/pre/geom_check.sh index 5a39d4fc7..4342f93e6 100755 --- a/processing/pre/geom_check.sh +++ b/processing/pre/geom_check.sh @@ -1,13 +1,20 @@ #!/usr/bin/env bash +if [[ "$1" == "-f" || "$1" == "--float" ]]; then + shift + arg='--float' +else + arg='' +fi + for geom in "$@" do - geom_toTable \ + geom_toTable $arg \ < $geom \ | \ vtk_rectilinearGrid > ${geom%.*}.vtk - geom_toTable \ + geom_toTable $arg \ < $geom \ | \ vtk_addRectilinearGridData \ diff --git a/processing/pre/geom_toTable.py b/processing/pre/geom_toTable.py index beb4987d8..eb6bdde61 100755 --- a/processing/pre/geom_toTable.py +++ b/processing/pre/geom_toTable.py @@ -19,8 +19,17 @@ Translate geom description into ASCIItable containing position and microstructur """, version = scriptID) +parser.add_option('--float', + dest = 'real', + action = 'store_true', + help = 'use float input') + +parser.set_defaults(real = False, + ) (options, filenames) = parser.parse_args() +datatype = 'f' if options.real else 'i' + # --- loop over input files ------------------------------------------------------------------------- if filenames == []: filenames = [None] @@ -56,7 +65,7 @@ for name in filenames: # --- read data ------------------------------------------------------------------------------------ - microstructure = table.microstructure_read(info['grid']) + microstructure = table.microstructure_read(info['grid'],datatype) # ------------------------------------------ assemble header --------------------------------------- From cb95f3b2447caa829f2fa4a2d47ca18d6a7fbdc6 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Wed, 30 Nov 2016 09:39:13 -0500 Subject: [PATCH 385/412] fixed systematic drift of grain structure along -[1,1,1] correction of periodic Gauss kernel extension, inclusion of ndimage.gaussian_filter alternative (same runtime as FFT), proper output handling of grids <3D --- processing/pre/geom_grainGrowth.py | 171 +++++++++++++++++------------ 1 file changed, 103 insertions(+), 68 deletions(-) diff --git a/processing/pre/geom_grainGrowth.py b/processing/pre/geom_grainGrowth.py index b6c1953c4..9b354762c 100755 --- a/processing/pre/geom_grainGrowth.py +++ b/processing/pre/geom_grainGrowth.py @@ -22,32 +22,46 @@ The final geometry is assembled by selecting at each voxel that grain index for """, version = scriptID) -parser.add_option('-d', '--distance', dest='d', type='int', metavar='int', - help='diffusion distance in voxels [%default]') -parser.add_option('-N', '--smooth', dest='N', type='int', metavar='int', - help='N for curvature flow [%default]') -parser.add_option('-r', '--renumber', dest='renumber', action='store_true', - help='renumber microstructure indices from 1...N [%default]') -parser.add_option('-i', '--immutable', action='extend', dest='immutable', metavar = '', - help='list of immutable microstructures') +parser.add_option('-d', '--distance', + dest = 'd', + type = 'float', metavar = 'float', + help = 'diffusion distance in voxels [%default]') +parser.add_option('-N', '--iterations', + dest = 'N', + type = 'int', metavar = 'int', + help = 'curvature flow iterations [%default]') +parser.add_option('-i', '--immutable', + action = 'extend', dest = 'immutable', metavar = '', + help = 'list of immutable microstructure indices') +parser.add_option('-r', '--renumber', + dest = 'renumber', action='store_true', + help = 'output consecutive microstructure indices') +parser.add_option('--ndimage', + dest = 'ndimage', action='store_true', + help = 'use ndimage.gaussian_filter in lieu of explicit FFT') -parser.set_defaults(d = 1) -parser.set_defaults(N = 1) -parser.set_defaults(renumber = False) -parser.set_defaults(immutable = []) +parser.set_defaults(d = 1, + N = 1, + immutable = [], + renumber = False, + ndimage = False, + ) (options, filenames) = parser.parse_args() options.immutable = map(int,options.immutable) -# --- loop over input files ------------------------------------------------------------------------- +getInterfaceEnergy = lambda A,B: (A*B != 0)*(A != B)*1.0 # 1.0 if A & B are distinct & nonzero, 0.0 otherwise +struc = ndimage.generate_binary_structure(3,1) # 3D von Neumann neighborhood + +# --- loop over input files ----------------------------------------------------------------------- if filenames == []: filenames = [None] for name in filenames: - try: - table = damask.ASCIItable(name = name, - buffered = False, labeled = False) + try: table = damask.ASCIItable(name = name, + buffered = False, + labeled = False) except: continue damask.util.report(scriptName,name) @@ -56,12 +70,12 @@ for name in filenames: table.head_read() info,extra_header = table.head_getGeom() - damask.util.croak(['grid a b c: %s'%(' x '.join(map(str,info['grid']))), - 'size x y z: %s'%(' x '.join(map(str,info['size']))), - 'origin x y z: %s'%(' : '.join(map(str,info['origin']))), - 'homogenization: %i'%info['homogenization'], - 'microstructures: %i'%info['microstructures'], - ]) + damask.util.croak(['grid a b c: {}'.format(' x '.join(map(str,info['grid']))), + 'size x y z: {}'.format(' x '.join(map(str,info['size']))), + 'origin x y z: {}'.format(' : '.join(map(str,info['origin']))), + 'homogenization: {}'.format(info['homogenization']), + 'microstructures: {}'.format(info['microstructures']), + ]) errors = [] if np.any(info['grid'] < 1): errors.append('invalid grid a b c.') @@ -71,39 +85,35 @@ for name in filenames: table.close(dismiss = True) continue -# --- read data ------------------------------------------------------------------------------------ - microstructure = np.tile(np.array(table.microstructure_read(info['grid']),'i').reshape(info['grid'],order='F'), - np.where(info['grid'] == 1, 2,1)) # make one copy along dimensions with grid == 1 +# --- read data ----------------------------------------------------------------------------------- + microstructure = np.tile(table.microstructure_read(info['grid']).reshape(info['grid'],order='F'), + np.where(info['grid'] == 1, 2,1)) # make one copy along dimensions with grid == 1 grid = np.array(microstructure.shape) -#--- initialize support data ----------------------------------------------------------------------- - +# --- initialize support data --------------------------------------------------------------------- # store a copy the initial microstructure to find locations of immutable indices microstructure_original = np.copy(microstructure) - X,Y,Z = np.mgrid[0:grid[0],0:grid[1],0:grid[2]] + if not options.ndimage: + X,Y,Z = np.mgrid[0:grid[0],0:grid[1],0:grid[2]] - # Calculates gaussian weights for simulating 3d diffusion - gauss = np.exp(-(X*X + Y*Y + Z*Z)/(2.0*options.d*options.d))/math.pow(2.0*np.pi*options.d*options.d,1.5) - gauss[:,:,grid[2]/2::] = gauss[:,:,int(round(grid[2]/2.))-1::-1] # trying to cope with uneven (odd) grid size - gauss[:,grid[1]/2::,:] = gauss[:,int(round(grid[1]/2.))-1::-1,:] - gauss[grid[0]/2::,:,:] = gauss[int(round(grid[0]/2.))-1::-1,:,:] - gauss = np.fft.rfftn(gauss) - - getInterfaceEnergy = lambda A,B: (A*B != 0)*(A != B)*1.0 # 1.0 if A & B are distinct & nonzero, 0.0 otherwise - struc = ndimage.generate_binary_structure(3,1) # 3D von Neumann neighborhood + # Calculates gaussian weights for simulating 3d diffusion + gauss = np.exp(-(X*X + Y*Y + Z*Z)/(2.0*options.d*options.d)) \ + /math.pow(2.0*np.pi*options.d*options.d,(3.0 - np.count_nonzero(info['grid'] == 1))/2.) + + gauss[:,:,:grid[2]/2:-1] = gauss[:,:,1:(grid[2]+1)/2] # trying to cope with uneven (odd) grid size + gauss[:,:grid[1]/2:-1,:] = gauss[:,1:(grid[1]+1)/2,:] + gauss[:grid[0]/2:-1,:,:] = gauss[1:(grid[0]+1)/2,:,:] + gauss = np.fft.rfftn(gauss) for smoothIter in range(options.N): - periodic_microstructure = np.tile(microstructure,(3,3,3))[grid[0]/2:-grid[0]/2, - grid[1]/2:-grid[1]/2, - grid[2]/2:-grid[2]/2] # periodically extend the microstructure interfaceEnergy = np.zeros(microstructure.shape) for i in (-1,0,1): for j in (-1,0,1): for k in (-1,0,1): - # assign interfacial energy to all voxels that have a differing neighbor (in Moore neighborhood) + # assign interfacial energy to all voxels that have a differing neighbor (in Moore neighborhood) interfaceEnergy = np.maximum(interfaceEnergy, getInterfaceEnergy(microstructure,np.roll(np.roll(np.roll( microstructure,i,axis=0), j,axis=1), k,axis=2))) @@ -112,44 +122,65 @@ for name in filenames: periodic_interfaceEnergy = np.tile(interfaceEnergy,(3,3,3))[grid[0]/2:-grid[0]/2, grid[1]/2:-grid[1]/2, grid[2]/2:-grid[2]/2] - # transform bulk volume (i.e. where interfacial energy is zero) + + # transform bulk volume (i.e. where interfacial energy remained zero), store index of closest boundary voxel index = ndimage.morphology.distance_transform_edt(periodic_interfaceEnergy == 0., return_distances = False, return_indices = True) + # want array index of nearest voxel on periodically extended boundary periodic_bulkEnergy = periodic_interfaceEnergy[index[0], index[1], - index[2]].reshape(2*grid) # fill bulk with energy of nearest interface - diffusedEnergy = np.fft.irfftn(np.fft.rfftn( - np.where( - ndimage.morphology.binary_dilation(interfaceEnergy > 0., - structure = struc, - iterations = options.d/2 + 1), # fat boundary | PE: why 2d-1? I would argue for d/2 + 1 - periodic_bulkEnergy[grid[0]/2:-grid[0]/2, # retain filled energy on fat boundary... - grid[1]/2:-grid[1]/2, - grid[2]/2:-grid[2]/2], # ...and zero everywhere else - 0.))*gauss) - periodic_diffusedEnergy = np.tile(diffusedEnergy,(3,3,3))[grid[0]/2:-grid[0]/2, - grid[1]/2:-grid[1]/2, - grid[2]/2:-grid[2]/2] # periodically extend the smoothed bulk energy - # transform voxels close to interface region | question PE: what motivates 1/2 (could be any small number, or)? - index = ndimage.morphology.distance_transform_edt(periodic_diffusedEnergy >= 0.5, + index[2]].reshape(2*grid) # fill bulk with energy of nearest interface + if options.ndimage: + periodic_diffusedEnergy = ndimage.gaussian_filter( + np.where(ndimage.morphology.binary_dilation(periodic_interfaceEnergy > 0., + structure = struc, + iterations = int(round(options.d*2.)), # fat boundary + ), + periodic_bulkEnergy, # ...and zero everywhere else + 0.), + sigma = options.d) + else: + diffusedEnergy = np.fft.irfftn(np.fft.rfftn( + np.where( + ndimage.morphology.binary_dilation(interfaceEnergy > 0., + structure = struc, + iterations = int(round(options.d*2.))),# fat boundary + periodic_bulkEnergy[grid[0]/2:-grid[0]/2, # retain filled energy on fat boundary... + grid[1]/2:-grid[1]/2, + grid[2]/2:-grid[2]/2], # ...and zero everywhere else + 0.))*gauss) + + periodic_diffusedEnergy = np.tile(diffusedEnergy,(3,3,3))[grid[0]/2:-grid[0]/2, + grid[1]/2:-grid[1]/2, + grid[2]/2:-grid[2]/2] # periodically extend the smoothed bulk energy + + + # transform voxels close to interface region + index = ndimage.morphology.distance_transform_edt(periodic_diffusedEnergy >= 0.5*np.amax(periodic_diffusedEnergy), return_distances = False, - return_indices = True) # want index of closest bulk grain + return_indices = True) # want index of closest bulk grain + + periodic_microstructure = np.tile(microstructure,(3,3,3))[grid[0]/2:-grid[0]/2, + grid[1]/2:-grid[1]/2, + grid[2]/2:-grid[2]/2] # periodically extend the microstructure + microstructure = periodic_microstructure[index[0], index[1], index[2]].reshape(2*grid)[grid[0]/2:-grid[0]/2, grid[1]/2:-grid[1]/2, - grid[2]/2:-grid[2]/2] # extent grains into interface region + grid[2]/2:-grid[2]/2] # extent grains into interface region immutable = np.zeros(microstructure.shape, dtype=bool) # find locations where immutable microstructures have been or are now for micro in options.immutable: - immutable += np.logical_or(microstructure == micro, microstructure_original == micro) - # undo any changes involving immutable microstructures - microstructure = np.where(immutable, microstructure_original,microstructure) + immutable += np.logical_or(microstructure == micro, microstructure_original == micro) -# --- renumber to sequence 1...Ngrains if requested ------------------------------------------------ + # undo any changes involving immutable microstructures + microstructure = np.where(immutable, microstructure_original,microstructure) + +# --- renumber to sequence 1...Ngrains if requested ----------------------------------------------- # http://stackoverflow.com/questions/10741346/np-frequency-counts-for-unique-values-in-an-array if options.renumber: @@ -162,13 +193,14 @@ for name in filenames: newInfo = {'microstructures': 0,} newInfo['microstructures'] = microstructure.max() -# --- report --------------------------------------------------------------------------------------- +# --- report -------------------------------------------------------------------------------------- remarks = [] - if (newInfo['microstructures'] != info['microstructures']): remarks.append('--> microstructures: %i'%newInfo['microstructures']) + if newInfo['microstructures'] != info['microstructures']: + remarks.append('--> microstructures: {}'.format(newInfo['microstructures'])) if remarks != []: damask.util.croak(remarks) -# --- write header --------------------------------------------------------------------------------- +# --- write header -------------------------------------------------------------------------------- table.labels_clear() table.info_clear() @@ -185,8 +217,11 @@ for name in filenames: # --- write microstructure information ------------------------------------------------------------ formatwidth = int(math.floor(math.log10(microstructure.max())+1)) - table.data = microstructure.reshape((info['grid'][0],info['grid'][1]*info['grid'][2]),order='F').transpose() - table.data_writeArray('%%%ii'%(formatwidth),delimiter = ' ') + table.data = microstructure[::1 if info['grid'][0]>1 else 2, + ::1 if info['grid'][1]>1 else 2, + ::1 if info['grid'][2]>1 else 2,].\ + reshape((info['grid'][0],info['grid'][1]*info['grid'][2]),order='F').transpose() + table.data_writeArray('%{}i'.format(formatwidth),delimiter = ' ') # --- output finalization -------------------------------------------------------------------------- From e42db0ea2537ef34a06640e4afffaad3f2d0d07d Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Wed, 30 Nov 2016 18:18:03 -0500 Subject: [PATCH 386/412] Individual test can be selected by sequence number polishing, slightly more elaborate debugging --- lib/damask/test/test.py | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/lib/damask/test/test.py b/lib/damask/test/test.py index 223b21b78..5445ee443 100644 --- a/lib/damask/test/test.py +++ b/lib/damask/test/test.py @@ -58,11 +58,11 @@ class Test(): self.parser.add_option("--ok", "--accept", action = "store_true", dest = "accept", - help = "calculate results but always consider test as successfull") + help = "calculate results but always consider test as successful") self.parser.add_option("-l", "--list", action = "store_true", dest = "show", - help = "show all test variants and do no calculation") + help = "show all test variants without actual calculation") self.parser.add_option("-s", "--select", dest = "select", help = "run test of given name only") @@ -83,8 +83,9 @@ class Test(): for variant,name in enumerate(self.variants): if self.options.show: - logging.critical('{}: {}'.format(variant,name)) - elif self.options.select is not None and name != self.options.select: + logging.critical('{}: {}'.format(variant+1,name)) + elif self.options.select is not None \ + and not (name == self.options.select or str(variant+1) == self.options.select): pass else: try: @@ -93,14 +94,15 @@ class Test(): self.run(variant) self.postprocess(variant) - + self.compare(variant) + if self.options.update: if self.update(variant) != 0: logging.critical('update for "{}" failed.'.format(name)) elif not (self.options.accept or self.compare(variant)): # no update, do comparison return variant+1 # return culprit - except Exception as e : - logging.critical('exception during variant execution: {}'.format(e)) + except Exception as e: + logging.critical('exception during variant execution: "{}"'.format(e.message)) return variant+1 # return culprit return 0 @@ -465,7 +467,7 @@ class Test(): mean = np.amax(np.abs(np.mean(normedDelta,0))) std = np.amax(np.std(normedDelta,0)) logging.info('mean: {:f}'.format(mean)) - logging.info('std: {:f}'.format(std)) + logging.info('std: {:f}'.format(std)) return (mean atol + rtol*np.absolute(data[1]) + logging.info('shape of violators: {}'.format(violators.shape)) + for j,culprits in enumerate(violators): + goodguys = np.logical_not(culprits) + if culprits.any(): + logging.info('{} has {}'.format(j,np.sum(culprits))) + logging.info('deviation: {}'.format(np.absolute(data[0][j]-data[1][j])[culprits])) + logging.info('data : {}'.format(np.absolute(data[1][j])[culprits])) + logging.info('deviation: {}'.format(np.absolute(data[0][j]-data[1][j])[goodguys])) + logging.info('data : {}'.format(np.absolute(data[1][j])[goodguys])) +# for ok,valA,valB in zip(allclose,data[0],data[1]): +# logging.debug('{}:\n{}\n{}'.format(ok,valA,valB)) allclose = True # start optimistic for i in range(1,len(data)): @@ -565,7 +576,7 @@ class Test(): ret = culprit if culprit == 0: - msg = 'The test passed' if len(self.variants) == 1 \ + msg = 'The test passed.' if (self.options.select is not None or len(self.variants) == 1) \ else 'All {} tests passed.'.format(len(self.variants)) elif culprit == -1: msg = 'Warning: Could not start test...' From f5a10ae480c7d011c1cf22b4eb696e5ad2f68970 Mon Sep 17 00:00:00 2001 From: Test User Date: Thu, 1 Dec 2016 04:41:39 +0100 Subject: [PATCH 387/412] updated version information after successful test of v2.0.1-329-ge42db0e --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index badc23c91..0bc79fadb 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-317-gd6baa71 +v2.0.1-329-ge42db0e From a2db7e9ba182eebd1365f9cfd8e3738fa3e73cf0 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Tue, 6 Dec 2016 21:36:25 -0500 Subject: [PATCH 388/412] added option to suppress writing of material.config part in header --- .../pre/geom_fromVoronoiTessellation.py | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/processing/pre/geom_fromVoronoiTessellation.py b/processing/pre/geom_fromVoronoiTessellation.py index dfb68d896..9c16a6213 100755 --- a/processing/pre/geom_fromVoronoiTessellation.py +++ b/processing/pre/geom_fromVoronoiTessellation.py @@ -178,6 +178,10 @@ parser.add_option_group(group) group = OptionGroup(parser, "Configuration","") +group.add_option('--no-config', + dest = 'config', + action = 'store_false', + help = 'omit material configuration header') group.add_option('--homogenization', dest = 'homogenization', type = 'int', metavar = 'int', @@ -203,6 +207,7 @@ parser.set_defaults(pos = 'pos', cpus = 2, laguerre = False, nonperiodic = False, + config = True, ) (options,filenames) = parser.parse_args() @@ -303,20 +308,21 @@ for name in filenames: config_header = [] formatwidth = 1+int(math.log10(NgrainIDs)) - config_header += [''] - for i,ID in enumerate(grainIDs): - config_header += ['[Grain{}]'.format(str(ID).zfill(formatwidth)), - 'crystallite {}'.format(options.crystallite), - '(constituent)\tphase {}\ttexture {}\tfraction 1.0'.format(options.phase,str(ID).rjust(formatwidth)), - ] - if hasEulers: - config_header += [''] - for ID in grainIDs: - eulerID = np.nonzero(grains == ID)[0][0] # find first occurrence of this grain id + if options.config: + config_header += [''] + for i,ID in enumerate(grainIDs): config_header += ['[Grain{}]'.format(str(ID).zfill(formatwidth)), - '(gauss)\tphi1 {:g}\tPhi {:g}\tphi2 {:g}\tscatter 0.0\tfraction 1.0'.format(*eulers[eulerID]) + 'crystallite {}'.format(options.crystallite), + '(constituent)\tphase {}\ttexture {}\tfraction 1.0'.format(options.phase,str(ID).rjust(formatwidth)), ] - if options.axes is not None: config_header.append('axes\t{} {} {}'.format(*options.axes)) + if hasEulers: + config_header += [''] + for ID in grainIDs: + eulerID = np.nonzero(grains == ID)[0][0] # find first occurrence of this grain id + config_header += ['[Grain{}]'.format(str(ID).zfill(formatwidth)), + '(gauss)\tphi1 {:g}\tPhi {:g}\tphi2 {:g}\tscatter 0.0\tfraction 1.0'.format(*eulers[eulerID]) + ] + if options.axes is not None: config_header.append('axes\t{} {} {}'.format(*options.axes)) table.labels_clear() table.info_clear() From 9bb4f89e78bf425df74902c5cbfded19e5f94ef9 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Tue, 6 Dec 2016 21:36:45 -0500 Subject: [PATCH 389/412] removed leftover debug output --- processing/pre/seeds_fromPokes.py | 1 - 1 file changed, 1 deletion(-) diff --git a/processing/pre/seeds_fromPokes.py b/processing/pre/seeds_fromPokes.py index d3ea632fc..3e831e906 100755 --- a/processing/pre/seeds_fromPokes.py +++ b/processing/pre/seeds_fromPokes.py @@ -109,7 +109,6 @@ for name in filenames: for j in range(Ny): grid[0] = round((i+0.5)*box[0]*info['grid'][0]/Nx-0.5)+offset[0] grid[1] = round((j+0.5)*box[1]*info['grid'][1]/Ny-0.5)+offset[1] - damask.util.croak('x,y coord on surface: {},{}...'.format(*grid[:2])) for k in range(Nz): grid[2] = k + offset[2] grid %= info['grid'] From ebfc16b94ece244c0077e57758553d4c5e8fcc60 Mon Sep 17 00:00:00 2001 From: Test User Date: Wed, 7 Dec 2016 16:41:07 +0100 Subject: [PATCH 390/412] updated version information after successful test of v2.0.1-332-g9bb4f89 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 0bc79fadb..a90fe5295 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-329-ge42db0e +v2.0.1-332-g9bb4f89 From 4b7030362524f932be3b2de0f4a2f93cd85700c4 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 8 Dec 2016 10:21:12 +0100 Subject: [PATCH 391/412] some variants of the bar code --- ...{DAMASK QR-Code.png => DAMASK_QR-Code.png} | Bin misc/DAMASK_QR-CodeBW.png | Bin 0 -> 5662 bytes misc/DAMASK_QR-CodeBW.svg | 31 ++++++++++++++++++ 3 files changed, 31 insertions(+) rename misc/{DAMASK QR-Code.png => DAMASK_QR-Code.png} (100%) create mode 100644 misc/DAMASK_QR-CodeBW.png create mode 100644 misc/DAMASK_QR-CodeBW.svg diff --git a/misc/DAMASK QR-Code.png b/misc/DAMASK_QR-Code.png similarity index 100% rename from misc/DAMASK QR-Code.png rename to misc/DAMASK_QR-Code.png diff --git a/misc/DAMASK_QR-CodeBW.png b/misc/DAMASK_QR-CodeBW.png new file mode 100644 index 0000000000000000000000000000000000000000..b9e46a2ca783ec9ef7374099cbb914a8d65a612b GIT binary patch literal 5662 zcmd5=dr(tX8b3h9P(>28YZa9UxNO&5S;c}>gkXZ0K|yz{Y#%(dh@*;! z-|zg+_qu2A>d0`{S7y9|5OU?LVE+{%iU9wp6nJubZqN$&bKDRS&PKzz`)-Kg&Lw%p z+bIa`{~G@sItvbZ!o%^YoK<1tl@lG^7WrL}gr*|&Y88hax|Y}WuwzYO`|^olYc5|i zB~8~0V$3V%o;oqxU*2Cf?kGF|-g~UF?J-%Ge0#rs^KQ>^{adx>GPf4L{q@rw5CbEj zBa-2WXl#V|RK%n?AS&1krTn&oWxcT`eoW4roSM$1`iyd-u2K=#rstXhJ%Z9rtpMsV z;A99sK`$F9kV6)ANEPwi?_3@LqcTkkPPXY||s-8~@} z*-eU4#;3PAL`#V5n7kH!a`4Qm-f=BWQo9TEo}LJW0J?`NQsDcdY+$m5GiIDy5$?#vW_BIu2;;0xdT3!uL$UhZ^f#2p^MML(ZxODX8 z+n<@!FFAx#7#~5{F+L(IdS;lHX0)ByqD^s?ssc>B3ZnVyzV4Kh*LEAeGJGyEa8y@v zsLJZs`Kf#=bLvjULPxZQ0wrTqKp}n@Gkg+qqTaA=01OMe!h6O8<^o>TR$bRRpG3$8Z8E3T@4$<$G!%WlVj2_L==1I zWb>1NH8n+Q#WyKc#X?QVqt?YqNABfy656|!|Ij{;%+5X+F|#Ctm7UGtay)tCLn(EP z{GfeKR8Qs%?YmbR^QaU$`Ikbht$yJrnFY?r@3p9R7H_(hdD*oaTp_lC&3795%$1(Z z{M{|hg&;Julfou58wrSG(MMzwM}Olc@$+cMVsY3%w%PO#N`ffv$Z>(f2~ zT;rxGu}@%8f_tgHu0T)tgD!w{S>hQrq7V7qsf@h{J zY)OghIFuE9IAn1}nz+Jjwj~*AcX2;>7&b7d>2e2!H^Iu&d`j{R;zgRNc;{>|{57SC z7%ruNj{3S!Z2=y@f#L&3L4XecHc_#{50)YlUOyIUK{}#9-t@iz~WCif^ zmVbHsx?ydp!zf!=PlHDNAn6;goQekvos_e5yB_EaGEFH_w;2a368QXV!({B3Z)MlY z=kPJ`<>w%8?W&^LoXOT^i;6;;sAHHEN!8+IT`oAlM_X}HXbedlWg&i^I29r|-Y<#< z9{IGzJo_WXw)LXo@MAVVL28-r;w*iT>HBMEa_2?I`Oc2KpQSsli>;9=^aF;Ebpank zzd{2|TN5f>uu}1Qn@1&__P~LZR?e`ckhCAC+5DT_I{T=zb$!*V-S>!RI?lE^d3zqzI@QqxQ8uIrm@goY zY#Y>Ulk_XbaR}aoP|DVb15&ZE5Y|FQ|Gr>4+HY)`h2kz_w0NHz6R`y*hHVkp4GsbU zU@zAejr>+O*#3OX&~pOuzHFzW;Pp!=J|bN4;A6+QpncBbJ+@v_DUrKf3e4Q-%*bJs zSWqm&4X#2_{tu<}XFPi(&;0Tb9(hx+{m86jZCgw47g?6?M&seQ?9DArshc$^ zb(<7XQnk*XjhI1@pztC_-h#!AhS~oQ%!{a1CUCWV0rHw5vYnGo=q`pdn~jm;*gM0? z;^B0=!zxQ8C*=2EC{u7W5eDNI9!sjGL3hr8++Zm#FN;KLUA1gna&>JRZHOC_r<)=T zNy0}5#={Y%ih?Q((SV`s+)sQ;~tgW3x-t2(dgdATypul@aC%j_?lPJC)V zC50Dm#25Cos?xQ+CxY*uk>u)yrX3NradvmYC4=)KQPb*hp;Dw-V&X~fDz>P7)zRwc z{x?j-MivEKox+CF2j4Bvgdt@47iMEj=kq_FHAbdY5tp{G#+kp{=&U}{t + + + + + image/svg+xml + + + + + + + + From 67457b9c652bc99689dcd28f7215428b6bda2fa5 Mon Sep 17 00:00:00 2001 From: Franz Roters Date: Thu, 8 Dec 2016 11:20:51 +0100 Subject: [PATCH 392/412] also remove *.optrpt during clean and tidy --- code/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/Makefile b/code/Makefile index a3d50d6ef..49ce9c50e 100644 --- a/code/Makefile +++ b/code/Makefile @@ -712,6 +712,7 @@ C_routines.o: C_routines.c tidy: @rm -rf *.o @rm -rf *.mod + @rm -rf *.optrpt @rm -rf *.inst.f90 # for instrumentation @rm -rf *.pomp.f90 # for instrumentation @rm -rf *.pp.f90 # for instrumentation @@ -724,6 +725,7 @@ cleanDAMASK: @rm -rf *.marc @rm -rf *.o @rm -rf *.mod + @rm -rf *.optrpt @rm -rf *.inst.f90 # for instrumentation @rm -rf *.pomp.f90 # for instrumentation @rm -rf *.pp.f90 # for instrumentation From c8f321356d88bcbace8cc4eead7e285a0348f382 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Thu, 8 Dec 2016 09:47:20 -0500 Subject: [PATCH 393/412] prefill immutable indices with closest mutable one Retain only orginially immutable locations, not those where immutability bled into. Changed threshold for change from 0.5 to 0.95 of max diffusedEnergy. --- processing/pre/geom_grainGrowth.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/processing/pre/geom_grainGrowth.py b/processing/pre/geom_grainGrowth.py index 9b354762c..20aab4cbb 100755 --- a/processing/pre/geom_grainGrowth.py +++ b/processing/pre/geom_grainGrowth.py @@ -109,6 +109,15 @@ for name in filenames: for smoothIter in range(options.N): + + # replace immutable microstructures with closest mutable ones + index = ndimage.morphology.distance_transform_edt(np.in1d(microstructure,options.immutable).reshape(grid), + return_distances = False, + return_indices = True) + microstructure = microstructure[index[0], + index[1], + index[2]] + interfaceEnergy = np.zeros(microstructure.shape) for i in (-1,0,1): for j in (-1,0,1): @@ -146,7 +155,7 @@ for name in filenames: np.where( ndimage.morphology.binary_dilation(interfaceEnergy > 0., structure = struc, - iterations = int(round(options.d*2.))),# fat boundary + iterations = int(round(options.d*2.))-1),# fat boundary periodic_bulkEnergy[grid[0]/2:-grid[0]/2, # retain filled energy on fat boundary... grid[1]/2:-grid[1]/2, grid[2]/2:-grid[2]/2], # ...and zero everywhere else @@ -158,7 +167,7 @@ for name in filenames: # transform voxels close to interface region - index = ndimage.morphology.distance_transform_edt(periodic_diffusedEnergy >= 0.5*np.amax(periodic_diffusedEnergy), + index = ndimage.morphology.distance_transform_edt(periodic_diffusedEnergy >= 0.95*np.amax(periodic_diffusedEnergy), return_distances = False, return_indices = True) # want index of closest bulk grain @@ -173,9 +182,9 @@ for name in filenames: grid[2]/2:-grid[2]/2] # extent grains into interface region immutable = np.zeros(microstructure.shape, dtype=bool) - # find locations where immutable microstructures have been or are now + # find locations where immutable microstructures have been (or are now) for micro in options.immutable: - immutable += np.logical_or(microstructure == micro, microstructure_original == micro) + immutable += microstructure_original == micro # undo any changes involving immutable microstructures microstructure = np.where(immutable, microstructure_original,microstructure) From 9829db31e4486748054e87cae0a44225a9623a91 Mon Sep 17 00:00:00 2001 From: Test User Date: Thu, 8 Dec 2016 16:42:03 +0100 Subject: [PATCH 394/412] updated version information after successful test of v2.0.1-335-g67457b9 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index a90fe5295..a6001a603 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-332-g9bb4f89 +v2.0.1-335-g67457b9 From d67be0e3f3f320a3b0f98c948ac9bf6bd5af4eef Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Thu, 8 Dec 2016 23:34:43 -0500 Subject: [PATCH 395/412] reduced memory footprint (substantially) by switching to 32bit precision --- processing/pre/geom_grainGrowth.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/processing/pre/geom_grainGrowth.py b/processing/pre/geom_grainGrowth.py index 20aab4cbb..90c24219c 100755 --- a/processing/pre/geom_grainGrowth.py +++ b/processing/pre/geom_grainGrowth.py @@ -51,7 +51,7 @@ parser.set_defaults(d = 1, options.immutable = map(int,options.immutable) -getInterfaceEnergy = lambda A,B: (A*B != 0)*(A != B)*1.0 # 1.0 if A & B are distinct & nonzero, 0.0 otherwise +getInterfaceEnergy = lambda A,B: np.float32((A*B != 0)*(A != B)*1.0) # 1.0 if A & B are distinct & nonzero, 0.0 otherwise struc = ndimage.generate_binary_structure(3,1) # 3D von Neumann neighborhood # --- loop over input files ----------------------------------------------------------------------- @@ -99,14 +99,13 @@ for name in filenames: X,Y,Z = np.mgrid[0:grid[0],0:grid[1],0:grid[2]] # Calculates gaussian weights for simulating 3d diffusion - gauss = np.exp(-(X*X + Y*Y + Z*Z)/(2.0*options.d*options.d)) \ - /math.pow(2.0*np.pi*options.d*options.d,(3.0 - np.count_nonzero(info['grid'] == 1))/2.) + gauss = np.exp(-(X*X + Y*Y + Z*Z)/(2.0*options.d*options.d),dtype=np.float32) \ + /np.power(2.0*np.pi*options.d*options.d,(3.0 - np.count_nonzero(info['grid'] == 1))/2.,dtype=np.float32) gauss[:,:,:grid[2]/2:-1] = gauss[:,:,1:(grid[2]+1)/2] # trying to cope with uneven (odd) grid size gauss[:,:grid[1]/2:-1,:] = gauss[:,1:(grid[1]+1)/2,:] gauss[:grid[0]/2:-1,:,:] = gauss[1:(grid[0]+1)/2,:,:] - gauss = np.fft.rfftn(gauss) - + gauss = np.fft.rfftn(gauss).astype(np.complex64) for smoothIter in range(options.N): @@ -118,7 +117,7 @@ for name in filenames: index[1], index[2]] - interfaceEnergy = np.zeros(microstructure.shape) + interfaceEnergy = np.zeros(microstructure.shape,dtype=np.float32) for i in (-1,0,1): for j in (-1,0,1): for k in (-1,0,1): @@ -141,11 +140,12 @@ for name in filenames: periodic_bulkEnergy = periodic_interfaceEnergy[index[0], index[1], index[2]].reshape(2*grid) # fill bulk with energy of nearest interface + if options.ndimage: periodic_diffusedEnergy = ndimage.gaussian_filter( np.where(ndimage.morphology.binary_dilation(periodic_interfaceEnergy > 0., structure = struc, - iterations = int(round(options.d*2.)), # fat boundary + iterations = int(round(options.d*2.))-1, # fat boundary ), periodic_bulkEnergy, # ...and zero everywhere else 0.), @@ -159,7 +159,8 @@ for name in filenames: periodic_bulkEnergy[grid[0]/2:-grid[0]/2, # retain filled energy on fat boundary... grid[1]/2:-grid[1]/2, grid[2]/2:-grid[2]/2], # ...and zero everywhere else - 0.))*gauss) + 0.)).astype(np.complex64) * + gauss).astype(np.float32) periodic_diffusedEnergy = np.tile(diffusedEnergy,(3,3,3))[grid[0]/2:-grid[0]/2, grid[1]/2:-grid[1]/2, @@ -181,7 +182,7 @@ for name in filenames: grid[1]/2:-grid[1]/2, grid[2]/2:-grid[2]/2] # extent grains into interface region - immutable = np.zeros(microstructure.shape, dtype=bool) + immutable = np.zeros(microstructure.shape, dtype=np.bool) # find locations where immutable microstructures have been (or are now) for micro in options.immutable: immutable += microstructure_original == micro From cbef4034a4f0a4cc0bd0d3367f50b2b0ccae926e Mon Sep 17 00:00:00 2001 From: Test User Date: Mon, 12 Dec 2016 04:41:17 +0100 Subject: [PATCH 396/412] updated version information after successful test of v2.0.1-339-gd67be0e --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index a6001a603..3440f8734 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-335-g67457b9 +v2.0.1-339-gd67be0e From e9b9e08fe2ab4a725434c8c743c69be0d7639231 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 23 Dec 2016 14:20:29 +0100 Subject: [PATCH 397/412] set OMP related variables to 4 byte integer as expected when compiling marc --- code/DAMASK_marc.f90 | 2 +- code/numerics.f90 | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/code/DAMASK_marc.f90 b/code/DAMASK_marc.f90 index 50bc82f76..8425f3e1e 100644 --- a/code/DAMASK_marc.f90 +++ b/code/DAMASK_marc.f90 @@ -240,7 +240,7 @@ subroutine hypela2(d,g,e,de,s,t,dt,ngens,m,nn,kcus,matus,ndi,nshear,disp, & real(pReal), dimension(6) :: stress real(pReal), dimension(6,6) :: ddsdde integer(pInt) :: computationMode, i, cp_en, node, CPnodeID - !$ integer :: defaultNumThreadsInt !< default value set by Marc + !$ integer(4) :: defaultNumThreadsInt !< default value set by Marc if (iand(debug_level(debug_MARC),debug_LEVELBASIC) /= 0_pInt) then write(6,'(a,/,i8,i8,i2)') ' MSC.MARC information on shape of element(2), IP:', m, nn diff --git a/code/numerics.f90 b/code/numerics.f90 index 24bd19018..6569d7cb4 100644 --- a/code/numerics.f90 +++ b/code/numerics.f90 @@ -28,7 +28,7 @@ module numerics fixedSeed = 0_pInt, & !< fixed seeding for pseudo-random number generator, Default 0: use random seed worldrank = 0_pInt, & !< MPI worldrank (/=0 for MPI simulations only) worldsize = 0_pInt !< MPI worldsize (/=0 for MPI simulations only) - integer, protected, public :: & + integer(4), protected, public :: & DAMASK_NumThreadsInt = 0 !< value stored in environment variable DAMASK_NUM_THREADS, set to zero if no OpenMP directive integer(pInt), public :: & numerics_integrationMode = 0_pInt !< integrationMode 1 = central solution; integrationMode 2 = perturbation, Default 0: undefined, is not read from file @@ -210,7 +210,6 @@ subroutine numerics_init IO_warning, & IO_timeStamp, & IO_EOF - #if defined(Spectral) || defined(FEM) !$ use OMP_LIB, only: omp_set_num_threads ! Use the standard conforming module file for omp if using the spectral solver implicit none @@ -242,10 +241,10 @@ subroutine numerics_init !$ call GET_ENVIRONMENT_VARIABLE(NAME='DAMASK_NUM_THREADS',VALUE=DAMASK_NumThreadsString,STATUS=gotDAMASK_NUM_THREADS) ! get environment variable DAMASK_NUM_THREADS... !$ if(gotDAMASK_NUM_THREADS /= 0) then ! could not get number of threads, set it to 1 !$ call IO_warning(35_pInt,ext_msg='BEGIN:'//DAMASK_NumThreadsString//':END') -!$ DAMASK_NumThreadsInt = 1 +!$ DAMASK_NumThreadsInt = 1_4 !$ else !$ read(DAMASK_NumThreadsString,'(i6)') DAMASK_NumThreadsInt ! read as integer -!$ if (DAMASK_NumThreadsInt < 1) DAMASK_NumThreadsInt = 1 ! in case of string conversion fails, set it to one +!$ if (DAMASK_NumThreadsInt < 1_4) DAMASK_NumThreadsInt = 1_4 ! in case of string conversion fails, set it to one !$ endif !$ call omp_set_num_threads(DAMASK_NumThreadsInt) ! set number of threads for parallel execution From e532228b15a3a08793c90743e364a26ad404754a Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 23 Dec 2016 14:21:17 +0100 Subject: [PATCH 398/412] fixed handling of version string --- .../2016/Marc_tools/include_linux64 | 23 +++++++------------ .../2016/Marc_tools/run_damask | 16 +++++++++++++ .../2016/Marc_tools/run_damask_h | 16 +++++++++++++ .../2016/Marc_tools/run_damask_hmp | 16 +++++++++++++ .../2016/Marc_tools/run_damask_l | 16 +++++++++++++ .../2016/Marc_tools/run_damask_lmp | 16 +++++++++++++ .../2016/Marc_tools/run_damask_mp | 16 +++++++++++++ 7 files changed, 104 insertions(+), 15 deletions(-) diff --git a/installation/mods_MarcMentat/2016/Marc_tools/include_linux64 b/installation/mods_MarcMentat/2016/Marc_tools/include_linux64 index 39562d9d0..5a8d96a93 100644 --- a/installation/mods_MarcMentat/2016/Marc_tools/include_linux64 +++ b/installation/mods_MarcMentat/2016/Marc_tools/include_linux64 @@ -471,21 +471,14 @@ FORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/comm FORTNA="$FCOMP $FORT_OPT -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" - # determine DAMASK version -HIT=0 -for arg in "$@" -do - if [ $HIT = 1 ] - then - DAMASKPATH=`dirname $arg` - break - elif [ ${arg:0:2} = -u -o ${arg:0:2} = -U ] - then - HIT=1 - fi -done -read DAMASKVERSION < $DAMASKPATH/../VERSION -DAMASKVERSION="'"$DAMASKVERSION"'" +# determine DAMASK version +if test -n "$DAMASK_USER"; then + DAMASK_ROOT=`dirname $DAMASK_USER`/.. + read DAMASKVERSION < $DAMASK_ROOT/VERSION + DAMASKVERSION="'"$DAMASKVERSION"'" +else + DAMASKVERSION='NA' +fi # DAMASK compiler calls: additional flags are in line 2 OpenMP flags in line 3 DFORTLOW="$FCOMP $FORT_OPT $PROFILE -O0 $I8FFLAGS -I$MARC_SOURCE/common \ diff --git a/installation/mods_MarcMentat/2016/Marc_tools/run_damask b/installation/mods_MarcMentat/2016/Marc_tools/run_damask index e3d746b55..0fc2e639a 100644 --- a/installation/mods_MarcMentat/2016/Marc_tools/run_damask +++ b/installation/mods_MarcMentat/2016/Marc_tools/run_damask @@ -299,7 +299,23 @@ fi . "$DIR/getarch" + +# getting user subroutine file name +found=0 +for i in "$@"; do + if test $found = 1; then + DAMASK_USER=$i + found=0 + fi + case $i in + -u* | -U*) + found=1 + ;; + esac +done +# sourcing include_linux64 (needs DAMASK_USER to be set) . $MARC_INCLUDE + # # diff --git a/installation/mods_MarcMentat/2016/Marc_tools/run_damask_h b/installation/mods_MarcMentat/2016/Marc_tools/run_damask_h index 9ca45c335..182b5fc25 100644 --- a/installation/mods_MarcMentat/2016/Marc_tools/run_damask_h +++ b/installation/mods_MarcMentat/2016/Marc_tools/run_damask_h @@ -299,7 +299,23 @@ fi . "$DIR/getarch" + +# getting user subroutine file name +found=0 +for i in "$@"; do + if test $found = 1; then + DAMASK_USER=$i + found=0 + fi + case $i in + -u* | -U*) + found=1 + ;; + esac +done +# sourcing include_linux64 (needs DAMASK_USER to be set) . $MARC_INCLUDE + # # diff --git a/installation/mods_MarcMentat/2016/Marc_tools/run_damask_hmp b/installation/mods_MarcMentat/2016/Marc_tools/run_damask_hmp index 7af233017..69aa8d652 100644 --- a/installation/mods_MarcMentat/2016/Marc_tools/run_damask_hmp +++ b/installation/mods_MarcMentat/2016/Marc_tools/run_damask_hmp @@ -299,7 +299,23 @@ fi . "$DIR/getarch" + +# getting user subroutine file name +found=0 +for i in "$@"; do + if test $found = 1; then + DAMASK_USER=$i + found=0 + fi + case $i in + -u* | -U*) + found=1 + ;; + esac +done +# sourcing include_linux64 (needs DAMASK_USER to be set) . $MARC_INCLUDE + # # diff --git a/installation/mods_MarcMentat/2016/Marc_tools/run_damask_l b/installation/mods_MarcMentat/2016/Marc_tools/run_damask_l index 579c49856..87cd1e5c6 100644 --- a/installation/mods_MarcMentat/2016/Marc_tools/run_damask_l +++ b/installation/mods_MarcMentat/2016/Marc_tools/run_damask_l @@ -299,7 +299,23 @@ fi . "$DIR/getarch" + +# getting user subroutine file name +found=0 +for i in "$@"; do + if test $found = 1; then + DAMASK_USER=$i + found=0 + fi + case $i in + -u* | -U*) + found=1 + ;; + esac +done +# sourcing include_linux64 (needs DAMASK_USER to be set) . $MARC_INCLUDE + # # diff --git a/installation/mods_MarcMentat/2016/Marc_tools/run_damask_lmp b/installation/mods_MarcMentat/2016/Marc_tools/run_damask_lmp index 72348a618..227ac1110 100644 --- a/installation/mods_MarcMentat/2016/Marc_tools/run_damask_lmp +++ b/installation/mods_MarcMentat/2016/Marc_tools/run_damask_lmp @@ -299,7 +299,23 @@ fi . "$DIR/getarch" + +# getting user subroutine file name +found=0 +for i in "$@"; do + if test $found = 1; then + DAMASK_USER=$i + found=0 + fi + case $i in + -u* | -U*) + found=1 + ;; + esac +done +# sourcing include_linux64 (needs DAMASK_USER to be set) . $MARC_INCLUDE + # # diff --git a/installation/mods_MarcMentat/2016/Marc_tools/run_damask_mp b/installation/mods_MarcMentat/2016/Marc_tools/run_damask_mp index 7e1d7265d..03cf4b951 100644 --- a/installation/mods_MarcMentat/2016/Marc_tools/run_damask_mp +++ b/installation/mods_MarcMentat/2016/Marc_tools/run_damask_mp @@ -299,7 +299,23 @@ fi . "$DIR/getarch" + +# getting user subroutine file name +found=0 +for i in "$@"; do + if test $found = 1; then + DAMASK_USER=$i + found=0 + fi + case $i in + -u* | -U*) + found=1 + ;; + esac +done +# sourcing include_linux64 (needs DAMASK_USER to be set) . $MARC_INCLUDE + # # From 3628deb30e93a41704424e67a1a8041c1a2cf8bf Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Fri, 23 Dec 2016 17:46:16 -0500 Subject: [PATCH 399/412] changed option name from "no-config" to more common "without-config" --- processing/pre/geom_fromVoronoiTessellation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/processing/pre/geom_fromVoronoiTessellation.py b/processing/pre/geom_fromVoronoiTessellation.py index 9c16a6213..95fb1cab7 100755 --- a/processing/pre/geom_fromVoronoiTessellation.py +++ b/processing/pre/geom_fromVoronoiTessellation.py @@ -178,7 +178,7 @@ parser.add_option_group(group) group = OptionGroup(parser, "Configuration","") -group.add_option('--no-config', +group.add_option('--without-config', dest = 'config', action = 'store_false', help = 'omit material configuration header') From f6513842e0b3dedac681b7b9ae9c274c91680417 Mon Sep 17 00:00:00 2001 From: Test User Date: Sat, 24 Dec 2016 10:50:13 +0100 Subject: [PATCH 400/412] updated version information after successful test of v2.0.1-345-g52964fe --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 3440f8734..34bc42e42 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-339-gd67be0e +v2.0.1-345-g52964fe From 49eb7aa1be8c779d70437576165dadc19441337a Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Sun, 25 Dec 2016 12:39:49 -0500 Subject: [PATCH 401/412] fixed nasty ABS that caused wrong packing for 1,2,1,1,1,... and the like --- processing/pre/geom_pack.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/processing/pre/geom_pack.py b/processing/pre/geom_pack.py index 24636c7d7..4932b8795 100755 --- a/processing/pre/geom_pack.py +++ b/processing/pre/geom_pack.py @@ -36,12 +36,12 @@ for name in filenames: table.head_read() info,extra_header = table.head_getGeom() - damask.util.croak(['grid a b c: %s'%(' x '.join(map(str,info['grid']))), - 'size x y z: %s'%(' x '.join(map(str,info['size']))), - 'origin x y z: %s'%(' : '.join(map(str,info['origin']))), - 'homogenization: %i'%info['homogenization'], - 'microstructures: %i'%info['microstructures'], - ]) + damask.util.croak(['grid a b c: {}'.format(' x '.join(map(str,info['grid']))), + 'size x y z: {}'.format(' x '.join(map(str,info['size']))), + 'origin x y z: {}'.format(' : '.join(map(str,info['origin']))), + 'homogenization: {}'.format(info['homogenization']), + 'microstructures: {}'.format(info['microstructures']), + ]) errors = [] if np.any(info['grid'] < 1): errors.append('invalid grid a b c.') @@ -81,7 +81,7 @@ for name in filenames: else: items = map(int,items) for current in items: - if abs(current - former) == 1 and abs(start-former) == reps - 1: + if abs(current - former) == 1 and (start - current) == reps*(former - current): compressType = 'to' reps += 1 elif current == former and start == former: From 80191c10c040e71fcfc130fffa87337ffdb549a2 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Sun, 25 Dec 2016 12:41:06 -0500 Subject: [PATCH 402/412] absorb some more errors caused by broken shell pipes --- lib/damask/asciitable.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/damask/asciitable.py b/lib/damask/asciitable.py index 771ae76a5..446770313 100644 --- a/lib/damask/asciitable.py +++ b/lib/damask/asciitable.py @@ -547,7 +547,10 @@ class ASCIItable(): except: output = [fmt % row] if fmt else [repr(row)] - self.__IO__['out'].write(delimiter.join(output) + '\n') + try: + self.__IO__['out'].write(delimiter.join(output) + '\n') + except: + pass # ------------------------------------------------------------------ def data_append(self, From 5011a03e84edbb4cb238c1913104046c7a3bc76e Mon Sep 17 00:00:00 2001 From: Test User Date: Mon, 26 Dec 2016 04:41:55 +0100 Subject: [PATCH 403/412] updated version information after successful test of v2.0.1-348-g80191c1 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 34bc42e42..5c382bd4a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-345-g52964fe +v2.0.1-348-g80191c1 From 6d0e3f4f32b00e000d5e8ebf07515bdadac62f0b Mon Sep 17 00:00:00 2001 From: Franz Roters Date: Mon, 2 Jan 2017 17:31:38 +0100 Subject: [PATCH 404/412] corrected opneMP options fixed N/A string in version handling --- .../2016/Marc_tools/include_linux64 | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/installation/mods_MarcMentat/2016/Marc_tools/include_linux64 b/installation/mods_MarcMentat/2016/Marc_tools/include_linux64 index 5a8d96a93..a6cc7e2f9 100644 --- a/installation/mods_MarcMentat/2016/Marc_tools/include_linux64 +++ b/installation/mods_MarcMentat/2016/Marc_tools/include_linux64 @@ -452,10 +452,10 @@ fi FORT_OPT="-c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr -mp1 -WB -fp-model source" if test "$MTHREAD" = "OPENMP" then - FORT_OPT=" $FORT_OPT -openmp" + FORT_OPT=" $FORT_OPT -qopenmp" if test "$OMP_COMPAT" = "YES" then - FORT_OPT=" $FORT_OPT -openmp-threadprivate=compat" + FORT_OPT=" $FORT_OPT -qopenmp-threadprivate=compat" fi else # FORT_OPT=" $FORT_OPT -auto " @@ -473,11 +473,11 @@ FORTNA="$FCOMP $FORT_OPT -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ # determine DAMASK version if test -n "$DAMASK_USER"; then - DAMASK_ROOT=`dirname $DAMASK_USER`/.. - read DAMASKVERSION < $DAMASK_ROOT/VERSION + DAMASKROOT=`dirname $DAMASK_USER`/.. + read DAMASKVERSION < $DAMASKROOT/VERSION DAMASKVERSION="'"$DAMASKVERSION"'" else - DAMASKVERSION='NA' + DAMASKVERSION="'N/A'" fi # DAMASK compiler calls: additional flags are in line 2 OpenMP flags in line 3 @@ -486,21 +486,21 @@ DFORTLOW="$FCOMP $FORT_OPT $PROFILE -O0 $I8FFLAGS -I$MARC_SOURCE/common \ -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" DFORTLOWMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB -O0 $I8FFLAGS -I$MARC_SOURCE/common \ -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2016 -DDAMASKVERSION=$DAMASKVERSION \ - -openmp -openmp_report2 -openmp-threadprivate=compat\ + -qopenmp -qopenmp-threadprivate=compat\ -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" DFORTRAN="$FCOMP $FORT_OPT $PROFILE -O1 $I8FFLAGS -I$MARC_SOURCE/common \ -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2016 -DDAMASKVERSION=$DAMASKVERSION \ -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" DFORTRANMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB -O1 $I8FFLAGS -I$MARC_SOURCE/common \ -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2016 -DDAMASKVERSION=$DAMASKVERSION \ - -openmp -openmp_report2 -openmp-threadprivate=compat\ + -qopenmp -qopenmp-threadprivate=compat\ -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" DFORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias -O2 $I8FFLAGS -I$MARC_SOURCE/common \ -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2016 -DDAMASKVERSION=$DAMASKVERSION \ -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" DFORTHIGHMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB -fno-alias -O2 $I8FFLAGS -I$MARC_SOURCE/common \ -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2016 -DDAMASKVERSION=$DAMASKVERSION \ - -openmp -openmp_report2 -openmp-threadprivate=compat\ + -qopenmp -qopenmp-threadprivate=compat\ -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" if test "$MARCDEBUG" = "ON" @@ -520,21 +520,21 @@ then -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" DFORTLOWMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2016 -DDAMASKVERSION=$DAMASKVERSION \ - -openmp -openmp_report2 -openmp-threadprivate=compat\ + -qopenmp -qopenmp-threadprivate=compat\ -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" DFORTRAN="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \ -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2016 -DDAMASKVERSION=$DAMASKVERSION \ -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" DFORTRANMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \ -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2016 -DDAMASKVERSION=$DAMASKVERSION \ - -openmp -openmp_report2 -openmp-threadprivate=compat\ + -qopenmp -qopenmp-threadprivate=compat\ -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" DFORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ -fpp -ftz -diag-enable sc3 -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2016 -DDAMASKVERSION=$DAMASKVERSION \ -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" DFORTHIGHMP="$FCOMP -c -assume byterecl -stand f08 -standard-semantics -safe_cray_ptr $PROFILE -zero -mp1 -WB -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \ -fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2016 -DDAMASKVERSION=$DAMASKVERSION \ - -openmp -openmp_report2 -openmp-threadprivate=compat\ + -qopenmp -qopenmp-threadprivate=compat\ -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS" fi @@ -719,7 +719,7 @@ else SFLIB=" " fi -OPENMP="-openmp" +OPENMP="-qopenmp" SYSLIBS=" $OPENMP -lpthread " From 8d2037b834ea5d5d2e8ac19f1b9bdffb0216337a Mon Sep 17 00:00:00 2001 From: Test User Date: Tue, 3 Jan 2017 04:42:30 +0100 Subject: [PATCH 405/412] updated version information after successful test of v2.0.1-350-g6d0e3f4 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 5c382bd4a..935395327 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-348-g80191c1 +v2.0.1-350-g6d0e3f4 From 676ecb2ade56ac203a372e21d102f1ddaa58fa26 Mon Sep 17 00:00:00 2001 From: Franz Roters Date: Fri, 6 Jan 2017 16:14:35 +0100 Subject: [PATCH 406/412] correctly determine DAMASK version --- .../2015/Marc_tools/include_linux64 | 21 +++++++------------ .../2015/Marc_tools/run_damask | 14 +++++++++++++ .../2015/Marc_tools/run_damask_h | 14 +++++++++++++ .../2015/Marc_tools/run_damask_hmp | 14 +++++++++++++ .../2015/Marc_tools/run_damask_l | 14 +++++++++++++ .../2015/Marc_tools/run_damask_lmp | 14 +++++++++++++ .../2015/Marc_tools/run_damask_mp | 14 +++++++++++++ 7 files changed, 91 insertions(+), 14 deletions(-) diff --git a/installation/mods_MarcMentat/2015/Marc_tools/include_linux64 b/installation/mods_MarcMentat/2015/Marc_tools/include_linux64 index 9b1e2bec7..0a315f85b 100644 --- a/installation/mods_MarcMentat/2015/Marc_tools/include_linux64 +++ b/installation/mods_MarcMentat/2015/Marc_tools/include_linux64 @@ -442,20 +442,13 @@ FORTNA="$FCOMP $FORT_OPT -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \ -I$MARC_SOURCE/${BCS_DIR}/common -I$MARC_SOURCE/mumpssolver/include $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM" # determine DAMASK version -HIT=0 -for arg in "$@" -do - if [ $HIT = 1 ] - then - DAMASKPATH=`dirname $arg` - break - elif [ ${arg:0:2} = -u -o ${arg:0:2} = -U ] - then - HIT=1 - fi -done -read DAMASKVERSION < $DAMASKPATH/../VERSION -DAMASKVERSION="'"$DAMASKVERSION"'" +if test -n "$DAMASK_USER"; then + DAMASKROOT=`dirname $DAMASK_USER`/.. + read DAMASKVERSION < $DAMASKROOT/VERSION + DAMASKVERSION="'"$DAMASKVERSION"'" +else + DAMASKVERSION="'N/A'" +fi # DAMASK compiler calls: additional flags are in line 2 OpenMP flags in line 3 DFORTLOW="$FCOMP $FORT_OPT $PROFILE -O0 $I8FFLAGS -I$MARC_SOURCE/common \ diff --git a/installation/mods_MarcMentat/2015/Marc_tools/run_damask b/installation/mods_MarcMentat/2015/Marc_tools/run_damask index 5286ccfa0..ef792247a 100644 --- a/installation/mods_MarcMentat/2015/Marc_tools/run_damask +++ b/installation/mods_MarcMentat/2015/Marc_tools/run_damask @@ -299,6 +299,20 @@ fi . "$DIR/getarch" +# getting user subroutine file name +found=0 +for i in "$@"; do + if test $found = 1; then + DAMASK_USER=$i + found=0 + fi + case $i in + -u* | -U*) + found=1 + ;; + esac +done +# sourcing include_linux64 (needs DAMASK_USER to be set) . $MARC_INCLUDE # diff --git a/installation/mods_MarcMentat/2015/Marc_tools/run_damask_h b/installation/mods_MarcMentat/2015/Marc_tools/run_damask_h index 5ed49f3a2..b77e80157 100644 --- a/installation/mods_MarcMentat/2015/Marc_tools/run_damask_h +++ b/installation/mods_MarcMentat/2015/Marc_tools/run_damask_h @@ -299,6 +299,20 @@ fi . "$DIR/getarch" +# getting user subroutine file name +found=0 +for i in "$@"; do + if test $found = 1; then + DAMASK_USER=$i + found=0 + fi + case $i in + -u* | -U*) + found=1 + ;; + esac +done +# sourcing include_linux64 (needs DAMASK_USER to be set) . $MARC_INCLUDE # diff --git a/installation/mods_MarcMentat/2015/Marc_tools/run_damask_hmp b/installation/mods_MarcMentat/2015/Marc_tools/run_damask_hmp index 3e3053f04..270e78f17 100644 --- a/installation/mods_MarcMentat/2015/Marc_tools/run_damask_hmp +++ b/installation/mods_MarcMentat/2015/Marc_tools/run_damask_hmp @@ -299,6 +299,20 @@ fi . "$DIR/getarch" +# getting user subroutine file name +found=0 +for i in "$@"; do + if test $found = 1; then + DAMASK_USER=$i + found=0 + fi + case $i in + -u* | -U*) + found=1 + ;; + esac +done +# sourcing include_linux64 (needs DAMASK_USER to be set) . $MARC_INCLUDE # diff --git a/installation/mods_MarcMentat/2015/Marc_tools/run_damask_l b/installation/mods_MarcMentat/2015/Marc_tools/run_damask_l index 86d5464bd..87c63f05a 100644 --- a/installation/mods_MarcMentat/2015/Marc_tools/run_damask_l +++ b/installation/mods_MarcMentat/2015/Marc_tools/run_damask_l @@ -299,6 +299,20 @@ fi . "$DIR/getarch" +# getting user subroutine file name +found=0 +for i in "$@"; do + if test $found = 1; then + DAMASK_USER=$i + found=0 + fi + case $i in + -u* | -U*) + found=1 + ;; + esac +done +# sourcing include_linux64 (needs DAMASK_USER to be set) . $MARC_INCLUDE # diff --git a/installation/mods_MarcMentat/2015/Marc_tools/run_damask_lmp b/installation/mods_MarcMentat/2015/Marc_tools/run_damask_lmp index 5fe65b829..9c10c5229 100644 --- a/installation/mods_MarcMentat/2015/Marc_tools/run_damask_lmp +++ b/installation/mods_MarcMentat/2015/Marc_tools/run_damask_lmp @@ -299,6 +299,20 @@ fi . "$DIR/getarch" +# getting user subroutine file name +found=0 +for i in "$@"; do + if test $found = 1; then + DAMASK_USER=$i + found=0 + fi + case $i in + -u* | -U*) + found=1 + ;; + esac +done +# sourcing include_linux64 (needs DAMASK_USER to be set) . $MARC_INCLUDE # diff --git a/installation/mods_MarcMentat/2015/Marc_tools/run_damask_mp b/installation/mods_MarcMentat/2015/Marc_tools/run_damask_mp index 1e3eadf37..5f34b18f5 100644 --- a/installation/mods_MarcMentat/2015/Marc_tools/run_damask_mp +++ b/installation/mods_MarcMentat/2015/Marc_tools/run_damask_mp @@ -299,6 +299,20 @@ fi . "$DIR/getarch" +# getting user subroutine file name +found=0 +for i in "$@"; do + if test $found = 1; then + DAMASK_USER=$i + found=0 + fi + case $i in + -u* | -U*) + found=1 + ;; + esac +done +# sourcing include_linux64 (needs DAMASK_USER to be set) . $MARC_INCLUDE # From 6748b32eb75a38ce737b4264a721b3e949cfedc8 Mon Sep 17 00:00:00 2001 From: Test User Date: Sat, 7 Jan 2017 10:45:51 +0100 Subject: [PATCH 407/412] updated version information after successful test of v2.0.1-352-g676ecb2 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 935395327..c1da855ba 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-350-g6d0e3f4 +v2.0.1-352-g676ecb2 From c80b02dd72ad6761dad6444af205a48d753de961 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Thu, 19 Jan 2017 15:10:17 +0100 Subject: [PATCH 408/412] avoid reporting "none" as STDIN filename --- processing/post/addDisplacement.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/processing/post/addDisplacement.py b/processing/post/addDisplacement.py index 611e21db2..bc1d7377b 100755 --- a/processing/post/addDisplacement.py +++ b/processing/post/addDisplacement.py @@ -128,7 +128,8 @@ for name in filenames: outname = outname, buffered = False) except: continue - damask.util.report(scriptName,'{}{}'.format(name,' --> {}'.format(outname) if outname else '')) + damask.util.report(scriptName,'{}{}'.format(name if name else '', + ' --> {}'.format(outname) if outname else '')) # ------------------------------------------ read header ------------------------------------------ From 746cb9c306f99cf7ffcdb55278e4478bf16746a0 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Thu, 19 Jan 2017 15:10:38 +0100 Subject: [PATCH 409/412] nicer code layout --- processing/post/binXY.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/processing/post/binXY.py b/processing/post/binXY.py index 819e07df5..aac9aaffa 100755 --- a/processing/post/binXY.py +++ b/processing/post/binXY.py @@ -89,15 +89,13 @@ if options.weight is not None: labels += [options.weight] if filenames == []: filenames = [None] for name in filenames: - try: - table = damask.ASCIItable(name = name, - outname = os.path.join(os.path.dirname(name), - 'binned-{}-{}_'.format(*options.data)+ \ - ('weighted-{}_'.format(options.weight) if options.weight else '') + \ - os.path.basename(name)) if name else name, - buffered = False) - except: - continue + try: table = damask.ASCIItable(name = name, + outname = os.path.join(os.path.dirname(name), + 'binned-{}-{}_'.format(*options.data) + + ('weighted-{}_'.format(options.weight) if options.weight else '') + + os.path.basename(name)) if name else name, + buffered = False) + except: continue damask.util.report(scriptName,name) # ------------------------------------------ read header ------------------------------------------ From 38471c1b82cb1ffa034f40f6ff7f8ea878482a01 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Tue, 24 Jan 2017 09:39:24 -0500 Subject: [PATCH 410/412] added shorthand command to DAMASK_ROOT directory --- DAMASK_env.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/DAMASK_env.sh b/DAMASK_env.sh index e45e16d42..fa3171c48 100644 --- a/DAMASK_env.sh +++ b/DAMASK_env.sh @@ -10,6 +10,9 @@ else DAMASK_ROOT=${STAT##* } fi +# shorthand command to change to DAMASK_ROOT directory +eval "function damask() { cd $DAMASK_ROOT; }" + # defining set() allows to source the same file for tcsh and bash, with and without space around = set() { export $1$2$3 From 71347bfd2f679bf66dcee84356e673314ebbb005 Mon Sep 17 00:00:00 2001 From: Test User Date: Fri, 27 Jan 2017 16:41:41 +0100 Subject: [PATCH 411/412] updated version information after successful test of v2.0.1-357-g38471c1 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index c1da855ba..2aa809898 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.0.1-352-g676ecb2 +v2.0.1-357-g38471c1 From 0319a5ee5df43a07830eb85698a58307948721f7 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 25 Jan 2017 07:56:26 +0100 Subject: [PATCH 412/412] nice also for zsh users --- DAMASK_env.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/DAMASK_env.zsh b/DAMASK_env.zsh index 557397630..dbb781894 100644 --- a/DAMASK_env.zsh +++ b/DAMASK_env.zsh @@ -3,6 +3,9 @@ DAMASK_ROOT=${0:a:h} +# shorthand command to change to DAMASK_ROOT directory +eval "function damask() { cd $DAMASK_ROOT; }" + # defining set() allows to source the same file for tcsh and zsh, with and without space around = set() { export $1$2$3