Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions src/psij/launchers/scripts/mpi_launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,22 @@ fi
pre_launch

filter_out() {
sed -nE 's/^\[[^]]+\]<stdout>:(.*)/\1/p'
}

filter_err() {
sed -nE 's/^\[[^]]+\]<stderr>:(.*)/\1/p'
# must start with [n,n]<stdout>:
# may contain one or more [n,n]<stdout>: lodged into the line
sed -nE 's/^\[[^]]+\]<std[oe][ur][tr]>:(.*)/\1/p' | sed -E 's/\[[^]]+\]<std[oe][ur][tr]>://g'
}

filter_out_5() {
sed -nE 's/^\[[^]]+\]<stdout>: (.*)/\1/p'
}

filter_err_5() {
sed -nE 's/^\[[^]]+\]<stderr>: (.*)/\1/p'
sed -nE 's/^\[[^]]+\]<std[oe][ur][tr]>: (.*)/\1/p'
}

set +e
if [ "$IS_OPENMPI_5" == "1" ]; then
mpirun --oversubscribe --output TAG -n $_PSI_J_PROCESS_COUNT "$@" \
1> >(filter_out_5 > $_PSI_J_STDOUT) 2> >(filter_err_5 > $_PSI_J_STDERR) <$_PSI_J_STDIN
1> >(filter_out_5 > $_PSI_J_STDOUT) 2> >(filter_out_5 > $_PSI_J_STDERR) <$_PSI_J_STDIN
elif [ "$IS_OPENMPI" == "1" ]; then
mpirun --oversubscribe --tag-output -q -n $_PSI_J_PROCESS_COUNT "$@" \
1> >(filter_out > "$_PSI_J_STDOUT") 2> >(filter_err > $_PSI_J_STDERR) <$_PSI_J_STDIN
1> >(filter_out > "$_PSI_J_STDOUT") 2> >(filter_out > $_PSI_J_STDERR) <$_PSI_J_STDIN
else
mpirun -n $_PSI_J_PROCESS_COUNT "$@" 1>$_PSI_J_STDOUT 2>$_PSI_J_STDERR <$_PSI_J_STDIN
fi
Expand Down