Skip to content

Commit f098c0f

Browse files
committed
Main initial changes for Virtual School Tutorial Aug 10.
1 parent eeabea3 commit f098c0f

19 files changed

+502
-57
lines changed

part07/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ CFLAGS = -Wall -g
44

55
SRC = $(wildcard *.c)
66

7-
DEPS = timer.h
7+
DEPS =
88
OBJS = $(SRC:.c=.o)
99

1010
EXEC=mpi_hello

part07/mpi_hello.sub

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#! /bin/bash
2-
#SBATCH -p shared
2+
#SBATCH -p RM
33
#SBATCH --nodes=1
44
#SBATCH --ntasks-per-node=8
55
#SBATCH --mem=1G
@@ -9,6 +9,8 @@
99
#SBATCH --export=ALL
1010

1111
#export MV2_SHOW_CPU_BINDING=1
12+
hostname
1213
date
13-
ibrun -np 4 ./mpi_hello 5
14+
#ibrun -np 4 ./mpi_hello 5
15+
sh -c "mpirun -np 4 /home/wilde/xsede-tutorial/part07/mpi_hello.gcc_mvapich 1"
1416
date

part07/p7.swift

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
type file;
2+
3+
string curdir = java("java.lang.System","getProperty","user.dir");
4+
5+
app (file out, file err) mpi_hello (int time, int nproc)
6+
{
7+
mpirun "-np" nproc mpiapp time stderr=filename(err) stdout=filename(out);
8+
}
9+
10+
int nsim = toInt(arg("nsim", "10"));
11+
int time = toInt(arg("time", "1"));
12+
int nproc = toInt(arg("nproc", "56"));
13+
14+
global string mpiapp = arg("mpiapp", curdir+"/mpi_hello");
15+
16+
foreach i in [0:nsim-1] {
17+
file mpiout <single_file_mapper; file=strcat("output/mpi_",i,".out")>;
18+
file mpierr <single_file_mapper; file=strcat("output/mpi_",i,".err")>;
19+
(mpiout, mpierr) = mpi_hello(time, nproc);
20+
}

part08/bin/driver.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ int Y_MAX = 10000;
1919

2020
int dump_mandelbrot(char *buffer, char *filename)
2121
{
22-
char ppm_to_jpg[1000];
22+
// char ppm_to_jpg[1000];
2323
FILE * fp = fopen(filename, "w");
2424
fprintf(fp, "P6\n# CREATOR: Yadu Nand / mandel program\n");
2525
fprintf(fp, "%d %d\n255\n",X_MAX,Y_MAX);
@@ -97,14 +97,14 @@ int predef_run_client(int myrank, int nprocs, int strategy, int itermax)
9797

9898
int master(int myrank, int nprocs, int strategy, int itermax, char *output_filename)
9999
{
100-
int i, offset, slice_size;
100+
int i, offset; // , slice_size;
101101
MPI_Status stat;
102102

103103
int task_descriptor[4] = {0,0,0,0};
104104
char * buffer = malloc(X_MAX * Y_MAX * 3 * sizeof(char));
105105
//char * request = malloc(10*sizeof(char));
106106
// Slices are in multiples on rows.
107-
slice_size = SLICE_SIZE;
107+
// slice_size = SLICE_SIZE;
108108

109109
// In this world slaves ask for work! and there is work to do
110110
for ( i = 0 ; i < Y_MAX - SLICE_SIZE ; i+=SLICE_SIZE ) {

part08/bin/driver.o

17.3 KB
Binary file not shown.

part08/bin/mandelbrot

23.1 KB
Binary file not shown.

part08/bin/mandelbrot.o

5.2 KB
Binary file not shown.

part08/bin/mandelwrap

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
4+
MPI_RANKS=$1
5+
MPI_APP_PATH=$2
6+
shift 2
7+
outputfile="${@: -1}"
8+
9+
mpirun -np $MPI_RANKS $MPI_APP_PATH $*
10+
11+
# ls -thor $outputfile
12+
13+
convert $outputfile -resize 1000x1000 $outputfile

part08/bin/mandelwrap~

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/bin/bash
2+
3+
if [[ "$MPI_RANKS" == "" ]]
4+
then
5+
echo "MPI_RANKS not defined" 1>&2
6+
exit -1
7+
fi
8+
9+
outputfile="${@: -1}"
10+
11+
if [[ $MACHINE == "raven" ]]
12+
then
13+
$MPI_APP_PATH
14+
elif [[ $MACHINE == "swan" ]]
15+
then
16+
echo "aprun -n $MPI_RANKS -N 1 $MPI_APP_PATH $*"
17+
echo "hostname : $HOSTNAME"
18+
aprun -n $MPI_RANKS -N 1 $MPI_APP_PATH $*
19+
touch $outputfile
20+
21+
elif [[ $MACHINE == "stampede" ]]
22+
then
23+
echo "$MPI_APP_PATH $*"
24+
ibrun -n $MPI_RANKS -o 0 $MPI_APP_PATH $*
25+
26+
elif [[ $MACHINE == "gordon" ]]
27+
then
28+
echo "$MPI_APP_PATH $*"
29+
mpirun_rsh -np $MPI_RANKS -hostfile $PBS_NODEFILE $MPI_APP_PATH $*
30+
31+
elif [[ $MACHINE == "blacklight" ]]
32+
then
33+
export PATH=/usr/local/packages/ImageMagick-6.7.3-10/bin:$PATH
34+
echo "mpirun -np $PBS_NCPUS $MPI_APP_PATH $*"
35+
mpirun -np $PBS_NCPUS $MPI_APP_PATH $*
36+
37+
elif [[ $MACHINE == "bridges" ]]
38+
then
39+
# export PATH=/usr/local/packages/ImageMagick-6.7.3-10/bin:$PATH
40+
echo "mpirun -np $MPI_RANKS $MPI_APP_PATH $*"
41+
mpirun -np $MPI_RANKS $MPI_APP_PATH $*
42+
43+
elif [[ $MACHINE == "midway" ]]
44+
then
45+
module load openmpi
46+
mpirun -n $MPI_RANKS $MPI_APP_PATH $*
47+
else
48+
echo "MACHINE : $MACHINE is not defined"
49+
fi
50+
ls -thor $outputfile
51+
convert $outputfile -resize 1000x1000 $outputfile

part08/bin/run_mandelbrot

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ then
3434
echo "mpirun -np $PBS_NCPUS $MPI_APP_PATH $*"
3535
mpirun -np $PBS_NCPUS $MPI_APP_PATH $*
3636

37+
elif [[ $MACHINE == "bridges" ]]
38+
then
39+
# export PATH=/usr/local/packages/ImageMagick-6.7.3-10/bin:$PATH
40+
echo "mpirun -np $MPI_RANKS $MPI_APP_PATH $*"
41+
mpirun -np $MPI_RANKS $MPI_APP_PATH $*
42+
3743
elif [[ $MACHINE == "midway" ]]
3844
then
3945
module load openmpi

0 commit comments

Comments
 (0)