-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from ECP-VeloC/github_greg_branch
added gitlab testing infrastructure to the test
- Loading branch information
Showing
8 changed files
with
364 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
job: | ||
tags: | ||
- quartz | ||
- shell | ||
script: | ||
- module load cmake/3.9.2 | ||
- cmake -DWITH_KVTREE_PREFIX=$HOME/kvtree/KVTree.git/install -DWITH_SPATH_PREFIX=$HOME/spath/install -DWITH_AXL_PREFIX=$HOME/axl/AXL.git/install -DMPI=ON | ||
- make VERBOSE=1 | ||
- make check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
langauge: c | ||
dist: trusty | ||
|
||
compiler: | ||
- gcc | ||
- clang | ||
|
||
matrix: | ||
include: | ||
- name: "GCC 4.9" | ||
addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- libopenmpi-dev | ||
- openmpi-bin | ||
- g++-4.9 | ||
env : | ||
- MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9" | ||
|
||
- name: "GCC 6" | ||
addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- libopenmpi-dev | ||
- openmpi-bin | ||
- g++-6 | ||
env : | ||
- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6" | ||
|
||
- name: "GCC 7" | ||
addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- libopenmpi-dev | ||
- openmpi-bin | ||
- g++-7 | ||
env : | ||
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" | ||
|
||
- name: "GCC 8" | ||
addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- libopenmpi-dev | ||
- openmpi-bin | ||
- g++-8 | ||
env : | ||
- MATRIX_EVAL="CC=gcc-8 && CXX=g++-8" | ||
|
||
- name: "Clang 4.0" | ||
addons: | ||
apt: | ||
sources: | ||
- llvm-toolchain-trusty-4.0 | ||
packages: | ||
- libopenmpi-dev | ||
- openmpi-bin | ||
- clang-4.0 | ||
env : | ||
- MATRIX_EVAL="CC=clang-4.0 && CXX=clang++-4.0" | ||
|
||
- name: "Clang 6.0" | ||
addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
- llvm-toolchain-trusty-6.0 | ||
packages: | ||
- libopenmpi-dev | ||
- openmpi-bin | ||
- clang-6.0 | ||
env : | ||
- MATRIX_EVAL="CC=clang-6.0 && CXX=clang++-6.0" | ||
|
||
before_install: | ||
- eval "${MATRIX_EVAL}" | ||
- mkdir $HOME/deps-install | ||
- git clone https://github.com/ECP-VeloC/KVTree.git $HOME/KVTree | ||
- mkdir $HOME/KVTree/kvtree-build | ||
- cd $HOME/KVTree/kvtree-build | ||
- cmake .. -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX -DCMAKE_INSTALL_PREFIX=$HOME/deps-install -DMPI=ON | ||
- make | ||
- make install | ||
- git clone https://github.com/ECP-VeloC/AXL.git $HOME/AXL | ||
- mkdir $HOME/AXL/axl-build | ||
- cd $HOME/AXL/axl-build | ||
- cmake .. -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX -DCMAKE_INSTALL_PREFIX=$HOME/deps-install -DMPI=ON -DWITH_KVTREE_PREFIX=$HOME/deps-install | ||
- make | ||
- make install | ||
- git clone https://github.com/ECP-VeloC/spath.git $HOME/spath | ||
- mkdir $HOME/spath/spath-build | ||
- cd $HOME/spath/spath-build | ||
- cmake .. -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX -DCMAKE_INSTALL_PREFIX=$HOME/deps-install -DMPI=ON | ||
- make | ||
- make install | ||
|
||
script: | ||
- cd $TRAVIS_BUILD_DIR | ||
- cmake -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX -DCMAKE_C_FLAGS="-Wall -coverage" -DMPI=ON -DWITH_KVTREE_PREFIX=$HOME/deps-install -DWITH_AXL_PREFIX=$HOME/deps-install -DWITH_SPATH_PREFIX=$HOME/deps-install | ||
- make -k VERBOSE=1 | ||
- make check | ||
|
||
after_failure: | ||
- find . -type f -name "CMakeOutput.log" -execdir cat {} \; | ||
- find . -type f -name "CMakeError.log" -execdir cat {} \; | ||
- find . -type f -name "CMakeCache.txt" -execdir cat {} \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
############### | ||
# Build tests | ||
############### | ||
|
||
################ | ||
# Add tests to ctest | ||
################ | ||
|
||
ADD_EXECUTABLE(filo_test test_filo.c) | ||
TARGET_LINK_LIBRARIES(filo_test ${SPATH_EXTERNAL_LIBS} filo) | ||
ADD_TEST(NAME filo_test COMMAND ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 3 ./filo_test) | ||
|
||
ADD_EXECUTABLE(filo_corrupt_fetch_test test_filo_corrupt_fetch.c) | ||
TARGET_LINK_LIBRARIES(filo_corrupt_fetch_test ${SPATH_EXTERNAL_LIBS} filo) | ||
ADD_TEST(NAME filo_corrupt_fetch_test COMMAND ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 3 ./filo_corrupt_fetch_test) | ||
|
||
ADD_EXECUTABLE(filo_async_test test_filo_async.c) | ||
TARGET_LINK_LIBRARIES(filo_async_test ${SPATH_EXTERNAL_LIBS} filo) | ||
ADD_TEST(NAME filo_async_test COMMAND ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 3 ./filo_async_test) | ||
|
||
#################### | ||
# make a verbose "test" target named "check" | ||
#################### | ||
|
||
ADD_CUSTOM_TARGET(check COMMAND ${CMAKE_CTEST_COMMAND} --verbose) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
#include <stdlib.h> | ||
#include <stdio.h> | ||
#include <sys/types.h> | ||
#include <sys/stat.h> | ||
#include <fcntl.h> | ||
#include <errno.h> | ||
#include <string.h> | ||
|
||
#include <limits.h> | ||
#include <unistd.h> | ||
|
||
#include "mpi.h" | ||
#include "filo.h" | ||
|
||
#define TEST_PASS (0) | ||
#define TEST_FAIL (1) | ||
|
||
int main(int argc, char* argv[]) | ||
{ | ||
int rc = TEST_PASS; | ||
MPI_Init(&argc, &argv); | ||
int rank, ranks; | ||
MPI_Comm_rank(MPI_COMM_WORLD, &rank); | ||
MPI_Comm_size(MPI_COMM_WORLD, &ranks); | ||
|
||
char proc_specific_file_content[256]; | ||
sprintf(proc_specific_file_content, "data from rank %d\n", rank); | ||
char filename[256]; | ||
sprintf(filename, "/dev/shm/testfile_%d.out", rank); | ||
int fd = open(filename, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR); | ||
if (fd != -1) { | ||
write(fd, proc_specific_file_content, strlen(proc_specific_file_content)); | ||
close(fd); | ||
} else { | ||
rc = TEST_FAIL; | ||
printf("Error opening file %s: %d %s\n", filename, errno, strerror(errno)); | ||
} | ||
|
||
char dest_filename[256]; | ||
sprintf(dest_filename, "./testfile_%d.out", rank); | ||
|
||
rc = Filo_Init(); | ||
|
||
const char* filelist[1] = { filename }; | ||
const char* dest_filelist[1] = { dest_filename }; | ||
|
||
/* base path for storage is NULL, so destination files will be written to the local dir*/ | ||
rc = Filo_Flush_start("mapfile", NULL, 1, filelist, dest_filelist, MPI_COMM_WORLD); | ||
rc = Filo_Flush_test("mapfile", MPI_COMM_WORLD); | ||
rc = Filo_Flush_wait("mapfile", MPI_COMM_WORLD); | ||
|
||
unlink(filename); | ||
|
||
/* fetch list of files recorded in mapfile to /dev/shm */ | ||
int num_files; | ||
char** src_filelist; | ||
char** dst_filelist; | ||
/* src base path is still NULL (consistent with Filo_Flush), but the dest base path is /dev/shm*/ | ||
rc = Filo_Fetch("mapfile", NULL, "/dev/shm", &num_files, &src_filelist, &dst_filelist, MPI_COMM_WORLD); | ||
|
||
/* free file list returned by fetch */ | ||
int i; | ||
for (i = 0; i < num_files; i++) { | ||
//in file name, rank precedes ".out" suffix | ||
int rank_from_file_name = *((strstr(dst_filelist[i], ".out"))-1) - '0'; | ||
//assertain that the filename with consistant process marker was passed through flush/fetch | ||
if(rank != rank_from_file_name){ | ||
rc = TEST_FAIL; | ||
printf("rank = %d, rank_from_file_name = %d\n", rank, rank_from_file_name); | ||
} | ||
//assertain that the file content is consistent with the process | ||
FILE *file = fopen(dst_filelist[i], "r"); | ||
char *readContent = NULL; | ||
size_t readContent_size = 0; | ||
if (!file){ | ||
rc = TEST_FAIL; | ||
printf("Error opening file %s: %d %s\n", dst_filelist[i] , errno, strerror(errno)); | ||
} | ||
size_t line_size = getline(&readContent, &readContent_size, file); | ||
if (strcmp(readContent, proc_specific_file_content) != 0){ | ||
rc = TEST_FAIL; | ||
printf("flushed file content = %s, fetched file content = %s\n", proc_specific_file_content, readContent); | ||
} | ||
fclose(file); | ||
|
||
free(src_filelist[i]); | ||
free(dst_filelist[i]); | ||
} | ||
free(src_filelist); | ||
free(dst_filelist); | ||
|
||
rc = Filo_Finalize(); | ||
|
||
unlink(filename); | ||
|
||
MPI_Finalize(); | ||
|
||
return rc; | ||
} |
Oops, something went wrong.