Skip to content

Commit 4debbd4

Browse files
committed
Update deps for updated parser and collectives
* Depends libsesstype 1.4.3 and libscribble 1.3.4 * Update collective operation generator to detect group (non-all) collectives * Adds incomplete support for inline groups
1 parent 38d2113 commit 4debbd4

File tree

7 files changed

+217
-33
lines changed

7 files changed

+217
-33
lines changed

debian/changelog

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
pabble-mpi (1.1.1) unstable; urgency=low
2+
3+
* Depends libsesstype 1.4.3 and libscribble 1.3.4
4+
* Update collective operation generator to detect group (non-all)
5+
collectives
6+
* Adds incomplete support for inline groups
7+
8+
-- Nicholas Ng <[email protected]> Thu, 5 Dec 2013 21:14:30 +0000
9+
110
pabble-mpi (1.1.0) unstable; urgency=low
211

312
* Add non-deterministic receive support

debian/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Vcs-Git: git://github.com/sessionc/pabble-mpi.git
99

1010
Package: pabble-mpi
1111
Architecture: amd64
12-
Depends: ${shlibs:Depends}, ${misc:Depends}, libsesstype (>=1.4.1), libscribble (>=1.3.3~scribble0.3+pabble)
12+
Depends: ${shlibs:Depends}, ${misc:Depends}, libsesstype (>=1.4.3), libscribble (>=1.3.4~scribble0.3+pabble)
1313
Description: Scribble to MPI conversion tool
1414
Binary tool to convert Scribble/Pabble (endpoint) communication protocols to MPI/C code.
1515
This is part of Session C programming framework. See http://www.doc.ic.ac.uk/~cn06/sessionc for details.

include/scribble/mpi_print.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ void mpi_print(FILE *stream, st_tree *local_tree);
2525
void mpi_fprintf(FILE *stream, const char *format, ...);
2626

2727
// Helpers
28+
//
29+
int is_role_in_group(char *role_name, st_tree *tree);
2830

2931
void mpi_fprint_const_or_var(FILE *stream, st_tree *tree, st_expr *expr);
3032
void mpi_fprint_msg_cond(FILE *stream, st_tree *tree, const msg_cond_t *msg_cond, int indent);

src/pabble-mpi-tool.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <unistd.h>
77

88
#include <sesstype/st_node.h>
9+
#include <sesstype/st_node_print.h>
910
#include <sesstype/st_normalise.h>
1011

1112
#include <scribble/parser.h>

src/print.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
#include <unistd.h>
77

88
#include <sesstype/st_node.h>
9+
#ifdef __DEBUG__
10+
#include <sesstype/st_node_print.h>
11+
#endif
912
#include <scribble/print.h>
1013

1114
#include "scribble/mpi_print.h"
@@ -44,8 +47,6 @@ void mpi_find_labels(st_node *node)
4447
}
4548

4649

47-
48-
4950
void mpi_fprint_choice(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tree *tree, st_node *node, int indent)
5051
{
5152
assert(node != NULL && node->type == ST_NODE_CHOICE);
@@ -125,6 +126,10 @@ void mpi_fprint_choice(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tre
125126
void mpi_fprint_node(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tree *tree, st_node *node, int indent)
126127
{
127128
assert(node != NULL);
129+
#ifdef __DEBUG__
130+
st_node_fprint(stderr, node, 0);
131+
fprintf(stderr, "\n");
132+
#endif
128133

129134
switch (node->type) {
130135
case ST_NODE_ROOT: mpi_fprint_root(pre_stream, stream, post_stream, tree, node, indent); break;

src/print_collective.c

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <string.h>
55

66
#include <sesstype/st_node.h>
7+
#include <sesstype/st_node_print.h>
78
#include <scribble/print.h>
89

910
#include "scribble/mpi_print.h"
@@ -14,6 +15,13 @@ extern unsigned int mpi_primitive_count;
1415

1516
void mpi_fprint_allgather(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tree *tree, st_node *node, int indent)
1617
{
18+
#ifdef __DEBUG__
19+
fprintf(stderr, "INFO/%s:%d %s entry\nINFO/", __FILE__, __LINE__, __FUNCTION__);
20+
st_node_fprint(stderr, node, indent);
21+
#endif
22+
23+
assert(node != NULL);
24+
1725
// Variable declarations
1826
mpi_fprintf(pre_stream, " int count%u = 1 /* CHANGE ME */;\n", mpi_primitive_count);
1927

@@ -53,8 +61,12 @@ void mpi_fprint_allgather(FILE *pre_stream, FILE *stream, FILE *post_stream, st_
5361

5462
void mpi_fprint_allreduce(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tree *tree, st_node *node, int indent)
5563
{
56-
assert(node != NULL && node->type == ST_NODE_ALLREDUCE);
64+
#ifdef __DEBUG__
65+
fprintf(stderr, "INFO/%s:%d %s entry\nINFO/", __FILE__, __LINE__, __FUNCTION__);
66+
st_node_fprint(stderr, node, indent);
67+
#endif
5768

69+
assert(node != NULL && node->type == ST_NODE_ALLREDUCE);
5870

5971
// Variable declarations
6072
mpi_fprintf(pre_stream, " int count%u = 1 /* CHANGE ME */;\n", mpi_primitive_count);
@@ -85,8 +97,12 @@ void mpi_fprint_allreduce(FILE *pre_stream, FILE *stream, FILE *post_stream, st_
8597

8698
void mpi_fprint_scatter(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tree *tree, st_node *node, int indent)
8799
{
88-
assert(node != NULL && node->type == ST_NODE_RECV);
100+
#ifdef __DEBUG__
101+
fprintf(stderr, "INFO/%s:%d %s entry\nINFO/", __FILE__, __LINE__, __FUNCTION__);
102+
st_node_fprint(stderr, node, indent);
103+
#endif
89104

105+
assert(node != NULL && node->type == ST_NODE_RECV);
90106

91107
// Variable declarations
92108
mpi_fprintf(pre_stream, " int count%u = 1 /* CHANGE ME */;\n", mpi_primitive_count);
@@ -114,7 +130,15 @@ void mpi_fprint_scatter(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tr
114130
if (param!=0) mpi_fprintf(stream, ",");
115131
mpi_fprint_const_or_var(stream, tree, node->interaction->from->param[param]);
116132
}
117-
mpi_fprintf(stream, "), MPI_COMM_WORLD);\n");
133+
if (is_role_in_group(node->interaction->msg_cond->name, tree)) {
134+
mpi_fprintf(stream, "), %s_comm);\n", node->interaction->msg_cond->name);
135+
} else if (strcmp(node->interaction->msg_cond->name, ST_ROLE_ALL) == 0) {
136+
mpi_fprintf(stream, "), MPI_COMM_WORLD);\n");
137+
} else {
138+
fprintf(stderr, "ERROR/%s:%d %s Cannot determine communicator (inline group?), defaulting to MPI_COMM_WORLD\n", __FILE__, __LINE__, __FUNCTION__);
139+
// TODO Inline group not given name
140+
mpi_fprintf(stream, "), MPI_COMM_WORLD);\n");
141+
}
118142
mpi_fprintf(stream, "#pragma pabble compute%u (buf%u, count%u)\n", mpi_primitive_count, mpi_primitive_count, mpi_primitive_count);
119143

120144
mpi_fprintf(post_stream, " free(sbuf%u);\n", mpi_primitive_count);
@@ -125,8 +149,12 @@ void mpi_fprint_scatter(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tr
125149

126150
void mpi_fprint_gather(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tree *tree, st_node *node, int indent)
127151
{
128-
assert(node != NULL && node->type == ST_NODE_SEND);
152+
#ifdef __DEBUG__
153+
fprintf(stderr, "INFO/%s:%d %s entry\nINFO/", __FILE__, __LINE__, __FUNCTION__);
154+
st_node_fprint(stderr, node, indent);
155+
#endif
129156

157+
assert(node != NULL && node->type == ST_NODE_SEND);
130158

131159
// Variable declarations
132160
mpi_fprintf(pre_stream, " int count%u = 1 /* CHANGE ME */;\n", mpi_primitive_count);
@@ -162,7 +190,15 @@ void mpi_fprint_gather(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tre
162190
if (param!=0) mpi_fprintf(stream, ",");
163191
mpi_fprint_const_or_var(stream, tree, node->interaction->to[0]->param[param]);
164192
}
165-
mpi_fprintf(stream, "), MPI_COMM_WORLD);\n");
193+
if (is_role_in_group(node->interaction->msg_cond->name, tree)) {
194+
mpi_fprintf(stream, "), %s_comm);\n", node->interaction->msg_cond->name);
195+
} else if (strcmp(node->interaction->msg_cond->name, ST_ROLE_ALL) == 0) {
196+
mpi_fprintf(stream, "), MPI_COMM_WORLD);\n");
197+
} else {
198+
fprintf(stderr, "ERROR/%s:%d %s Cannot determine communicator (inline group?), defaulting to MPI_COMM_WORLD\n", __FILE__, __LINE__, __FUNCTION__);
199+
// TODO Inline group not given name
200+
mpi_fprintf(stream, "), MPI_COMM_WORLD);\n");
201+
}
166202
mpi_fprintf(stream, "#pragma pabble compute%u (buf%u, count%u)\n", mpi_primitive_count, mpi_primitive_count, mpi_primitive_count);
167203

168204
mpi_fprintf(post_stream, " free(sbuf%u);\n", mpi_primitive_count);

0 commit comments

Comments
 (0)