From 9b37141de82bd771d1667443c41ff61d0dcaecca Mon Sep 17 00:00:00 2001 From: khivi Date: Tue, 22 Sep 2020 14:42:13 -0400 Subject: [PATCH] Script for Abaqus wait using bash --- README.md | 9 ++++++++- abaqus_wait.sh | 14 ++++++++++++++ comsol_start.sh | 0 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100755 abaqus_wait.sh mode change 100644 => 100755 comsol_start.sh diff --git a/README.md b/README.md index a670c4f..f0534cf 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,14 @@ ## comsol_start.sh Script to start comsol matlab. -Since comsol chooses a socket port, this script will allow matlab to connect to the chosen port. + - Since comsol chooses a socket port and outputs it + - This scripts finds the port from output and then matlab can connect to that port + +## abaqus_wait.sh +On Ubuntu 18.04 the Abaqus script does not exit when the job is done. +See https://askubuntu.com/questions/1062058/process-hangs-before-termination-with-ubuntu-18-04 + +This script will wait for the job by looking at the .sta file ## Support Please create issues if you want enhancements to the script. diff --git a/abaqus_wait.sh b/abaqus_wait.sh new file mode 100755 index 0000000..c69aa16 --- /dev/null +++ b/abaqus_wait.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +JOB=$1 + + +wait_for_abaqus() { + file="$1.sta" + grep --quiet --line-regexp --fixed-strings --regexp=' THE ANALYSIS HAS NOT BEEN COMPLETED' --regexp=' THE ANALYSIS HAS COMPLETED SUCCESSFULLY' <(tail -f "$file") +} + +wait_for_abaqus "$JOB" + + + diff --git a/comsol_start.sh b/comsol_start.sh old mode 100644 new mode 100755