3 echo "This is a script that can be run concurrently."
4 echo "It takes as single argument the number of concurrent executions:"
5 echo "Usage: " $0 "<nb_execution> <output_folder>"
7 echo "Here is what executed code contents looks like:"
8 echo " - do some stuff"
9 echo " - run SALOME in terminal mode, and log port number to a file"
10 echo " - run some scripts (Python, binary), each in a dedicated SALOME session on a specific port"
11 echo " - do some stuff"
16 echo "Usage:" $0 "<nb_execution> <output_folder>"
24 if [ "x${SALOME_APPLI_FOLDER}" == "x" ]; then
25 echo "SALOME_APPLI_FOLDER variable is not set (or empty)."
26 echo "Try to locate SALOME launcher in current directory."
27 SALOME_APPLI_FOLDER=`pwd`
28 if ! [ -f ${SALOME_APPLI_FOLDER}/salome ]; then
29 echo "Unable to locate salome command."
35 WORK_DIR=`pwd` # a pushd has been done before calling this function
36 echo "Run command in folder:" ${WORK_DIR}
37 ${SALOME_APPLI_FOLDER}/salome start -t --ns-port-log=${WORK_DIR}/session.log
38 ${SALOME_APPLI_FOLDER}/salome shell -p `cat ${WORK_DIR}/session.log` ${SALOME_APPLI_FOLDER}/bin/salome/waitContainers.py
39 ${SALOME_APPLI_FOLDER}/salome shell -p `cat ${WORK_DIR}/session.log` ${BASE_DIR}/hello.py
40 ${SALOME_APPLI_FOLDER}/salome shell -p `cat ${WORK_DIR}/session.log` ${SALOME_APPLI_FOLDER}/bin/salome/killSalomeWithPort.py args:`cat ${WORK_DIR}/session.log`
41 echo "Execution terminated in folder:" ${WORK_DIR}
49 " > ${BASE_DIR}/hello.py
51 # Build output folders
52 typeset -i i=${NB_COMP}
55 mkdir -p ${OUTPUT_FOLDER}/execution_$i
60 typeset -i i=${NB_COMP}
63 pushd ${OUTPUT_FOLDER}/execution_$i > /dev/null