7b95c46185395e1500ab3a56bd185a11be4b9517 hiram Wed Oct 30 21:17:55 2024 -0700 not a good idea to use /tmp/ for the simple repeat - that filesystem is way too small for the long running hippos refs #34685 diff --git src/hg/utils/automation/doSimpleRepeat.pl src/hg/utils/automation/doSimpleRepeat.pl index 8e82288..6677cc0 100755 --- src/hg/utils/automation/doSimpleRepeat.pl +++ src/hg/utils/automation/doSimpleRepeat.pl @@ -169,32 +169,40 @@ my $fh = &HgAutomate::mustOpen(">$runDir/TrfRun.csh"); print $fh <<_EOF_ #!/bin/csh -ef set finalOut = \$1 set inLst = \$finalOut:r set inLft = \$inLst:r.lft unsetenv TMPDIR if ( -d "/data/tmp" ) then setenv TMPDIR "/data/tmp" else if ( -d "/scratch/tmp" ) then setenv TMPDIR "/scratch/tmp" else + set tmpSz = `df --output=avail -k /tmp | tail -1` + set shmSz = `df --output=avail -k /dev/shm | tail -1` + if ( "\${shmSz}" > "\${tmpSz}" ) then + mkdir -p /dev/shm/tmp + chmod 777 /dev/shm/tmp + setenv TMPDIR "/dev/shm/tmp" + else setenv TMPDIR "/tmp" endif +endif $HgAutomate::setMachtype # Use local disk for output, and move the final result to \$finalOut # when done, to minimize I/O. set tmpDir = `mktemp -d -p \$TMPDIR doSimpleRepeat.cluster.XXXXXX` pushd \$tmpDir foreach spec (`cat \$inLst`) # Remove path and .2bit filename to get just the seq:start-end spec: set base = `echo \$spec | sed -r -e 's/^[^:]+://'` # If \$spec is the whole sequence, twoBitToFa removes the :start-end part, # which causes liftUp to barf later. So tweak the header back to # seq:start-end for liftUp's sake: twoBitToFa \$spec stdout \\ @@ -305,32 +313,40 @@ my $trf409Option = ""; my $trfCmd = "trf"; if ($trf409 ne 0) { $trf409Option = "-l=$trf409"; $trfCmd = "trf.4.09"; } my $tmpDir = &HgAutomate::tmpDir(); $bossScript->add(<<_EOF_ $HgAutomate::setMachtype unsetenv TMPDIR if ( -d "/data/tmp" ) then setenv TMPDIR "/data/tmp" else if ( -d "/scratch/tmp" ) then setenv TMPDIR "/scratch/tmp" else + set tmpSz = `df --output=avail -k /tmp | tail -1` + set shmSz = `df --output=avail -k /dev/shm | tail -1` + if ( "\${shmSz}" > "\${tmpSz}" ) then + mkdir -p /dev/shm/tmp + chmod 777 /dev/shm/tmp + setenv TMPDIR "/dev/shm/tmp" + else setenv TMPDIR "/tmp" endif +endif twoBitToFa $unmaskedSeq stdout \\ | $clusterBin/trfBig $trf409Option -trf=$clusterBin/$trfCmd \\ stdin /dev/null -bedAt=simpleRepeat.bed -tempDir=\$TMPDIR _EOF_ ); $bossScript->execute(); } # doSingle sub doTrf { if ($useCluster) { &doCluster(); } else { &doSingle(); } } # doTrf