Compare commits

...

10 Commits

Author SHA1 Message Date
daviddoji
cc2614d7d2 Add plotting code 2021-04-13 20:44:16 +02:00
daviddoji
533d805d98 Plotting 2021-04-13 20:43:45 +02:00
David Doblas Jiménez
2be0f29e8a Include .vscode 2021-04-12 15:37:51 +02:00
David Doblas Jiménez
558df9220c Ex. 1 master_worker solution 2021-04-12 14:50:09 +02:00
David Doblas Jiménez
77d9142b6f Ex. 1 master_worker instructions 2021-04-12 14:49:43 +02:00
David Doblas Jiménez
32176938f3 Ex. 1 master_worker solution 2021-04-12 14:40:23 +02:00
David Doblas Jiménez
0af4af6fb7 Ex. 1 master_worker instructions 2021-04-12 14:39:47 +02:00
David Doblas Jiménez
a053d8e444 Ex. 1 ping_pong solution 2021-04-12 14:38:28 +02:00
David Doblas Jiménez
464d6862b0 Ex. 1 ping_pong instructions 2021-04-12 14:38:10 +02:00
David Doblas Jiménez
119bcc26a6 For consistency 2021-04-12 14:07:52 +02:00
15 changed files with 269 additions and 788 deletions

2
.gitignore vendored
View File

@@ -1,3 +1,5 @@
.vscode/
# ---> C
# Prerequisites
*.d

View File

@@ -0,0 +1,68 @@
# include <stdio.h>
# include <stdlib.h>
# include <mpi.h>
void master(int);
void worker(void);
//------------------------------------------------------------------------------
int main(int argc, char *argv[]) // master-worker
{
int maxtask = 40;
int rank;
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if (rank == 0)
master(maxtask);
else
worker();
MPI_Finalize();
return 0;
}
//------------------------------------------------------------------------------
void master(const int maxtask)
{
MPI_Status status;
int size, msg, task, dest;
MPI_Comm_size(MPI_COMM_WORLD, &size);
for (task = 1; task <= maxtask; task++)
{
MPI_Recv(&msg, 0, MPI_INT, MPI_ANY_SOURCE, 0, MPI_COMM_WORLD, &status);
MPI_Send(&task, 1, MPI_INT, status.MPI_SOURCE, 0, MPI_COMM_WORLD);
}
task = -1;
for (dest = 1; dest < size; dest++)
{
MPI_Recv(&msg, 0, MPI_INT, dest, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
MPI_Send(&task, 1, MPI_INT, dest, 0, MPI_COMM_WORLD);
}
}
//------------------------------------------------------------------------------
void worker(void)
{
int rank, msg, task;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
do
{
MPI_Send(&msg, 0, MPI_INT, 0, 0, MPI_COMM_WORLD);
MPI_Recv(&task, 1, MPI_INT, 0, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
if (task >= 0)
{
printf("rank %d: working on task %d\n", rank, task);
system("sleep 1");
}
}
while (task >= 0);
}

View File

@@ -0,0 +1,25 @@
Exercise 'master-worker'
~~~~~~~~~~~~~~~~~~~~~~~~
Write a simple master-worker program.
No real work has to be performed. Work is emulated by waiting for one
second. This can be implemented with the following system calls:
C : #include <stdlib.h>
system("sleep 1");
Fortran : call system("sleep 1") ! (ifort and gfortran compilers)
The master's task is to send task IDs to the workers upon their request.
(Task IDs are integers from 1 to MAXTASK=40, say.)
If the task queue is empty the master sends an 'end-of-work' message.
(The master can send -1 as a task ID, for example.)
The workers are supposed to print out their rank and the task ID they received
and then wait for one second.
Hint: Read about 'MPI_ANY_SOURCE' in the MPI standard and the 'status'
returned in MPI_Recv().

View File

@@ -0,0 +1,21 @@
8 1048576 0.43 18.68
16 524288 0.44 36.46
32 262144 0.45 71.15
64 131072 0.46 139.57
128 65536 0.51 251.47
256 32768 0.55 467.31
512 16384 0.61 838.44
1024 8192 0.70 1466.79
2048 4096 0.84 2434.00
4096 2048 1.73 2372.29
8192 1024 2.26 3628.56
16384 512 3.95 4149.35
32768 256 6.78 4836.20
65536 128 11.72 5589.84
131072 64 20.61 6360.76
262144 32 44.38 5907.35
524288 16 82.79 6332.73
1048576 8 187.02 5606.82
2097152 4 420.78 4983.91
4194304 2 1434.39 2924.09
8388608 1 4634.53 1810.02

View File

View File

@@ -0,0 +1,68 @@
#include <stdio.h>
#include <stdlib.h>
#include <mpi.h>
#define MAX_I 20
#define MAX_COUNT (1024 * 1024)
double buf[MAX_COUNT];
int main(int argc, char *argv[]) // ping pong
{
int size, rank, partner, i, count, r, repetitions;
double time, bandwidth;
FILE *fp;
fp = fopen("data.dat", "w");
if (!fp) {
printf("file could not be opened\n");
getchar();
return -1;
}
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &size);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if (size != 2) {
fprintf(stderr, "comm_size != 2\n");
MPI_Abort(MPI_COMM_WORLD, 1);
}
if (rank == 0) {
puts("message size number of time bandwidth");
puts(" [bytes] repetitions [us] [MB/s]");
puts("---------------------------------------------------");
}
partner = 1 - rank;
count = 1;
repetitions = MAX_COUNT;
for (i = 0; i <= MAX_I; i++) {
time = MPI_Wtime();
for (r = 0; r < repetitions; r++) {
if (rank == 0) {
MPI_Send(buf, count, MPI_DOUBLE, partner, 0, MPI_COMM_WORLD);
MPI_Recv(buf, count, MPI_DOUBLE, partner, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
} else {
MPI_Recv(buf, count, MPI_DOUBLE, partner, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
MPI_Send(buf, count, MPI_DOUBLE, partner, 0, MPI_COMM_WORLD);
}
}
time = MPI_Wtime() - time;
time = time / (2.0 * repetitions);
time = 1e6 * time; // micro-seconds
bandwidth = count * sizeof(double) / time; // MByte/s
if (rank == 0) {
fprintf(fp, "%12zd %12d %12.2f %12.2f\n", count * sizeof(double), repetitions, time, bandwidth);
printf("%12zd %12d %12.2f %12.2f\n", count * sizeof(double), repetitions, time, bandwidth);
}
count = count * 2;
repetitions = repetitions / 2;
}
MPI_Finalize();
return 0;
}

View File

@@ -0,0 +1,33 @@
Exercise 'ping pong'
~~~~~~~~~~~~~~~~~~~~
- Write a program in which two processes repeatedly pass a message back and
forth.
- Insert timing calls to measure the time taken for one message
(send+receive).
- Investigate how the time taken varies with the size of the message.
- Use message sizes 1, 2, 4, 8, 16, 32, ..., ~1 million
or 1, 10, 100, 1000, ..., 1 million
- Loop over message sizes
- In the loop time this block of code with MPI_Wtime()
MPI_Send(...);
MPI_Recv(...);
- Print out a table: message_size transfer_time
- Extra task: produce a graphical plot with double logarithmic axes for
transfer_time(message_size)
- Timers:
C : double MPI_Wtime(void);
Fortran : real(8), external :: mpi_wtime()
see also: MPI_Wtick()

View File

@@ -0,0 +1,7 @@
set output 'data.png'
set logscale xy
set xlabel 'time [us]'
set ylabel 'message size [bytes]'
set label 'message size'
plot 'data.dat' using 1:3 with points title 'message size'
quit

32
Exercises/ex_2/ring.c Normal file
View File

@@ -0,0 +1,32 @@
#include <stdio.h>
#include <mpi.h>
int main(int argc, char *argv[]) // ring
{
int size, rank;
int partner_left, partner_right;
int sum, sbuf, rbuf;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &size);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
partner_left = (rank - 1 + size) % size;
partner_right = (rank + 1) % size;
sum = 0;
sbuf = rank;
do {
MPI_Sendrecv(&sbuf, 1, MPI_INT, partner_right, 0,
&rbuf, 1, MPI_INT, partner_left, 0,
MPI_COMM_WORLD, MPI_STATUS_IGNORE);
sum += rbuf;
sbuf = rbuf;
} while (rbuf != rank);
printf("%d %d\n", rank, sum);
MPI_Finalize();
return 0;
}

13
Exercises/ex_2/ring.txt Normal file
View File

@@ -0,0 +1,13 @@
Exercise: Rotating information around a ring
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- A set of processes are arranged in a ring.
- Each process stores its rank in MPI_COMM_WORLD in an integer.
- Each process passes this on to its neighbour on the right.
- Keep passing what is received until the own rank is back where it started.
- Each processor calculates the sum of the values.

View File

@@ -1,12 +0,0 @@
#include <stdio.h>
#include <mpi.h>
int main(int argc, char*argv[])
{
MPI_Init(&argc, &argv);
printf("Hi!\n");
MPI_Finalize();
return 0;
}

View File

@@ -1,9 +0,0 @@
#include <stdio.h>
int main(int argc, char*argv[])
{
#pragma omp parallel
printf("Hi!\n");
return 0;
}

View File

@@ -1,12 +0,0 @@
#include <stdio.h>
#include <mpp/shmem.h>
int main(int argc, char*argv[])
{
shmem_init();
printf("SHMEM: n_pes = %d : my_pe = %d\n",
shmem_n_pes(), shmem_my_pe());
return 0;
}

View File

@@ -1,4 +0,0 @@
1 1
10 10
20 20
50 100

View File

@@ -1,751 +0,0 @@
%!PS-Adobe-2.0 EPSF-2.0
%%Title: test.eps
%%Creator: gnuplot 5.2 patchlevel 2
%%CreationDate: Tue Apr 6 14:42:54 2021
%%DocumentFonts: (atend)
%%BoundingBox: 50 50 410 302
%%EndComments
%%BeginProlog
/gnudict 256 dict def
gnudict begin
%
% The following true/false flags may be edited by hand if desired.
% The unit line width and grayscale image gamma correction may also be changed.
%
/Color false def
/Blacktext false def
/Solid false def
/Dashlength 1 def
/Landscape false def
/Level1 false def
/Level3 false def
/Rounded false def
/ClipToBoundingBox false def
/SuppressPDFMark false def
/TransparentPatterns false def
/gnulinewidth 5.000 def
/userlinewidth gnulinewidth def
/Gamma 1.0 def
/BackgroundColor {-1.000 -1.000 -1.000} def
%
/vshift -46 def
/dl1 {
10.0 Dashlength userlinewidth gnulinewidth div mul mul mul
Rounded { currentlinewidth 0.75 mul sub dup 0 le { pop 0.01 } if } if
} def
/dl2 {
10.0 Dashlength userlinewidth gnulinewidth div mul mul mul
Rounded { currentlinewidth 0.75 mul add } if
} def
/hpt_ 31.5 def
/vpt_ 31.5 def
/hpt hpt_ def
/vpt vpt_ def
/doclip {
ClipToBoundingBox {
newpath 50 50 moveto 410 50 lineto 410 302 lineto 50 302 lineto closepath
clip
} if
} def
%
% Gnuplot Prolog Version 5.1 (Oct 2015)
%
%/SuppressPDFMark true def
%
/M {moveto} bind def
/L {lineto} bind def
/R {rmoveto} bind def
/V {rlineto} bind def
/N {newpath moveto} bind def
/Z {closepath} bind def
/C {setrgbcolor} bind def
/f {rlineto fill} bind def
/g {setgray} bind def
/Gshow {show} def % May be redefined later in the file to support UTF-8
/vpt2 vpt 2 mul def
/hpt2 hpt 2 mul def
/Lshow {currentpoint stroke M 0 vshift R
Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def
/Rshow {currentpoint stroke M dup stringwidth pop neg vshift R
Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def
/Cshow {currentpoint stroke M dup stringwidth pop -2 div vshift R
Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def
/UP {dup vpt_ mul /vpt exch def hpt_ mul /hpt exch def
/hpt2 hpt 2 mul def /vpt2 vpt 2 mul def} def
/DL {Color {setrgbcolor Solid {pop []} if 0 setdash}
{pop pop pop 0 setgray Solid {pop []} if 0 setdash} ifelse} def
/BL {stroke userlinewidth 2 mul setlinewidth
Rounded {1 setlinejoin 1 setlinecap} if} def
/AL {stroke userlinewidth 2 div setlinewidth
Rounded {1 setlinejoin 1 setlinecap} if} def
/UL {dup gnulinewidth mul /userlinewidth exch def
dup 1 lt {pop 1} if 10 mul /udl exch def} def
/PL {stroke userlinewidth setlinewidth
Rounded {1 setlinejoin 1 setlinecap} if} def
3.8 setmiterlimit
% Classic Line colors (version 5.0)
/LCw {1 1 1} def
/LCb {0 0 0} def
/LCa {0 0 0} def
/LC0 {1 0 0} def
/LC1 {0 1 0} def
/LC2 {0 0 1} def
/LC3 {1 0 1} def
/LC4 {0 1 1} def
/LC5 {1 1 0} def
/LC6 {0 0 0} def
/LC7 {1 0.3 0} def
/LC8 {0.5 0.5 0.5} def
% Default dash patterns (version 5.0)
/LTB {BL [] LCb DL} def
/LTw {PL [] 1 setgray} def
/LTb {PL [] LCb DL} def
/LTa {AL [1 udl mul 2 udl mul] 0 setdash LCa setrgbcolor} def
/LT0 {PL [] LC0 DL} def
/LT1 {PL [2 dl1 3 dl2] LC1 DL} def
/LT2 {PL [1 dl1 1.5 dl2] LC2 DL} def
/LT3 {PL [6 dl1 2 dl2 1 dl1 2 dl2] LC3 DL} def
/LT4 {PL [1 dl1 2 dl2 6 dl1 2 dl2 1 dl1 2 dl2] LC4 DL} def
/LT5 {PL [4 dl1 2 dl2] LC5 DL} def
/LT6 {PL [1.5 dl1 1.5 dl2 1.5 dl1 1.5 dl2 1.5 dl1 6 dl2] LC6 DL} def
/LT7 {PL [3 dl1 3 dl2 1 dl1 3 dl2] LC7 DL} def
/LT8 {PL [2 dl1 2 dl2 2 dl1 6 dl2] LC8 DL} def
/SL {[] 0 setdash} def
/Pnt {stroke [] 0 setdash gsave 1 setlinecap M 0 0 V stroke grestore} def
/Dia {stroke [] 0 setdash 2 copy vpt add M
hpt neg vpt neg V hpt vpt neg V
hpt vpt V hpt neg vpt V closepath stroke
Pnt} def
/Pls {stroke [] 0 setdash vpt sub M 0 vpt2 V
currentpoint stroke M
hpt neg vpt neg R hpt2 0 V stroke
} def
/Box {stroke [] 0 setdash 2 copy exch hpt sub exch vpt add M
0 vpt2 neg V hpt2 0 V 0 vpt2 V
hpt2 neg 0 V closepath stroke
Pnt} def
/Crs {stroke [] 0 setdash exch hpt sub exch vpt add M
hpt2 vpt2 neg V currentpoint stroke M
hpt2 neg 0 R hpt2 vpt2 V stroke} def
/TriU {stroke [] 0 setdash 2 copy vpt 1.12 mul add M
hpt neg vpt -1.62 mul V
hpt 2 mul 0 V
hpt neg vpt 1.62 mul V closepath stroke
Pnt} def
/Star {2 copy Pls Crs} def
/BoxF {stroke [] 0 setdash exch hpt sub exch vpt add M
0 vpt2 neg V hpt2 0 V 0 vpt2 V
hpt2 neg 0 V closepath fill} def
/TriUF {stroke [] 0 setdash vpt 1.12 mul add M
hpt neg vpt -1.62 mul V
hpt 2 mul 0 V
hpt neg vpt 1.62 mul V closepath fill} def
/TriD {stroke [] 0 setdash 2 copy vpt 1.12 mul sub M
hpt neg vpt 1.62 mul V
hpt 2 mul 0 V
hpt neg vpt -1.62 mul V closepath stroke
Pnt} def
/TriDF {stroke [] 0 setdash vpt 1.12 mul sub M
hpt neg vpt 1.62 mul V
hpt 2 mul 0 V
hpt neg vpt -1.62 mul V closepath fill} def
/DiaF {stroke [] 0 setdash vpt add M
hpt neg vpt neg V hpt vpt neg V
hpt vpt V hpt neg vpt V closepath fill} def
/Pent {stroke [] 0 setdash 2 copy gsave
translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
closepath stroke grestore Pnt} def
/PentF {stroke [] 0 setdash gsave
translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
closepath fill grestore} def
/Circle {stroke [] 0 setdash 2 copy
hpt 0 360 arc stroke Pnt} def
/CircleF {stroke [] 0 setdash hpt 0 360 arc fill} def
/C0 {BL [] 0 setdash 2 copy moveto vpt 90 450 arc} bind def
/C1 {BL [] 0 setdash 2 copy moveto
2 copy vpt 0 90 arc closepath fill
vpt 0 360 arc closepath} bind def
/C2 {BL [] 0 setdash 2 copy moveto
2 copy vpt 90 180 arc closepath fill
vpt 0 360 arc closepath} bind def
/C3 {BL [] 0 setdash 2 copy moveto
2 copy vpt 0 180 arc closepath fill
vpt 0 360 arc closepath} bind def
/C4 {BL [] 0 setdash 2 copy moveto
2 copy vpt 180 270 arc closepath fill
vpt 0 360 arc closepath} bind def
/C5 {BL [] 0 setdash 2 copy moveto
2 copy vpt 0 90 arc
2 copy moveto
2 copy vpt 180 270 arc closepath fill
vpt 0 360 arc} bind def
/C6 {BL [] 0 setdash 2 copy moveto
2 copy vpt 90 270 arc closepath fill
vpt 0 360 arc closepath} bind def
/C7 {BL [] 0 setdash 2 copy moveto
2 copy vpt 0 270 arc closepath fill
vpt 0 360 arc closepath} bind def
/C8 {BL [] 0 setdash 2 copy moveto
2 copy vpt 270 360 arc closepath fill
vpt 0 360 arc closepath} bind def
/C9 {BL [] 0 setdash 2 copy moveto
2 copy vpt 270 450 arc closepath fill
vpt 0 360 arc closepath} bind def
/C10 {BL [] 0 setdash 2 copy 2 copy moveto vpt 270 360 arc closepath fill
2 copy moveto
2 copy vpt 90 180 arc closepath fill
vpt 0 360 arc closepath} bind def
/C11 {BL [] 0 setdash 2 copy moveto
2 copy vpt 0 180 arc closepath fill
2 copy moveto
2 copy vpt 270 360 arc closepath fill
vpt 0 360 arc closepath} bind def
/C12 {BL [] 0 setdash 2 copy moveto
2 copy vpt 180 360 arc closepath fill
vpt 0 360 arc closepath} bind def
/C13 {BL [] 0 setdash 2 copy moveto
2 copy vpt 0 90 arc closepath fill
2 copy moveto
2 copy vpt 180 360 arc closepath fill
vpt 0 360 arc closepath} bind def
/C14 {BL [] 0 setdash 2 copy moveto
2 copy vpt 90 360 arc closepath fill
vpt 0 360 arc} bind def
/C15 {BL [] 0 setdash 2 copy vpt 0 360 arc closepath fill
vpt 0 360 arc closepath} bind def
/Rec {newpath 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto
neg 0 rlineto closepath} bind def
/Square {dup Rec} bind def
/Bsquare {vpt sub exch vpt sub exch vpt2 Square} bind def
/S0 {BL [] 0 setdash 2 copy moveto 0 vpt rlineto BL Bsquare} bind def
/S1 {BL [] 0 setdash 2 copy vpt Square fill Bsquare} bind def
/S2 {BL [] 0 setdash 2 copy exch vpt sub exch vpt Square fill Bsquare} bind def
/S3 {BL [] 0 setdash 2 copy exch vpt sub exch vpt2 vpt Rec fill Bsquare} bind def
/S4 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt Square fill Bsquare} bind def
/S5 {BL [] 0 setdash 2 copy 2 copy vpt Square fill
exch vpt sub exch vpt sub vpt Square fill Bsquare} bind def
/S6 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt vpt2 Rec fill Bsquare} bind def
/S7 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt vpt2 Rec fill
2 copy vpt Square fill Bsquare} bind def
/S8 {BL [] 0 setdash 2 copy vpt sub vpt Square fill Bsquare} bind def
/S9 {BL [] 0 setdash 2 copy vpt sub vpt vpt2 Rec fill Bsquare} bind def
/S10 {BL [] 0 setdash 2 copy vpt sub vpt Square fill 2 copy exch vpt sub exch vpt Square fill
Bsquare} bind def
/S11 {BL [] 0 setdash 2 copy vpt sub vpt Square fill 2 copy exch vpt sub exch vpt2 vpt Rec fill
Bsquare} bind def
/S12 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill Bsquare} bind def
/S13 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill
2 copy vpt Square fill Bsquare} bind def
/S14 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill
2 copy exch vpt sub exch vpt Square fill Bsquare} bind def
/S15 {BL [] 0 setdash 2 copy Bsquare fill Bsquare} bind def
/D0 {gsave translate 45 rotate 0 0 S0 stroke grestore} bind def
/D1 {gsave translate 45 rotate 0 0 S1 stroke grestore} bind def
/D2 {gsave translate 45 rotate 0 0 S2 stroke grestore} bind def
/D3 {gsave translate 45 rotate 0 0 S3 stroke grestore} bind def
/D4 {gsave translate 45 rotate 0 0 S4 stroke grestore} bind def
/D5 {gsave translate 45 rotate 0 0 S5 stroke grestore} bind def
/D6 {gsave translate 45 rotate 0 0 S6 stroke grestore} bind def
/D7 {gsave translate 45 rotate 0 0 S7 stroke grestore} bind def
/D8 {gsave translate 45 rotate 0 0 S8 stroke grestore} bind def
/D9 {gsave translate 45 rotate 0 0 S9 stroke grestore} bind def
/D10 {gsave translate 45 rotate 0 0 S10 stroke grestore} bind def
/D11 {gsave translate 45 rotate 0 0 S11 stroke grestore} bind def
/D12 {gsave translate 45 rotate 0 0 S12 stroke grestore} bind def
/D13 {gsave translate 45 rotate 0 0 S13 stroke grestore} bind def
/D14 {gsave translate 45 rotate 0 0 S14 stroke grestore} bind def
/D15 {gsave translate 45 rotate 0 0 S15 stroke grestore} bind def
/DiaE {stroke [] 0 setdash vpt add M
hpt neg vpt neg V hpt vpt neg V
hpt vpt V hpt neg vpt V closepath stroke} def
/BoxE {stroke [] 0 setdash exch hpt sub exch vpt add M
0 vpt2 neg V hpt2 0 V 0 vpt2 V
hpt2 neg 0 V closepath stroke} def
/TriUE {stroke [] 0 setdash vpt 1.12 mul add M
hpt neg vpt -1.62 mul V
hpt 2 mul 0 V
hpt neg vpt 1.62 mul V closepath stroke} def
/TriDE {stroke [] 0 setdash vpt 1.12 mul sub M
hpt neg vpt 1.62 mul V
hpt 2 mul 0 V
hpt neg vpt -1.62 mul V closepath stroke} def
/PentE {stroke [] 0 setdash gsave
translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
closepath stroke grestore} def
/CircE {stroke [] 0 setdash
hpt 0 360 arc stroke} def
/Opaque {gsave closepath 1 setgray fill grestore 0 setgray closepath} def
/DiaW {stroke [] 0 setdash vpt add M
hpt neg vpt neg V hpt vpt neg V
hpt vpt V hpt neg vpt V Opaque stroke} def
/BoxW {stroke [] 0 setdash exch hpt sub exch vpt add M
0 vpt2 neg V hpt2 0 V 0 vpt2 V
hpt2 neg 0 V Opaque stroke} def
/TriUW {stroke [] 0 setdash vpt 1.12 mul add M
hpt neg vpt -1.62 mul V
hpt 2 mul 0 V
hpt neg vpt 1.62 mul V Opaque stroke} def
/TriDW {stroke [] 0 setdash vpt 1.12 mul sub M
hpt neg vpt 1.62 mul V
hpt 2 mul 0 V
hpt neg vpt -1.62 mul V Opaque stroke} def
/PentW {stroke [] 0 setdash gsave
translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
Opaque stroke grestore} def
/CircW {stroke [] 0 setdash
hpt 0 360 arc Opaque stroke} def
/BoxFill {gsave Rec 1 setgray fill grestore} def
/Density {
/Fillden exch def
currentrgbcolor
/ColB exch def /ColG exch def /ColR exch def
/ColR ColR Fillden mul Fillden sub 1 add def
/ColG ColG Fillden mul Fillden sub 1 add def
/ColB ColB Fillden mul Fillden sub 1 add def
ColR ColG ColB setrgbcolor} def
/BoxColFill {gsave Rec PolyFill} def
/PolyFill {gsave Density fill grestore grestore} def
/h {rlineto rlineto rlineto gsave closepath fill grestore} bind def
%
% PostScript Level 1 Pattern Fill routine for rectangles
% Usage: x y w h s a XX PatternFill
% x,y = lower left corner of box to be filled
% w,h = width and height of box
% a = angle in degrees between lines and x-axis
% XX = 0/1 for no/yes cross-hatch
%
/PatternFill {gsave /PFa [ 9 2 roll ] def
PFa 0 get PFa 2 get 2 div add PFa 1 get PFa 3 get 2 div add translate
PFa 2 get -2 div PFa 3 get -2 div PFa 2 get PFa 3 get Rec
TransparentPatterns {} {gsave 1 setgray fill grestore} ifelse
clip
currentlinewidth 0.5 mul setlinewidth
/PFs PFa 2 get dup mul PFa 3 get dup mul add sqrt def
0 0 M PFa 5 get rotate PFs -2 div dup translate
0 1 PFs PFa 4 get div 1 add floor cvi
{PFa 4 get mul 0 M 0 PFs V} for
0 PFa 6 get ne {
0 1 PFs PFa 4 get div 1 add floor cvi
{PFa 4 get mul 0 2 1 roll M PFs 0 V} for
} if
stroke grestore} def
%
/languagelevel where
{pop languagelevel} {1} ifelse
dup 2 lt
{/InterpretLevel1 true def
/InterpretLevel3 false def}
{/InterpretLevel1 Level1 def
2 gt
{/InterpretLevel3 Level3 def}
{/InterpretLevel3 false def}
ifelse }
ifelse
%
% PostScript level 2 pattern fill definitions
%
/Level2PatternFill {
/Tile8x8 {/PaintType 2 /PatternType 1 /TilingType 1 /BBox [0 0 8 8] /XStep 8 /YStep 8}
bind def
/KeepColor {currentrgbcolor [/Pattern /DeviceRGB] setcolorspace} bind def
<< Tile8x8
/PaintProc {0.5 setlinewidth pop 0 0 M 8 8 L 0 8 M 8 0 L stroke}
>> matrix makepattern
/Pat1 exch def
<< Tile8x8
/PaintProc {0.5 setlinewidth pop 0 0 M 8 8 L 0 8 M 8 0 L stroke
0 4 M 4 8 L 8 4 L 4 0 L 0 4 L stroke}
>> matrix makepattern
/Pat2 exch def
<< Tile8x8
/PaintProc {0.5 setlinewidth pop 0 0 M 0 8 L
8 8 L 8 0 L 0 0 L fill}
>> matrix makepattern
/Pat3 exch def
<< Tile8x8
/PaintProc {0.5 setlinewidth pop -4 8 M 8 -4 L
0 12 M 12 0 L stroke}
>> matrix makepattern
/Pat4 exch def
<< Tile8x8
/PaintProc {0.5 setlinewidth pop -4 0 M 8 12 L
0 -4 M 12 8 L stroke}
>> matrix makepattern
/Pat5 exch def
<< Tile8x8
/PaintProc {0.5 setlinewidth pop -2 8 M 4 -4 L
0 12 M 8 -4 L 4 12 M 10 0 L stroke}
>> matrix makepattern
/Pat6 exch def
<< Tile8x8
/PaintProc {0.5 setlinewidth pop -2 0 M 4 12 L
0 -4 M 8 12 L 4 -4 M 10 8 L stroke}
>> matrix makepattern
/Pat7 exch def
<< Tile8x8
/PaintProc {0.5 setlinewidth pop 8 -2 M -4 4 L
12 0 M -4 8 L 12 4 M 0 10 L stroke}
>> matrix makepattern
/Pat8 exch def
<< Tile8x8
/PaintProc {0.5 setlinewidth pop 0 -2 M 12 4 L
-4 0 M 12 8 L -4 4 M 8 10 L stroke}
>> matrix makepattern
/Pat9 exch def
/Pattern1 {PatternBgnd KeepColor Pat1 setpattern} bind def
/Pattern2 {PatternBgnd KeepColor Pat2 setpattern} bind def
/Pattern3 {PatternBgnd KeepColor Pat3 setpattern} bind def
/Pattern4 {PatternBgnd KeepColor Landscape {Pat5} {Pat4} ifelse setpattern} bind def
/Pattern5 {PatternBgnd KeepColor Landscape {Pat4} {Pat5} ifelse setpattern} bind def
/Pattern6 {PatternBgnd KeepColor Landscape {Pat9} {Pat6} ifelse setpattern} bind def
/Pattern7 {PatternBgnd KeepColor Landscape {Pat8} {Pat7} ifelse setpattern} bind def
} def
%
%
%End of PostScript Level 2 code
%
/PatternBgnd {
TransparentPatterns {} {gsave 1 setgray fill grestore} ifelse
} def
%
% Substitute for Level 2 pattern fill codes with
% grayscale if Level 2 support is not selected.
%
/Level1PatternFill {
/Pattern1 {0.250 Density} bind def
/Pattern2 {0.500 Density} bind def
/Pattern3 {0.750 Density} bind def
/Pattern4 {0.125 Density} bind def
/Pattern5 {0.375 Density} bind def
/Pattern6 {0.625 Density} bind def
/Pattern7 {0.875 Density} bind def
} def
%
% Now test for support of Level 2 code
%
Level1 {Level1PatternFill} {Level2PatternFill} ifelse
%
/Symbol-Oblique /Symbol findfont [1 0 .167 1 0 0] makefont
dup length dict begin {1 index /FID eq {pop pop} {def} ifelse} forall
currentdict end definefont pop
%
/Metrics {ExtendTextBox Gswidth} def
/Lwidth {currentpoint stroke M 0 vshift R Metrics} def
/Rwidth {currentpoint stroke M dup stringwidth pop neg vshift R Metrics} def
/Cwidth {currentpoint stroke M dup stringwidth pop -2 div vshift R Metrics} def
/GLwidth {currentpoint stroke M 0 vshift R {ExtendTextBox} forall} def
/GRwidth {currentpoint stroke M dup Gwidth vshift R {ExtendTextBox} forall} def
/GCwidth {currentpoint stroke M dup Gwidth 2 div vshift R {ExtendTextBox} forall} def
/GLwidth2 {0 Gwidth AddGlyphWidth} def
/GRwidth2 {Gwidth -1 mul 0 AddGlyphWidth} def
/GCwidth2 {Gwidth 2 div dup -1 mul AddGlyphWidth} def
/AddGlyphWidth { dup TBx2 gt {userdict /TBx2 3 -1 roll put} {pop} ifelse
dup TBx1 lt {userdict /TBx1 3 -1 roll put} {pop} ifelse } def
/MFshow {
{ dup 5 get 3 ge
{ 5 get 3 eq {gsave} {grestore} ifelse }
{dup dup 0 get findfont exch 1 get scalefont setfont
[ currentpoint ] exch dup 2 get 0 exch R dup 5 get 2 ne {dup dup 6
get exch 4 get {textshow} {Metrics pop 0 R} ifelse }if dup 5 get 0 eq
{dup 3 get {2 get neg 0 exch R pop} {pop aload pop M} ifelse} {dup 5
get 1 eq {dup 2 get exch dup 3 get exch 6 get Gswidth pop -2 div
dup 0 R} {dup 6 get Gswidth pop -2 div 0 R 6 get
textshow 2 index {aload pop M neg 3 -1 roll neg R pop pop} {pop pop pop
pop aload pop M} ifelse }ifelse }ifelse }
ifelse }
forall} def
/Gswidth {dup type /stringtype eq {stringwidth} {pop (n) stringwidth} ifelse} def
/MFwidth {0 exch { dup 5 get 3 ge { 5 get 3 eq { 0 } { pop } ifelse }
{dup 3 get{dup dup 0 get findfont exch 1 get scalefont setfont
6 get Gswidth pop add} {pop} ifelse} ifelse} forall} def
/MLshow { currentpoint stroke M
0 exch R
Blacktext {gsave 0 setgray MFshow grestore} {MFshow} ifelse } bind def
/MRshow { currentpoint stroke M
exch dup MFwidth neg 3 -1 roll R
Blacktext {gsave 0 setgray MFshow grestore} {MFshow} ifelse } bind def
/MCshow { currentpoint stroke M
exch dup MFwidth -2 div 3 -1 roll R
Blacktext {gsave 0 setgray MFshow grestore} {MFshow} ifelse } bind def
/XYsave { [( ) 1 2 true false 3 ()] } bind def
/XYrestore { [( ) 1 2 true false 4 ()] } bind def
Level1 SuppressPDFMark or
{} {
/SDict 10 dict def
systemdict /pdfmark known not {
userdict /pdfmark systemdict /cleartomark get put
} if
SDict begin [
/Title (test.eps)
/Subject (gnuplot plot)
/Creator (gnuplot 5.2 patchlevel 2)
% /Producer (gnuplot)
% /Keywords ()
/CreationDate (Tue Apr 6 14:42:54 2021)
/DOCINFO pdfmark
end
} ifelse
%
% Support for boxed text - Ethan A Merritt Sep 2016
%
/InitTextBox { userdict /TBy2 3 -1 roll put userdict /TBx2 3 -1 roll put
userdict /TBy1 3 -1 roll put userdict /TBx1 3 -1 roll put
/Boxing true def } def
/ExtendTextBox { dup type /stringtype eq
{ Boxing { gsave dup false charpath pathbbox
dup TBy2 gt {userdict /TBy2 3 -1 roll put} {pop} ifelse
dup TBx2 gt {userdict /TBx2 3 -1 roll put} {pop} ifelse
dup TBy1 lt {userdict /TBy1 3 -1 roll put} {pop} ifelse
dup TBx1 lt {userdict /TBx1 3 -1 roll put} {pop} ifelse
grestore } if }
{} ifelse} def
/PopTextBox { newpath TBx1 TBxmargin sub TBy1 TBymargin sub M
TBx1 TBxmargin sub TBy2 TBymargin add L
TBx2 TBxmargin add TBy2 TBymargin add L
TBx2 TBxmargin add TBy1 TBymargin sub L closepath } def
/DrawTextBox { PopTextBox stroke /Boxing false def} def
/FillTextBox { gsave PopTextBox fill grestore /Boxing false def} def
0 0 0 0 InitTextBox
/TBxmargin 20 def
/TBymargin 20 def
/Boxing false def
/textshow { ExtendTextBox Gshow } def
%
end
%%EndProlog
%%Page: 1 1
gnudict begin
gsave
doclip
50 50 translate
0.050 0.050 scale
0 setgray
newpath
(Helvetica) findfont 140 scalefont setfont
BackgroundColor 0 lt 3 1 roll 0 lt exch 0 lt or or not {BackgroundColor C 1.000 0 0 7200.00 5040.00 BoxColFill} if
/Helvetica findfont 140 scalefont setfont
/vshift -46 def
1.000 UL
LTb
LCb setrgbcolor
546 280 M
63 0 V
6338 0 R
-63 0 V
stroke
462 280 M
[ [(Helvetica) 140.0 0.0 true true 0 ( 1)]
] -46.7 MRshow
1.000 UL
LTb
LCb setrgbcolor
546 975 M
31 0 V
6370 0 R
-31 0 V
546 1382 M
31 0 V
6370 0 R
-31 0 V
546 1670 M
31 0 V
6370 0 R
-31 0 V
546 1894 M
31 0 V
6370 0 R
-31 0 V
546 2077 M
31 0 V
6370 0 R
-31 0 V
546 2232 M
31 0 V
6370 0 R
-31 0 V
546 2366 M
31 0 V
6370 0 R
-31 0 V
546 2484 M
31 0 V
6370 0 R
-31 0 V
546 2590 M
63 0 V
6338 0 R
-63 0 V
stroke
462 2590 M
[ [(Helvetica) 140.0 0.0 true true 0 ( 10)]
] -46.7 MRshow
1.000 UL
LTb
LCb setrgbcolor
546 3285 M
31 0 V
6370 0 R
-31 0 V
546 3691 M
31 0 V
6370 0 R
-31 0 V
546 3980 M
31 0 V
6370 0 R
-31 0 V
546 4204 M
31 0 V
6370 0 R
-31 0 V
546 4387 M
31 0 V
6370 0 R
-31 0 V
546 4541 M
31 0 V
6370 0 R
-31 0 V
546 4675 M
31 0 V
6370 0 R
-31 0 V
546 4793 M
31 0 V
6370 0 R
-31 0 V
546 4899 M
63 0 V
6338 0 R
-63 0 V
stroke
462 4899 M
[ [(Helvetica) 140.0 0.0 true true 0 ( 100)]
] -46.7 MRshow
1.000 UL
LTb
LCb setrgbcolor
546 280 M
0 63 V
0 4556 R
0 -63 V
stroke
546 140 M
[ [(Helvetica) 140.0 0.0 true true 0 ( 1)]
] -46.7 MCshow
1.000 UL
LTb
LCb setrgbcolor
1680 280 M
0 31 V
0 4588 R
0 -31 V
2344 280 M
0 31 V
0 4588 R
0 -31 V
2814 280 M
0 31 V
0 4588 R
0 -31 V
3179 280 M
0 31 V
0 4588 R
0 -31 V
3478 280 M
0 31 V
0 4588 R
0 -31 V
3730 280 M
0 31 V
0 4588 R
0 -31 V
3948 280 M
0 31 V
0 4588 R
0 -31 V
4141 280 M
0 31 V
0 4588 R
0 -31 V
4314 280 M
0 63 V
0 4556 R
0 -63 V
stroke
4314 140 M
[ [(Helvetica) 140.0 0.0 true true 0 ( 10)]
] -46.7 MCshow
1.000 UL
LTb
LCb setrgbcolor
5448 280 M
0 31 V
0 4588 R
0 -31 V
6111 280 M
0 31 V
0 4588 R
0 -31 V
6582 280 M
0 31 V
0 4588 R
0 -31 V
6947 280 M
0 31 V
0 4588 R
0 -31 V
stroke
LTB
LCb setrgbcolor
546 4899 N
546 280 L
6401 0 V
0 4619 V
-6401 0 V
Z stroke
1.000 UP
1.000 UL
LTb
LCb setrgbcolor
% Begin plot #1
1.000 UP
1.000 UL
LTb
LCb setrgbcolor
/Helvetica findfont 140 scalefont setfont
LCb setrgbcolor
6296 4766 M
('test.dat') Rshow
1.000 UP
1.000 UL
LTb
LCb setrgbcolor
546 280 Pls
4314 2590 Pls
5448 3285 Pls
6947 4899 Pls
6579 4766 Pls
% End plot #1
2.000 UL
LTb
LCb setrgbcolor
1.000 UL
LTB
LCb setrgbcolor
546 4899 N
546 280 L
6401 0 V
0 4619 V
-6401 0 V
Z stroke
1.000 UP
1.000 UL
LTb
LCb setrgbcolor
stroke
grestore
end
showpage
%%Trailer
%%DocumentFonts: Helvetica