From b663903606c8a092766ffb44dd4600ef255a2bd6 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Mon, 26 Sep 2016 10:34:53 -0400 Subject: [PATCH 001/127] 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 858d3c8b035e24a50de0c15c9f6fea6ef5292611 Mon Sep 17 00:00:00 2001 From: Test User Date: Wed, 28 Sep 2016 04:41:18 +0200 Subject: [PATCH 002/127] 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 003/127] 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 004/127] 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 005/127] 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 006/127] 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 007/127] 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 008/127] 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 009/127] 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 010/127] 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 011/127] 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 012/127] 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 013/127] 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 014/127] 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 015/127] 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 016/127] 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 017/127] 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 018/127] 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 019/127] 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 020/127] 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 021/127] 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 022/127] 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 023/127] 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 024/127] 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 025/127] 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 026/127] 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 027/127] 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 028/127] 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 029/127] 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 030/127] 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 031/127] 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 032/127] 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 033/127] 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 034/127] 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 035/127] 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 036/127] 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 037/127] 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 038/127] 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 039/127] 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 040/127] 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 041/127] 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 042/127] 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 043/127] 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 044/127] 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 045/127] 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 046/127] 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 047/127] 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 048/127] 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 049/127] 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 050/127] 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 051/127] 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 052/127] 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 053/127] 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 054/127] 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 055/127] 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 056/127] 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 057/127] 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 058/127] 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 059/127] 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 060/127] 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 061/127] 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 062/127] 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 063/127] 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 064/127] 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 065/127] 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 066/127] 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 067/127] 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 068/127] 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 069/127] 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 070/127] 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 071/127] 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 072/127] 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 073/127] 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 074/127] 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 075/127] 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 076/127] 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 077/127] 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 078/127] 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 079/127] 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 080/127] 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 081/127] 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 082/127] 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 083/127] 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 084/127] 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 085/127] 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 086/127] 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 087/127] 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 088/127] 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 089/127] 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 090/127] 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 091/127] 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 092/127] 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 093/127] 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 094/127] 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 095/127] 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 096/127] 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 097/127] 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 098/127] 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 099/127] 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 100/127] 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 101/127] 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 102/127] 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 103/127] 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 104/127] 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 105/127] 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 106/127] 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 107/127] 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 108/127] 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 109/127] 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 110/127] 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 111/127] 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 112/127] 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 113/127] 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 114/127] 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 115/127] 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 116/127] 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 117/127] 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 118/127] 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 119/127] 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 120/127] 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 121/127] 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 122/127] 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 123/127] 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 124/127] 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 125/127] 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 126/127] 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 127/127] 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