~ubuntu-branches/ubuntu/utopic/adios/utopic

« back to all changes in this revision

Viewing changes to examples/coupling/job

  • Committer: Package Import Robot
  • Author(s): Alastair McKinstry
  • Date: 2013-12-09 15:21:31 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20131209152131-jtd4fpmdv3xnunnm
Tags: 1.5.0-1
* New upstream.
* Standards-Version: 3.9.5
* Include latest config.{sub,guess} 
* New watch file.
* Create libadios-bin for binaries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
#PBS -A STF006
 
3
#PBS -N genarray
 
4
#PBS -j oe
 
5
#PBS -l walltime=1:00:00,size=20
 
6
## On jaguarpf, you need size=48 (4 nodes * 12cores for 4 apruns)
 
7
 
 
8
#cd $PBS_O_WORKDIR
 
9
 
 
10
# Number of writers (WPX*WPY = WRITEPROC)
 
11
WRITEPROC=16
 
12
WPX=4
 
13
WPY=4
 
14
# Number of staging processes, if staging is used
 
15
STAGINGPROC=4
 
16
# Number of readers (RPX*RPY = READPROC)
 
17
READPROC=9
 
18
RPX=3
 
19
RPY=3
 
20
 
 
21
 
 
22
let "WP=WPX*WPY"
 
23
if [ $WP -ne $WRITEPROC ]; then
 
24
    echo "WPX*WPY != WRITEPROC: " $WP and $WRITEPROC
 
25
    exit 1
 
26
fi
 
27
 
 
28
let "RP=RPX*RPY"
 
29
if [ $RP -ne $READPROC ]; then
 
30
    echo "RPX*RPY != READPROC: " $RP and $READPROC
 
31
    exit 1
 
32
fi
 
33
 
 
34
 
 
35
# clean-up
 
36
rm -f log.* draw* core* conf dataspaces.conf srv.lck
 
37
rm -f writer.bp reader_0*.bp
 
38
 
 
39
METHOD=`grep "<transport .*method=" coupling_writer_2D.xml | sed -e "s/^.*method=\"\([A-Z]*\).*/\1/"`
 
40
echo "The selected coupling method in coupling_writer_2D.xml is: $METHOD"
 
41
 
 
42
if [ "x$METHOD" == "xDATASPACES" ]; then
 
43
    READMETHOD="DATASPACES"
 
44
    let "PROCALL=WRITEPROC+READPROC"
 
45
 
 
46
    # Prepare config file for DataSpaces
 
47
    echo "## Config file for DataSpaces
 
48
ndim = 3
 
49
dimx = 1000
 
50
dimy = 1000
 
51
dimz = 1000
 
52
max_versions = 10
 
53
" > dataspaces.conf
 
54
 
 
55
    # Run DataSpaces
 
56
    SERVER=/ccs/proj/e2e/dataspaces/sith/pgi/bin/dataspaces_server
 
57
    echo "-- Start DataSpaces server "$SERVER" on $STAGINGPROC PEs, -s$STAGINGPROC -c$PROCALL"
 
58
    mpirun -np $STAGINGPROC $SERVER -s$STAGINGPROC -c$PROCALL &> log.server &
 
59
 
 
60
    ## Give some time for the servers to load and startup
 
61
    sleep 1s
 
62
    while [ ! -f conf ]; do
 
63
        echo "-- File conf is not yet available from server. Sleep more"
 
64
        sleep 1s
 
65
    done
 
66
    sleep 10s  # wait server to fill up the conf file
 
67
 
 
68
    ## Export the main server config to the environment
 
69
    while read line; do
 
70
        export set "${line}"
 
71
    done < conf
 
72
 
 
73
    echo "-- DataSpaces Portals IDs: P2TNID = $P2TNID   P2TPID = $P2TPID"
 
74
else
 
75
    READMETHOD="FILE"
 
76
fi
 
77
 
 
78
# Start WRITER
 
79
echo "-- Start WRITER on $WRITEPROC PEs"
 
80
mpirun -np $WRITEPROC ./coupling_writer_2D $WPX $WPY 10 10 5  >& log.writer &
 
81
 
 
82
# Start READER
 
83
echo "-- Start READER on $READPROC PEs."
 
84
mpirun -np $READPROC ./coupling_reader_2D $RPX $RPY $READMETHOD 1 >& log.reader &
 
85
 
 
86
echo "-- Wait until all applications exit. Run ./check.sh to see status"
 
87
wait
 
88
rm -f conf
 
89