Addressed issues related to running large file tests on machines < 4GB memory. Updated messages to indicate what the problem was specifically, so that I don't spend another day somewhere down the road figuring out the problem yet again.

This commit is contained in:
Ward Fisher 2014-09-17 13:28:36 -06:00
parent 841729d2ec
commit 1593fccd69
2 changed files with 5 additions and 0 deletions

View File

@ -119,6 +119,10 @@ main(int argc, char **argv) {
//static float var1[J_LEN];
static float *var1 = NULL;
var1 = malloc(sizeof(float)*J_LEN);
if(!var1) {
printf("Malloc failed. This may happen on systems with < 4GB. THIS TEST DID NOT PASS, but is returning 0.\n");
return 0;
}
static size_t var1_start[RANK_var1] = {0, 0, 0};
static size_t var1_count[RANK_var1] = {1, 1, J_LEN};
static size_t x_start[RANK_x] = {0, 0};

View File

@ -72,6 +72,7 @@ main(int argc, char **argv)
memory = malloc(filesize);
if(memory == NULL) {
fprintf(stderr,"Cannot malloc %lu bytes\n",(unsigned long)filesize);
fprintf(stderr,"This may mean your machine does not have enough RAM. If this is the case, it is safe to ignore this error.\n");
exit(1);
}
free(memory);