Skip to content

Commit 38d2113

Browse files
committed
Add support for existential operator
1 parent b8aa6cb commit 38d2113

File tree

9 files changed

+161
-17
lines changed

9 files changed

+161
-17
lines changed

debian/changelog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
pabble-mpi (1.1.0) unstable; urgency=low
2+
3+
* Add non-deterministic receive support
4+
* Depends libsesstype 1.4.1 and libscribble 1.3.3
5+
6+
-- Nicholas Ng <[email protected]> Sat, 23 Nov 2013 18:26:37 +0000
7+
18
pabble-mpi (1.0.1) unstable; urgency=low
29

310
* Initial release

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.2.0), libscribble (>=1.2.0~scribble0.3+pabble)
12+
Depends: ${shlibs:Depends}, ${misc:Depends}, libsesstype (>=1.4.1), libscribble (>=1.3.3~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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ void mpi_fprint_expr(FILE *stream, st_expr *expr);
3333
void mpi_fprint_rank(FILE *stream, st_expr *param, const char *replace, const char *with);
3434
void mpi_fprint_role(FILE *stream, st_role *role);
3535
void mpi_fprint_children(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tree *tree, st_node *node, int indent);
36+
st_node *next_interaction(st_node *node);
3637

3738
void mpi_fprint_node(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tree *tree, st_node *node, int indent);
3839
void mpi_fprint_root(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tree *tree, st_node *node, int indent);
@@ -48,6 +49,9 @@ void mpi_fprint_allgather(FILE *pre_stream, FILE *stream, FILE *post_stream, st_
4849
void mpi_fprint_scatter(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tree *tree, st_node *node, int indent);
4950
void mpi_fprint_gather(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tree *tree, st_node *node, int indent);
5051

52+
void mpi_fprint_ifblk(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tree *tree, st_node *node, int indent);
53+
void mpi_fprint_oneof(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tree *tree, st_node *node, int indent);
54+
5155

5256
#ifdef __cplusplus
5357
}

src/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
ROOT := ..
66
include $(ROOT)/Common.mk
77

8-
OBJS := $(BUILD_DIR)/print.o $(BUILD_DIR)/print_sendrecv.o $(BUILD_DIR)/print_common.o $(BUILD_DIR)/print_collective.o
8+
OBJS := $(BUILD_DIR)/print.o $(BUILD_DIR)/print_sendrecv.o $(BUILD_DIR)/print_common.o $(BUILD_DIR)/print_collective.o $(BUILD_DIR)/print_dynamic.o
99

1010
all: objs
1111
$(CC) $(CFLAGS) pabble-mpi-tool.c \

src/print.c

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ void mpi_fprint_choice(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tre
6464
indent++;
6565

6666
// Representing all branches
67-
for (int child=0; node->nchild; child++) {
67+
for (int child=0; child<node->nchild; child++) {
6868

6969
indent++;
7070
mpi_fprint_node(pre_stream, stream, post_stream, tree, node->children[child], indent);
@@ -118,12 +118,14 @@ void mpi_fprint_choice(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tre
118118

119119
indent--;
120120

121-
mpi_fprintf(stream, "} // rank selection\n");
121+
mpi_fprintf(stream, "%*s} // rank selection\n", indent, SPACE);
122122
}
123123

124124

125125
void mpi_fprint_node(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tree *tree, st_node *node, int indent)
126126
{
127+
assert(node != NULL);
128+
127129
switch (node->type) {
128130
case ST_NODE_ROOT: mpi_fprint_root(pre_stream, stream, post_stream, tree, node, indent); break;
129131
case ST_NODE_SEND: mpi_fprint_send(pre_stream, stream, post_stream, tree, node, indent); break;
@@ -134,6 +136,8 @@ void mpi_fprint_node(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tree
134136
case ST_NODE_CONTINUE: mpi_fprint_continue(pre_stream, stream, post_stream, tree, node, indent); break;
135137
case ST_NODE_FOR: mpi_fprint_for(pre_stream, stream, post_stream, tree, node, indent); break;
136138
case ST_NODE_ALLREDUCE: mpi_fprint_allreduce(pre_stream, stream, post_stream, tree, node, indent); break;
139+
case ST_NODE_IFBLK: mpi_fprint_ifblk(pre_stream, stream, post_stream, tree, node, indent); break;
140+
case ST_NODE_ONEOF: mpi_fprint_oneof(pre_stream, stream, post_stream, tree, node, indent); break;
137141

138142
case ST_NODE_SENDRECV: assert(0/* Global protocol not possible */); break;
139143
default: fprintf(stderr, "%s:%d %s Unknown node type: %d\n", __FILE__, __LINE__, __FUNCTION__, node->type);
@@ -172,6 +176,7 @@ void mpi_fprint_recur(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tree
172176
scribble_fprint_node(stream, node, indent+1);
173177
mpi_fprintf(stream, "%*s*/\n", indent, SPACE);
174178

179+
mpi_fprintf(stream, "#pragma pabble loop\n");
175180
mpi_fprintf(stream, "%*swhile (1/* CHANGEME */) {\n", indent, SPACE);
176181

177182
mpi_fprint_children(pre_stream, stream, post_stream, tree, node, indent);
@@ -211,6 +216,9 @@ void mpi_fprint_for(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tree *
211216
mpi_fprint_expr(stream, node->forloop->range->to);
212217
mpi_fprintf(stream, "; %s++) {\n", node->forloop->range->bindvar);
213218
indent++;
219+
if (node->forloop->except != NULL) {
220+
mpi_fprintf(stream, "%*sif (%s!=%s) continue; // SKIP\n", indent, SPACE, node->forloop->range->bindvar, node->forloop->except);
221+
}
214222
for (int child=0; child<node->nchild; ++child) {
215223
mpi_fprint_node(pre_stream, stream, post_stream, tree, node->children[child], indent);
216224
}
@@ -248,6 +256,10 @@ void mpi_fprint(FILE *stream, st_tree *tree)
248256
FILE *tail_fp = fdopen(mkstemp(tail_tmpfile), "w+");
249257
unlink(tail_tmpfile);
250258

259+
#ifdef __DEBUG__
260+
fprintf(stderr, "DEBUG/%s:%d headers..\n", __FUNCTION__, __LINE__);
261+
#endif
262+
251263
/**
252264
* Includes.
253265
*/
@@ -257,6 +269,10 @@ void mpi_fprint(FILE *stream, st_tree *tree)
257269
mpi_fprintf(stream, "#include <string.h>\n");
258270
mpi_fprintf(stream, "#include <mpi.h>\n\n");
259271

272+
#ifdef __DEBUG__
273+
fprintf(stderr, "DEBUG/%s:%d auto generate label/tags..\n", __FUNCTION__, __LINE__);
274+
#endif
275+
260276
/**
261277
* Define MPI tags / Pabble message labels as constants.
262278
* (1) Walk whole st_tree->root to find unique labels
@@ -271,6 +287,9 @@ void mpi_fprint(FILE *stream, st_tree *tree)
271287
}
272288
}
273289

290+
#ifdef __DEBUG__
291+
fprintf(stderr, "DEBUG/%s:%d rank conversion macros..\n", __FUNCTION__, __LINE__);
292+
#endif
274293

275294
/**
276295
* Define macros to convert multi-dimension roles to MPI ranks.
@@ -280,16 +299,22 @@ void mpi_fprint(FILE *stream, st_tree *tree)
280299
* => declared constants (eg. N) = find value (if defined), use as is otherwise
281300
* (3) Derive and bind values of constants from SIZE_VARIABLE
282301
*/
283-
mpi_fprintf(stream, "\n/*** Scirbble parameterised role to MPI rank conversion macros ***/\n");
302+
mpi_fprintf(stream, "\n/*** Scribble parameterised role to MPI rank conversion macros ***/\n");
284303
int mpi_nroles = 0;
285304
for (int role=0; role<tree->info->nrole; role++) {
286305
switch (tree->info->roles[role]->dimen) {
287306
case 0: // Ordinary role, use defined rank value
307+
#ifdef __DEBUG__
308+
fprintf(stderr, "DEBUG/%s:%d rank conversion macro for %s..\n", __FUNCTION__, __LINE__, tree->info->roles[role]->name);
309+
#endif
288310
mpi_fprintf(stream, "#define %s_RANK %d\n\n", tree->info->roles[role]->name, mpi_nroles);
289311
mpi_nroles++;
290312
break;
291313
case 1:
292314
case 2:
315+
#ifdef __DEBUG__
316+
fprintf(stderr, "DEBUG/%s:%d rank conversion macro for %s..\n", __FUNCTION__, __LINE__, tree->info->roles[role]->name);
317+
#endif
293318
assert(tree->info->roles[role]->dimen <= 2 /* Won't work with > 2 dimen for now */);
294319

295320
mpi_fprintf(stream, "#define %s_RANK(", tree->info->roles[role]->name);
@@ -321,6 +346,10 @@ void mpi_fprint(FILE *stream, st_tree *tree)
321346
}
322347
}
323348

349+
#ifdef __DEBUG__
350+
fprintf(stderr, "DEBUG/%s:%d generate main/declarations..\n", __FUNCTION__, __LINE__);
351+
#endif
352+
324353
mpi_fprintf(stream, "\n\nint main(int argc, char *argv[])\n");
325354
mpi_fprintf(stream, "{\n");
326355
mpi_fprintf(stream, " int %s, %s; // MPI variables\n", RANK_VARIABLE, SIZE_VARIABLE);

src/print_collective.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ void mpi_fprint_allgather(FILE *pre_stream, FILE *stream, FILE *post_stream, st_
2929
strlen(node->interaction->msgsig.payload) == 0 ? "unsigned char" : node->interaction->msgsig.payload,
3030
mpi_primitive_count);
3131

32+
mpi_fprintf(stream, "#pragma pabble compute%u (buf%u, count%u)\n", mpi_primitive_count, mpi_primitive_count, mpi_primitive_count);
3233
mpi_fprintf(stream, "%*sMPI_Allgather(sbuf%u, count%u, ", indent, SPACE, mpi_primitive_count, mpi_primitive_count);
3334
mpi_fprint_datatype(stream, node->interaction->msgsig);
3435
mpi_fprintf(stream, ", ");
@@ -41,6 +42,7 @@ void mpi_fprint_allgather(FILE *pre_stream, FILE *stream, FILE *post_stream, st_
4142
} else {
4243
mpi_fprintf(stream, "%s_comm);\n", node->interaction->from == NULL? node->interaction->to[0]->name : node->interaction->from->name);
4344
}
45+
mpi_fprintf(stream, "#pragma pabble compute%u (buf%u, count%u)\n", mpi_primitive_count, mpi_primitive_count, mpi_primitive_count);
4446

4547
mpi_fprintf(post_stream, " free(sbuf%u);\n", mpi_primitive_count);
4648
mpi_fprintf(post_stream, " free(rbuf%u);\n", mpi_primitive_count);
@@ -69,9 +71,11 @@ void mpi_fprint_allreduce(FILE *pre_stream, FILE *stream, FILE *post_stream, st_
6971
strlen(node->interaction->msgsig.payload) == 0 ? "unsigned char" : node->interaction->msgsig.payload,
7072
mpi_primitive_count);
7173

74+
mpi_fprintf(stream, "#pragma pabble compute%u (buf%u, count%u)\n", mpi_primitive_count, mpi_primitive_count, mpi_primitive_count);
7275
mpi_fprintf(stream, "%*sMPI_Reduce(sbuf%u, rbuf%u, count, ", indent, SPACE, mpi_primitive_count, mpi_primitive_count);
7376
mpi_fprint_datatype(stream, node->interaction->msgsig);
7477
mpi_fprintf(stream, ", %s, MPI_COMM_WORLD);\n", node->interaction->msgsig.op); // MPI_Op
78+
mpi_fprintf(stream, "#pragma pabble compute%u (buf%u, count%u)\n", mpi_primitive_count, mpi_primitive_count, mpi_primitive_count);
7579

7680
mpi_fprintf(post_stream, " free(sbuf%u);\n", mpi_primitive_count);
7781
mpi_fprintf(post_stream, " free(rbuf%u);\n", mpi_primitive_count);
@@ -99,6 +103,7 @@ void mpi_fprint_scatter(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tr
99103
strlen(node->interaction->msgsig.payload) == 0 ? "unsigned char" : node->interaction->msgsig.payload,
100104
mpi_primitive_count);
101105

106+
mpi_fprintf(stream, "#pragma pabble compute%u (buf%u, count%u)\n", mpi_primitive_count, mpi_primitive_count, mpi_primitive_count);
102107
mpi_fprintf(stream, "%*sMPI_Scatter(sbuf%u, count%u, ", indent, SPACE, mpi_primitive_count, mpi_primitive_count);
103108
mpi_fprint_datatype(stream, node->interaction->msgsig);
104109
mpi_fprintf(stream, ", ");
@@ -110,6 +115,7 @@ void mpi_fprint_scatter(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tr
110115
mpi_fprint_const_or_var(stream, tree, node->interaction->from->param[param]);
111116
}
112117
mpi_fprintf(stream, "), MPI_COMM_WORLD);\n");
118+
mpi_fprintf(stream, "#pragma pabble compute%u (buf%u, count%u)\n", mpi_primitive_count, mpi_primitive_count, mpi_primitive_count);
113119

114120
mpi_fprintf(post_stream, " free(sbuf%u);\n", mpi_primitive_count);
115121
mpi_fprintf(post_stream, " free(rbuf%u);\n", mpi_primitive_count);
@@ -137,6 +143,7 @@ void mpi_fprint_gather(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tre
137143
strlen(node->interaction->msgsig.payload) == 0 ? "unsigned char" : node->interaction->msgsig.payload,
138144
mpi_primitive_count);
139145

146+
mpi_fprintf(stream, "#pragma pabble compute%u (buf%u, count%u)\n", mpi_primitive_count, mpi_primitive_count, mpi_primitive_count);
140147
mpi_fprintf(stream, "%*s", indent, SPACE);
141148

142149
if (strlen(node->interaction->msgsig.op)>0) {
@@ -156,6 +163,7 @@ void mpi_fprint_gather(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tre
156163
mpi_fprint_const_or_var(stream, tree, node->interaction->to[0]->param[param]);
157164
}
158165
mpi_fprintf(stream, "), MPI_COMM_WORLD);\n");
166+
mpi_fprintf(stream, "#pragma pabble compute%u (buf%u, count%u)\n", mpi_primitive_count, mpi_primitive_count, mpi_primitive_count);
159167

160168
mpi_fprintf(post_stream, " free(sbuf%u);\n", mpi_primitive_count);
161169
mpi_fprintf(post_stream, " free(rbuf%u);\n", mpi_primitive_count);

src/print_common.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,3 +419,19 @@ void mpi_fprint_children(FILE *pre_stream, FILE *stream, FILE *post_stream, st_t
419419

420420
}
421421
}
422+
423+
424+
st_node *next_interaction(st_node *node)
425+
{
426+
switch (node->type) {
427+
case ST_NODE_ROOT:
428+
case ST_NODE_RECUR:
429+
case ST_NODE_FOR:
430+
case ST_NODE_ONEOF:
431+
if (node->nchild > 1) return next_interaction(node->children[0]);
432+
case ST_NODE_SEND:
433+
case ST_NODE_RECV:
434+
return node;
435+
}
436+
return NULL;
437+
}

src/print_dynamic.c

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#include <assert.h>
2+
#include <stdio.h>
3+
#include <stdlib.h>
4+
#include <string.h>
5+
6+
#include <sesstype/st_node.h>
7+
#include <scribble/print.h>
8+
9+
#include "scribble/mpi_print.h"
10+
11+
12+
extern unsigned int mpi_primitive_count;
13+
14+
15+
void mpi_fprint_ifblk(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tree *tree, st_node *node, int indent)
16+
{
17+
assert(node != NULL && node->type == ST_NODE_IFBLK);
18+
19+
// If
20+
mpi_fprintf(stream, "%*s", indent, SPACE);
21+
mpi_fprint_msg_cond(stream, tree, node->ifblk->cond, indent);
22+
mpi_fprintf(stream, "{ // IF-BLK\n");
23+
24+
indent++;
25+
for (int child=0; child<node->nchild; ++child) {
26+
mpi_fprint_node(pre_stream, stream, post_stream, tree, node->children[child], indent);
27+
}
28+
indent--;
29+
30+
mpi_fprintf(stream, "%*s}\n", indent, SPACE);
31+
32+
indent++;
33+
}
34+
35+
36+
void mpi_fprint_oneof(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tree *tree, st_node *node, int indent)
37+
{
38+
assert(node != NULL && node->type == ST_NODE_ONEOF);
39+
40+
if (node->oneof->unordered) {
41+
mpi_fprintf(stream, "%*sfor (int %s = ", indent, SPACE, node->oneof->range->bindvar);
42+
mpi_fprint_expr(stream, node->forloop->range->from);
43+
mpi_fprintf(stream, "; %s <= ", node->oneof->range->bindvar);
44+
mpi_fprint_expr(stream, node->forloop->range->to);
45+
mpi_fprintf(stream, "; %s++) {\n", node->oneof->range->bindvar);
46+
indent++;
47+
}
48+
49+
// Variable declarations
50+
mpi_fprintf(pre_stream, " int count%u = 1 /* CHANGE ME */;\n", mpi_primitive_count);
51+
52+
st_node *first_interaction = next_interaction(node);
53+
54+
mpi_fprintf(pre_stream, " %s *buf%u = malloc(sizeof(%s) * count%u);\n",
55+
strlen(first_interaction->interaction->msgsig.payload) == 0 ? "unsigned char" : first_interaction->interaction->msgsig.payload,
56+
mpi_primitive_count,
57+
strlen(first_interaction->interaction->msgsig.payload) == 0 ? "unsigned char" : first_interaction->interaction->msgsig.payload,
58+
mpi_primitive_count);
59+
60+
mpi_fprintf(stream, "%*sMPI_Recv(buf%u, count%u, ", indent, SPACE, mpi_primitive_count, mpi_primitive_count);
61+
mpi_fprint_datatype(stream, node->interaction->msgsig);
62+
mpi_fprintf(stream, ", MPI_ANY_RANK, ");
63+
mpi_fprintf(stream, first_interaction->interaction->msgsig.op == NULL ? 0: first_interaction->interaction->msgsig.op); // This should be a constant
64+
mpi_fprintf(stream, ", MPI_COMM_WORLD, MPI_STATUS_IGNORE);\n"); // Ignore status (this is not non-blocking)
65+
66+
mpi_fprintf(post_stream, " free(buf%u);\n", mpi_primitive_count);
67+
68+
for (int child=0; child<node->nchild; ++child) {
69+
mpi_fprint_node(pre_stream, stream, post_stream, tree, node->children[child], indent);
70+
}
71+
72+
if (node->oneof->unordered) {
73+
indent--;
74+
mpi_fprintf(stream, "%*s}\n", indent, SPACE);
75+
}
76+
}

src/print_sendrecv.c

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,15 @@ void mpi_fprint_send(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tree
1717
{
1818
assert(node != NULL && node->type == ST_NODE_SEND);
1919

20-
mpi_fprintf(stream, "%*s", indent, SPACE);
2120

2221
// If
2322
if (node->interaction->msg_cond != NULL) {
23+
mpi_fprintf(stream, "%*s", indent, SPACE);
2424
mpi_fprint_msg_cond(stream, tree, node->interaction->msg_cond, indent);
25+
mpi_fprintf(stream, "{\n");
26+
indent++;
2527
}
2628

27-
mpi_fprintf(stream, "{\n");
28-
29-
indent++;
30-
3129
// Variable declarations
3230
mpi_fprintf(pre_stream, " int count%u = 1 /* CHANGE ME */;\n", mpi_primitive_count);
3331

@@ -37,6 +35,7 @@ void mpi_fprint_send(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tree
3735
strlen(node->interaction->msgsig.payload) == 0 ? "unsigned char" : node->interaction->msgsig.payload,
3836
mpi_primitive_count);
3937

38+
mpi_fprintf(stream, "#pragma pabble compute%u (buf%u, count%u)\n", mpi_primitive_count, mpi_primitive_count, mpi_primitive_count);
4039
mpi_fprintf(stream, "%*sMPI_Send(buf%u, count%u, ", indent, SPACE, mpi_primitive_count, mpi_primitive_count);
4140
mpi_fprint_datatype(stream, node->interaction->msgsig);
4241
mpi_fprintf(stream, ", ");
@@ -145,8 +144,10 @@ void mpi_fprint_send(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tree
145144

146145
mpi_fprintf(post_stream, " free(buf%u);\n", mpi_primitive_count);
147146

148-
indent--;
149-
mpi_fprintf(stream, "%*s}\n", indent, SPACE);
147+
if (node->interaction->msg_cond != NULL) {
148+
indent--;
149+
mpi_fprintf(stream, "%*s}\n", indent, SPACE);
150+
}
150151

151152
mpi_primitive_count++;
152153
}
@@ -160,12 +161,12 @@ void mpi_fprint_recv(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tree
160161

161162
// If
162163
if (node->interaction->msg_cond != NULL) {
164+
mpi_fprintf(stream, "%*s", indent, SPACE);
163165
mpi_fprint_msg_cond(stream, tree, node->interaction->msg_cond, indent);
166+
mpi_fprintf(stream, "{\n");
167+
indent++;
164168
}
165169

166-
mpi_fprintf(stream, "{\n");
167-
168-
indent++;
169170

170171
// Variable declarations
171172
mpi_fprintf(pre_stream, " int count%u = 1 /* CHANGE ME */;\n", mpi_primitive_count);
@@ -282,11 +283,14 @@ void mpi_fprint_recv(FILE *pre_stream, FILE *stream, FILE *post_stream, st_tree
282283
mpi_fprintf(stream, ", ");
283284
mpi_fprintf(stream, node->interaction->msgsig.op == NULL ? 0: node->interaction->msgsig.op); // This should be a constant
284285
mpi_fprintf(stream, ", MPI_COMM_WORLD, MPI_STATUS_IGNORE);\n"); // Ignore status (this is not non-blocking)
286+
mpi_fprintf(stream, "#pragma pabble compute%u (buf%u, count%u)\n", mpi_primitive_count, mpi_primitive_count, mpi_primitive_count);
285287

286288
mpi_fprintf(post_stream, " free(buf%u);\n", mpi_primitive_count);
287289

288-
indent--;
289-
mpi_fprintf(stream, "%*s}\n", indent, SPACE);
290+
if (node->interaction->msg_cond != NULL) {
291+
indent--;
292+
mpi_fprintf(stream, "%*s}\n", indent, SPACE);
293+
}
290294

291295
mpi_primitive_count++;
292296
}

0 commit comments

Comments
 (0)