mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-11-21 01:04:10 +08:00
[svn-r8501] Purpose:
Improvement Description: The MPI atomicity and file_sync tests may hang if a filesystem is not able to support the operation. This will block the whole tests. PHDF5 is not using either features. So, removed them from the default tests. Platforms tested: Only in eirene using pp. Copper is still down.
This commit is contained in:
parent
ae28a28911
commit
b6449ce42e
@ -56,7 +56,7 @@ test_mpio_overlap_writes(char *filename)
|
|||||||
int vrfyerrs;
|
int vrfyerrs;
|
||||||
char buf[4093]; /* use some prime number for size */
|
char buf[4093]; /* use some prime number for size */
|
||||||
int bufsize = sizeof(buf);
|
int bufsize = sizeof(buf);
|
||||||
int stride;
|
MPI_Offset stride;
|
||||||
MPI_Offset mpi_off;
|
MPI_Offset mpi_off;
|
||||||
MPI_Status mpi_stat;
|
MPI_Status mpi_stat;
|
||||||
|
|
||||||
@ -93,12 +93,12 @@ test_mpio_overlap_writes(char *filename)
|
|||||||
while (mpi_off < MPIO_TEST_WRITE_SIZE){
|
while (mpi_off < MPIO_TEST_WRITE_SIZE){
|
||||||
/* make sure the write does not exceed the TEST_WRITE_SIZE */
|
/* make sure the write does not exceed the TEST_WRITE_SIZE */
|
||||||
if (mpi_off+stride > MPIO_TEST_WRITE_SIZE)
|
if (mpi_off+stride > MPIO_TEST_WRITE_SIZE)
|
||||||
stride = MPIO_TEST_WRITE_SIZE - (int)mpi_off;
|
stride = MPIO_TEST_WRITE_SIZE - mpi_off;
|
||||||
|
|
||||||
/* set data to some trivial pattern for easy verification */
|
/* set data to some trivial pattern for easy verification */
|
||||||
for (i=0; i<stride; i++)
|
for (i=0; i<stride; i++)
|
||||||
buf[i] = (char)(mpi_off+i) & 0x7f;
|
buf[i] = (char)(mpi_off+i);
|
||||||
mrc = MPI_File_write_at(fh, mpi_off, buf, stride, MPI_BYTE,
|
mrc = MPI_File_write_at(fh, mpi_off, buf, (int)stride, MPI_BYTE,
|
||||||
&mpi_stat);
|
&mpi_stat);
|
||||||
VRFY((mrc==MPI_SUCCESS), "");
|
VRFY((mrc==MPI_SUCCESS), "");
|
||||||
|
|
||||||
@ -137,14 +137,14 @@ test_mpio_overlap_writes(char *filename)
|
|||||||
for (mpi_off=0; mpi_off < MPIO_TEST_WRITE_SIZE; mpi_off += bufsize){
|
for (mpi_off=0; mpi_off < MPIO_TEST_WRITE_SIZE; mpi_off += bufsize){
|
||||||
/* make sure it does not read beyond end of data */
|
/* make sure it does not read beyond end of data */
|
||||||
if (mpi_off+stride > MPIO_TEST_WRITE_SIZE)
|
if (mpi_off+stride > MPIO_TEST_WRITE_SIZE)
|
||||||
stride = MPIO_TEST_WRITE_SIZE - (int)mpi_off;
|
stride = MPIO_TEST_WRITE_SIZE - mpi_off;
|
||||||
mrc = MPI_File_read_at(fh, mpi_off, buf, stride, MPI_BYTE,
|
mrc = MPI_File_read_at(fh, mpi_off, buf, (int)stride, MPI_BYTE,
|
||||||
&mpi_stat);
|
&mpi_stat);
|
||||||
VRFY((mrc==MPI_SUCCESS), "");
|
VRFY((mrc==MPI_SUCCESS), "");
|
||||||
vrfyerrs=0;
|
vrfyerrs=0;
|
||||||
for (i=0; i<stride; i++){
|
for (i=0; i<stride; i++){
|
||||||
char expected;
|
char expected;
|
||||||
expected = (char)(mpi_off+i) & 0x7f;
|
expected = (char)(mpi_off+i);
|
||||||
if ((buf[i] != expected) &&
|
if ((buf[i] != expected) &&
|
||||||
(vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED))
|
(vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED))
|
||||||
printf("proc %d: found data error at [%ld], expect %d, got %d\n",
|
printf("proc %d: found data error at [%ld], expect %d, got %d\n",
|
||||||
@ -393,7 +393,7 @@ finish:
|
|||||||
#define USEFSYNC 2 /* request file_sync */
|
#define USEFSYNC 2 /* request file_sync */
|
||||||
|
|
||||||
|
|
||||||
static int test_mpio_1wMr(char *filename, int special_request)
|
int test_mpio_1wMr(char *filename, int special_request)
|
||||||
{
|
{
|
||||||
char hostname[128];
|
char hostname[128];
|
||||||
int mpi_size, mpi_rank;
|
int mpi_size, mpi_rank;
|
||||||
@ -404,7 +404,7 @@ static int test_mpio_1wMr(char *filename, int special_request)
|
|||||||
unsigned char writedata[DIMSIZE], readdata[DIMSIZE];
|
unsigned char writedata[DIMSIZE], readdata[DIMSIZE];
|
||||||
unsigned char expect_val;
|
unsigned char expect_val;
|
||||||
int i, irank;
|
int i, irank;
|
||||||
int nerr= 0; /* number of errors */
|
int nerrors = 0; /* number of errors */
|
||||||
int atomicity;
|
int atomicity;
|
||||||
MPI_Offset mpi_off;
|
MPI_Offset mpi_off;
|
||||||
MPI_Status mpi_stat;
|
MPI_Status mpi_stat;
|
||||||
@ -489,7 +489,7 @@ if (special_request & USEATOM){
|
|||||||
/* Only one process writes */
|
/* Only one process writes */
|
||||||
if (mpi_rank==irank){
|
if (mpi_rank==irank){
|
||||||
if (VERBOSE_HI){
|
if (VERBOSE_HI){
|
||||||
PRINTID; printf("wrote %d bytes at %d\n", DIMSIZE, (int)mpi_off);
|
PRINTID; printf("wrote %d bytes at %ld\n", DIMSIZE, (long)mpi_off);
|
||||||
}
|
}
|
||||||
if ((mpi_err = MPI_File_write_at(fh, mpi_off, writedata, DIMSIZE,
|
if ((mpi_err = MPI_File_write_at(fh, mpi_off, writedata, DIMSIZE,
|
||||||
MPI_BYTE, &mpi_stat))
|
MPI_BYTE, &mpi_stat))
|
||||||
@ -497,7 +497,7 @@ if (special_request & USEATOM){
|
|||||||
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
|
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
|
||||||
PRINTID;
|
PRINTID;
|
||||||
printf("MPI_File_write_at offset(%ld), bytes (%d), failed (%s)\n",
|
printf("MPI_File_write_at offset(%ld), bytes (%d), failed (%s)\n",
|
||||||
(long) mpi_off, (int) DIMSIZE, mpi_err_str);
|
(long) mpi_off, DIMSIZE, mpi_err_str);
|
||||||
return 1;
|
return 1;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -551,7 +551,7 @@ if (special_request & USEFSYNC){
|
|||||||
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
|
MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen);
|
||||||
PRINTID;
|
PRINTID;
|
||||||
printf("MPI_File_read_at offset(%ld), bytes (%d), failed (%s)\n",
|
printf("MPI_File_read_at offset(%ld), bytes (%d), failed (%s)\n",
|
||||||
(long) mpi_off, (int) DIMSIZE, mpi_err_str);
|
(long) mpi_off, DIMSIZE, mpi_err_str);
|
||||||
return 1;
|
return 1;
|
||||||
};
|
};
|
||||||
for (i=0; i < DIMSIZE; i++){
|
for (i=0; i < DIMSIZE; i++){
|
||||||
@ -560,7 +560,7 @@ if (special_request & USEFSYNC){
|
|||||||
PRINTID;
|
PRINTID;
|
||||||
printf("read data[%d:%d] got %02x, expect %02x\n", irank, i,
|
printf("read data[%d:%d] got %02x, expect %02x\n", irank, i,
|
||||||
readdata[i], expect_val);
|
readdata[i], expect_val);
|
||||||
nerr++;
|
nerrors++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -568,18 +568,18 @@ if (special_request & USEFSYNC){
|
|||||||
|
|
||||||
if (VERBOSE_HI){
|
if (VERBOSE_HI){
|
||||||
PRINTID;
|
PRINTID;
|
||||||
printf("%d data errors detected\n", nerr);
|
printf("%d data errors detected\n", nerrors);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
int temp;
|
int temp;
|
||||||
MPI_Reduce(&nerr, &temp, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD);
|
MPI_Reduce(&nerrors, &temp, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD);
|
||||||
if (mpi_rank == 0 && temp > 0)
|
if (mpi_rank == 0 && temp > 0)
|
||||||
nerr= temp;
|
nerrors = temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
mpi_err = MPI_Barrier(MPI_COMM_WORLD);
|
mpi_err = MPI_Barrier(MPI_COMM_WORLD);
|
||||||
return nerr;
|
return nerrors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -692,15 +692,19 @@ main(int argc, char **argv)
|
|||||||
if (mpi_rank==0 && ret_code > 0)
|
if (mpi_rank==0 && ret_code > 0)
|
||||||
printf("***FAILED with %d total errors\n", ret_code);
|
printf("***FAILED with %d total errors\n", ret_code);
|
||||||
|
|
||||||
MPI_BANNER("MPIO 1 write Many read test with atomicity...");
|
/* test atomicity and file sync in high verbose mode only */
|
||||||
ret_code = test_mpio_1wMr(filenames[0], USEATOM);
|
/* since they often hang when broken and PHDF5 does not use them. */
|
||||||
if (mpi_rank==0 && ret_code > 0)
|
if (VERBOSE_HI){
|
||||||
printf("***FAILED with %d total errors\n", ret_code);
|
MPI_BANNER("MPIO 1 write Many read test with atomicity...");
|
||||||
|
ret_code = test_mpio_1wMr(filenames[0], USEATOM);
|
||||||
|
if (mpi_rank==0 && ret_code > 0)
|
||||||
|
printf("***FAILED with %d total errors\n", ret_code);
|
||||||
|
|
||||||
MPI_BANNER("MPIO 1 write Many read test with file sync...");
|
MPI_BANNER("MPIO 1 write Many read test with file sync...");
|
||||||
ret_code = test_mpio_1wMr(filenames[0], USEFSYNC);
|
ret_code = test_mpio_1wMr(filenames[0], USEFSYNC);
|
||||||
if (mpi_rank==0 && ret_code > 0)
|
if (mpi_rank==0 && ret_code > 0)
|
||||||
printf("***FAILED with %d total errors\n", ret_code);
|
printf("***FAILED with %d total errors\n", ret_code);
|
||||||
|
}
|
||||||
|
|
||||||
MPI_BANNER("MPIO File size range test...");
|
MPI_BANNER("MPIO File size range test...");
|
||||||
test_mpio_gb_file(filenames[0]);
|
test_mpio_gb_file(filenames[0]);
|
||||||
|
Loading…
Reference in New Issue
Block a user