autonomic performance environment for exascale (apex)khuck/apex_docs/doc/refman.pdfautonomic...

84
Autonomic Performance Environment for eXascale (APEX) 2.20.0 Generated by Doxygen 1.8.17

Upload: others

Post on 31-Jul-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

Autonomic Performance Environment for eXascale (APEX)2.20.0

Generated by Doxygen 1.8.17

Page 2: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016
Page 3: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

i

1 APEX: Autonomic Performance Environment for eXascale 1

1.1 Copyright . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1.2 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

1.3 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

1.3.1 Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

1.4 User Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

1.5 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2 Namespace Index 5

2.1 Namespace List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

3 Class Index 7

3.1 Class List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

4 File Index 9

4.1 File List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

5 Namespace Documentation 11

5.1 apex Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

5.1.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

5.1.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

5.1.2.1 cleanup() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

5.1.2.2 custom_event() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

5.1.2.3 deregister_policy() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

5.1.2.4 dump() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

5.1.2.5 exit_thread() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

5.1.2.6 finalize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

5.1.2.7 get_best_values() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

5.1.2.8 get_profile() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

5.1.2.9 get_profile() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

5.1.2.10 get_thread_cap() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

5.1.2.11 get_tunable_params() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

5.1.2.12 has_session_converged() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

5.1.2.13 init() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

5.1.2.14 new_task() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

5.1.2.15 new_task() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

5.1.2.16 null_task_wrapper() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

5.1.2.17 print_options() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

5.1.2.18 recv() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

5.1.2.19 register_custom_event() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

5.1.2.20 register_periodic_policy() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

5.1.2.21 register_policy() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

5.1.2.22 register_policy() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

5.1.2.23 register_thread() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

Generated by Doxygen

Page 4: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

ii

5.1.2.24 reset() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

5.1.2.25 reset() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

5.1.2.26 resume() [1/3] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

5.1.2.27 resume() [2/3] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

5.1.2.28 resume() [3/3] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

5.1.2.29 sample_runtime_counter() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

5.1.2.30 sample_value() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

5.1.2.31 send() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

5.1.2.32 set_state() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

5.1.2.33 set_thread_cap() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

5.1.2.34 setup_custom_tuning() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

5.1.2.35 setup_custom_tuning() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

5.1.2.36 setup_power_cap_throttling() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

5.1.2.37 setup_throughput_tuning() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

5.1.2.38 setup_timer_throttling() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

5.1.2.39 setup_timer_throttling() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

5.1.2.40 shutdown_throttling() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

5.1.2.41 start() [1/3] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

5.1.2.42 start() [2/3] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

5.1.2.43 start() [3/3] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

5.1.2.44 stop() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

5.1.2.45 stop() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

5.1.2.46 stop_all_async_threads() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

5.1.2.47 update_task() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

5.1.2.48 update_task() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

5.1.2.49 version() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

5.1.2.50 yield() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

5.1.2.51 yield() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

6 Class Documentation 37

6.1 apex_event_type Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

6.1.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

6.2 apex_profiler_type Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

6.2.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

6.3 apex::scoped_thread Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

6.3.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

6.3.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

6.3.2.1 scoped_thread() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

6.4 apex::scoped_timer Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

6.4.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

6.4.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

6.4.2.1 scoped_timer() [1/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

Generated by Doxygen

Page 5: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

iii

6.4.2.2 scoped_timer() [2/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

6.4.2.3 scoped_timer() [3/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

6.4.2.4 scoped_timer() [4/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

6.4.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

6.4.3.1 resume() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

6.4.3.2 start() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

6.4.3.3 stop() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

6.4.3.4 yield() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

6.5 apex::task_wrapper Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

6.5.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

6.5.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

6.5.2.1 get_apex_main_wrapper() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

6.5.2.2 get_task_id() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

7 File Documentation 43

7.1 /Users/khuck/src/xpress-apex/doc/apex.dox File Reference . . . . . . . . . . . . . . . . . . . . . . 43

7.2 /Users/khuck/src/xpress-apex/src/apex/apex.h File Reference . . . . . . . . . . . . . . . . . . . . . 43

7.2.1 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

7.2.1.1 apex_cleanup() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

7.2.1.2 apex_current_power_high() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

7.2.1.3 apex_custom_event() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

7.2.1.4 apex_deregister_policy() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

7.2.1.5 apex_dump() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

7.2.1.6 apex_exit_thread() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

7.2.1.7 apex_finalize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

7.2.1.8 apex_get_profile() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

7.2.1.9 apex_get_thread_cap() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

7.2.1.10 apex_hardware_concurrency() . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

7.2.1.11 apex_init() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

7.2.1.12 apex_new_task() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

7.2.1.13 apex_print_options() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

7.2.1.14 apex_recv() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

7.2.1.15 apex_register_custom_event() . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

7.2.1.16 apex_register_periodic_policy() . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

7.2.1.17 apex_register_policy() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

7.2.1.18 apex_register_thread() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

7.2.1.19 apex_reset() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

7.2.1.20 apex_resume() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

7.2.1.21 apex_resume_guid() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

7.2.1.22 apex_sample_value() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

7.2.1.23 apex_send() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

7.2.1.24 apex_set_state() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

Generated by Doxygen

Page 6: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

iv

7.2.1.25 apex_set_thread_cap() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

7.2.1.26 apex_setup_power_cap_throttling() . . . . . . . . . . . . . . . . . . . . . . . . . 55

7.2.1.27 apex_setup_throughput_tuning() . . . . . . . . . . . . . . . . . . . . . . . . . . 56

7.2.1.28 apex_setup_timer_throttling() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

7.2.1.29 apex_shutdown_throttling() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

7.2.1.30 apex_start() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

7.2.1.31 apex_start_guid() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

7.2.1.32 apex_stop() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

7.2.1.33 apex_version() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

7.2.1.34 apex_yield() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

7.3 /Users/khuck/src/xpress-apex/src/apex/apex_api.hpp File Reference . . . . . . . . . . . . . . . . . 60

7.3.1 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

7.3.1.1 APEX_SCOPED_TIMER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

7.4 /Users/khuck/src/xpress-apex/src/apex/apex_types.h File Reference . . . . . . . . . . . . . . . . . 63

7.4.1 Class Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

7.4.1.1 struct _policy_handle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

7.4.1.2 struct _context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

7.4.1.3 struct _profile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

7.4.2 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

7.4.2.1 APEX_DEFAULT_OTF2_ARCHIVE_NAME . . . . . . . . . . . . . . . . . . . . . 65

7.4.2.2 APEX_DEFAULT_OTF2_ARCHIVE_PATH . . . . . . . . . . . . . . . . . . . . . . 65

7.4.2.3 APEX_IDLE_RATE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

7.4.2.4 APEX_IDLE_TIME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

7.4.2.5 APEX_MAX_EVENTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

7.4.2.6 APEX_NON_IDLE_TIME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

7.4.2.7 APEX_NULL_FUNCTION_ADDRESS . . . . . . . . . . . . . . . . . . . . . . . . 66

7.4.2.8 APEX_NULL_PROFILER_HANDLE . . . . . . . . . . . . . . . . . . . . . . . . . 66

7.4.3 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

7.4.3.1 apex_function_address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

7.4.3.2 apex_policy_function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

7.4.3.3 apex_profiler_handle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

7.4.3.4 apex_tuning_session_handle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

7.4.4 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

7.4.4.1 _apex_profiler_type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

7.4.4.2 _error_codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

7.4.4.3 _event_type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

7.4.4.4 _profile_type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

7.4.4.5 _thread_state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

7.4.4.6 apex_optimization_criteria_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

7.4.4.7 apex_optimization_method_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

7.5 /Users/khuck/src/xpress-apex/src/comm/apex_global.h File Reference . . . . . . . . . . . . . . . . 69

7.5.1 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

Generated by Doxygen

Page 7: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

v

7.5.1.1 action_apex_get_value() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

7.5.1.2 action_apex_reduce() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

7.5.1.3 apex_global_setup() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

7.5.1.4 apex_periodic_policy_func() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

Index 73

Generated by Doxygen

Page 8: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016
Page 9: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

Chapter 1

APEX: Autonomic Performance Environment foreXascale

1.1 Copyright

*************************************************************************

APEX - Autonomic Performance Environment for eXascale

sub-project of:

Phylanx - A Distributed Array Toolkithttp://phylanx.stellar-group.orgHPX - High Performance ParalleXhttp://stellar.cct.lsu.edu/projects/hpx/eXascale PRogramming Environment and System Software (XPRESS)http://xstack.sandia.gov/xpress/

*************************************************************************

Copyright 2013-2020

Department of Computer and Information Science, University of Oregonand partner institutions:

Sandia National Laboratories (XPRESS)Indiana University (XPRESS)Lawrence Berkeley National Laboratory (XPRESS)Louisiana State University (XPRESS, HPX, Phylanx)Oak Ridge National Laboratory (XPRESS)University of Arizona (Phylanx)University of Houston (XPRESS)University of North Carolina (XPRESS)

All Rights Reserved.

*************************************************************************

Permission to use, copy, modify, and distribute this software and itsdocumentation for any purpose and without fee is hereby granted, provided thatthe above copyright notice appear in all copies and that both that copyrightnotice and this permission notice appear in supporting documentation, and thatthe name of University of Oregon (UO) and all partner institutions not be usedin advertising or publicity pertaining to distribution of the software withoutspecific, written prior permission. The University of Oregon and partnerinstitutions make no representations about the suitability of this software forany purpose. It is provided "as is" without express or implied warranty.

THE UNIVERSITY OF OREGON AND PARTNER INSTITUTIONS DISCLAIM ALL WARRANTIES WITHREGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY

Page 10: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

2 APEX: Autonomic Performance Environment for eXascale

AND FITNESS, IN NO EVENT SHALL THE UNIVERSITY OF OREGON OR PARTNER INSTITUTIONSBE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGESWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OFCONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTIONWITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

***************************************************************************

1.2 Overview

One of the key components of the XPRESS project is a new approach to performance observation, measurement,analysis and runtime decision making in order to optimize performance. The particular challenges of accuratelymeasuring the performance characteristics of ParalleX applications requires a new approach to parallel performanceobservation. The standard model of multiple operating system processes and threads observing themselves in afirst-person manner while writing out performance profiles or traces for offline analysis will not adequately capturethe full execution context, nor provide opportunities for runtime adaptation within OpenX. The approach taken inthe XPRESS project is a new performance measurement system, called (Autonomic Performance Environmentfor eXascale). APEX will include methods for information sharing between the layers of the software stack, fromthe hardware through operating and runtime systems, all the way to domain specific or legacy applications. Theperformance measurement components will incorporate relevant information across stack layers, with merging ofthird-person performance observation of node-level and global resources, remote processes, and both operatingand runtime system threads.

1.3 Introduction

1.3.1 Interfaces

Essentially, APEX is both a measurement system for introspection, as well as a Policy Engine for modifying runtimebehavior based on the observations. While APEX has capabilities for generating profile data for post-mortemanalysis, the key purpose of the measurement is to provide support for policy enforcement. To that end, APEX isdesigned to have very low overhead and minimize perturbation of runtime worker thread productivity. APEX supportsboth start/stop timers and either event-based or periodic counter samples. Measurements are taken synchronously,but profiling statistics and internal state management is performed by (preferably lower-priority) threads distinct fromthe running application. The heart of APEX is an event handler that dispatches events to registered listeners withinAPEX. Policy enforcement can trigger synchronously when events are triggered by the OS/RS or application, or canoccur asynchronously on a periodic basis.

APEX is a library written in C++, and has both C and C++ external interfaces. While the C interface can be usedfor either language, some C++ applications prefer to work with namespaces (i.e. apex::∗) rather than prefixes (i.e.apex_∗). All functionality is supported through both interfaces, and the C interface contains inlined implementationsof the C++ code.

While the designed purpose for APEX is supporting the current and future needs of ParalleX runtimes within theXPRESS project (such as HPX3, HPX5), experimental support is also available for introspection of current runtimessuch as OpenMP. APEX could potentially be integrated into other runtime systems, such as any of a number oflightweight task based systems. The introspection provided by APEX is intended to be in the third-person model,rather than traditional first-person, per-thread/per-process application profile or tracing measurement. APEX isdesigned to combine information from the OS, Runtime, hardware and application in order to guide policy decisions.

For distributed communication, APEX provides an API to be implemented for the required communication for a givenapplication. An MPI implementation is provided as a reference, and both HPX3 and HPX5 implementations havebeen implemented. In this way, APEX is integrated into the observed runtime, and asyncrhonous communication isprovided at a lower priority, in order to minimize perturbation of the application.

The direct links to each API are here:

Generated by Doxygen

Page 11: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

1.4 User Manual 3

• C API : apex.h

• C++ API : apex

1.4 User Manual

For a complete user manual, please see the APEX documentation.

1.5 Acknowledgements

Support for this work was provided through Scientific Discovery through Advanced Computing (SciDAC) programfunded by U.S. Department of Energy, Office of Science, Advanced Scientific Computing Research (and BasicEnergy Sciences/Biological and Environmental Research/High Energy Physics/Fusion Energy Sciences/NuclearPhysics) under award numbers DE-SC0008638, DE-SC0008704, DE-FG02-11ER26050 and DE-SC0006925.

Generated by Doxygen

Page 12: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

4 APEX: Autonomic Performance Environment for eXascale

Generated by Doxygen

Page 13: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

Chapter 2

Namespace Index

2.1 Namespace List

Here is a list of all documented namespaces with brief descriptions:

apexThe main APEX namespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

Page 14: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

6 Namespace Index

Generated by Doxygen

Page 15: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

Chapter 3

Class Index

3.1 Class List

Here are the classes, structs, unions and interfaces with brief descriptions:

apex_event_typeTypedef for enumerating the different event types . . . . . . . . . . . . . . . . . . . . . . . . 37

apex_profiler_typeTypedef for enumerating the different timer types . . . . . . . . . . . . . . . . . . . . . . . . 37

apex::scoped_threadA convenience class for creating a scoped thread . . . . . . . . . . . . . . . . . . . . . . . . 38

apex::scoped_timerA convenience class for using APEX in C++ applications . . . . . . . . . . . . . . . . . . . . 38

apex::task_wrapperA wrapper around APEX tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

Page 16: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

8 Class Index

Generated by Doxygen

Page 17: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

Chapter 4

File Index

4.1 File List

Here is a list of all documented files with brief descriptions:

/Users/khuck/src/xpress-apex/src/apex/apex.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43/Users/khuck/src/xpress-apex/src/apex/apex_api.hpp . . . . . . . . . . . . . . . . . . . . . . . . . . . 60/Users/khuck/src/xpress-apex/src/apex/apex_types.h . . . . . . . . . . . . . . . . . . . . . . . . . . . 63/Users/khuck/src/xpress-apex/src/apex/task_wrapper.hpp . . . . . . . . . . . . . . . . . . . . . . . . ??/Users/khuck/src/xpress-apex/src/comm/apex_global.h . . . . . . . . . . . . . . . . . . . . . . . . . . 69

Page 18: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

10 File Index

Generated by Doxygen

Page 19: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

Chapter 5

Namespace Documentation

5.1 apex Namespace Reference

The main APEX namespace.

Classes

• class scoped_thread

A convenience class for creating a scoped thread.

• class scoped_timer

A convenience class for using APEX in C++ applications.

• struct task_wrapper

A wrapper around APEX tasks.

Functions

• static std::shared_ptr< task_wrapper > null_task_wrapper (nullptr)

declare a default "null" pointer for std::shared_ptr<task_wrapper>& references

• uint64_t init (const char ∗thread_name, const uint64_t comm_rank, const uint64_t comm_size)

Intialize APEX.

• std::string dump (bool reset)

Dump output from APEX.

• void finalize (void)

Finalize APEX.

• void cleanup (void)

Cleanup APEX.

• profiler ∗ start (const std::string &timer_name)

Start a timer.

• profiler ∗ start (const apex_function_address function_address)

Start a timer.

• void start (std::shared_ptr< task_wrapper > task_wrapper_ptr)

Start a timer.

• void stop (profiler ∗the_profiler, bool cleanup=true)

Stop a timer.

Page 20: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

12 Namespace Documentation

• void stop (std::shared_ptr< task_wrapper > task_wrapper_ptr)

Stop a timer.

• void yield (profiler ∗the_profiler)

Stop a timer, but don't increment the number of calls.

• void yield (std::shared_ptr< task_wrapper > task_wrapper_ptr)

Stop a timer, but don't increment the number of calls.

• profiler ∗ resume (const std::string &timer_name)

Resume a timer.

• profiler ∗ resume (const apex_function_address function_address)

Resume a timer.

• void resume (std::shared_ptr< task_wrapper > task_wrapper_ptr)

Resume a timer.

• void reset (const std::string &timer_name)

Reset a timer or counter.

• void reset (apex_function_address function_address)

Reset a timer.

• void set_state (apex_thread_state state)

Set the thread state.

• void sample_value (const std::string &name, double value)

Sample a state value.

• std::shared_ptr< task_wrapper > new_task (const std::string &name, const uint64_t task_id=UINTMAX_←↩

MAX, const std::shared_ptr< apex::task_wrapper > parent_task=null_task_wrapper)

Create a new task (dependency).

• std::shared_ptr< task_wrapper > new_task (const apex_function_address function_address, const uint64←↩

_t task_id=UINTMAX_MAX, const std::shared_ptr< apex::task_wrapper > parent_task=null_task_wrapper)

Create a new task (dependency).

• std::shared_ptr< task_wrapper > update_task (std::shared_ptr< task_wrapper > wrapper, const std::string&name)

Update a task (dependency).

• std::shared_ptr< task_wrapper > update_task (std::shared_ptr< task_wrapper > wrapper, constapex_function_address function_address)

Update a task wrapper (dependency).

• apex_event_type register_custom_event (const std::string &name)

Register an event type with APEX.

• void custom_event (apex_event_type event_type, void ∗custom_data)

Trigger a custom event.

• std::string & version (void)

Return the APEX version.

• void register_thread (const std::string &name)

Register a new thread.

• void exit_thread (void)

Exit a thread.

• apex_policy_handle ∗ register_policy (const apex_event_type when, std::function< int(apex_context const&)> f)

Register a policy with APEX.

• std::set< apex_policy_handle ∗ > register_policy (std::set< apex_event_type > when, std::function<int(apex_context const &)> f)

Register a policy with APEX.

• apex_policy_handle ∗ register_periodic_policy (unsigned long period, std::function< int(apex_context const&)> f)

Register a policy with APEX.

• apex_policy_handle ∗ sample_runtime_counter (unsigned long period, const std::string &counter_name)

Generated by Doxygen

Page 21: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

5.1 apex Namespace Reference 13

Periodically sample a runtime counter.

• void deregister_policy (apex_policy_handle ∗handle)

Deregister a policy with APEX.

• void stop_all_async_threads (void)

Stop all asynchronous APEX background threads.

• apex_profile ∗ get_profile (apex_function_address function_address)

Get the current profile for the specified function address.

• apex_profile ∗ get_profile (const std::string &timer_name)

Get the current profile for the specified function address.

• int setup_power_cap_throttling (void)

Initialize the power cap throttling policy.

• int setup_timer_throttling (apex_function_address the_address, apex_optimization_criteria_t criteria,apex_optimization_method_t method, unsigned long update_interval)

Setup throttling to optimize for the specified function.

• int setup_throughput_tuning (apex_function_address the_address, apex_optimization_criteria_t criteria,apex_event_type event_type, int num_inputs, long ∗∗inputs, long ∗mins, long ∗maxs, long ∗steps)

Setup throttling to optimize for the specified function, using multiple input criteria.

• apex_tuning_session_handle setup_custom_tuning (std::function< double(void)> metric, apex_event_typeevent_type, int num_inputs, long ∗∗inputs, long ∗mins, long ∗maxs, long ∗steps)

Setup tuning of specified parameters to optimize for a custom metric, using multiple input criteria.

• apex_tuning_session_handle setup_custom_tuning (apex_tuning_request &request)

Setup tuning of specified parameters to optimize for a custom metric, using multiple input criteria of potentially multipletypes.

• int setup_timer_throttling (const std::string &the_name, apex_optimization_criteria_t criteria, apex_optimization_method_tmethod, unsigned long update_interval)

Setup throttling to optimize for the specified function or counter.

• int shutdown_throttling (void)

Terminate the throttling policy.

• int get_thread_cap (void)

Get the current thread cap set by the throttling.

• void set_thread_cap (int new_cap)

Set the current thread cap for throttling.

• std::vector< std::pair< std::string, long ∗ > > & get_tunable_params (apex_tuning_session_handle h)

Return a vector of the current tunable parameters.

• bool has_session_converged (apex_tuning_session_handle handle)

Check whether a tuning session has converged.

• void get_best_values (apex_tuning_session_handle h)

Set a tuning session's values to the best known values.

• void print_options (void)

Print out all configuration settings for APEX.

• void send (uint64_t tag, uint64_t size, uint64_t target)

Notify APEX that the current thread is sending a parcel/message to another rank/locality/process.

• void recv (uint64_t tag, uint64_t size, uint64_t source_rank, uint64_t source_thread)

Notify APEX that the current thread is receiving a parcel/message from another rank/locality/process.

5.1.1 Detailed Description

The main APEX namespace.

The C++ interface for APEX uses the apex namespace. In comparison, The C interface has functions that start with"apex_".

Generated by Doxygen

Page 22: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

14 Namespace Documentation

5.1.2 Function Documentation

5.1.2.1 cleanup()

void apex::cleanup (

void )

Cleanup APEX.

Warning

For best results, this function should be explicitly called to free all memory allocated by APEX. If not explicitlycalled from the application or runtime, it will be automatically called when the APEX main singleton object isdestructed. apex::finalize will be automatically called from apex::cleanup if it has not yet been called.

The cleanup method will free all allocated memory for APEX.

Returns

No return value.

See also

apex::init apex::finalize

5.1.2.2 custom_event()

void apex::custom_event (

apex_event_type event_type,

void ∗ custom_data )

Trigger a custom event.

This function will pass a custom event to the APEX event listeners. Each listeners' custom event handler will handlethe custom event. Policy functions will be passed the custom event name in the event context.

Parameters

event_type The type of the custom event

custom_data Data specific to the custom event

Returns

No return value.

Generated by Doxygen

Page 23: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

5.1 apex Namespace Reference 15

See also

apex::register_custom_event

5.1.2.3 deregister_policy()

void apex::deregister_policy (

apex_policy_handle ∗ handle )

Deregister a policy with APEX.

This function will deregister the specified policy. In order to enable the policy again, it should be registered usingapex::register_policy or apex::register_periodic_policy.

Parameters

handle The handle of the policy to be deregistered.

See also

apex::register_policy, apex::register_periodic_policy

5.1.2.4 dump()

std::string apex::dump (

bool reset )

Dump output from APEX.

The stop measurement method will terminate all measurement and optionally:

• print a report to the screen

• write a profile to disk (if requested)

• output all other visualization data

Parameters

reset Whether to reset all statistics

Returns

a string containing the output

Generated by Doxygen

Page 24: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

16 Namespace Documentation

See also

apex::finalize

5.1.2.5 exit_thread()

void apex::exit_thread (

void )

Exit a thread.

For multithreaded applications, exit this thread and clean up.

Warning

Failure to exit a thread with APEX may invalidate statistics.

Returns

No return value.

5.1.2.6 finalize()

void apex::finalize (

void )

Finalize APEX.

The stop measurement method will terminate all measurement and optionally:

• print a report to the screen

• write a profile to disk (if requested)

Returns

No return value.

See also

apex::init

5.1.2.7 get_best_values()

void apex::get_best_values (

apex_tuning_session_handle h )

Set a tuning session's values to the best known values.

Generated by Doxygen

Page 25: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

5.1 apex Namespace Reference 17

Parameters

h The handle for the tuning session of interest.

5.1.2.8 get_profile() [1/2]

apex_profile∗ apex::get_profile (

apex_function_address function_address )

Get the current profile for the specified function address.

This function will return the current profile for the specified address. Because profiles are updated out-of-band, it ispossible that this profile value is out of date.

Parameters

function_address The address of the function.

Returns

The current profile for that timed function.

5.1.2.9 get_profile() [2/2]

apex_profile∗ apex::get_profile (

const std::string & timer_name )

Get the current profile for the specified function address.

This function will return the current profile for the specified address. Because profiles are updated out-of-band, it ispossible that this profile value is out of date. This profile can be either a timer or a sampled value.

Parameters

timer_name The name of the function

Returns

The current profile for that timed function or sampled value.

Generated by Doxygen

Page 26: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

18 Namespace Documentation

5.1.2.10 get_thread_cap()

int apex::get_thread_cap (

void )

Get the current thread cap set by the throttling.

This function will return the current thread cap based on the throttling policy.

Returns

The current thread cap value.

5.1.2.11 get_tunable_params()

std::vector<std::pair<std::string,long∗> >& apex::get_tunable_params (

apex_tuning_session_handle h )

Return a vector of the current tunable parameters.

Returns

A vector of pairs; the first element is the name of the tunable parameter, while the second is a pointer to itsvalue.

5.1.2.12 has_session_converged()

bool apex::has_session_converged (

apex_tuning_session_handle handle )

Check whether a tuning session has converged.

Parameters

handle The handle for the tuning session of interest.

Returns

true if the tuning session has converged, otherwise false

5.1.2.13 init()

uint64_t apex::init (

const char ∗ thread_name,

Generated by Doxygen

Page 27: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

5.1 apex Namespace Reference 19

const uint64_t comm_rank,

const uint64_t comm_size )

Intialize APEX.

Warning

For best results, this function should be called before any other APEX functions.

Use this version of apex::init when you do not have access to the input arguments.

Parameters

thread_name The name of the thread, or NULL. The lifetime of the thread will be timed with a timer using thissame name.

comm_rank The rank of this process within the full distributed application, i.e. MPI rank or HPX locality.

comm_size The total number of processes within the full distributed application, i.e. MPI comm_size ortotal number of HPX localities.

Returns

APEX_NOERROR on success, or APEX_ERROR on failure.

See also

apex::init apex::finalize

5.1.2.14 new_task() [1/2]

std::shared_ptr<task_wrapper> apex::new_task (

const apex_function_address function_address,

const uint64_t task_id = UINTMAX_MAX,

const std::shared_ptr< apex::task_wrapper > parent_task = null_task_wrapper )

Create a new task (dependency).

This function will note a task dependency between the current timer (task) and the new task.

Parameters

function_address The function address of the timer.task_id The ID of the task (default of -1 implies none provided by runtime)

parent_task The apex::task_wrapper (if available) that is the parent task of this task

Returns

pointer to an apex::task_wrapper object

Generated by Doxygen

Page 28: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

20 Namespace Documentation

5.1.2.15 new_task() [2/2]

std::shared_ptr<task_wrapper> apex::new_task (

const std::string & name,

const uint64_t task_id = UINTMAX_MAX,

const std::shared_ptr< apex::task_wrapper > parent_task = null_task_wrapper )

Create a new task (dependency).

This function will note a task dependency between the current timer (task) and the new task.

Parameters

name The name of the timer.task_id The ID of the task (default of UINTMAX_MAX implies none provided by runtime)

parent_task The apex::task_wrapper (if available) that is the parent task of this task

Returns

pointer to an apex::task_wrapper object

5.1.2.16 null_task_wrapper()

static std::shared_ptr<task_wrapper> apex::null_task_wrapper (

nullptr ) [static]

declare a default "null" pointer for std::shared_ptr<task_wrapper>& references

See also

apex::task_wrapper

5.1.2.17 print_options()

void apex::print_options (

void )

Print out all configuration settings for APEX.

5.1.2.18 recv()

void apex::recv (

uint64_t tag,

uint64_t size,

uint64_t source_rank,

uint64_t source_thread )

Notify APEX that the current thread is receiving a parcel/message from another rank/locality/process.

This method notifies APEX that the current thread is receiving a parcel/message from another rank/locality/process.The tag is meant to be an identifier for the message, not required to be unique. The source value is the APEX rankof the source of the message.

Generated by Doxygen

Page 29: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

5.1 apex Namespace Reference 21

Parameters

tag The message identifier

size The message size (in bytes)

source_rank The message source (as a rank/locality index)

source_thread The message source (as a worker index - 0 if unknown)

5.1.2.19 register_custom_event()

apex_event_type apex::register_custom_event (

const std::string & name )

Register an event type with APEX.

Create a user-defined event type for APEX.

Parameters

name The name of the custom event

Returns

The index of the custom event.

See also

apex::custom_event

5.1.2.20 register_periodic_policy()

apex_policy_handle∗ apex::register_periodic_policy (

unsigned long period,

std::function< int(apex_context const &)> f )

Register a policy with APEX.

Apex provides the ability to call an application-specified function periodically. This assigns the passed in function tobe called on a periodic basis. The context for the event will be passed to the registered function.

Parameters

period How frequently the function should be called (in microseconds)

f The function to be called when that event is handled by APEX.

Generated by Doxygen

Page 30: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

22 Namespace Documentation

Returns

A handle to the policy, to be stored if the policy is to be un-registered later.

5.1.2.21 register_policy() [1/2]

apex_policy_handle∗ apex::register_policy (

const apex_event_type when,

std::function< int(apex_context const &)> f )

Register a policy with APEX.

Apex provides the ability to call an application-specified function when certain events occur in the APEX library, orperiodically. This assigns the passed in function to the event, so that when that event occurs in APEX, the functionis called. The context for the event will be passed to the registered function.

Parameters

when The APEX event when this function should be calledf The function to be called when that event is handled by APEX.

Returns

A handle to the policy, to be stored if the policy is to be un-registered later.

See also

apex::deregister_policy, apex::register_periodic_policy

5.1.2.22 register_policy() [2/2]

std::set<apex_policy_handle∗> apex::register_policy (

std::set< apex_event_type > when,

std::function< int(apex_context const &)> f )

Register a policy with APEX.

Apex provides the ability to call an application-specified function when certain events occur in the APEX library, orperiodically. This assigns the passed in function to the event, so that when that event occurs in APEX, the functionis called. The context for the event will be passed to the registered function.

Parameters

when The set of APEX events when this function should be calledf The function to be called when that event is handled by APEX.

Generated by Doxygen

Page 31: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

5.1 apex Namespace Reference 23

Returns

A handle to the policy, to be stored if the policy is to be un-registered later.

See also

apex::deregister_policy, apex::register_periodic_policy

5.1.2.23 register_thread()

void apex::register_thread (

const std::string & name )

Register a new thread.

For multithreaded applications, register a new thread with APEX.

Warning

Failure to register a thread with APEX may invalidate statistics, and may prevent the ability to use timers orsampled values for this thread.

Parameters

name The name that will be assigned to the new thread.

Returns

No return value.

5.1.2.24 reset() [1/2]

void apex::reset (

apex_function_address function_address )

Reset a timer.

This function will reset the profile associated with the specified timer to zero.

Parameters

function_address The function address of the timer.

Generated by Doxygen

Page 32: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

24 Namespace Documentation

Returns

No return value.

5.1.2.25 reset() [2/2]

void apex::reset (

const std::string & timer_name )

Reset a timer or counter.

This function will reset the profile associated with the specified timer or counter name to zero.

Parameters

timer_name The name of the timer.

Returns

No return value.

See also

apex::get_profile

5.1.2.26 resume() [1/3]

profiler∗ apex::resume (

const apex_function_address function_address )

Resume a timer.

This function will create a profiler object in APEX, and return a handle to the object. The object will be associatedwith the address passed in to this function. The difference between this function and the apex::start function is thatthe number of calls to that timer will not be incremented.

Parameters

function_address The address of the function to be timed

Returns

The handle for the timer object in APEX. Not intended to be queried by the application. Should be retainedlocally, if possible, and passed in to the matching apex::stop call when the timer should be stopped.

Generated by Doxygen

Page 33: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

5.1 apex Namespace Reference 25

See also

apex::stop, apex::yield, apex::start

5.1.2.27 resume() [2/3]

profiler∗ apex::resume (

const std::string & timer_name )

Resume a timer.

This function will create a profiler object in APEX, and return a handle to the object. The object will be associatedwith the name passed in to this function. The difference between this function and the apex::start function is thatthe number of calls to that timer will not be incremented.

Parameters

timer_name The name of the timer.

Returns

The handle for the timer object in APEX. Not intended to be queried by the application. Should be retainedlocally, if possible, and passed in to the matching apex::stop() call when the timer should be stopped.

See also

apex::stop, apex::yield, apex::start

5.1.2.28 resume() [3/3]

void apex::resume (

std::shared_ptr< task_wrapper > task_wrapper_ptr )

Resume a timer.

This function will create a profiler object in APEX, and return a handle to the object. The object will be associatedwith the address passed in to this function. The difference between this function and the apex::start function is thatthe number of calls to that timer will not be incremented.

Parameters

task_wrapper_ptr A pointer to an apex::task_wrapper created by apex::new_task. APEX will use this to storethe profiler data.

Generated by Doxygen

Page 34: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

26 Namespace Documentation

Returns

No return value.

See also

apex::stop, apex::yield, apex::start

5.1.2.29 sample_runtime_counter()

apex_policy_handle∗ apex::sample_runtime_counter (

unsigned long period,

const std::string & counter_name )

Periodically sample a runtime counter.

Apex provides the ability to call an application-specified function periodically. This assigns the passed in function tobe called on a periodic basis. The context for the event will be passed to the registered function.

Parameters

period How frequently the counter should be called (in microseconds)

counter_name The name of the counter to sample

Returns

A handle to the policy, to be stored if the policy is to be un-registered later.

5.1.2.30 sample_value()

void apex::sample_value (

const std::string & name,

double value )

Sample a state value.

This function will retain a sample of some value. The profile for this sampled value will store the min, mean, max,total and standard deviation for this value for all times it is sampled.

Parameters

name The name of the sampled value

value The sampled value

Generated by Doxygen

Page 35: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

5.1 apex Namespace Reference 27

Returns

No return value.

5.1.2.31 send()

void apex::send (

uint64_t tag,

uint64_t size,

uint64_t target )

Notify APEX that the current thread is sending a parcel/message to another rank/locality/process.

This method notifies APEX that the current thread is sending a parcel/message to another rank/locality/process.The tag is meant to be an identifier for the message, not required to be unique. The target value is the APEX rankof the target of the message.

Parameters

tag The message identifier

size The message size (in bytes)

target The message target (as an APEX rank)

5.1.2.32 set_state()

void apex::set_state (

apex_thread_state state )

Set the thread state.

This function will set the thread state in APEX for 3rd party observation

Parameters

state The state of the thread.

Returns

No return value.

5.1.2.33 set_thread_cap()

void apex::set_thread_cap (

int new_cap )

Generated by Doxygen

Page 36: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

28 Namespace Documentation

Set the current thread cap for throttling.

This function will set the current thread cap based on an external throttling policy.

Parameters

new_cap The current thread cap value.

5.1.2.34 setup_custom_tuning() [1/2]

apex_tuning_session_handle apex::setup_custom_tuning (

apex_tuning_request & request )

Setup tuning of specified parameters to optimize for a custom metric, using multiple input criteria of potentiallymultiple types.

This function will initialize a policy to optimize a custom metric, using metric and parameters specified in the tuningrequest. The system tries to minimize the custom metric.

Parameters

request An apex_tuning_request object that specifies the tuning parameters.

Returns

A handle to the tuning session.

5.1.2.35 setup_custom_tuning() [2/2]

apex_tuning_session_handle apex::setup_custom_tuning (

std::function< double(void)> metric,

apex_event_type event_type,

int num_inputs,

long ∗∗ inputs,

long ∗ mins,

long ∗ maxs,

long ∗ steps )

Setup tuning of specified parameters to optimize for a custom metric, using multiple input criteria.

This function will initialize a policy to optimize a custom metric, using the list of tunable parameters. The systemtries to minimize the custom metric. After evaluating the state of the system, the policy will assign new values to theinputs.

Parameters

metric A function returning the value to be minimized.

Generated by Doxygen

Page 37: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

5.1 apex Namespace Reference 29

Parameters

event_type The apex_event_type that should trigger this policy

num_inputs The number of tunable inputs for optimization

inputs An array of addresses to inputs for optimization

mins An array of minimum values for each input

maxs An array of maximum values for each input

steps An array of step values for each input

Returns

A handle to the tuning session

5.1.2.36 setup_power_cap_throttling()

int apex::setup_power_cap_throttling (

void )

Initialize the power cap throttling policy.

This function will initialize APEX for power cap throttling. There are several environment variables that control powercap throttling:

HPX_THROTTLING If set, throttling will be enabled and initialized at startup.

APEX_THROTTLING_MAX_THREADS The maximum number of threads the throttling system will allow. Thedefault value is 48.

APEX_THROTTLING_MIN_THREADS The minimum number of threads the throttling system will allow. The de-fault value is 12.

APEX_THROTTLING_MAX_WATTS The maximum number of Watts the system can consume as an averagerate. The default value is 220.

APEX_THROTTLING_MIN_WATTS The minimum number of Watts the system can consume as an average rate.The default value is 180.

HPX_ENERGY_THROTTLING If set, power/energy throttling will be performed.

HPX_ENERGY TBD

After evaluating the state of the system, the policy will set the thread cap, which can be queried usingapex::get_thread_cap().

Returns

APEX_NOERROR on success, otherwise an error code.

Generated by Doxygen

Page 38: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

30 Namespace Documentation

5.1.2.37 setup_throughput_tuning()

int apex::setup_throughput_tuning (

apex_function_address the_address,

apex_optimization_criteria_t criteria,

apex_event_type event_type,

int num_inputs,

long ∗∗ inputs,

long ∗ mins,

long ∗ maxs,

long ∗ steps )

Setup throttling to optimize for the specified function, using multiple input criteria.

This function will initialize a policy to optimize the specified function, using the list of tunable inputs for the speci-fied function. The optimization criteria include maximizing throughput, minimizing or maximizing time spent in thespecified function. After evaluating the state of the system, the policy will assign new values to the inputs.

Parameters

the_address The address of the function to be optimized.

criteria The optimization criteria.

event_type The apex_event_type that should trigger this policy

num_inputs The number of tunable inputs for optimization

inputs An array of addresses to inputs for optimization

mins An array of minimum values for each input

maxs An array of maximum values for each input

steps An array of step values for each input

Returns

APEX_NOERROR on success, otherwise an error code.

5.1.2.38 setup_timer_throttling() [1/2]

int apex::setup_timer_throttling (

apex_function_address the_address,

apex_optimization_criteria_t criteria,

apex_optimization_method_t method,

unsigned long update_interval )

Setup throttling to optimize for the specified function.

This function will initialize the throttling policy to optimize for the specified function. The optimization criteria includemaximizing throughput, minimizing or maximizing time spent in the specified function. After evaluating the state ofthe system, the policy will set the thread cap, which can be queried using apex::get_thread_cap().

Parameters

the_address The address of the function to be optimized.

criteria The optimization criteria.

method The optimization method.

update_interval The time between observations, in microseconds.Generated by Doxygen

Page 39: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

5.1 apex Namespace Reference 31

Returns

APEX_NOERROR on success, otherwise an error code.

5.1.2.39 setup_timer_throttling() [2/2]

int apex::setup_timer_throttling (

const std::string & the_name,

apex_optimization_criteria_t criteria,

apex_optimization_method_t method,

unsigned long update_interval )

Setup throttling to optimize for the specified function or counter.

This function will initialize the throttling policy to optimize for the specified function or counter. The optimization cri-teria include maximizing throughput, minimizing or maximizing time spent in the specified function or value sampledin the counter. After evaluating the state of the system, the policy will set the thread cap, which can be queried usingapex::get_thread_cap().

Parameters

the_name The name of the function or counter to be optimized.

criteria The optimization criteria.

method The optimization method.

update_interval The time between observations, in microseconds.

Returns

APEX_NOERROR on success, otherwise an error code.

5.1.2.40 shutdown_throttling()

int apex::shutdown_throttling (

void )

Terminate the throttling policy.

This function will terminate the throttling policy.

Returns

APEX_NOERROR on success, otherwise an error code.

5.1.2.41 start() [1/3]

profiler∗ apex::start (

const apex_function_address function_address )

Start a timer.

This function will create a profiler object in APEX, and return a handle to the object. The object will be associatedwith the address passed in to this function.

Generated by Doxygen

Page 40: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

32 Namespace Documentation

Parameters

function_address The address of the function to be timed

Returns

The handle for the timer object in APEX. Not intended to be queried by the application. Should be retainedlocally, if possible, and passed in to the matching apex::stop call when the timer should be stopped.

See also

apex::stop, apex::yield, apex::resume

5.1.2.42 start() [2/3]

profiler∗ apex::start (

const std::string & timer_name )

Start a timer.

This function will create a profiler object in APEX, and return a handle to the object. The object will be associatedwith the name passed in to this function.

Parameters

timer_name The name of the timer.

Returns

The handle for the timer object in APEX. Not intended to be queried by the application. Should be retainedlocally, if possible, and passed in to the matching apex::stop() call when the timer should be stopped.

See also

apex::stop, apex::yield, apex::resume

5.1.2.43 start() [3/3]

void apex::start (

std::shared_ptr< task_wrapper > task_wrapper_ptr )

Start a timer.

This function will create a profiler object in APEX, and return a handle to the object. The object will be associatedwith the task_wrapper passed in to this function.

Generated by Doxygen

Page 41: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

5.1 apex Namespace Reference 33

Parameters

task_wrapper_ptr A pointer to an apex::task_wrapper created by apex::new_task. APEX will use this to storethe profiler data.

Returns

No return value.

See also

apex::stop, apex::yield, apex::resume apex::new_task

5.1.2.44 stop() [1/2]

void apex::stop (

profiler ∗ the_profiler,

bool cleanup = true )

Stop a timer.

This function will stop the specified profiler object, and queue the profiler to be processed out-of-band. The timervalue will eventually added to the profile for the process.

Parameters

the_profiler The handle of the profiler object.

cleanup Internal use only.

Returns

No return value.

See also

apex::start, apex::yield, apex::resume

5.1.2.45 stop() [2/2]

void apex::stop (

std::shared_ptr< task_wrapper > task_wrapper_ptr )

Stop a timer.

This function will stop the specified profiler object, and queue the profiler to be processed out-of-band. The timervalue will eventually added to the profile for the process.

Generated by Doxygen

Page 42: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

34 Namespace Documentation

Parameters

task_wrapper_ptr an apex::task_wrapper pointer that was started

Returns

No return value.

See also

apex::start, apex::yield, apex::resume, apex::new_task

5.1.2.46 stop_all_async_threads()

void apex::stop_all_async_threads (

void )

Stop all asynchronous APEX background threads.

This function will stop all background threads from all listeners, and force them to exit. This is necessary for stoppingperodic policies that would otherwise prevent runtimes from finishing work and calling apex::finalize().

See also

apex::deregister_policy, apex::register_policy apex::finalize

5.1.2.47 update_task() [1/2]

std::shared_ptr<task_wrapper> apex::update_task (

std::shared_ptr< task_wrapper > wrapper,

const apex_function_address function_address )

Update a task wrapper (dependency).

This function will update the function address that this task wrapper refers to.

Parameters

wrapper The existing apex::task_wrapper object

function_address The new function address of the timer.

Generated by Doxygen

Page 43: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

5.1 apex Namespace Reference 35

5.1.2.48 update_task() [2/2]

std::shared_ptr<task_wrapper> apex::update_task (

std::shared_ptr< task_wrapper > wrapper,

const std::string & name )

Update a task (dependency).

This function will update the name that this task wrapper refers to.

Parameters

wrapper The existing apex::task_wrapper object

name The new name of the timer.

5.1.2.49 version()

std::string& apex::version (

void )

Return the APEX version.

Returns

A string with the APEX version.

5.1.2.50 yield() [1/2]

void apex::yield (

profiler ∗ the_profiler )

Stop a timer, but don't increment the number of calls.

This function will stop the specified profiler object, and queue the profiler to be processed out-of-band. The timervalue will eventually added to the profile for the process. The number of calls will NOT be incremented - this "task"was yielded, not completed. It will be resumed by another thread at a later time.

Parameters

the_profiler The handle of the profiler object.

Returns

No return value.

Generated by Doxygen

Page 44: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

36 Namespace Documentation

See also

apex::start, apex::stop, apex::resume

5.1.2.51 yield() [2/2]

void apex::yield (

std::shared_ptr< task_wrapper > task_wrapper_ptr )

Stop a timer, but don't increment the number of calls.

This function will stop the specified profiler object, and queue the profiler to be processed out-of-band. The timervalue will eventually added to the profile for the process. The number of calls will NOT be incremented - this "task"was yielded, not completed. It will be resumed by another thread at a later time.

Parameters

task_wrapper_ptr an apex::task_wrapper pointer that was started

Returns

No return value.

See also

apex::start, apex::stop, apex::resume

Generated by Doxygen

Page 45: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

Chapter 6

Class Documentation

6.1 apex_event_type Struct Reference

Typedef for enumerating the different event types.

#include <apex_types.h>

6.1.1 Detailed Description

Typedef for enumerating the different event types.

The documentation for this struct was generated from the following file:

• /Users/khuck/src/xpress-apex/src/apex/apex_types.h

6.2 apex_profiler_type Struct Reference

Typedef for enumerating the different timer types.

#include <apex_types.h>

6.2.1 Detailed Description

Typedef for enumerating the different timer types.

The documentation for this struct was generated from the following file:

• /Users/khuck/src/xpress-apex/src/apex/apex_types.h

Page 46: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

38 Class Documentation

6.3 apex::scoped_thread Class Reference

A convenience class for creating a scoped thread.

#include <apex_api.hpp>

Public Member Functions

• scoped_thread (const std::string &thread_name)

Constructor.

• ∼scoped_thread ()

Destructor.

6.3.1 Detailed Description

A convenience class for creating a scoped thread.

This object will register a thread when it starts, and when the object goes out of scope, it will tell APEX that thethread has exited.

6.3.2 Constructor & Destructor Documentation

6.3.2.1 scoped_thread()

apex::scoped_thread::scoped_thread (

const std::string & thread_name ) [inline]

Constructor.

Parameters

thread_name The name of this thread (nullptr allowed).

The documentation for this class was generated from the following file:

• /Users/khuck/src/xpress-apex/src/apex/apex_api.hpp

6.4 apex::scoped_timer Class Reference

A convenience class for using APEX in C++ applications.

#include <apex_api.hpp>

Generated by Doxygen

Page 47: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

6.4 apex::scoped_timer Class Reference 39

Public Member Functions

• scoped_timer (uint64_t func)

Construct and start an APEX timer.

• scoped_timer (std::string func)

Construct and start an APEX timer.

• scoped_timer (uint64_t func, std::shared_ptr< apex::task_wrapper > parent)

Register a new thread with APEX, then construct and start an APEX timer.

• scoped_timer (std::string func, std::shared_ptr< apex::task_wrapper > parent)

Register a new thread with APEX, then construct and start an APEX timer.

• void start (void)

Start the APEX timer.

• void stop (void)

Stop the APEX timer.

• void yield (void)

Yield the APEX timer.

• void resume (void)

Resume the APEX timer.

• ∼scoped_timer ()

Destructor.

• std::shared_ptr< apex::task_wrapper > get_task_wrapper (void)

Get the internal task wrapper object.

6.4.1 Detailed Description

A convenience class for using APEX in C++ applications.

This class will automatically start an APEX timer when the object is constructed, and automatically stop the timerwhen the object goes out of scope. There are options for registering a thread when creating a timer for the first timeon a thread.

6.4.2 Constructor & Destructor Documentation

6.4.2.1 scoped_timer() [1/4]

apex::scoped_timer::scoped_timer (

uint64_t func ) [inline]

Construct and start an APEX timer.

Parameters

func The address of a function used to identify the timer type

Generated by Doxygen

Page 48: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

40 Class Documentation

6.4.2.2 scoped_timer() [2/4]

apex::scoped_timer::scoped_timer (

std::string func ) [inline]

Construct and start an APEX timer.

Parameters

func The name of a function used to identify the timer type

6.4.2.3 scoped_timer() [3/4]

apex::scoped_timer::scoped_timer (

uint64_t func,

std::shared_ptr< apex::task_wrapper > parent ) [inline]

Register a new thread with APEX, then construct and start an APEX timer.

Parameters

func The address of a function used to identify the timer type

parent The parent task wrapper (if available) of this new scoped_timer

6.4.2.4 scoped_timer() [4/4]

apex::scoped_timer::scoped_timer (

std::string func,

std::shared_ptr< apex::task_wrapper > parent ) [inline]

Register a new thread with APEX, then construct and start an APEX timer.

Parameters

func The name of a function used to identify the timer type

parent The parent task wrapper (if available) of this new scoped_timer

6.4.3 Member Function Documentation

Generated by Doxygen

Page 49: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

6.5 apex::task_wrapper Struct Reference 41

6.4.3.1 resume()

void apex::scoped_timer::resume (

void ) [inline]

Resume the APEX timer.

6.4.3.2 start()

void apex::scoped_timer::start (

void ) [inline]

Start the APEX timer.

6.4.3.3 stop()

void apex::scoped_timer::stop (

void ) [inline]

Stop the APEX timer.

6.4.3.4 yield()

void apex::scoped_timer::yield (

void ) [inline]

Yield the APEX timer.

The documentation for this class was generated from the following file:

• /Users/khuck/src/xpress-apex/src/apex/apex_api.hpp

6.5 apex::task_wrapper Struct Reference

A wrapper around APEX tasks.

#include <task_wrapper.hpp>

Public Member Functions

• task_wrapper (void)

Constructor.

• task_identifier ∗ get_task_id (void)

Get the task_identifier for this task_wrapper.

Generated by Doxygen

Page 50: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

42 Class Documentation

Static Public Member Functions

• static std::shared_ptr< task_wrapper > & get_apex_main_wrapper (void)

Static method to get a pre-defined task_wrapper around "main".

Public Attributes

• task_identifier ∗ task_id

A pointer to the task_identifier for this task_wrapper.• profiler ∗ prof

A pointer to the active profiler object timing this task.• uint64_t guid

An internally generated GUID for this task.• uint64_t parent_guid

An internally generated GUID for the parent task of this task.• std::shared_ptr< task_wrapper > parent

A managed pointer to the parent task_wrapper for this task.• std::vector< profiler ∗ > data_ptr

Internal usage, used to manage HPX direct actions when their parent task is yielded by the runtime.• task_identifier ∗ alias

If the task changes names after creation (due to the application of an annotation) then the alias becomes the newtask_identifier for the task.

6.5.1 Detailed Description

A wrapper around APEX tasks.

6.5.2 Member Function Documentation

6.5.2.1 get_apex_main_wrapper()

static std::shared_ptr<task_wrapper>& apex::task_wrapper::get_apex_main_wrapper (

void ) [inline], [static]

Static method to get a pre-defined task_wrapper around "main".

Returns

A shared pointer to the task_wrapper

6.5.2.2 get_task_id()

task_identifier∗ apex::task_wrapper::get_task_id (

void ) [inline]

Get the task_identifier for this task_wrapper.

Returns

A pointer to the task_identifier

The documentation for this struct was generated from the following file:

• /Users/khuck/src/xpress-apex/src/apex/task_wrapper.hpp

Generated by Doxygen

Page 51: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

Chapter 7

File Documentation

7.1 /Users/khuck/src/xpress-apex/doc/apex.dox File Reference

7.2 /Users/khuck/src/xpress-apex/src/apex/apex.h File Reference

#include "apex_types.h"#include "apex_export.h"#include "stdbool.h"#include "stdint.h"

Functions

• int apex_init (const char ∗thread_name, const uint64_t comm_rank, const uint64_t comm_size)

Intialize APEX.

• const char ∗ apex_dump (bool reset)

Dump output from APEX.

• void apex_finalize ()

Finalize APEX.

• void apex_cleanup ()

Cleanup APEX.

• apex_profiler_handle apex_start (apex_profiler_type type, void ∗identifier)

Start a timer.

• apex_profiler_handle apex_start_guid (apex_profiler_type type, void ∗identifier, uint64_t guid)

Start a timer.

• void apex_stop (apex_profiler_handle profiler)

Stop a timer.

• void apex_yield (apex_profiler_handle profiler)

Stop a timer, but don't increment the number of calls.

• apex_profiler_handle apex_resume (apex_profiler_type type, void ∗identifier)

Resume a timer.

• apex_profiler_handle apex_resume_guid (apex_profiler_type type, void ∗identifier, uint64_t guid)

Resume a timer.

• void apex_reset (apex_profiler_type type, void ∗identifier)

Page 52: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

44 File Documentation

Reset a timer or counter.

• void apex_set_state (apex_thread_state state)

Set the thread state.

• void apex_sample_value (const char ∗name, double value)

Sample a state value.

• void apex_new_task (apex_profiler_type type, void ∗identifier, uint64_t task_id)

Create a new task (dependency).

• apex_event_type apex_register_custom_event (const char ∗name)

Register an event type with APEX.

• void apex_custom_event (apex_event_type event_type, void ∗custom_data)

Trigger a custom event.

• const char ∗ apex_version (void)

Return the APEX version.

• void apex_register_thread (const char ∗name)

Register a new thread.

• void apex_exit_thread (void)

Exit a thread.

• apex_policy_handle ∗ apex_register_policy (const apex_event_type when, apex_policy_function f)

Register a policy with APEX.

• apex_policy_handle ∗ apex_register_periodic_policy (unsigned long period, apex_policy_function f)

Register a policy with APEX.

• void apex_deregister_policy (apex_policy_handle ∗handle)

Deregister a policy with APEX.

• apex_profile ∗ apex_get_profile (apex_profiler_type type, void ∗identifier)

Get the current profile for the specified id.

• double apex_current_power_high (void)

Get the current power reading.

• int apex_setup_power_cap_throttling (void)

Initialize the power cap throttling policy.

• int apex_setup_timer_throttling (apex_profiler_type type, void ∗identifier, apex_optimization_criteria_t criteria,apex_optimization_method_t method, unsigned long update_interval)

Setup throttling to optimize for the specified function.

• int apex_setup_throughput_tuning (apex_profiler_type type, void ∗identifier, apex_optimization_criteria_t cri-teria, apex_event_type event_type, int num_inputs, long ∗∗inputs, long ∗mins, long ∗maxs, long ∗steps)

Setup throttling to optimize for the specified function, using multiple input criteria.

• int apex_shutdown_throttling (void)

Terminate the throttling policy.

• int apex_get_thread_cap (void)

Get the current thread cap set by the throttling.

• void apex_set_thread_cap (int new_cap)

Set the current thread cap for throttling.

• void apex_print_options (void)

Print the current APEX settings.

• void apex_send (uint64_t tag, uint64_t size, uint64_t target)

Notify APEX that the current thread is sending a parcel/message to another rank/locality/process.

• void apex_recv (uint64_t tag, uint64_t size, uint64_t source_rank, uint64_t source_thread)

Notify APEX that the current thread is receiving a parcel/message from another rank/locality/process.

• uint64_t apex_hardware_concurrency (void)

Get the number of possible threads supported on this system.

Generated by Doxygen

Page 53: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

7.2 /Users/khuck/src/xpress-apex/src/apex/apex.h File Reference 45

7.2.1 Function Documentation

7.2.1.1 apex_cleanup()

void apex_cleanup ( )

Cleanup APEX.

Warning

For best results, this function should be explicitly called to free all memory allocated by APEX. If not explicitlycalled from the application or runtime, it will be automatically called when the APEX main singleton object isdestructed. apex_finalize will be automatically called from apex_cleanup if it has not yet been called.

The cleanup method will free all allocated memory for APEX.

Returns

No return value.

See also

apex_finalize

7.2.1.2 apex_current_power_high()

double apex_current_power_high (

void )

Get the current power reading.

This function will return the current power level for the node, measured in Watts.

Returns

The current power level in Watts.

7.2.1.3 apex_custom_event()

void apex_custom_event (

apex_event_type event_type,

void ∗ custom_data )

Trigger a custom event.

This function will pass a custom event to the APEX event listeners. Each listeners' custom event handler will handlethe custom event. Policy functions will be passed the custom event name in the event context.

Generated by Doxygen

Page 54: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

46 File Documentation

Parameters

event_type The type of the custom event

custom_data Data specific to the custom event

Returns

No return value.

See also

apex_register_custom_event

7.2.1.4 apex_deregister_policy()

void apex_deregister_policy (

apex_policy_handle ∗ handle )

Deregister a policy with APEX.

This function will deregister the specified policy. In order to enable the policy again, it should be registered usingapex_register_policy or apex_register_periodic_policy.

Parameters

handle The handle of the policy to be deregistered.

See also

apex_register_policy, apex_register_periodic_policy

7.2.1.5 apex_dump()

const char∗ apex_dump (

bool reset )

Dump output from APEX.

The stop measurement method will terminate all measurement and optionally:

• print a report to the screen

• write a profile to disk (if requested)

• output all other visualization data

Generated by Doxygen

Page 55: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

7.2 /Users/khuck/src/xpress-apex/src/apex/apex.h File Reference 47

Parameters

reset Flag indicating whether to reset all statistics (true) or not (false).

Returns

a string containing the output.

See also

apex::finalize

7.2.1.6 apex_exit_thread()

void apex_exit_thread (

void )

Exit a thread.

For multithreaded applications, exit this thread and clean up.

Warning

Failure to exit a thread with APEX may invalidate statistics.

Returns

No return value.

7.2.1.7 apex_finalize()

void apex_finalize ( )

Finalize APEX.

The stop measurement method will terminate all measurement and optionally:

• print a report to the screen (if requested)

• write a profile to disk (if requested)

Returns

No return value.

See also

apex_init

7.2.1.8 apex_get_profile()

apex_profile∗ apex_get_profile (

apex_profiler_type type,

void ∗ identifier )

Get the current profile for the specified id.

This function will return the current profile for the specified profiler id. Because profiles are updated out-of-band, itis possible that this profile value is out of date. This profile can be either a timer or a sampled value.

Generated by Doxygen

Page 56: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

48 File Documentation

Parameters

type The type of the address to be returned. This can be one of the apex_profiler_type values.

identifier The function address of the function to be returned, or a "const char ∗" pointer to the name of thetimer / counter.

Returns

The current profile for that timed function or sampled value.

7.2.1.9 apex_get_thread_cap()

int apex_get_thread_cap (

void )

Get the current thread cap set by the throttling.

This function will return the current thread cap based on the throttling policy.

Returns

The current thread cap value.

7.2.1.10 apex_hardware_concurrency()

uint64_t apex_hardware_concurrency (

void )

Get the number of possible threads supported on this system.

This method queries the system to determine how many threads can be executed concurrently without oversub-scription.

Returns

number of hardware threads available

7.2.1.11 apex_init()

int apex_init (

const char ∗ thread_name,

const uint64_t comm_rank,

const uint64_t comm_size )

Intialize APEX.

Warning

For best results, this function should be called before any other APEX functions.

Use this version of apex_init when you do not have access to the input arguments.

Generated by Doxygen

Page 57: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

7.2 /Users/khuck/src/xpress-apex/src/apex/apex.h File Reference 49

Parameters

thread_name The name of the thread, or nullptr. The lifetime of the thread will be timed with a timer usingthis same name.

comm_rank The rank of this process within the full distributed application, i.e. MPI rank or HPX locality.

comm_size The total number of processes within the full distributed application, i.e. MPI comm_size ortotal number of HPX localities.

Returns

APEX_NOERROR on success, or APEX_ERROR on failure.

See also

apex_finalize

7.2.1.12 apex_new_task()

void apex_new_task (

apex_profiler_type type,

void ∗ identifier,

uint64_t task_id )

Create a new task (dependency).

This function will note a task dependency between the current timer (task) and the new task.

Parameters

type The type of the address to be reset. This can be one of the apex_profiler_type values.

identifier The function address of the function of the task, or a "const char ∗" pointer to the name of the task.

task_id The ID of the task

Returns

No return value.

7.2.1.13 apex_print_options()

void apex_print_options (

void )

Print the current APEX settings.

This function will print all the current APEX settings.

Generated by Doxygen

Page 58: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

50 File Documentation

7.2.1.14 apex_recv()

void apex_recv (

uint64_t tag,

uint64_t size,

uint64_t source_rank,

uint64_t source_thread )

Notify APEX that the current thread is receiving a parcel/message from another rank/locality/process.

This method notifies APEX that the current thread is receiving a parcel/message from another rank/locality/process.The tag is meant to be an identifier for the message, not required to be unique. The source value is the APEX rankof the source of the message.

Parameters

tag The message identifier

size The message size (in bytes)

source_rank The message source (as a rank/locality index)

source_thread The message source (as a worker thread index)

7.2.1.15 apex_register_custom_event()

apex_event_type apex_register_custom_event (

const char ∗ name )

Register an event type with APEX.

Create a user-defined event type for APEX.

Parameters

name The name of the custom event

Returns

The index of the custom event.

See also

apex_custom_event

7.2.1.16 apex_register_periodic_policy()

apex_policy_handle∗ apex_register_periodic_policy (

unsigned long period,

apex_policy_function f )

Generated by Doxygen

Page 59: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

7.2 /Users/khuck/src/xpress-apex/src/apex/apex.h File Reference 51

Register a policy with APEX.

Apex provides the ability to call an application-specified function periodically. This assigns the passed in function tobe called on a periodic basis. The context for the event will be passed to the registered function.

Parameters

period How frequently the function should be called

f The function to be called when that event is handled by APEX.

Returns

A handle to the policy, to be stored if the policy is to be un-registered later.

See also

apex_deregister_policy, apex_register_policy

7.2.1.17 apex_register_policy()

apex_policy_handle∗ apex_register_policy (

const apex_event_type when,

apex_policy_function f )

Register a policy with APEX.

Apex provides the ability to call an application-specified function when certain events occur in the APEX library, orperiodically. This assigns the passed in function to the event, so that when that event occurs in APEX, the functionis called. The context for the event will be passed to the registered function.

Parameters

when The APEX event when this function should be calledf The function to be called when that event is handled by APEX.

Returns

A handle to the policy, to be stored if the policy is to be un-registered later.

See also

apex_deregister_policy, apex_register_periodic_policy

Generated by Doxygen

Page 60: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

52 File Documentation

7.2.1.18 apex_register_thread()

void apex_register_thread (

const char ∗ name )

Register a new thread.

For multithreaded applications, register a new thread with APEX.

Warning

Failure to register a thread with APEX may invalidate statistics, and may prevent the ability to use timers orsampled values for this thread.

Parameters

name The name that will be assigned to the new thread.

Returns

No return value.

7.2.1.19 apex_reset()

void apex_reset (

apex_profiler_type type,

void ∗ identifier )

Reset a timer or counter.

This function will reset the profile associated with the specified timer or counter id to zero.

Parameters

type The type of the address to be reset. This can be one of the apex_profiler_type values.

identifier The function address of the function to be reset, or a "const char ∗" pointer to the name of the timer/ counter.

Returns

No return value.

See also

apex_get_profile

Generated by Doxygen

Page 61: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

7.2 /Users/khuck/src/xpress-apex/src/apex/apex.h File Reference 53

7.2.1.20 apex_resume()

apex_profiler_handle apex_resume (

apex_profiler_type type,

void ∗ identifier )

Resume a timer.

This function will create a profiler object in APEX, and return a handle to the object. The object will be associatedwith the name and/or function address passed in to this function. The difference between this function and theapex_start function is that the number of calls to that timer will not be incremented.

Parameters

type The type of the address to be stored. This can be one of the apex_profiler_type values.

identifier The function address of the function to be timed, or a "const char ∗" pointer to the name of the timer.

Returns

The handle for the timer object in APEX. Not intended to be queried by the application. Should be retainedlocally, if possible, and passed in to the matching apex_stop call when the timer should be stopped.

See also

apex_start, apex_stop, apex_yield

7.2.1.21 apex_resume_guid()

apex_profiler_handle apex_resume_guid (

apex_profiler_type type,

void ∗ identifier,

uint64_t guid )

Resume a timer.

This function will create a profiler object in APEX, and return a handle to the object. The object will be associatedwith the name and/or function address passed in to this function. The difference between this function and theapex_start function is that the number of calls to that timer will not be incremented.

Parameters

type The type of the address to be stored. This can be one of the apex_profiler_type values.

identifier The function address of the function to be timed, or a "const char ∗" pointer to the name of the timer.

guid A globally unique identifier for this task.

Returns

The handle for the timer object in APEX. Not intended to be queried by the application. Should be retainedlocally, if possible, and passed in to the matching apex_stop call when the timer should be stopped.

Generated by Doxygen

Page 62: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

54 File Documentation

See also

apex_start, apex_stop, apex_yield

7.2.1.22 apex_sample_value()

void apex_sample_value (

const char ∗ name,

double value )

Sample a state value.

This function will retain a sample of some value. The profile for this sampled value will store the min, mean, max,total and standard deviation for this value for all times it is sampled.

Parameters

name The name of the sampled value

value The sampled value

Returns

No return value.

7.2.1.23 apex_send()

void apex_send (

uint64_t tag,

uint64_t size,

uint64_t target )

Notify APEX that the current thread is sending a parcel/message to another rank/locality/process.

This method notifies APEX that the current thread is sending a parcel/message to another rank/locality/process.The tag is meant to be an identifier for the message, not required to be unique. The target value is the APEX rankof the target of the message.

Parameters

tag The message identifier

size The message size (in bytes)

target The message target (as an APEX rank)

Generated by Doxygen

Page 63: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

7.2 /Users/khuck/src/xpress-apex/src/apex/apex.h File Reference 55

7.2.1.24 apex_set_state()

void apex_set_state (

apex_thread_state state )

Set the thread state.

This function will set the thread state in APEX for 3rd party observation

Parameters

state The state of the thread.

Returns

No return value.

7.2.1.25 apex_set_thread_cap()

void apex_set_thread_cap (

int new_cap )

Set the current thread cap for throttling.

This function will set the current thread cap based on an external throttling policy.

Parameters

new_cap The current thread cap value.

7.2.1.26 apex_setup_power_cap_throttling()

int apex_setup_power_cap_throttling (

void )

Initialize the power cap throttling policy.

This function will initialize APEX for power cap throttling. There are several environment variables that control powercap throttling:

HPX_THROTTLING If set, throttling will be enabled and initialized at startup.

APEX_THROTTLING_MAX_THREADS The maximum number of threads the throttling system will allow. Thedefault value is 48.

APEX_THROTTLING_MIN_THREADS The minimum number of threads the throttling system will allow. The de-fault value is 12.

Generated by Doxygen

Page 64: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

56 File Documentation

APEX_THROTTLING_MAX_WATTS The maximum number of Watts the system can consume as an averagerate. The default value is 220.

APEX_THROTTLING_MIN_WATTS The minimum number of Watts the system can consume as an average rate.The default value is 180.

HPX_ENERGY_THROTTLING If set, power/energy throttling will be performed.

HPX_ENERGY TBD

After evaluating the state of the system, the policy will set the thread cap, which can be queried usingapex_get_thread_cap().

Returns

APEX_NOERROR on success, otherwise an error code.

7.2.1.27 apex_setup_throughput_tuning()

int apex_setup_throughput_tuning (

apex_profiler_type type,

void ∗ identifier,

apex_optimization_criteria_t criteria,

apex_event_type event_type,

int num_inputs,

long ∗∗ inputs,

long ∗ mins,

long ∗ maxs,

long ∗ steps )

Setup throttling to optimize for the specified function, using multiple input criteria.

This function will initialize a policy to optimize the specified function, using the list of tunable inputs for the speci-fied function. The optimization criteria include maximizing throughput, minimizing or maximizing time spent in thespecified function. After evaluating the state of the system, the policy will assign new values to the inputs.

Parameters

type The type of the address to be optimized. This can be one of the apex_profiler_type values.

identifier The function address of the function to be optimized, or a "const char ∗" pointer to the name ofthe counter/timer.

criteria The optimization criteria.

event_type The apex_event_type that should trigger this policy

num_inputs The number of tunable inputs for optimization

inputs An array of addresses to inputs for optimization

mins An array of minimum values for each input

maxs An array of maximum values for each input

steps An array of step values for each input

Generated by Doxygen

Page 65: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

7.2 /Users/khuck/src/xpress-apex/src/apex/apex.h File Reference 57

Returns

APEX_NOERROR on success, otherwise an error code.

7.2.1.28 apex_setup_timer_throttling()

int apex_setup_timer_throttling (

apex_profiler_type type,

void ∗ identifier,

apex_optimization_criteria_t criteria,

apex_optimization_method_t method,

unsigned long update_interval )

Setup throttling to optimize for the specified function.

This function will initialize the throttling policy to optimize for the specified function. The optimization criteria includemaximizing throughput, minimizing or maximizing time spent in the specified function. After evaluating the state ofthe system, the policy will set the thread cap, which can be queried using apex_get_thread_cap().

Parameters

type The type of the address to be optimized. This can be one of the apex_profiler_type values.

identifier The function address of the function to be optimized, or a "const char ∗" pointer to the nameof the counter/timer.

criteria The optimization criteria.

method The optimization method.

update_interval The time between observations, in microseconds.

Returns

APEX_NOERROR on success, otherwise an error code.

7.2.1.29 apex_shutdown_throttling()

int apex_shutdown_throttling (

void )

Terminate the throttling policy.

This function will terminate the throttling policy.

Returns

APEX_NOERROR on success, otherwise an error code.

Generated by Doxygen

Page 66: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

58 File Documentation

7.2.1.30 apex_start()

apex_profiler_handle apex_start (

apex_profiler_type type,

void ∗ identifier )

Start a timer.

This function will create a profiler object in APEX, and return a handle to the object. The object will be associatedwith the address or name passed in to this function. If both are zero (null) then the call will fail and the return valuewill be null.

Parameters

type The type of the address to be stored. This can be one of the apex_profiler_type values.

identifier The function address of the function to be timed, or a "const char ∗" pointer to the name of the timer.

Returns

The handle for the timer object in APEX. Not intended to be queried by the application. Should be retainedlocally, if possible, and passed in to the matching apex_stop call when the timer should be stopped.

See also

apex_stop, apex_resume, apex_yield

7.2.1.31 apex_start_guid()

apex_profiler_handle apex_start_guid (

apex_profiler_type type,

void ∗ identifier,

uint64_t guid )

Start a timer.

This function will create a profiler object in APEX, and return a handle to the object. The object will be associatedwith the address or name passed in to this function. If both are zero (null) then the call will fail and the return valuewill be null.

Parameters

type The type of the address to be stored. This can be one of the apex_profiler_type values.

identifier The function address of the function to be timed, or a "const char ∗" pointer to the name of the timer.

guid A globally unique identifier for this task.

Returns

The handle for the timer object in APEX. Not intended to be queried by the application. Should be retainedlocally, if possible, and passed in to the matching apex_stop call when the timer should be stopped.

Generated by Doxygen

Page 67: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

7.2 /Users/khuck/src/xpress-apex/src/apex/apex.h File Reference 59

See also

apex_stop, apex_resume, apex_yield

7.2.1.32 apex_stop()

void apex_stop (

apex_profiler_handle profiler )

Stop a timer.

This function will stop the specified profiler object, and queue the profiler to be processed out-of-band. The timervalue will eventually added to the profile for the process.

Parameters

profiler The handle of the profiler object.

Returns

No return value.

See also

apex_start, apex_yield, apex_resume

7.2.1.33 apex_version()

const char∗ apex_version (

void )

Return the APEX version.

Returns

A character string with the APEX version. This string should not be freed after the calling function is done withit.

7.2.1.34 apex_yield()

void apex_yield (

apex_profiler_handle profiler )

Stop a timer, but don't increment the number of calls.

This function will stop the specified profiler object, and queue the profiler to be processed out-of-band. The timervalue will eventually added to the profile for the process. The number of calls will NOT be incremented - this "task"was yielded, not completed. It will be resumed by another thread at a later time.

Generated by Doxygen

Page 68: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

60 File Documentation

Parameters

profiler The handle of the profiler object.

Returns

No return value.

See also

apex_start, apex_stop, apex_resume

7.3 /Users/khuck/src/xpress-apex/src/apex/apex_api.hpp File Reference

Classes

• class apex::scoped_timer

A convenience class for using APEX in C++ applications.

• class apex::scoped_thread

A convenience class for creating a scoped thread.

Namespaces

• apex

The main APEX namespace.

Macros

• #define APEX_SCOPED_TIMER

A convenient macro for inserting an APEX self-stopping timer.

Functions

• static std::shared_ptr< task_wrapper > apex::null_task_wrapper (nullptr)

declare a default "null" pointer for std::shared_ptr<task_wrapper>& references

• uint64_t apex::init (const char ∗thread_name, const uint64_t comm_rank, const uint64_t comm_size)

Intialize APEX.

• std::string apex::dump (bool reset)

Dump output from APEX.

• void apex::finalize (void)

Finalize APEX.

• void apex::cleanup (void)

Cleanup APEX.

• profiler ∗ apex::start (const std::string &timer_name)

Start a timer.

• profiler ∗ apex::start (const apex_function_address function_address)

Start a timer.

Generated by Doxygen

Page 69: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

7.3 /Users/khuck/src/xpress-apex/src/apex/apex_api.hpp File Reference 61

• void apex::start (std::shared_ptr< task_wrapper > task_wrapper_ptr)

Start a timer.

• void apex::stop (profiler ∗the_profiler, bool cleanup=true)

Stop a timer.

• void apex::stop (std::shared_ptr< task_wrapper > task_wrapper_ptr)

Stop a timer.

• void apex::yield (profiler ∗the_profiler)

Stop a timer, but don't increment the number of calls.

• void apex::yield (std::shared_ptr< task_wrapper > task_wrapper_ptr)

Stop a timer, but don't increment the number of calls.

• profiler ∗ apex::resume (const std::string &timer_name)

Resume a timer.

• profiler ∗ apex::resume (const apex_function_address function_address)

Resume a timer.

• void apex::resume (std::shared_ptr< task_wrapper > task_wrapper_ptr)

Resume a timer.

• void apex::reset (const std::string &timer_name)

Reset a timer or counter.

• void apex::reset (apex_function_address function_address)

Reset a timer.

• void apex::set_state (apex_thread_state state)

Set the thread state.

• void apex::sample_value (const std::string &name, double value)

Sample a state value.

• std::shared_ptr< task_wrapper > apex::new_task (const std::string &name, const uint64_t task_id=UINT←↩

MAX_MAX, const std::shared_ptr< apex::task_wrapper > parent_task=null_task_wrapper)

Create a new task (dependency).

• std::shared_ptr< task_wrapper > apex::new_task (const apex_function_address function_address, constuint64_t task_id=UINTMAX_MAX, const std::shared_ptr< apex::task_wrapper > parent_task=null_task_←↩

wrapper)

Create a new task (dependency).

• std::shared_ptr< task_wrapper > apex::update_task (std::shared_ptr< task_wrapper > wrapper, const std←↩

::string &name)

Update a task (dependency).

• std::shared_ptr< task_wrapper > apex::update_task (std::shared_ptr< task_wrapper > wrapper, constapex_function_address function_address)

Update a task wrapper (dependency).

• apex_event_type apex::register_custom_event (const std::string &name)

Register an event type with APEX.

• void apex::custom_event (apex_event_type event_type, void ∗custom_data)

Trigger a custom event.

• std::string & apex::version (void)

Return the APEX version.

• void apex::register_thread (const std::string &name)

Register a new thread.

• void apex::exit_thread (void)

Exit a thread.

• apex_policy_handle ∗ apex::register_policy (const apex_event_type when, std::function< int(apex_contextconst &)> f)

Register a policy with APEX.

• std::set< apex_policy_handle ∗ > apex::register_policy (std::set< apex_event_type > when, std::function<int(apex_context const &)> f)

Generated by Doxygen

Page 70: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

62 File Documentation

Register a policy with APEX.

• apex_policy_handle ∗ apex::register_periodic_policy (unsigned long period, std::function< int(apex_contextconst &)> f)

Register a policy with APEX.

• apex_policy_handle ∗ apex::sample_runtime_counter (unsigned long period, const std::string &counter_←↩

name)

Periodically sample a runtime counter.

• void apex::deregister_policy (apex_policy_handle ∗handle)

Deregister a policy with APEX.

• void apex::stop_all_async_threads (void)

Stop all asynchronous APEX background threads.

• apex_profile ∗ apex::get_profile (apex_function_address function_address)

Get the current profile for the specified function address.

• apex_profile ∗ apex::get_profile (const std::string &timer_name)

Get the current profile for the specified function address.

• int apex::setup_power_cap_throttling (void)

Initialize the power cap throttling policy.

• int apex::setup_timer_throttling (apex_function_address the_address, apex_optimization_criteria_t criteria,apex_optimization_method_t method, unsigned long update_interval)

Setup throttling to optimize for the specified function.

• int apex::setup_throughput_tuning (apex_function_address the_address, apex_optimization_criteria_t crite-ria, apex_event_type event_type, int num_inputs, long ∗∗inputs, long ∗mins, long ∗maxs, long ∗steps)

Setup throttling to optimize for the specified function, using multiple input criteria.

• apex_tuning_session_handle apex::setup_custom_tuning (std::function< double(void)> metric, apex_event_typeevent_type, int num_inputs, long ∗∗inputs, long ∗mins, long ∗maxs, long ∗steps)

Setup tuning of specified parameters to optimize for a custom metric, using multiple input criteria.

• apex_tuning_session_handle apex::setup_custom_tuning (apex_tuning_request &request)

Setup tuning of specified parameters to optimize for a custom metric, using multiple input criteria of potentially multipletypes.

• int apex::setup_timer_throttling (const std::string &the_name, apex_optimization_criteria_t criteria,apex_optimization_method_t method, unsigned long update_interval)

Setup throttling to optimize for the specified function or counter.

• int apex::shutdown_throttling (void)

Terminate the throttling policy.

• int apex::get_thread_cap (void)

Get the current thread cap set by the throttling.

• void apex::set_thread_cap (int new_cap)

Set the current thread cap for throttling.

• std::vector< std::pair< std::string, long ∗>> & apex::get_tunable_params (apex_tuning_session_handle h)

Return a vector of the current tunable parameters.

• bool apex::has_session_converged (apex_tuning_session_handle handle)

Check whether a tuning session has converged.

• void apex::get_best_values (apex_tuning_session_handle h)

Set a tuning session's values to the best known values.

• void apex::print_options (void)

Print out all configuration settings for APEX.

• void apex::send (uint64_t tag, uint64_t size, uint64_t target)

Notify APEX that the current thread is sending a parcel/message to another rank/locality/process.

• void apex::recv (uint64_t tag, uint64_t size, uint64_t source_rank, uint64_t source_thread)

Notify APEX that the current thread is receiving a parcel/message from another rank/locality/process.

Generated by Doxygen

Page 71: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

7.4 /Users/khuck/src/xpress-apex/src/apex/apex_types.h File Reference 63

7.3.1 Macro Definition Documentation

7.3.1.1 APEX_SCOPED_TIMER

#define APEX_SCOPED_TIMER

Value:std::ostringstream _s_foo; \_s_foo « __func__ « " [" « __FILE__ « ":" « __LINE__ « "]"; \apex::scoped_timer __foo(_s_foo.str());

A convenient macro for inserting an APEX self-stopping timer.

This macro will create a timer using the values of func, LINE and FILE from the preprocessor.

7.4 /Users/khuck/src/xpress-apex/src/apex/apex_types.h File Reference

#include <stdint.h>#include <stdbool.h>#include <unistd.h>

Classes

• struct _policy_handle• struct _context• struct _profile

Macros

• #define APEX_NULL_PROFILER_HANDLE (apex_profiler_handle)(nullptr)• #define APEX_MAX_EVENTS 128• #define APEX_NULL_FUNCTION_ADDRESS 0L• #define APEX_IDLE_TIME "APEX Idle"• #define APEX_NON_IDLE_TIME "APEX Non-Idle"• #define APEX_IDLE_RATE "APEX Idle Rate"• #define APEX_DEFAULT_OTF2_ARCHIVE_PATH "OTF2_archive"• #define APEX_DEFAULT_OTF2_ARCHIVE_NAME "APEX"

Typedefs

• typedef void ∗ apex_profiler_handle• typedef uintptr_t apex_function_address• typedef int(∗ apex_policy_function) (apex_context const context)• typedef uint32_t apex_tuning_session_handle

Generated by Doxygen

Page 72: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

64 File Documentation

Enumerations

• enum _apex_profiler_type { APEX_FUNCTION_ADDRESS = 0, APEX_NAME_STRING }• enum _error_codes { APEX_NOERROR = 0, APEX_ERROR }• enum _event_type {

APEX_INVALID_EVENT = -1, APEX_STARTUP = 0, APEX_SHUTDOWN, APEX_DUMP,APEX_RESET, APEX_NEW_NODE, APEX_NEW_THREAD, APEX_EXIT_THREAD,APEX_START_EVENT, APEX_RESUME_EVENT, APEX_STOP_EVENT, APEX_YIELD_EVENT,APEX_SAMPLE_VALUE, APEX_SEND, APEX_RECV, APEX_PERIODIC,APEX_CUSTOM_EVENT_1, APEX_CUSTOM_EVENT_2, APEX_CUSTOM_EVENT_3, APEX_CUSTO←↩

M_EVENT_4,APEX_CUSTOM_EVENT_5, APEX_CUSTOM_EVENT_6, APEX_CUSTOM_EVENT_7, APEX_CUSTO←↩

M_EVENT_8,APEX_UNUSED_EVENT = APEX_MAX_EVENTS }

• enum _thread_state {APEX_IDLE, APEX_BUSY, APEX_THROTTLED, APEX_WAITING,APEX_BLOCKED }

• enum apex_optimization_criteria_t { APEX_MAXIMIZE_THROUGHPUT, APEX_MAXIMIZE_ACCUMULATED,APEX_MINIMIZE_ACCUMULATED }

• enum apex_optimization_method_t { APEX_SIMPLE_HYSTERESIS, APEX_DISCRETE_HILL_CLIMBING,APEX_ACTIVE_HARMONY }

• enum _profile_type { APEX_TIMER, APEX_COUNTER }

7.4.1 Class Documentation

7.4.1.1 struct _policy_handle

A reference to the policy object, so that policies can be "unregistered", or paused later

Class Members

apex_event_type event_type The type of policy

int id The ID of the policy, used internally to APEX

unsigned long period If periodic, the length of the period

7.4.1.2 struct _context

The APEX context when an event occurs.

Class Members

void ∗ data Data associated with the event, such as the custom_data for acustom_event

apex_event_type event_type The type of the event currently processing

apex_policy_handle ∗ policy_handle The policy handle for the current policy function

7.4.1.3 struct _profile

The profile object for a timer in APEX.

Generated by Doxygen

Page 73: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

7.4 /Users/khuck/src/xpress-apex/src/apex/apex_types.h File Reference 65

Class Members

double accumulated Accumulated values for all calls/samples

double calls Number of times a timer was called, or the number of samplescollected for a counter

double maximum Maximum value seen by the timer or counter

double minimum Minimum value seen by the timer or counter

double papi_metrics[8] Array of accumulated PAPI hardware metrics

double sum_squares Running sum of squares calculation for all calls/samples

int times_reset How many times was this timer reset

apex_profile_type type Whether this is a timer or a counter

7.4.2 Macro Definition Documentation

7.4.2.1 APEX_DEFAULT_OTF2_ARCHIVE_NAME

#define APEX_DEFAULT_OTF2_ARCHIVE_NAME "APEX"

Default OTF2 trace name

7.4.2.2 APEX_DEFAULT_OTF2_ARCHIVE_PATH

#define APEX_DEFAULT_OTF2_ARCHIVE_PATH "OTF2_archive"

Default OTF2 trace path

7.4.2.3 APEX_IDLE_RATE

#define APEX_IDLE_RATE "APEX Idle Rate"

Special profile counter for derived idle rate

7.4.2.4 APEX_IDLE_TIME

#define APEX_IDLE_TIME "APEX Idle"

Special profile counter for derived idle time

7.4.2.5 APEX_MAX_EVENTS

#define APEX_MAX_EVENTS 128

The maximum number of event types. Allows for many custom events.

Generated by Doxygen

Page 74: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

66 File Documentation

7.4.2.6 APEX_NON_IDLE_TIME

#define APEX_NON_IDLE_TIME "APEX Non-Idle"

Special profile counter for derived non-idle time

7.4.2.7 APEX_NULL_FUNCTION_ADDRESS

#define APEX_NULL_FUNCTION_ADDRESS 0L

A null pointer representing an APEX function address. Used when a null APEX function address is to be passed into any apex functions to represent "all functions".

7.4.2.8 APEX_NULL_PROFILER_HANDLE

#define APEX_NULL_PROFILER_HANDLE (apex_profiler_handle)(nullptr)

A null pointer representing an APEX profiler handle. Used when a null APEX profile handle is to be passed in toapex::stop when the profiler object wasn't retained locally.

7.4.3 Typedef Documentation

7.4.3.1 apex_function_address

typedef uintptr_t apex_function_address

Rather than use void pointers everywhere, be explicit about what the functions are expecting.

7.4.3.2 apex_policy_function

typedef int(∗ apex_policy_function) (apex_context const context)

Rather than use void pointers everywhere, be explicit about what the functions are expecting.

7.4.3.3 apex_profiler_handle

typedef void∗ apex_profiler_handle

The address of a C++ object in APEX. Not useful for the caller that gets it back, but required for stopping the timerlater.

7.4.3.4 apex_tuning_session_handle

typedef uint32_t apex_tuning_session_handle

A handle to a tuning session.

7.4.4 Enumeration Type Documentation

7.4.4.1 _apex_profiler_type

enum _apex_profiler_type

Generated by Doxygen

Page 75: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

7.4 /Users/khuck/src/xpress-apex/src/apex/apex_types.h File Reference 67

Enumerator

APEX_FUNCTION_ADDRESS The ID is a function (or instruction) address

APEX_NAME_STRING The ID is a character string

7.4.4.2 _error_codes

enum _error_codes

Typedef for enumerating the different event types

Enumerator

APEX_NOERROR No error occurredAPEX_ERROR Some error occurred - check stderr output for details

7.4.4.3 _event_type

enum _event_type

Enumerator

APEX_STARTUP APEX is initializedAPEX_SHUTDOWN APEX is terminated

APEX_DUMP APEX is dumping output

APEX_RESET APEX is resetting data structures

APEX_NEW_NODE APEX has registered a new process ID

APEX_NEW_THREAD APEX has registered a new OS thread

APEX_EXIT_THREAD APEX has exited an OS threadAPEX_START_EVENT APEX has processed a timer start event

APEX_RESUME_EVENT APEX has processed a timer resume event (the number of calls is notincremented)

APEX_STOP_EVENT APEX has processed a timer stop event

APEX_YIELD_EVENT APEX has processed a timer yield event

APEX_SAMPLE_VALUE APEX has processed a sampled value

APEX_SEND APEX has processed a send event

APEX_RECV APEX has processed a recv event

APEX_PERIODIC APEX has processed a periodic timer

APEX_CUSTOM_EVENT←↩

_1APEX has processed a custom event - useful for large granularity applicationcontrol events

Generated by Doxygen

Page 76: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

68 File Documentation

7.4.4.4 _profile_type

enum _profile_type

The type of a profiler object

Enumerator

APEX_TIMER This profile is a instrumented timer

APEX_COUNTER This profile is a sampled counter

7.4.4.5 _thread_state

enum _thread_state

Typedef for enumerating the thread states.

Enumerator

APEX_IDLE Thread is idleAPEX_BUSY Thread is working

APEX_THROTTLED Thread is throttled (sleeping)

APEX_WAITING Thread is waiting for a resource

APEX_BLOCKED Thread is blocked

7.4.4.6 apex_optimization_criteria_t

enum apex_optimization_criteria_t

Typedef for enumerating the different optimization strategies for throttling.

Enumerator

APEX_MAXIMIZE_THROUGHPUT maximize the number of calls to a timer/counterAPEX_MAXIMIZE_ACCUMULATED maximize the accumulated value of a timer/counterAPEX_MINIMIZE_ACCUMULATED minimize the accumulated value of a timer/counter

7.4.4.7 apex_optimization_method_t

enum apex_optimization_method_t

Typedef for enumerating the different optimization methods for throttling.

Generated by Doxygen

Page 77: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

7.5 /Users/khuck/src/xpress-apex/src/comm/apex_global.h File Reference 69

Enumerator

APEX_SIMPLE_HYSTERESIS optimize using sliding window of historical observations. A runningaverage of the most recent N observations are used as themeasurement.

APEX_DISCRETE_HILL_CLIMBING Use a discrete hill climbing algorithm for optimization

APEX_ACTIVE_HARMONY Use Active Harmony for optimization.

7.5 /Users/khuck/src/xpress-apex/src/comm/apex_global.h FileReference

#include "apex.h"

Functions

• int action_apex_reduce (void ∗unused)

the function declaration, this is the funcion that does the reduction

• int action_apex_get_value (void ∗args)

Each node has to populate their local value.

• int apex_periodic_policy_func (apex_context const context)

A policy function to do periodic output.

• void apex_global_setup (apex_profiler_type type, void ∗in_action)

The function to set up global reductions.

• void apex_global_teardown (void)

The function to tear down global reductions, if necessary.

7.5.1 Function Documentation

7.5.1.1 action_apex_get_value()

int action_apex_get_value (

void ∗ args )

Each node has to populate their local value.

Parameters

args Local data to be exchanged globally.

Returns

0 on no error.

Generated by Doxygen

Page 78: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

70 File Documentation

7.5.1.2 action_apex_reduce()

int action_apex_reduce (

void ∗ unused )

the function declaration, this is the funcion that does the reduction

Parameters

unused Unused value.

Returns

0 on no error.

7.5.1.3 apex_global_setup()

void apex_global_setup (

apex_profiler_type type,

void ∗ in_action )

The function to set up global reductions.

Parameters

type The type of the profiler

in_action The name of a timer or address of a function. This is the function timer that should be reducedglobally. This value is used for the example.

Returns

0 on no error.

7.5.1.4 apex_periodic_policy_func()

int apex_periodic_policy_func (

apex_context const context )

A policy function to do periodic output.

Generated by Doxygen

Page 79: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

7.5 /Users/khuck/src/xpress-apex/src/comm/apex_global.h File Reference 71

Parameters

context The context for the periodic policy.

Returns

0 on no error.

Generated by Doxygen

Page 80: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

72 File Documentation

Generated by Doxygen

Page 81: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

Index

/Users/khuck/src/xpress-apex/doc/apex.dox, 43/Users/khuck/src/xpress-apex/src/apex/apex.h, 43/Users/khuck/src/xpress-apex/src/apex/apex_api.hpp,

60/Users/khuck/src/xpress-apex/src/apex/apex_types.h,

63/Users/khuck/src/xpress-apex/src/comm/apex_global.h,

69_apex_profiler_type

apex_types.h, 66_context, 64_error_codes

apex_types.h, 67_event_type

apex_types.h, 67_policy_handle, 64_profile, 64_profile_type

apex_types.h, 67_thread_state

apex_types.h, 68

action_apex_get_valueapex_global.h, 69

action_apex_reduceapex_global.h, 70

apex, 11cleanup, 14custom_event, 14deregister_policy, 15dump, 15exit_thread, 16finalize, 16get_best_values, 16get_profile, 17get_thread_cap, 17get_tunable_params, 18has_session_converged, 18init, 18new_task, 19null_task_wrapper, 20print_options, 20recv, 20register_custom_event, 21register_periodic_policy, 21register_policy, 22register_thread, 23reset, 23, 24resume, 24, 25sample_runtime_counter, 26

sample_value, 26send, 27set_state, 27set_thread_cap, 27setup_custom_tuning, 28setup_power_cap_throttling, 29setup_throughput_tuning, 29setup_timer_throttling, 30, 31shutdown_throttling, 31start, 31, 32stop, 33stop_all_async_threads, 34update_task, 34version, 35yield, 35, 36

apex.hapex_cleanup, 45apex_current_power_high, 45apex_custom_event, 45apex_deregister_policy, 46apex_dump, 46apex_exit_thread, 47apex_finalize, 47apex_get_profile, 47apex_get_thread_cap, 48apex_hardware_concurrency, 48apex_init, 48apex_new_task, 49apex_print_options, 49apex_recv, 49apex_register_custom_event, 50apex_register_periodic_policy, 50apex_register_policy, 51apex_register_thread, 51apex_reset, 52apex_resume, 52apex_resume_guid, 53apex_sample_value, 54apex_send, 54apex_set_state, 54apex_set_thread_cap, 55apex_setup_power_cap_throttling, 55apex_setup_throughput_tuning, 56apex_setup_timer_throttling, 57apex_shutdown_throttling, 57apex_start, 57apex_start_guid, 58apex_stop, 59apex_version, 59

Page 82: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

74 INDEX

apex_yield, 59apex::scoped_thread, 38

scoped_thread, 38apex::scoped_timer, 38

resume, 40scoped_timer, 39, 40start, 41stop, 41yield, 41

apex::task_wrapper, 41get_apex_main_wrapper, 42get_task_id, 42

APEX_ACTIVE_HARMONYapex_types.h, 69

apex_api.hppAPEX_SCOPED_TIMER, 63

APEX_BLOCKEDapex_types.h, 68

APEX_BUSYapex_types.h, 68

apex_cleanupapex.h, 45

APEX_COUNTERapex_types.h, 68

apex_current_power_highapex.h, 45

apex_custom_eventapex.h, 45

APEX_CUSTOM_EVENT_1apex_types.h, 67

APEX_DEFAULT_OTF2_ARCHIVE_NAMEapex_types.h, 65

APEX_DEFAULT_OTF2_ARCHIVE_PATHapex_types.h, 65

apex_deregister_policyapex.h, 46

APEX_DISCRETE_HILL_CLIMBINGapex_types.h, 69

APEX_DUMPapex_types.h, 67

apex_dumpapex.h, 46

APEX_ERRORapex_types.h, 67

apex_event_type, 37APEX_EXIT_THREAD

apex_types.h, 67apex_exit_thread

apex.h, 47apex_finalize

apex.h, 47APEX_FUNCTION_ADDRESS

apex_types.h, 67apex_function_address

apex_types.h, 66apex_get_profile

apex.h, 47apex_get_thread_cap

apex.h, 48apex_global.h

action_apex_get_value, 69action_apex_reduce, 70apex_global_setup, 70apex_periodic_policy_func, 70

apex_global_setupapex_global.h, 70

apex_hardware_concurrencyapex.h, 48

APEX_IDLEapex_types.h, 68

APEX_IDLE_RATEapex_types.h, 65

APEX_IDLE_TIMEapex_types.h, 65

apex_initapex.h, 48

APEX_MAX_EVENTSapex_types.h, 65

APEX_MAXIMIZE_ACCUMULATEDapex_types.h, 68

APEX_MAXIMIZE_THROUGHPUTapex_types.h, 68

APEX_MINIMIZE_ACCUMULATEDapex_types.h, 68

APEX_NAME_STRINGapex_types.h, 67

APEX_NEW_NODEapex_types.h, 67

apex_new_taskapex.h, 49

APEX_NEW_THREADapex_types.h, 67

APEX_NOERRORapex_types.h, 67

APEX_NON_IDLE_TIMEapex_types.h, 65

APEX_NULL_FUNCTION_ADDRESSapex_types.h, 66

APEX_NULL_PROFILER_HANDLEapex_types.h, 66

apex_optimization_criteria_tapex_types.h, 68

apex_optimization_method_tapex_types.h, 68

APEX_PERIODICapex_types.h, 67

apex_periodic_policy_funcapex_global.h, 70

apex_policy_functionapex_types.h, 66

apex_print_optionsapex.h, 49

apex_profiler_handleapex_types.h, 66

apex_profiler_type, 37APEX_RECV

Generated by Doxygen

Page 83: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

INDEX 75

apex_types.h, 67apex_recv

apex.h, 49apex_register_custom_event

apex.h, 50apex_register_periodic_policy

apex.h, 50apex_register_policy

apex.h, 51apex_register_thread

apex.h, 51APEX_RESET

apex_types.h, 67apex_reset

apex.h, 52apex_resume

apex.h, 52APEX_RESUME_EVENT

apex_types.h, 67apex_resume_guid

apex.h, 53APEX_SAMPLE_VALUE

apex_types.h, 67apex_sample_value

apex.h, 54APEX_SCOPED_TIMER

apex_api.hpp, 63APEX_SEND

apex_types.h, 67apex_send

apex.h, 54apex_set_state

apex.h, 54apex_set_thread_cap

apex.h, 55apex_setup_power_cap_throttling

apex.h, 55apex_setup_throughput_tuning

apex.h, 56apex_setup_timer_throttling

apex.h, 57APEX_SHUTDOWN

apex_types.h, 67apex_shutdown_throttling

apex.h, 57APEX_SIMPLE_HYSTERESIS

apex_types.h, 69apex_start

apex.h, 57APEX_START_EVENT

apex_types.h, 67apex_start_guid

apex.h, 58APEX_STARTUP

apex_types.h, 67apex_stop

apex.h, 59APEX_STOP_EVENT

apex_types.h, 67APEX_THROTTLED

apex_types.h, 68APEX_TIMER

apex_types.h, 68apex_tuning_session_handle

apex_types.h, 66apex_types.h

_apex_profiler_type, 66_error_codes, 67_event_type, 67_profile_type, 67_thread_state, 68APEX_ACTIVE_HARMONY, 69APEX_BLOCKED, 68APEX_BUSY, 68APEX_COUNTER, 68APEX_CUSTOM_EVENT_1, 67APEX_DEFAULT_OTF2_ARCHIVE_NAME, 65APEX_DEFAULT_OTF2_ARCHIVE_PATH, 65APEX_DISCRETE_HILL_CLIMBING, 69APEX_DUMP, 67APEX_ERROR, 67APEX_EXIT_THREAD, 67APEX_FUNCTION_ADDRESS, 67apex_function_address, 66APEX_IDLE, 68APEX_IDLE_RATE, 65APEX_IDLE_TIME, 65APEX_MAX_EVENTS, 65APEX_MAXIMIZE_ACCUMULATED, 68APEX_MAXIMIZE_THROUGHPUT, 68APEX_MINIMIZE_ACCUMULATED, 68APEX_NAME_STRING, 67APEX_NEW_NODE, 67APEX_NEW_THREAD, 67APEX_NOERROR, 67APEX_NON_IDLE_TIME, 65APEX_NULL_FUNCTION_ADDRESS, 66APEX_NULL_PROFILER_HANDLE, 66apex_optimization_criteria_t, 68apex_optimization_method_t, 68APEX_PERIODIC, 67apex_policy_function, 66apex_profiler_handle, 66APEX_RECV, 67APEX_RESET, 67APEX_RESUME_EVENT, 67APEX_SAMPLE_VALUE, 67APEX_SEND, 67APEX_SHUTDOWN, 67APEX_SIMPLE_HYSTERESIS, 69APEX_START_EVENT, 67APEX_STARTUP, 67APEX_STOP_EVENT, 67APEX_THROTTLED, 68APEX_TIMER, 68apex_tuning_session_handle, 66

Generated by Doxygen

Page 84: Autonomic Performance Environment for eXascale (APEX)khuck/apex_docs/doc/refman.pdfAutonomic Performance Environment for eXascale (APEX) 0.5 Generated by Doxygen 1.8.10 Wed May 4 2016

76 INDEX

APEX_WAITING, 68APEX_YIELD_EVENT, 67

apex_versionapex.h, 59

APEX_WAITINGapex_types.h, 68

apex_yieldapex.h, 59

APEX_YIELD_EVENTapex_types.h, 67

cleanupapex, 14

custom_eventapex, 14

deregister_policyapex, 15

dumpapex, 15

exit_threadapex, 16

finalizeapex, 16

get_apex_main_wrapperapex::task_wrapper, 42

get_best_valuesapex, 16

get_profileapex, 17

get_task_idapex::task_wrapper, 42

get_thread_capapex, 17

get_tunable_paramsapex, 18

has_session_convergedapex, 18

initapex, 18

new_taskapex, 19

null_task_wrapperapex, 20

print_optionsapex, 20

recvapex, 20

register_custom_eventapex, 21

register_periodic_policyapex, 21

register_policyapex, 22

register_threadapex, 23

resetapex, 23, 24

resumeapex, 24, 25apex::scoped_timer, 40

sample_runtime_counterapex, 26

sample_valueapex, 26

scoped_threadapex::scoped_thread, 38

scoped_timerapex::scoped_timer, 39, 40

sendapex, 27

set_stateapex, 27

set_thread_capapex, 27

setup_custom_tuningapex, 28

setup_power_cap_throttlingapex, 29

setup_throughput_tuningapex, 29

setup_timer_throttlingapex, 30, 31

shutdown_throttlingapex, 31

startapex, 31, 32apex::scoped_timer, 41

stopapex, 33apex::scoped_timer, 41

stop_all_async_threadsapex, 34

update_taskapex, 34

versionapex, 35

yieldapex, 35, 36apex::scoped_timer, 41

Generated by Doxygen