# Let’s compare two different vendors

This is the code: compute pi (It is not my code)

## Machine

- Intel Core i5 10th gen, 16GB RAM.
- GNU Fortran (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0.
- ifort version 2021.1

## Let’s compile

```
$ caf -ffree-form -fcoarray=lib -O3 coarrays.f -o coarray_gfort
$ ifort -free -coarray -O3 coarrays.f -o coarray_ifort
```

# Run the program

## GFortran results

Let’s run it several times to find out a patron (this is just one of many results)

```
$ time cafrun -np 8 ./coarray_gfort
number of Fortran coarray images: 8
approximating pi in 2000000 steps.
pi: 3.1415926535897931 iterated pi: 3.1395227456008259
pi error 0.207E-02
Elapsed wall clock time 0.475E-02 seconds, using 8 images.
real 0m0,047s
user 0m0,106s
sys 0m0,096s
```

## Intel Fortran results

```
$ time ./coarray_ifort
number of Fortran coarray images: 8
approximating pi in 2000000 steps.
pi: 3.14159265358979 iterated pi: 3.13952274560078
pi error 0.207E-02
Elapsed wall clock time 0.224E-02 seconds, using 8 images.
real 0m0,081s
user 0m0,166s
sys 0m0,192s
```

# My questions

Although elapsed time calculated by code is better with Intel Fortran, the operative system says the GFortran program ran faster. Is this ok for you? Am I doing something wrong? I am not able to interpret results.