Skip to content

Commit

Permalink
mwc_rng: abort if prime number file not found
Browse files Browse the repository at this point in the history
  • Loading branch information
mjuric committed Jun 30, 2010
1 parent 70975a7 commit f51787c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/common/cuda_rng.h
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,11 @@ namespace prngs
// initialize CPU streams
if(safeprimes_file == NULL) { safeprimes_file = "safeprimes32.txt"; }
FILE *f = fopen(safeprimes_file, "r");
assert(f != NULL);
if(f == NULL)
{
fprintf(stderr, "Cannot open random number generator prime numbers file '%s'. Is it there?\n", safeprimes_file);
abort();
}
srand48(seed);
//printf("seed=%u\n", seed);
for(uint32_t i = 0; i != nstreams; i++)
Expand Down

0 comments on commit f51787c

Please sign in to comment.