Commit 9cef6470 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Merge master with HDF5 output

parents 180c1c54 0d69e7e7
Loading
Loading
Loading
Loading
+55 −12
Original line number Original line Diff line number Diff line
@@ -154,7 +154,7 @@ building_stage:
      - cat /etc/os-release
      - cat /etc/os-release
      - cd build
      - cd build
      - echo "Configuring with default compilers (MAGMA disabled)..."
      - echo "Configuring with default compilers (MAGMA disabled)..."
      - ./configure --without-magma --without-cublas --disable-offload --enable-refinement
      - ./configure --without-magma --without-cublas --disable-offload --enable-refinement --enable-shared
      - make wipe
      - make wipe
      - echo "Building the default configuration..."
      - echo "Building the default configuration..."
      - make -j
      - make -j
@@ -174,7 +174,7 @@ sanity_stage:
      - building_stage
      - building_stage
   artifacts:
   artifacts:
      paths:
      paths:
         - build/testing/valgrind.log
         - build/testing/valgrind_*.log
      exclude:
      exclude:
         - ".git*"
         - ".git*"
         - ".git/**/*"
         - ".git/**/*"
@@ -185,11 +185,26 @@ sanity_stage:
      - hostname
      - hostname
      - echo $CI_COMMIT_SHA
      - echo $CI_COMMIT_SHA
      - echo $CI_COMMIT_BRANCH
      - echo $CI_COMMIT_BRANCH
      - cd build/testing
      - cd build/libnptm
      - echo "Running memory sanity check"
      - export LD_LIBRARY_PATH="$LD_LIBRARY_PATH;$PWD"
      - cd ../testing
      - echo "Running memory sanity check for ParticleDescriptor"
      - chmod +x test_ParticleDescriptor
      - chmod +x test_ParticleDescriptor
      - valgrind --leak-check=full --log-file=valgrind.log ./test_ParticleDescriptor
      - valgrind --leak-check=full --log-file=valgrind_Particle.log ./test_ParticleDescriptor
      - grep "no leaks are possible" valgrind.log
      - grep "0 errors from 0 contexts" valgrind_Particle.log
      - echo "Running memory sanity check for output classes"
      - chmod +x test_cluster_outputs
      - valgrind --leak-check=full --log-file=valgrind_cluster.log ./test_cluster_outputs
      - grep "0 errors from 0 contexts" valgrind_cluster.log
      - rm -rf c_OCLU_24
      - chmod +x test_inclusion_outputs
      - valgrind --leak-check=full --log-file=valgrind_inclusion.log ./test_inclusion_outputs
      - grep "0 errors from 0 contexts" valgrind_inclusion.log
      - rm -rf c_OINCLU
      - chmod +x test_sphere_outputs
      - valgrind --leak-check=full --log-file=valgrind_sphere.log ./test_sphere_outputs
      - grep "0 errors from 0 contexts" valgrind_sphere.log
      - rm -rf c_OSPH
      
      
running_stage:
running_stage:
   stage: run
   stage: run
@@ -215,10 +230,12 @@ running_stage:
      - hostname
      - hostname
      - echo $CI_COMMIT_SHA
      - echo $CI_COMMIT_SHA
      - echo $CI_COMMIT_BRANCH
      - echo $CI_COMMIT_BRANCH
      - cd build/sphere
      - cd build/libnptm
      - export LD_LIBRARY_PATH="$LD_LIBRARY_PATH;$PWD"
      - cd ../sphere
      - echo "Running np_sphere"
      - echo "Running np_sphere"
      - chmod +x np_sphere
      - chmod +x np_sphere
      - ./np_sphere
      - OMP_NUM_THREADS=1 ./np_sphere
      - cd ../cluster
      - cd ../cluster
      - echo "Running np_cluster"
      - echo "Running np_cluster"
      - chmod +x np_cluster
      - chmod +x np_cluster
@@ -240,7 +257,7 @@ testing_stage:
      - running_stage
      - running_stage
   artifacts:
   artifacts:
      paths:
      paths:
         - build/cluster/pycompare.html
         - build/cluster/pycompare_*.html
         - build/inclusion/pycompare.html
         - build/inclusion/pycompare.html
         - build/sphere/pycompare.html
         - build/sphere/pycompare.html
      exclude:
      exclude:
@@ -253,7 +270,9 @@ testing_stage:
      - hostname
      - hostname
      - echo $CI_COMMIT_SHA
      - echo $CI_COMMIT_SHA
      - echo $CI_COMMIT_BRANCH
      - echo $CI_COMMIT_BRANCH
      - cd build/sphere
      - cd build/libnptm
      - export LD_LIBRARY_PATH="$LD_LIBRARY_PATH;$PWD"
      - cd ../sphere
      - export FFILE=../../test_data/sphere/OSPH
      - export FFILE=../../test_data/sphere/OSPH
      - echo "Comparing output of SPHERE"
      - echo "Comparing output of SPHERE"
      - python3 ../../src/scripts/pycompare.py --no-progress --ffile $FFILE --cfile c_OSPH --html
      - python3 ../../src/scripts/pycompare.py --no-progress --ffile $FFILE --cfile c_OSPH --html
@@ -266,13 +285,37 @@ testing_stage:
      - cd ../cluster
      - cd ../cluster
      - echo "Comparing output of CLUSTER"
      - echo "Comparing output of CLUSTER"
      - export FFILE=../../test_data/cluster/OCLU
      - export FFILE=../../test_data/cluster/OCLU
      - python3 ../../src/scripts/pycompare.py --no-progress --ffile $FFILE --cfile c_OCLU --html
      - python3 ../../src/scripts/pycompare.py --no-progress --ffile $FFILE --cfile c_OCLU --html=pycompare_dev.html
      - echo "Testing cluster with 24 spheres"
      - echo "Testing cluster with 24 spheres"
      - OMP_NUM_THREADS=1 OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 mpirun -n 2 ./np_cluster ../../test_data/cluster/DEDFB_24 ../../test_data/cluster/DCLU_24 .
      - OMP_NUM_THREADS=1 OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 mpirun -n 2 ./np_cluster ../../test_data/cluster/DEDFB_24 ../../test_data/cluster/DCLU_24 .
      - echo "Comparing output of CLUSTER with 24 spheres"
      - echo "Comparing output of CLUSTER with 24 spheres"
      - export FFILE=../../test_data/cluster/OCLU_24
      - export FFILE=../../test_data/cluster/OCLU_24
      - python3 ../../src/scripts/pycompare.py --no-progress --ffile $FFILE --cfile c_OCLU --html
      - python3 ../../src/scripts/pycompare.py --no-progress --ffile $FFILE --cfile c_OCLU --html=pycompare_24.html
      - echo "Checking consistency among legacy and HDF5 configuration files"
      - echo "Checking consistency among legacy and HDF5 configuration files"
      - ../testing/test_TEDF ../../test_data/cluster/DEDFB_24 c_TEDF c_TEDF.hd5
      - ../testing/test_TEDF ../../test_data/cluster/DEDFB_24 c_TEDF c_TEDF.hd5
      - echo "Checking consistency among legacy and HDF5 TM files"
      - echo "Checking consistency among legacy and HDF5 TM files"
      - ../testing/test_TTMS c_TTMS c_TTMS.hd5
      - ../testing/test_TTMS c_TTMS c_TTMS.hd5
      - echo "Testing cluster with 48 spheres"
      - OMP_NUM_THREADS=5 ./np_cluster ../../test_data/cluster/DEDFB_48 ../../test_data/cluster/DCLU_48 .
      - echo "Comparing output of CLUSTER with 48 spheres"
      - export FFILE=../../test_data/cluster/OCLU_48
      - python3 ../../src/scripts/pycompare.py --no-progress --ffile $FFILE --cfile c_OCLU --html=pycompare_48.html
      - cd ../testing
      - echo "Checking consistency of HDF5 cluster output"
      - chmod u+x test_cluster_outputs
      - ./test_cluster_outputs
      - export FFILE=../../test_data/cluster/OCLU_24
      - python3 ../../src/scripts/pycompare.py --no-progress --ffile $FFILE --cfile c_OCLU_24
      - rm -rf c_OCLU_24
      - echo "Checking consistency of HDF5 incluson output"
      - chmod u+x test_inclusion_outputs
      - ./test_inclusion_outputs
      - export FFILE=../../test_data/inclusion/OINCLU
      - python3 ../../src/scripts/pycompare.py --no-progress --ffile $FFILE --cfile c_OINCLU
      - rm -rf c_OINCLU
      - chmod u+x test_sphere_outputs
      - ./test_sphere_outputs
      - export FFILE=../../test_data/sphere/OSPH
      - python3 ../../src/scripts/pycompare.py --no-progress --ffile $FFILE --cfile c_OSPH
      - rm -rf c_OSPH
      
 No newline at end of file
+1 −1
Original line number Original line Diff line number Diff line
@@ -11,7 +11,7 @@ Distributing the code and its sources is possible under the terms of the GNU GPL
- Saija et al. 2001, ApJ, 559, 993, DOI:10.1086/322350
- Saija et al. 2001, ApJ, 559, 993, DOI:10.1086/322350
- Borghese, Denti, Saija 2007, Scattering from Model Nonspherical Particles (ISBN 978-3-540-37413-8), DOI:10.1007/978-3-540-37414-5
- Borghese, Denti, Saija 2007, Scattering from Model Nonspherical Particles (ISBN 978-3-540-37413-8), DOI:10.1007/978-3-540-37414-5


*NOTE:* The building process requires a working installation of a C++ and a FORTRAN compiler. Many solutions are available, but the recommended option is the *GNU Compiler Collection* `gcc` with the addition of `g++` and `gfortran`. The parallel code implementation further requires the use of parallel compilers complying with the MPI standard (*OpenMPI*, *MPICH*).
*NOTE:* The building process requires a working installation of a C++ and a FORTRAN compiler. Many solutions are available, but the recommended option is the *GNU Compiler Collection* `gcc` with the addition of `g++` and `gfortran`. Single-workstation multi-threaded parallelism is supported through _OpenMP_, while the multi-node code implementation further requires the use of parallel compilers complying with the _MPI_ standard (_OpenMPI_, _MPICH_).


# Acknowledgments
# Acknowledgments


+22 −4
Original line number Original line Diff line number Diff line
@@ -14,21 +14,29 @@ else
	NPTM_LIB=libnptm/libnptm.a
	NPTM_LIB=libnptm/libnptm.a
	CXXFLAGSLIB=-static
	CXXFLAGSLIB=-static
endif # LIBMODE
endif # LIBMODE
NP_LIBNPTM_SRCS=../src/libnptm/algebraic.cpp ../src/libnptm/clu_subs.cpp ../src/libnptm/Commons.cpp ../src/libnptm/Configuration.cpp ../src/libnptm/cublas_calls.cpp ../src/libnptm/file_io.cpp ../src/libnptm/inclu_subs.cpp ../src/libnptm/logging.cpp ../src/libnptm/lapack_calls.cpp ../src/libnptm/magma_calls.cpp ../src/libnptm/Parsers.cpp ../src/libnptm/sph_subs.cpp ../src/libnptm/tfrfme.cpp ../src/libnptm/tra_subs.cpp ../src/libnptm/TransitionMatrix.cpp ../src/libnptm/utils.cpp
NP_DOC_SRCS=../doc/src/config.dox
NP_LIBNPTM_OBJS=../src/libnptm/algebraic.o ../src/libnptm/clu_subs.o ../src/libnptm/Commons.o ../src/libnptm/Configuration.o ../src/libnptm/cublas_calls.o ../src/libnptm/file_io.o ../src/libnptm/inclu_subs.o ../src/libnptm/logging.o ../src/libnptm/lapack_calls.o ../src/libnptm/magma_calls.o ../src/libnptm/Parsers.o ../src/libnptm/sph_subs.o ../src/libnptm/tfrfme.o ../src/libnptm/tra_subs.o ../src/libnptm/TransitionMatrix.o ../src/libnptm/utils.o
NP_LIBNPTM_SRCS=../src/libnptm/algebraic.cpp ../src/libnptm/clu_subs.cpp ../src/libnptm/Commons.cpp ../src/libnptm/Configuration.cpp ../src/libnptm/cublas_calls.cpp ../src/libnptm/file_io.cpp ../src/libnptm/inclu_subs.cpp ../src/libnptm/logging.cpp ../src/libnptm/lapack_calls.cpp ../src/libnptm/magma_calls.cpp ../src/libnptm/outputs.cpp ../src/libnptm/Parsers.cpp ../src/libnptm/sph_subs.cpp ../src/libnptm/tfrfme.cpp ../src/libnptm/tra_subs.cpp ../src/libnptm/TransitionMatrix.cpp ../src/libnptm/utils.cpp
NP_LIBNPTM_OBJS=../src/libnptm/algebraic.o ../src/libnptm/clu_subs.o ../src/libnptm/Commons.o ../src/libnptm/Configuration.o ../src/libnptm/cublas_calls.o ../src/libnptm/file_io.o ../src/libnptm/inclu_subs.o ../src/libnptm/logging.o ../src/libnptm/lapack_calls.o ../src/libnptm/magma_calls.o ../src/libnptm/outputs.o ../src/libnptm/Parsers.o ../src/libnptm/sph_subs.o ../src/libnptm/tfrfme.o ../src/libnptm/tra_subs.o ../src/libnptm/TransitionMatrix.o ../src/libnptm/utils.o
NP_CLUSTER_SRCS=../src/cluster/np_cluster.cpp ../src/cluster/cluster.cpp
NP_CLUSTER_OBJS=../src/cluster/np_cluster.o ../src/cluster/cluster.o
NP_CLUSTER_OBJS=../src/cluster/np_cluster.o ../src/cluster/cluster.o
NP_CLUSTER_BINS=cluster/np_cluster
NP_CLUSTER_BINS=cluster/np_cluster
NP_INCLUSION_SRCS=../src/inclusion/np_inclusion.cpp ../src/inclusion/inclusion.cpp
NP_INCLUSION_OBJS=../src/inclusion/np_inclusion.o ../src/inclusion/inclusion.o
NP_INCLUSION_OBJS=../src/inclusion/np_inclusion.o ../src/inclusion/inclusion.o
NP_INCLUSION_BINS=inclusion/np_inclusion
NP_INCLUSION_BINS=inclusion/np_inclusion
NP_SPHERE_SRCS=../src/sphere/np_sphere.cpp ../src/sphere/sphere.cpp
NP_SPHERE_OBJS=../src/sphere/np_sphere.o ../src/sphere/sphere.o
NP_SPHERE_OBJS=../src/sphere/np_sphere.o ../src/sphere/sphere.o
NP_SPHERE_BINS=sphere/np_sphere
NP_SPHERE_BINS=sphere/np_sphere
NP_TRAPPING_SRCS=../src/trapping/np_trapping.cpp ../src/trapping/cfrfme.cpp ../src/trapping/clffft.cpp
NP_TRAPPING_OBJS=../src/trapping/np_trapping.o ../src/trapping/cfrfme.o ../src/trapping/clffft.o
NP_TRAPPING_OBJS=../src/trapping/np_trapping.o ../src/trapping/cfrfme.o ../src/trapping/clffft.o
NP_TRAPPING_BINS=trapping/np_trapping
NP_TRAPPING_BINS=trapping/np_trapping
NP_TESTING_OBJS=../src/testing/test_ParticleDescriptor.o ../src/testing/test_TEDF.o ../src/testing/test_TTMS.o
NP_TESTING_OBJS=../src/testing/test_cluster_outputs.o ../src/testing/test_inclusion_outputs.o ../src/testing/test_sphere_outputs.o ../src/testing/test_ParticleDescriptor.o ../src/testing/test_TEDF.o ../src/testing/test_TTMS.o
NP_TESTING_BINS=testing/test_ParticleDescriptor testing/test_TEDF testing/test_TTMS
NP_TESTING_BINS=testing/test_cluster_outputs testing/test_inclusion_outputs testing/test_sphere_outputs testing/test_ParticleDescriptor testing/test_TEDF testing/test_TTMS


all: $(NPTM_LIB) $(FORTRAN_BINS) $(NP_CLUSTER_BINS) $(NP_INCLUSION_BINS) $(NP_SPHERE_BINS) $(NP_TRAPPING_BINS) $(NP_TESTING_BINS)
all: $(NPTM_LIB) $(FORTRAN_BINS) $(NP_CLUSTER_BINS) $(NP_INCLUSION_BINS) $(NP_SPHERE_BINS) $(NP_TRAPPING_BINS) $(NP_TESTING_BINS)


docs: $(NP_LIBNPTM_SRCS) $(NP_CLUSTER_SRCS) $(NP_DOC_SRCS) $(NP_INCLUSION_SRCS) $(NP_SPHERE_SRCS) $(NP_TRAPPING_SRCS)
	cd ../doc/src; doxygen config.dox

libnptm/libnptm.a: $(NP_LIBNPTM_OBJS)
libnptm/libnptm.a: $(NP_LIBNPTM_OBJS)
	$(AR) $(ARFLAGS) $@ $(NP_LIBNPTM_OBJS)
	$(AR) $(ARFLAGS) $@ $(NP_LIBNPTM_OBJS)


@@ -75,6 +83,15 @@ trapping/np_trapping: $(NPTM_LIB) $(NP_TRAPPING_OBJS)
testing/test_ParticleDescriptor: $(NPTM_LIB) ../src/testing/test_ParticleDescriptor.o
testing/test_ParticleDescriptor: $(NPTM_LIB) ../src/testing/test_ParticleDescriptor.o
	$(CXX) $(CXXFLAGS) ../src/testing/test_ParticleDescriptor.o -o $@ $(CXXLDFLAGS)
	$(CXX) $(CXXFLAGS) ../src/testing/test_ParticleDescriptor.o -o $@ $(CXXLDFLAGS)


testing/test_cluster_outputs: $(NPTM_LIB) ../src/testing/test_cluster_outputs.o
	$(CXX) $(CXXFLAGS) ../src/testing/test_cluster_outputs.o -o $@ $(CXXLDFLAGS)

testing/test_inclusion_outputs: $(NPTM_LIB) ../src/testing/test_inclusion_outputs.o
	$(CXX) $(CXXFLAGS) ../src/testing/test_inclusion_outputs.o -o $@ $(CXXLDFLAGS)

testing/test_sphere_outputs: $(NPTM_LIB) ../src/testing/test_sphere_outputs.o
	$(CXX) $(CXXFLAGS) ../src/testing/test_sphere_outputs.o -o $@ $(CXXLDFLAGS)

testing/test_TEDF: $(NPTM_LIB) ../src/testing/test_TEDF.o
testing/test_TEDF: $(NPTM_LIB) ../src/testing/test_TEDF.o
	$(CXX) $(CXXFLAGS) ../src/testing/test_TEDF.o -o $@ $(CXXLDFLAGS)
	$(CXX) $(CXXFLAGS) ../src/testing/test_TEDF.o -o $@ $(CXXLDFLAGS)


@@ -146,3 +163,4 @@ clean:
wipe:
wipe:
	rm -rf $(FORTRAN_OBJS) $(NP_LIBNPTM_OBJS) $(NP_CLUSTER_OBJS) $(NP_INCLUSION_OBJS) $(NP_SPHERE_OBJS) $(NP_TRAPPING_OBJS) $(NP_TESTING_OBJS)
	rm -rf $(FORTRAN_OBJS) $(NP_LIBNPTM_OBJS) $(NP_CLUSTER_OBJS) $(NP_INCLUSION_OBJS) $(NP_SPHERE_OBJS) $(NP_TRAPPING_OBJS) $(NP_TESTING_OBJS)
	rm -rf $(FORTRAN_BINS) libnptm/libnptm.a libnptm/libnptm.so $(NP_CLUSTER_BINS) $(NP_INCLUSION_BINS) $(NP_SPHERE_BINS) $(NP_TRAPPING_BINS) $(NP_TESTING_BINS)
	rm -rf $(FORTRAN_BINS) libnptm/libnptm.a libnptm/libnptm.so $(NP_CLUSTER_BINS) $(NP_INCLUSION_BINS) $(NP_SPHERE_BINS) $(NP_TRAPPING_BINS) $(NP_TESTING_BINS)
	rm -rf ../doc/build
+873 −426

File changed.

Preview size limit exceeded, changes collapsed.

+24 −17
Original line number Original line Diff line number Diff line
@@ -35,6 +35,12 @@
#include <cstdio>
#include <cstdio>
#include <string>
#include <string>


#ifdef USE_MPI
#ifndef MPI_VERSION
#include <mpi.h>
#endif
#endif

#ifndef INCLUDE_TYPES_H_
#ifndef INCLUDE_TYPES_H_
#include "../include/types.h"
#include "../include/types.h"
#endif
#endif
@@ -64,8 +70,9 @@ extern void cluster(const string& config_file, const string& data_file, const st
 * \return result: `int` An exit code passed to the OS (0 for succesful execution).
 * \return result: `int` An exit code passed to the OS (0 for succesful execution).
 */
 */
int main(int argc, char **argv) {
int main(int argc, char **argv) {
  int ierr = 0;
#ifdef MPI_VERSION
#ifdef MPI_VERSION
	int ierr = MPI_Init(&argc, &argv);
  ierr = MPI_Init(&argc, &argv);
  // create and initialise class with essential MPI data
  // create and initialise class with essential MPI data
  mixMPI *mpidata = new mixMPI(MPI_COMM_WORLD);
  mixMPI *mpidata = new mixMPI(MPI_COMM_WORLD);
#else
#else
@@ -85,5 +92,5 @@ int main(int argc, char **argv) {
  MPI_Finalize();
  MPI_Finalize();
#endif
#endif
  delete mpidata;
  delete mpidata;
	return 0;
  return ierr;
}
}
Loading