|
| 1 | +Proof of Concept |
| 2 | +---------------- |
| 3 | +This directory's [main program](./main.f90) defines an application in the form |
| 4 | +of a FEATS `application_t` object containing |
| 5 | + |
| 6 | +1. A directed acyclic graph (DAG) encapsulated in a `dag_t` object provided by |
| 7 | + the [dag] library and |
| 8 | +2. An array of FEATS `task_t` objects capturing information about tasks that |
| 9 | + that the scheduler image assigns to compute images in an order that respects |
| 10 | + the dependencies described in the DAG. |
| 11 | + |
| 12 | +The DAG in this example represents the module dependencies within the FEATS |
| 13 | +source code as described in the diagram at the bottom of this page. |
| 14 | + |
| 15 | +The motivating use case is enabling the Fortran Package Manager ([`fpm`]) to |
| 16 | +perform parallel builds. In this proof concept, each task simply sleeps to pass |
| 17 | +a randomly chosen period of time. (No actual software compiling happens.) See |
| 18 | +below for the command used to run this example with present working directory |
| 19 | +set to the top directory in the FEATS source tree. Also below is sample output. |
| 20 | +The task completion order and image/task pairings will vary from one execution |
| 21 | +of the first command to the next execution of the same command. |
| 22 | + |
| 23 | +``` |
| 24 | +fpm run --example --compiler caf --runner "cafrun -n 4" |
| 25 | +Executing task number: 2 on image number: 3 |
| 26 | +Executing task number: 1 on image number: 4 |
| 27 | +Executing task number: 3 on image number: 2 |
| 28 | +Compiling: dag_m |
| 29 | +Executing task number: 4 on image number: 3 |
| 30 | +Compiling: assert_m |
| 31 | +Executing task number: 5 on image number: 4 |
| 32 | +Compiling: payload_m |
| 33 | +Executing task number: 6 on image number: 2 |
| 34 | +Compiling: data_loc_map_m |
| 35 | +Compiling: task_m |
| 36 | +Executing task number: 15 on image number: 2 |
| 37 | +Executing task number: 7 on image number: 4 |
| 38 | +Compiling: compile_m |
| 39 | +Executing task number: 13 on image number: 3 |
| 40 | +Compiling: task_item_m |
| 41 | +Executing task number: 8 on image number: 4 |
| 42 | +Compiling: app_m |
| 43 | +Executing task number: 9 on image number: 4 |
| 44 | +Compiling: data_loc_map_s |
| 45 | +Executing task number: 10 on image number: 2 |
| 46 | +Compiling: compile_s |
| 47 | +Executing task number: 12 on image number: 3 |
| 48 | +Compiling: app_generator_m |
| 49 | +Executing task number: 14 on image number: 4 |
| 50 | +Compiling: task_item_s |
| 51 | +Executing task number: 16 on image number: 3 |
| 52 | +Compiling: image_m |
| 53 | +Executing task number: 11 on image number: 2 |
| 54 | +Compiling: app_generator_s |
| 55 | +Executing task number: 17 on image number: 4 |
| 56 | +Compiling: main |
| 57 | +Executing task number: 18 on image number: 2 |
| 58 | +Compiling: payload_s |
| 59 | +Executing task number: 20 on image number: 3 |
| 60 | +Compiling: mailbox_m |
| 61 | +Compiling: app_s |
| 62 | +Executing task number: 19 on image number: 4 |
| 63 | +Compiling: image_s |
| 64 | +Compiling: final_task_m |
| 65 | +Executing task number: 21 on image number: 4 |
| 66 | +Compiling: final_task_s |
| 67 | +``` |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | +[`fpm`]: https://github.com/fortran-lang/fpm |
| 72 | +[dag]: https://github.com/sourceryinstitute/dag |
0 commit comments