Skip to content

Commit b4e130b

Browse files
author
Damian Rouson
committed
Merge pull request #162 from sourceryinstitute/bugfix-stop
Bugfix STOP
2 parents bb00154 + 0c84a52 commit b4e130b

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/mpi/mpi_caf.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ PREFIX (finalize) (void)
408408
{
409409
*img_status = STAT_STOPPED_IMAGE; /* GFC_STAT_STOPPED_IMAGE = 6000 */
410410
MPI_Win_sync(*stat_tok);
411+
411412
MPI_Barrier(CAF_COMM_WORLD);
412413

413414
while (caf_static_list != NULL)
@@ -445,6 +446,7 @@ PREFIX (finalize) (void)
445446
pthread_mutex_lock(&lock_am);
446447
caf_is_finalized = 1;
447448
pthread_mutex_unlock(&lock_am);
449+
exit(0);
448450
}
449451

450452

@@ -2482,6 +2484,25 @@ error_stop (int error)
24822484
exit (error);
24832485
}
24842486

2487+
/* STOP function for integer arguments. */
2488+
void
2489+
PREFIX (stop_numeric) (int32_t stop_code)
2490+
{
2491+
fprintf (stderr, "STOP %d\n", stop_code);
2492+
PREFIX (finalize) ();
2493+
}
2494+
2495+
/* STOP function for string arguments. */
2496+
void
2497+
PREFIX (stop_str) (const char *string, int32_t len)
2498+
{
2499+
fputs ("STOP ", stderr);
2500+
while (len--)
2501+
fputc (*(string++), stderr);
2502+
fputs ("\n", stderr);
2503+
2504+
PREFIX (finalize) ();
2505+
}
24852506

24862507
/* ERROR STOP function for string arguments. */
24872508

0 commit comments

Comments
 (0)