diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8a19254..a22e380 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,12 +13,13 @@ jobs: build-and-test: strategy: matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest, macos-latest, linux-gpu-cuda] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 - uses: conda-incubator/setup-miniconda@v2 - with: + with: + miniconda-version: "latest" auto-update-conda: true - name: Install shell: bash -l {0} @@ -32,12 +33,15 @@ jobs: sudo mv -f /Library/Developer/CommandLineTools /Library/Developer/CommandLineTools.org fi + df -h . if [[ "$(uname -s)" == "Linux" ]]; then - conda create --yes -n unifrac -c conda-forge -c bioconda gxx_linux-64 hdf5 mkl-include lz4 zlib hdf5-static libcblas liblapacke make curl + conda create -q --yes -n unifrac -c conda-forge -c bioconda gxx_linux-64 hdf5 mkl-include lz4 zlib hdf5-static libcblas liblapacke make curl else - conda create --yes -n unifrac -c conda-forge -c bioconda clangxx_osx-64 hdf5 mkl-include lz4 hdf5-static libcblas liblapacke make curl + conda create -q --yes -n unifrac -c conda-forge -c bioconda clangxx_osx-64 hdf5 mkl-include lz4 hdf5-static libcblas liblapacke make curl fi + conda clean --yes -t + df -h . conda activate unifrac echo "$(uname -s)" if [[ "$(uname -s)" == "Linux" ]]; @@ -52,19 +56,21 @@ jobs: which h5c++ if [[ "$(uname -s)" == "Linux" ]]; then - ./scripts/install_hpc_sdk.sh + ./scripts/install_hpc_sdk.sh >/dev/null 2>/dev/null &_dm_stripes, const su::task_parameters* _task_p) : dm_stripes(_dm_stripes), task_p(_task_p) - , start_idx(task_p->start), n_samples(task_p->n_samples) + , start_idx(task_p->start), stop_idx(task_p->stop), n_samples(task_p->n_samples) , n_samples_r(((n_samples + UNIFRAC_BLOCK-1)/UNIFRAC_BLOCK)*UNIFRAC_BLOCK) // round up - , buf((dm_stripes[start_idx]==NULL) ? NULL : new TFloat[n_samples_r*(task_p->stop-start_idx)]) // dm_stripes could be null, in which case keep it null + , buf((dm_stripes[start_idx]==NULL) ? NULL : new TFloat[n_samples_r*(stop_idx-start_idx)]) // dm_stripes could be null, in which case keep it null { TFloat* const ibuf = buf; if (ibuf != NULL) { #ifdef _OPENACC - const uint64_t bufels = n_samples_r * (task_p->stop-start_idx); + const uint64_t bufels = n_samples_r * (stop_idx-start_idx); #endif - for(unsigned int stripe=start_idx; stripe < task_p->stop; stripe++) { + for(unsigned int stripe=start_idx; stripe < stop_idx; stripe++) { double * dm_stripe = dm_stripes[stripe]; TFloat * buf_stripe = this->operator[](stripe); for(unsigned int j=0; j(const UnifracTaskVector& ) = delete; + UnifracTaskVector& operator= (const UnifracTaskVector&) = delete; + TFloat * operator[](unsigned int idx) { return buf+((idx-start_idx)*n_samples_r);} const TFloat * operator[](unsigned int idx) const { return buf+((idx-start_idx)*n_samples_r);} @@ -95,10 +99,10 @@ namespace SUCMP_NM { TFloat* const ibuf = buf; if (ibuf != NULL) { #ifdef _OPENACC - const uint64_t bufels = n_samples_r * (task_p->stop-start_idx); + const uint64_t bufels = n_samples_r * (stop_idx-start_idx); #pragma acc exit data copyout(ibuf[:bufels]) #endif - for(unsigned int stripe=start_idx; stripe < task_p->stop; stripe++) { + for(unsigned int stripe=start_idx; stripe < stop_idx; stripe++) { double * dm_stripe = dm_stripes[stripe]; TFloat * buf_stripe = this->operator[](stripe); for(unsigned int j=0; j(const UnifracTaskBase& ) = delete; + UnifracTaskBase& operator= (const UnifracTaskBase&) = delete; + virtual ~UnifracTaskBase() { #ifdef _OPENACC @@ -316,6 +323,8 @@ namespace SUCMP_NM { , embedded_proportions(_embedded_proportions), max_embs(_max_embs) {} */ + UnifracTask(const UnifracTask& ) = delete; + UnifracTask& operator= (const UnifracTask&) = delete; virtual ~UnifracTask() {} @@ -346,6 +355,9 @@ namespace SUCMP_NM { #pragma acc enter data create(zcheck[:n_samples],sums[:n_samples]) } + UnifracUnnormalizedWeightedTask(const UnifracUnnormalizedWeightedTask& ) = delete; + UnifracUnnormalizedWeightedTask& operator= (const UnifracUnnormalizedWeightedTask&) = delete; + virtual ~UnifracUnnormalizedWeightedTask() { #ifdef _OPENACC @@ -381,6 +393,9 @@ namespace SUCMP_NM { #pragma acc enter data create(zcheck[:n_samples],sums[:n_samples]) } + UnifracNormalizedWeightedTask(const UnifracNormalizedWeightedTask& ) = delete; + UnifracNormalizedWeightedTask& operator= (const UnifracNormalizedWeightedTask&) = delete; + virtual ~UnifracNormalizedWeightedTask() { #ifdef _OPENACC @@ -421,6 +436,9 @@ namespace SUCMP_NM { #pragma acc enter data create(zcheck[:n_samples],stripe_sums[:n_samples],sums[:bsize]) } + UnifracUnweightedTask(const UnifracUnweightedTask& ) = delete; + UnifracUnweightedTask& operator= (const UnifracUnweightedTask&) = delete; + virtual ~UnifracUnweightedTask() { #ifdef _OPENACC @@ -450,6 +468,9 @@ namespace SUCMP_NM { UnifracGeneralizedTask(std::vector &_dm_stripes, std::vector &_dm_stripes_total, unsigned int _max_embs, const su::task_parameters* _task_p) : UnifracTask(_dm_stripes,_dm_stripes_total,_max_embs,_task_p) {} + UnifracGeneralizedTask(const UnifracGeneralizedTask& ) = delete; + UnifracGeneralizedTask& operator= (const UnifracGeneralizedTask&) = delete; + virtual void run(unsigned int filled_embs, const TFloat * __restrict__ length) {_run(filled_embs, length);} void _run(unsigned int filled_embs, const TFloat * __restrict__ length); @@ -516,6 +537,8 @@ namespace SUCMP_NM { , embedded_proportions(_embedded_proportions), embedded_counts(initialize_embedded()), sample_total_counts(_sample_total_counts), max_embs(_max_embs) {} */ + UnifracVawTask(const UnifracVawTask& ) = delete; + UnifracVawTask& operator= (const UnifracVawTask&) = delete; virtual ~UnifracVawTask() { @@ -554,6 +577,9 @@ namespace SUCMP_NM { unsigned int _max_embs, const su::task_parameters* _task_p) : UnifracVawTask(_dm_stripes,_dm_stripes_total,_sample_total_counts,_max_embs,_task_p) {} + UnifracVawUnnormalizedWeightedTask(const UnifracVawUnnormalizedWeightedTask& ) = delete; + UnifracVawUnnormalizedWeightedTask& operator= (const UnifracVawUnnormalizedWeightedTask&) = delete; + virtual void run(unsigned int filled_embs, const TFloat * __restrict__ length) {_run(filled_embs, length);} void _run(unsigned int filled_embs, const TFloat * __restrict__ length); @@ -566,6 +592,9 @@ namespace SUCMP_NM { unsigned int _max_embs, const su::task_parameters* _task_p) : UnifracVawTask(_dm_stripes,_dm_stripes_total,_sample_total_counts,_max_embs,_task_p) {} + UnifracVawNormalizedWeightedTask(const UnifracVawNormalizedWeightedTask& ) = delete; + UnifracVawNormalizedWeightedTask& operator= (const UnifracVawNormalizedWeightedTask&) = delete; + virtual void run(unsigned int filled_embs, const TFloat * __restrict__ length) {_run(filled_embs, length);} void _run(unsigned int filled_embs, const TFloat * __restrict__ length); @@ -578,6 +607,9 @@ namespace SUCMP_NM { unsigned int _max_embs, const su::task_parameters* _task_p) : UnifracVawTask(_dm_stripes,_dm_stripes_total,_sample_total_counts,_max_embs,_task_p) {} + UnifracVawUnweightedTask(const UnifracVawUnweightedTask& ) = delete; + UnifracVawUnweightedTask& operator= (const UnifracVawUnweightedTask&) = delete; + virtual void run(unsigned int filled_embs, const TFloat * __restrict__ length) {_run(filled_embs, length);} void _run(unsigned int filled_embs, const TFloat * __restrict__ length); @@ -590,6 +622,9 @@ namespace SUCMP_NM { unsigned int _max_embs, const su::task_parameters* _task_p) : UnifracVawTask(_dm_stripes,_dm_stripes_total,_sample_total_counts,_max_embs,_task_p) {} + UnifracVawGeneralizedTask(const UnifracVawGeneralizedTask& ) = delete; + UnifracVawGeneralizedTask& operator= (const UnifracVawGeneralizedTask&) = delete; + virtual void run(unsigned int filled_embs, const TFloat * __restrict__ length) {_run(filled_embs, length);} void _run(unsigned int filled_embs, const TFloat * __restrict__ length);