StarPU Internal Handbook
starpu_fxt.h
Go to the documentation of this file.
1 /* StarPU --- Runtime system for heterogeneous multicore architectures.
2  *
3  * Copyright (C) 2009-2022 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
4  * Copyright (C) 2018-2020 Federal University of Rio Grande do Sul (UFRGS)
5  *
6  * StarPU is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation; either version 2.1 of the License, or (at
9  * your option) any later version.
10  *
11  * StarPU is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  *
15  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
16  */
17 
18 #ifndef __STARPU__FXT_H__
19 #define __STARPU__FXT_H__
20 
23 #include <starpu.h>
24 #include <starpu_config.h>
25 #include <common/config.h>
26 
27 #ifdef STARPU_USE_FXT
28 
29 #include <search.h>
30 
31 #include <sys/types.h>
32 #include <sys/stat.h>
33 #include <fcntl.h>
34 #include <stdio.h>
35 #include <stdint.h>
36 #include <stdlib.h>
37 
38 #include <common/fxt.h>
39 #include <common/list.h>
40 #include "../mpi/src/starpu_mpi_fxt.h"
41 #include <starpu.h>
42 #include "../../../include/starpu_fxt.h"
43 
44 #ifdef STARPU_HAVE_POTI
45 #include <poti.h>
46 #define STARPU_POTI_STR_LEN 200
47 #endif
48 #define STARPU_TRACE_STR_LEN 200
49 
50 #pragma GCC visibility push(hidden)
51 
52 extern char _starpu_last_codelet_symbol[STARPU_NMAXWORKERS][(FXT_MAX_PARAMS-5)*sizeof(unsigned long)];
53 
54 void _starpu_fxt_dag_init(char *dag_filename);
55 void _starpu_fxt_dag_terminate(void);
56 void _starpu_fxt_dag_add_tag(const char *prefix, uint64_t tag, unsigned long job_id, const char *label);
57 void _starpu_fxt_dag_add_tag_deps(const char *prefix, uint64_t child, uint64_t father, const char *label);
58 void _starpu_fxt_dag_set_tag_done(const char *prefix, uint64_t tag, const char *color, const char *fontcolor);
59 void _starpu_fxt_dag_add_task_deps(const char *prefix, unsigned long dep_prev, unsigned long dep_succ, const char *label);
60 void _starpu_fxt_dag_add_task_end_dep(const char *prefix, unsigned long prev, unsigned long succ);
61 void _starpu_fxt_dag_set_task_name(const char *prefix, unsigned long job_id, const char *label, const char *color, const char *fontcolor);
62 #ifdef STARPU_BUBBLE
63 void _starpu_fxt_dag_set_task_bubble(const char *prefix, unsigned long job_id, int is_bubble, unsigned long bubble_parent);
64 #endif
65 void _starpu_fxt_dag_set_task_line(const char *prefix, unsigned long job_id, const char *file, int line);
66 void _starpu_fxt_dag_add_send(int src, unsigned long dep_prev, unsigned long tag, unsigned long id);
67 void _starpu_fxt_dag_add_receive(int dst, unsigned long dep_prev, unsigned long tag, unsigned long id);
68 void _starpu_fxt_dag_add_sync_point(void);
69 unsigned _starpu_fxt_data_get_coord(unsigned long handle, int mpi_rank, unsigned dim);
70 const char * _starpu_fxt_data_get_name(unsigned long handle, int mpi_rank);
71 
72 void _starpu_convert_numa_nodes_bitmap_to_str(long bitmap, char str[]);
73 
74 /*
75  * MPI
76  */
77 
78 struct starpu_fxt_mpi_offset _starpu_fxt_mpi_find_sync_points(char *filename_in, int *key, int *rank);
79 void _starpu_fxt_mpi_add_send_transfer(int src, int dst, long mpi_tag, size_t size, float date, long jobid, unsigned long handle, unsigned type, int prio);
80 void _starpu_fxt_mpi_send_transfer_set_numa_node(int src, int dest, long jobid, long numa_nodes_bitmap);
81 void _starpu_fxt_mpi_add_recv_transfer(int src, int dst, long mpi_tag, float date, long jobid, unsigned long handle);
82 void _starpu_fxt_mpi_recv_transfer_set_numa_node(int src, int dst, long jobid, long numa_nodes_bitmap);
83 void _starpu_fxt_display_mpi_transfers(struct starpu_fxt_options *options, int *ranks, FILE *out_paje_file, FILE* out_comms_file);
84 
85 void _starpu_fxt_write_paje_header(FILE *file, struct starpu_fxt_options *options);
86 
87 extern int _starpu_poti_extendedSetState;
88 extern int _starpu_poti_semiExtendedSetState;
89 extern int _starpu_poti_MemoryEvent;
90 extern int _starpu_poti_CommLinkStart;
91 extern int _starpu_poti_MpiLinkStart;
92 
93 /*
94  * Animation
95  */
96 void _starpu_fxt_component_print_header(FILE *output);
97 void _starpu_fxt_component_new(uint64_t component, char *name);
98 void _starpu_fxt_component_connect(uint64_t parent, uint64_t child);
99 void _starpu_fxt_component_update_ntasks(unsigned nsubmitted, unsigned curq_size);
100 void _starpu_fxt_component_push(FILE *output, struct starpu_fxt_options *options, double timestamp, int workerid, uint64_t from, uint64_t to, uint64_t task, unsigned prio);
101 void _starpu_fxt_component_pull(FILE *output, struct starpu_fxt_options *options, double timestamp, int workerid, uint64_t from, uint64_t to, uint64_t task, unsigned prio);
102 void _starpu_fxt_component_dump(FILE *output);
103 void _starpu_fxt_component_finish(FILE *output);
104 void _starpu_fxt_component_deinit(void);
105 
106 #pragma GCC visibility pop
107 
108 #endif // STARPU_USE_FXT
109 
110 #endif // __STARPU__FXT_H__
#define STARPU_NMAXWORKERS
Definition: starpu_config.h:284