-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgoldrush_f.c
124 lines (113 loc) · 2.32 KB
/
goldrush_f.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/**
* Fortran interface of GoldRush public APIs
*
*/
#include "goldrush.h"
/*
* Initialize GoldRush runtime library.
* Called by both simulation and analysis.
*
* Parameter:
* comm: MPI communicator of the calling program
*
* Return 0 for success and -1 for error.
*/
int gr_init_(MPI_Fint *comm)
{
MPI_Comm c_comm = MPI_Comm_f2c(*comm);
return gr_init(c_comm);
}
/*
* Finalize GoldRush runtime library.
* Called by both simulation and analysis.
*
* Return 0 for success and -1 for error.
*/
int gr_finalize_()
{
return gr_finalize();
}
/*
* Set the applicaiton ID.
*/
void gr_set_application_id_(int *id)
{
gr_set_application_id(*id);
}
/*
* Get the applicaiton ID.
*/
void gr_get_application_id_(int *id)
{
gr_get_application_id(id);
}
/* Public API used by simulation code */
/*
* Mark the start of mainloop
*/
int gr_mainloop_start_()
{
return gr_mainloop_start();
}
/*
* Mark the end of mainloop
*/
int gr_mainloop_end_()
{
return gr_mainloop_end();
}
/*
* Mark the start of a phase.
*
* Parameter:
* file: an integer identifying a source file
* line: an integer identifying line number in source file
*
* Return 0 for success and -1 for error.
*/
int gr_phase_start_(unsigned long int *file, unsigned int *line)
{
int rc = gr_phase_start(*file, *line);
return rc;
}
/*
* Mark the end of a phase. It must match a gr_phase_start() call.
*
* Parameter:
* file: an integer identifying a source file
* line: an integer identifying line number in source file
*
* Return 0 for success and -1 for error.
*/
int gr_phase_end_(unsigned long int *file, unsigned int *line)
{
return gr_phase_end(*file, *line);
}
/*
* Retrieve a list of registered receivers.
*
* Parameter:
* receivers: an array of receiver handles
* num_receivers: number of receiver handles
*
* Return 0 for success and -1 for error.
*/
int gr_get_receivers_()
{
gr_receiver_t receivers;
int num_receivers;
return gr_get_receivers(&receivers, &num_receivers);
}
/*
* Load a scheduler specified by name
*
* Parameter:
* sched_name: name of scheduler
* interval: scheduling interval in milliseconds
*
* Return 0 for success and -1 for error.
*/
int gr_load_scheduelr_(char *sched_name, int *interval, int sched_name_size)
{
return gr_load_scheduler(sched_name, *interval);
}