|
| 1 | +#!/bin/sh |
| 2 | +# |
| 3 | +#======================================================================== |
| 4 | +# HEADER |
| 5 | +#======================================================================== |
| 6 | +#% DESCRIPTION |
| 7 | +#% mpi |
| 8 | +#% |
| 9 | +#% DO NOT call this script directly. This is called by REMORA |
| 10 | +#% |
| 11 | +#======================================================================== |
| 12 | +#- IMPLEMENTATION |
| 13 | +#- version REMORA 1.7 |
| 14 | +#- authors Carlos Rosales ([email protected]) |
| 15 | +#- Antonio Gomez ([email protected]) |
| 16 | +#- license MIT |
| 17 | +#======================================================================== |
| 18 | + |
| 19 | +# All the functions take three arguments: |
| 20 | +# 1.- The name of the node where this function is running |
| 21 | +# 2.- The full path where the output will be stored/read |
| 22 | +# 3.- The full path to an optional temporary storage location |
| 23 | + |
| 24 | +init_module_mpi() |
| 25 | +{ |
| 26 | + : |
| 27 | +# REMORA_NODE=$1; REMORA_OUTDIR=$2; REMORA_TMPDIR=$3 |
| 28 | +# source $REMORA_OUTDIR/remora_env.txt |
| 29 | +# export LD_PRELOAD=$REMORA_BIN/../lib/libmpiP.so:$LD_PRELOAD |
| 30 | +} |
| 31 | + |
| 32 | +collect_data_mpi() |
| 33 | +{ |
| 34 | + : |
| 35 | +} |
| 36 | + |
| 37 | +# This function might perform some processing on the data. |
| 38 | +# If nothing needs to be done, it can be empty (but declared) |
| 39 | +process_data_mpi() |
| 40 | +{ |
| 41 | + : |
| 42 | +} |
| 43 | + |
| 44 | +monitor_data_mpi() |
| 45 | +{ |
| 46 | + : |
| 47 | +} |
| 48 | + |
| 49 | +finalize_module_mpi() |
| 50 | +{ |
| 51 | + REMORA_NODE=$1; REMORA_OUTDIR=$2; REMORA_TMPDIR=$3 |
| 52 | + source $REMORA_OUTDIR/remora_env.txt |
| 53 | + REMORA_MASTER=`head -n 1 $REMORA_OUTDIR/remora_nodes.txt` |
| 54 | + if [ "$REMORA_NODE" == "$REMORA_MASTER" ]; then |
| 55 | + if [ "$REMORA_MODE" == "FULL" ] || [ "$REMORA_MODE" == "MONITOR" ]; then |
| 56 | + outfile=`ls -ltr *.mpiP | tail -n 1 | awk '{print $9}'` |
| 57 | + mpiNum=`grep -c "MPI Task Assignment" $outfile` |
| 58 | + nodeNum=`cat $REMORA_OUTDIR/remora_nodes.txt | wc -l` |
| 59 | + appTime=`grep "*" ./outfile | head -n 1 | awk '{print $2}'` |
| 60 | + mpiTime=`grep "*" ./outfile | head -n 1 | awk '{print $3}'` |
| 61 | + mpiFrac=`grep "*" ./outfile | head -n 1 | awk '{print $4}'` |
| 62 | + echo "Number of Nodes : $nodeNum" > $REMORA_OUTDIR/mpi_info.txt |
| 63 | + echo "Number of MPI Tasks : $mpiTaskNum" >> $REMORA_OUTDIR/mpi_info.txt |
| 64 | + echo "Communication Time : $mpiFrac %" >> $REMORA_OUTDIR/mpi_info.txt |
| 65 | + fi |
| 66 | + fi |
| 67 | +} |
0 commit comments