mirror of
https://git.gfz-potsdam.de/naaice/poet.git
synced 2025-12-16 04:48:23 +01:00
Merge branch 'fix-ci' into 'main'
Fix CI See merge request naaice/poet!6
This commit is contained in:
commit
4829a0e563
@ -16,7 +16,7 @@
|
|||||||
# This specific template is located at:
|
# This specific template is located at:
|
||||||
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml
|
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml
|
||||||
|
|
||||||
image: git.gfz-potsdam.de:5000/sec34/port:builder
|
image: git.gfz-potsdam.de:5000/naaice/poet:ci
|
||||||
|
|
||||||
stages: # List of stages for jobs, and their order of execution
|
stages: # List of stages for jobs, and their order of execution
|
||||||
- build
|
- build
|
||||||
@ -32,16 +32,20 @@ build-poet: # This job runs in the build stage, which runs first.
|
|||||||
stage: build
|
stage: build
|
||||||
script:
|
script:
|
||||||
- mkdir build && cd build
|
- mkdir build && cd build
|
||||||
- cmake ..
|
- cmake -DPOET_ENABLE_TESTING=ON ..
|
||||||
- make -j$(nproc)
|
- make -j$(nproc)
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- build
|
||||||
|
|
||||||
test-poet:
|
test-poet:
|
||||||
stage: test
|
stage: test
|
||||||
|
dependencies:
|
||||||
|
- build-poet
|
||||||
script:
|
script:
|
||||||
- mkdir build_test && cd build_test
|
- cd build
|
||||||
- cmake -DPOET_ENABLE_TESTING=ON ..
|
|
||||||
- make -j$(nproc) check
|
- make -j$(nproc) check
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
||||||
@ -101,12 +105,14 @@ release-create:
|
|||||||
|
|
||||||
pages:
|
pages:
|
||||||
stage: release
|
stage: release
|
||||||
|
dependencies:
|
||||||
|
- build-poet
|
||||||
before_script:
|
before_script:
|
||||||
- apt-get update && apt-get install -y doxygen graphviz
|
- apt-get update && apt-get install -y doxygen graphviz
|
||||||
- mkdir {public,build}
|
- mkdir public
|
||||||
script:
|
script:
|
||||||
- pushd build
|
- pushd build
|
||||||
- cmake .. && make doxygen
|
- make doxygen
|
||||||
- popd && mv build/docs/html/* public/
|
- popd && mv build/docs/html/* public/
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
// // Time-stamp: "Last modified 2023-03-27 14:51:05 mluebke"
|
// // Time-stamp: "Last modified 2023-03-31 14:59:49 mluebke"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Copyright (C) 2018-2021 Alexander Lindemann, Max Luebke (University of
|
** Copyright (C) 2018-2021 Alexander Lindemann, Max Luebke (University of
|
||||||
@ -24,17 +24,12 @@
|
|||||||
#define HASHFUNCTIONS_H_
|
#define HASHFUNCTIONS_H_
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <openssl/evp.h>
|
|
||||||
|
|
||||||
namespace poet {
|
namespace poet {
|
||||||
|
|
||||||
// Sum of POET interpreted as ASCII
|
// Sum of POET interpreted as ASCII
|
||||||
constexpr uint32_t HASH_SEED = 80 + 79 + 69 + 84;
|
constexpr uint32_t HASH_SEED = 80 + 79 + 69 + 84;
|
||||||
|
|
||||||
void initHashCtx(const EVP_MD *md);
|
|
||||||
void freeHashCtx();
|
|
||||||
|
|
||||||
uint64_t hashDHT(int key_size, const void *key);
|
|
||||||
uint64_t Murmur2_64A(int len, const void *key);
|
uint64_t Murmur2_64A(int len, const void *key);
|
||||||
|
|
||||||
} // namespace poet
|
} // namespace poet
|
||||||
|
|||||||
@ -10,7 +10,7 @@ find_library(CRYPTO_LIBRARY crypto)
|
|||||||
add_library(poet_lib ${poet_lib_SRC})
|
add_library(poet_lib ${poet_lib_SRC})
|
||||||
target_include_directories(poet_lib PUBLIC ${PROJECT_SOURCE_DIR}/include)
|
target_include_directories(poet_lib PUBLIC ${PROJECT_SOURCE_DIR}/include)
|
||||||
target_link_libraries(poet_lib PUBLIC
|
target_link_libraries(poet_lib PUBLIC
|
||||||
MPI::MPI_CXX ${MATH_LIBRARY} ${CRYPTO_LIBRARY} RRuntime tug PhreeqcRM DataStructures ChemistryModule)
|
MPI::MPI_CXX ${MATH_LIBRARY} RRuntime tug PhreeqcRM DataStructures ChemistryModule)
|
||||||
target_compile_definitions(poet_lib PUBLIC STRICT_R_HEADERS OMPI_SKIP_MPICXX)
|
target_compile_definitions(poet_lib PUBLIC STRICT_R_HEADERS OMPI_SKIP_MPICXX)
|
||||||
|
|
||||||
add_subdirectory(ChemistryModule)
|
add_subdirectory(ChemistryModule)
|
||||||
|
|||||||
@ -18,7 +18,7 @@ add_library(ChemistryModule ${CHEM_MODEL_SRC})
|
|||||||
target_include_directories(ChemistryModule PUBLIC ${PROJECT_SOURCE_DIR}/include)
|
target_include_directories(ChemistryModule PUBLIC ${PROJECT_SOURCE_DIR}/include)
|
||||||
target_link_libraries(ChemistryModule
|
target_link_libraries(ChemistryModule
|
||||||
PUBLIC MPI::MPI_CXX PhreeqcRM
|
PUBLIC MPI::MPI_CXX PhreeqcRM
|
||||||
PRIVATE ${MATH_LIBRARY} ${CRYPTO_LIBRARY}
|
PRIVATE ${MATH_LIBRARY}
|
||||||
)
|
)
|
||||||
|
|
||||||
target_compile_definitions(ChemistryModule PUBLIC OMPI_SKIP_MPICXX)
|
target_compile_definitions(ChemistryModule PUBLIC OMPI_SKIP_MPICXX)
|
||||||
|
|||||||
@ -29,7 +29,6 @@
|
|||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <openssl/evp.h>
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
@ -71,7 +70,6 @@ void poet::DHT_ResultObject::ResultsToWP(std::vector<double> &curr_wp) {
|
|||||||
DHT_Wrapper::DHT_Wrapper(MPI_Comm dht_comm, uint32_t dht_size,
|
DHT_Wrapper::DHT_Wrapper(MPI_Comm dht_comm, uint32_t dht_size,
|
||||||
uint32_t key_count, uint32_t data_count)
|
uint32_t key_count, uint32_t data_count)
|
||||||
: key_count(key_count), data_count(data_count) {
|
: key_count(key_count), data_count(data_count) {
|
||||||
poet::initHashCtx(EVP_md5());
|
|
||||||
// initialize DHT object
|
// initialize DHT object
|
||||||
uint32_t key_size = key_count * sizeof(DHT_Keyelement);
|
uint32_t key_size = key_count * sizeof(DHT_Keyelement);
|
||||||
uint32_t data_size = data_count * sizeof(double);
|
uint32_t data_size = data_count * sizeof(double);
|
||||||
@ -100,7 +98,6 @@ DHT_Wrapper::~DHT_Wrapper() {
|
|||||||
// free DHT
|
// free DHT
|
||||||
DHT_free(dht_object, NULL, NULL);
|
DHT_free(dht_object, NULL, NULL);
|
||||||
|
|
||||||
poet::freeHashCtx();
|
|
||||||
}
|
}
|
||||||
auto DHT_Wrapper::checkDHT(int length, double dt,
|
auto DHT_Wrapper::checkDHT(int length, double dt,
|
||||||
const std::vector<double> &work_package)
|
const std::vector<double> &work_package)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
// Time-stamp: "Last modified 2023-03-27 14:50:53 mluebke"
|
// Time-stamp: "Last modified 2023-03-31 15:00:11 mluebke"
|
||||||
/*
|
/*
|
||||||
**-----------------------------------------------------------------------------
|
**-----------------------------------------------------------------------------
|
||||||
** MurmurHash2 was written by Austin Appleby, and is placed in the public
|
** MurmurHash2 was written by Austin Appleby, and is placed in the public
|
||||||
@ -27,8 +27,6 @@
|
|||||||
#include "poet/HashFunctions.hpp"
|
#include "poet/HashFunctions.hpp"
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <openssl/evp.h>
|
|
||||||
#include <openssl/md5.h>
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
@ -43,42 +41,6 @@
|
|||||||
|
|
||||||
#endif // !defined(_MSC_VER)
|
#endif // !defined(_MSC_VER)
|
||||||
|
|
||||||
// HACK: I know this is not a good practice, but this will do it for now!
|
|
||||||
EVP_MD_CTX *ctx = NULL;
|
|
||||||
|
|
||||||
void poet::initHashCtx(const EVP_MD *md) {
|
|
||||||
if (ctx == NULL) {
|
|
||||||
ctx = EVP_MD_CTX_new();
|
|
||||||
EVP_DigestInit_ex(ctx, md, NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void poet::freeHashCtx() {
|
|
||||||
EVP_MD_CTX_free(ctx);
|
|
||||||
ctx = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint64_t poet::hashDHT(int key_size, const void *key) {
|
|
||||||
unsigned char sum[MD5_DIGEST_LENGTH];
|
|
||||||
uint32_t md_len;
|
|
||||||
uint64_t retval, *v1, *v2;
|
|
||||||
|
|
||||||
// calculate md5 using MD5 functions
|
|
||||||
EVP_DigestUpdate(ctx, key, key_size);
|
|
||||||
EVP_DigestFinal_ex(ctx, sum, &md_len);
|
|
||||||
|
|
||||||
if (md_len != MD5_DIGEST_LENGTH) {
|
|
||||||
throw std::runtime_error("Something went wrong during MD5 hashing!");
|
|
||||||
}
|
|
||||||
|
|
||||||
// divide hash in 2 64 bit parts and XOR them
|
|
||||||
v1 = (uint64_t *)&sum[0];
|
|
||||||
v2 = (uint64_t *)&sum[8];
|
|
||||||
retval = *v1 ^ *v2;
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// MurmurHash2, 64-bit versions, by Austin Appleby
|
// MurmurHash2, 64-bit versions, by Austin Appleby
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user