Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
c694d90
MIC requires that mpi.h be included before stdio.h (issue #12)
alecjohnson Jul 15, 2013
c4eaee2
Issue #29: add errors.h for diagnostics: eprintf() and invalid_value_…
alecjohnson Jul 15, 2013
37414e3
issue #30: MPIdata should be a singleton
alecjohnson Jul 15, 2013
984f599
debug.h was broken under commit bd0fa30835c. This uses MPIdata singl…
alecjohnson Jul 15, 2013
da737d9
issue#31: consistently use stdout rather than stderr
alecjohnson Jul 15, 2013
aeccc32
issue #32: implemented USING_PARALLEL_HDF5 so that users are not forc…
alecjohnson Jul 15, 2013
6c90362
Restored implementation of TimeTasks (issue #17). Some communication…
alecjohnson Jul 16, 2013
b8a1a58
issue #27: rhocs last dimension is allocated incorrectly in EMfields.cpp
alecjohnson Jul 16, 2013
c201c8c
issue #35: making MPI_Barrier() a no-op
alecjohnson Jul 16, 2013
7e4d4d1
issue #36: use int rather than long long in critical particle loops
alecjohnson Jul 16, 2013
23f510c
fixed typo in TimeTask output introduced in commit 6c903629
alecjohnson Jul 16, 2013
3687a02
Local omp.h was conflicting with system omp.h
alecjohnson Jul 16, 2013
bb6ec5f
issue #33: making grid accessors inline again
alecjohnson Jul 16, 2013
2bcd750
issues #23 and issue #33: using one preallocated Moments instance per…
alecjohnson Jul 16, 2013
4cbe820
issue #23 and #33: accumulating Moments using multiple instances for …
alecjohnson Jul 16, 2013
499c8bf
issue #33: eliminating iostream header from asserts.h
alecjohnson Jul 16, 2013
cdc05b3
issue #39: removed asgArr3 and asgArr4
alecjohnson Jul 22, 2013
e8982ee
issue#31: use stdout rather than stderr in debug.h
alecjohnson Jul 23, 2013
ed7accf
issue #40: replacing node_coordinate and center_coordinate arrays
alecjohnson Jul 23, 2013
1c2ff24
issue#41: interpP2G reimplemented as sumMoments in EMfields class
alecjohnson Jul 23, 2013
8187fbd
remove code commented in previous commit (iss #41)
alecjohnson Jul 23, 2013
c3b88b1
removed unused code obsoleted under iss#41
alecjohnson Jul 23, 2013
8556e6c
issue #42: Support -fno-exceptions: replacing throw with eprintf
alecjohnson Aug 1, 2013
31ebd95
issue #43: implemented new array classes
alecjohnson Jul 25, 2013
9b4962a
fixed compiler errors introduced in previous commit (g++)
alecjohnson Aug 2, 2013
5221388
implemented use of doubleArr3 for Moments class
alecjohnson Aug 5, 2013
c532855
iss #43: implemented array classes; fixes iss #44 (memory leak)
alecjohnson Aug 7, 2013
f2fe840
eliminated unnecessary reference for arrays
alecjohnson Aug 9, 2013
967631a
committing settings for large number of particles (for MIC)
alecjohnson Aug 9, 2013
dc4a2dc
using arr4_double(nxn,nyn,nzn,10) instance to sum moments
alecjohnson Aug 12, 2013
991d97d
fixed bugs introduced in previous commit
alecjohnson Aug 12, 2013
9f0e972
turned off use of moments10 introduced in dc4a2dcb81: not working wit…
alecjohnson Aug 12, 2013
07a20af
issue #46: implemented cmake support for MIC cross-compile (Xeon and …
alecjohnson Sep 24, 2013
28665ed
issue #10: XLEN divides nxc should be enforced
alecjohnson Sep 26, 2013
8b81a53
issue #47: created communication/VCtopology3D.cpp to speed recompile …
alecjohnson Sep 26, 2013
d68535c
issue #48: executable is now created as exec/iPic3D in the build dire…
alecjohnson Sep 26, 2013
46fd165
issue #49: create ipic scripts system: ctags and help
alecjohnson Oct 1, 2013
e3d1efd
Removing "siamo qua" comment.
alecjohnson Oct 1, 2013
2ac8e76
iss #47: put XLEN and PERIODICX in GEM.inp; iss #50: CollectiveIO rem…
alecjohnson Oct 1, 2013
51fa54d
issue #47: updating ipic help: configurable XLEN
alecjohnson Oct 1, 2013
c0855af
minor correction to ipic-help
alecjohnson Oct 1, 2013
990cba0
created makefile in main directory to give useful info for "make".
alecjohnson Oct 1, 2013
964e8b0
issue #41: doubled rate of summing moments via array(nx,ny,nz,10)
alecjohnson Oct 2, 2013
7c6db4e
commenting out deprecated TenMoments class with preprocessor directives
alecjohnson Oct 2, 2013
3304a90
issue #49: created ipic.py to replace ipic scripts
alecjohnson Oct 4, 2013
8ab8b3a
issue #49: removed ipic shell scripts
alecjohnson Oct 4, 2013
4f74c32
iss #49: scripts/ipic linked to scripts/ipic.py
alecjohnson Oct 4, 2013
4b92444
give environment info in response to "ipic help deep"
alecjohnson Oct 7, 2013
179b9a5
added support for single-precision particles
alecjohnson Oct 7, 2013
5da183b
issue #52: use separate fieldForPcls array to push particles
alecjohnson Oct 8, 2013
379a030
commented out #pragma simd directive: was only hurting performance
alecjohnson Oct 8, 2013
93b043f
Plugged memory leak in c_Solver::WriteConserved
alecjohnson Oct 8, 2013
09ed53e
issue #53: use long long for pclId, not arr index
alecjohnson Oct 8, 2013
e4ba3d5
made VelocityDist a local variable (follow-up to 93b043f5093)
alecjohnson Oct 8, 2013
3522db6
corrected MPI_UNSIGNED_LONG_LONG to MPI_LONG_LONG in getVelocityDistr…
alecjohnson Oct 8, 2013
90334a2
issue #54: TimeTasks now supports non-exclusive tasks and
alecjohnson Oct 10, 2013
1fb8825
corrected compile error from previous commit
alecjohnson Oct 10, 2013
e86bc65
sumMoments now sums moments of all species
alecjohnson Oct 14, 2013
aa96d72
fix to errors in previous commit
alecjohnson Oct 14, 2013
c950a84
issue #55: Sum moments for all species in one OpenMP parallel clause …
alecjohnson Oct 14, 2013
3837df2
create OpenMP threads only once to push particles
alecjohnson Oct 14, 2013
517c03a
issue #56: mover_PC(): iterate NiterMover times
alecjohnson Oct 15, 2013
d51cb74
issue #54: TimeTasks now averaged across threads
alecjohnson Oct 15, 2013
0fc8147
implemented CallFinalize input file option
alecjohnson Oct 15, 2013
489b670
cleaned up mover_PC() and sumMoments() methods
alecjohnson Oct 15, 2013
e1e32ae
mover_PC: renamed vars, used Om:=B*q*dt/(2*m*c) to reduce multiplicat…
alecjohnson Oct 17, 2013
ca89d59
enforcing that field and particle topology coincide (assumed in subse…
alecjohnson Oct 17, 2013
78e9e16
print error once only when nxc/XLEN is non-integer
alecjohnson Oct 17, 2013
b106afa
eliminate Particles abstract base class (cf. iss #18, #41)
alecjohnson Oct 17, 2013
64541ff
exclude unused files from ctags file
alecjohnson Jan 10, 2014
4b97b5f
vectorized mover and summing moments at cost of sorting serially
alecjohnson Jan 10, 2014
a513bb1
committing new file forgotten in previous commit
alecjohnson Jan 10, 2014
b3cc725
corrected compile error on mic introduced two commits earlier
alecjohnson Jan 13, 2014
504b3be
improved thread-awareness of debug and some asserts
alecjohnson Jan 13, 2014
44e99ea
fixed bug in sumMoments_vectorized()
alecjohnson Jan 13, 2014
4c36c2d
cleanup after previous commit
alecjohnson Jan 14, 2014
bef8049
created mechanism to restrict debug to master thread of main process
alecjohnson Jan 14, 2014
a351d13
implemented assert_almost_eq() with tolerance parameter like with fcmp
alecjohnson Jan 14, 2014
eda8098
setting get_VECTORIZE_MOMENTS to true
alecjohnson Jan 14, 2014
7b35413
Restored iteration order over momentsArray[c][m] so m is inner.
alecjohnson Jan 15, 2014
1f447db
Merge branch 'amaya-library' into merged
alecjohnson Jan 15, 2014
1a4e10b
fixed compile errors from merge
alecjohnson Jan 15, 2014
d20621b
trying to vectorize moments acumulation
alecjohnson Jan 15, 2014
c7692ad
vectorized summing moments
alecjohnson Jan 15, 2014
5b4298f
trying to vectorize moments acumulation
alecjohnson Jan 15, 2014
0a4cb3b
vectorized summing moments
alecjohnson Jan 15, 2014
937a8af
improved thread rection of sumMoments() and simplified sumMoments_vec…
alecjohnson Jan 16, 2014
e1dba2f
implemented mover_PC_AoS (array of structs particles)
alecjohnson Jan 22, 2014
b9f2958
added compile options -g -xHost for Xeon
alecjohnson Jan 21, 2014
b947bb4
fixed compiler bugs on MIC introduced in e1dba2f4abd
alecjohnson Jan 22, 2014
4d5156e
added TimeTasks: TRANSPOSE_PCLS_TO_SOA and TRANSPOSE_PCLS_TO_AOS
alecjohnson Jan 23, 2014
ba67737
restricted TimeTasks to master thread of rank 0 process
alecjohnson Jan 23, 2014
1a5b131
created sumMoments_AoS(). code blowing up at 10 cycles.
alecjohnson Jan 23, 2014
9164960
Fixed compile errors on Xeon Phi
alecjohnson Jan 29, 2014
6b150e8
Implemented support for 'ipic run' and 'ipic show' commands
alecjohnson Jan 29, 2014
9f04251
ipic run: calculate number of threads based on number of processes
alecjohnson Jan 30, 2014
ed23f3e
regularized Parameters options for mover_PC
alecjohnson Jan 23, 2014
e5a84d3
fixed AoS bugs and turned off sorting and vectorization in Parameters…
alecjohnson Jan 25, 2014
7086947
Merge branch 'premerge' into merge2head
alecjohnson Jan 30, 2014
48b1031
fixed bug in "ipic cmake" command
alecjohnson Jan 31, 2014
af34642
fixed ipic cmake
alecjohnson Feb 3, 2014
6c7cd96
implemented mover_PC_AoS_vec
alecjohnson Jan 31, 2014
fe2a01a
created utility/Basic.cpp for methods that need not be inline
alecjohnson Feb 22, 2014
d3ae3cf
inserted #include "errors.h" forgotten in commit fe2a01ab
alecjohnson Mar 7, 2014
fb3473f
created former_MPI_Barrier macro
alecjohnson Mar 7, 2014
091349a
moved MPI_Allreduce calls from .h to .cpp
alecjohnson Mar 7, 2014
b6639f2
commented out unused declarations in MPIdata.h
alecjohnson Mar 7, 2014
645af80
changed "ipic run" to call mpirun rather than mpiexec
alecjohnson Mar 7, 2014
4bd2416
added number of threads to utility/MPIdata.cpp output
alecjohnson Mar 7, 2014
f500fad
issue#62: changed getVelocityDistribution to make one MPI_Allreduce c…
alecjohnson Mar 7, 2014
699f6c0
issue#35: replaced MPI_Barrier with former_MPI_Barrier; MPI_Barrier i…
alecjohnson Mar 7, 2014
88ee39e
issue #63: made invalid_value_error thread safe
alecjohnson Mar 7, 2014
8a17293
warning messages should issue warning and proceed, not exit
alecjohnson Mar 7, 2014
0996301
implemented MPIdata::exit(code) to exit after calling MPI_Finalize()
alecjohnson Mar 7, 2014
507e0a6
issue #64: MPI should be initialized immediately
alecjohnson Mar 7, 2014
333cae3
issue #66: moving includes out of Collective.h
alecjohnson Mar 10, 2014
965aeaf
iss #65, iss #67: defined options for second-order accuracy
alecjohnson Mar 10, 2014
776da31
fixed compile errors on icpc probably introduced two commits ago
alecjohnson Mar 10, 2014
e5fa332
"ipic exec" now calls mpiexec, just as "ipic run" calls mpirun
alecjohnson Mar 10, 2014
8c8d657
removed unnecessary header includes in Grid3DCU.h (iss #66)
alecjohnson Mar 26, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 69 additions & 52 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
cmake_minimum_required(VERSION 2.8.8)

cmake_minimum_required(VERSION 2.8.8)
# compiler set in ../cmake/cmake_template.cmake.XeonPhi
#message ("for Xeon Phi:")
#message ("cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/cmake_template.cmake.XeonPhi")
#message ("for Xeon:")
#message ("cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/cmake_template.cmake.Xeon")
#
# Project declaration
#
Expand All @@ -13,17 +17,53 @@ project(iPic3D)
set(EXECUTABLE_OUTPUT_PATH exec/${CMAKE_BUILD_TYPE})
set(LIBRARY_OUTPUT_PATH lib)

#
# Set compiler flags per system
#
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "k1om") ## Xeon Phi
option(IPIC_XEONPHI "ipic xeon phi standard compile flags" on)
if(IPIC_XEONPHI)
set(CMAKE_CXX_FLAGS "-O3 -openmp -fno-exceptions -vec-report -mmic")
else()
set(CMAKE_CXX_FLAGS "-mmic")
endif()
#set(CMAKE_CXX_FLAGS "$(CMAKE_CXX_FLAGS) -mmic")
#set(CMAKE_CXX_FLAGS "-O3 -openmp -fno-exceptions -vec-report -mmic")
#set(CMAKE_CXX_FLAGS "-openmp -g -mmic") # set flags for Xeon Phi, totalview
elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64") ## Xeon
option(IPIC_XEON "icpc with optimization" on)
if(IPIC_XEON)
# reporting: -g -vec-report
# optimization: -O3 -xHost -fno-exceptions
set(CMAKE_CXX_FLAGS "-openmp -fno-exceptions -O3 -xHost -vec-report")
set(CMAKE_CXX_COMPILER "icpc")
endif()
#set(CMAKE_CXX_FLAGS "-O3 -openmp -g -xHost -fno-exceptions -vec-report")
else()
#set(CMAKE_CXX_FLAGS "-O3")
endif()

#
# Find third class libraries
#
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "k1om") ## Xeon Phi
set(CMAKE_PREFIX_PATH /opt/hdf5/1.8.10-patch1-mic)
set(VARIOUS_LIB /opt/intel/lib/mic)
set (EXTRA_LIBS ${VARIOUS_LIB}/libimf.so ${VARIOUS_LIB}/libsvml.so ${VARIOUS_LIB}/libirng.so ${VARIOUS_LIB}/libintlc.so ${MPELIB})
else()
find_package(MPI REQUIRED)
set(EXTRA_LIBS "")
endif()

find_package(HDF5 COMPONENTS HL C REQUIRED)
find_package(MPI REQUIRED)
message("HDF5_INCLUDE_DIRS is ${HDF5_INCLUDE_DIRS}")


#
# include and lib directories
#

# include_directories: files there are accessible to the project
include_directories(
include
${HDF5_INCLUDE_DIRS}
Expand All @@ -33,6 +73,7 @@ include_directories(
link_directories(
${HDF5_LIBRARY_DIRS}
${MPI_LIBRARY_DIRS}
${EXTRA_LIBS}
)

#
Expand All @@ -58,7 +99,6 @@ file(
communication/*.cpp
fields/*.cpp
grids/*.cpp
iPIC3D.cpp/*.cpp
inputoutput/*.cpp
mathlib/*.cpp
mpidata/*.cpp
Expand All @@ -67,52 +107,38 @@ file(
processtopology/*.cpp
solvers/*.cpp
utility/*.cpp
main/iPic3Dlib.cpp
main/*.cpp
)

#
# Compilation options
# Macro definitions
#

set(IPIC_TESTS_DIR "${CMAKE_BINARY_DIR}/tests" CACHE STRING "Location of the source files for iPic3D")

option(IPIC_PARALLEL_HDF5 "Output is done using the parallel HDF5 library" OFF)
if(IPIC_PARALLEL_HDF5)
add_definitions(-DPHDF5)
endif()

option(IPIC_BATSRUS "Compile library with coupling code for BATS-R-US" OFF)
if(IPIC_BATSRUS)
set(TEST_B $ENV{BATSRUS})
if(DEFINED TEST_B)
add_definitions( -DBATSRUS )
endif()

option(IPIC_XEONPHI "Compile options for Xeon Phi" OFF)
if(IPIC_XEONPHI)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
endif()

option(IPIC_TESTS "Set up the code tests" OFF)

option(IPIC_BUILD_SHARED "Compile shared library" OFF)
if(IPIC_BUILD_SHARED)
set(IPIC_BUILD_TYPE SHARED)
else()
set(IPIC_BUILD_TYPE STATIC)
endif()
message(" WARNING: BATSRUS flag is active.")
else(DEFINED TEST_B)
message(" INFO: BATSRUS is not active.")
endif(DEFINED TEST_B)

#
# Executable declaration
#

# Particle solver
add_executable(
iPic3D
iPic3D.cpp
)


#build iPic as a library also
#libiPic3Dlib.so in folder lib
add_library(
iPic3Dlib
${IPIC_BUILD_TYPE}
${inc_files}
iPic3Dlib #name of the library
SHARED #type of the library
${inc_files} # stuff to build the library
${src_files}
)

Expand All @@ -125,33 +151,24 @@ target_link_libraries(
${HDF5_LIBRARIES}
${HDF5_HL_LIBRARIES}
${MPI_LIBRARIES}
${EXTRA_LIBS}
)

target_link_libraries(
iPic3D
iPic3Dlib
)

#
# Code testing
#
## to save the executable in the folder where the CMakeLists.txt file is, i.e. CMAKE_CURRENT_SOURCE_DIR
#set_target_properties(iPic3D PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

if(IPIC_TESTS)
enable_testing()
## debug releases have a _d appended to the executable
set_target_properties(iPic3D PROPERTIES DEBUG_POSTFIX "_d")

add_test(NAME GEM-test
COMMAND ${CMAKE_COMMAND}
-DIPIC_TESTS_DIR=${IPIC_TESTS_DIR}
-DIPIC_SOURCE_DIR=${CMAKE_SOURCE_DIR}
-DIPICEXEC=$<TARGET_FILE:iPic3D>
-DMPIEXEC=${MPIEXEC}
-DMPIEXEC_NUMPROC_FLAG=${MPIEXEC_NUMPROC_FLAG}
-DMPIEXEC_POSTFLAGS=${MPIEXEC_POSTFLAGS}
-DIPIC_TESTS_DIR=${IPIC_TESTS_DIR}
-P ${CMAKE_SOURCE_DIR}/testfiles/CMakeRunTest-GEM.txt)

add_test(NAME uname-test
COMMAND ${CMAKE_COMMAND}
-P ${CMAKE_SOURCE_DIR}/testfiles/CMakeRunTest-uname.txt)
message("Which system am I compiling for:")
message("CMAKE_SYSTEM_PROCESSOR is ${CMAKE_SYSTEM_PROCESSOR}")

endif(IPIC_TESTS)
message("Compiler & compiler flags:")
message("CMAKE_CXX_COMPILER is ${CMAKE_CXX_COMPILER}")
message("CMAKE_CXX_FLAGS is ${CMAKE_CXX_FLAGS}")
5 changes: 4 additions & 1 deletion ConfigFile/src/ConfigFile.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// ConfigFile.cpp

#include "ConfigFile.h"
#include "errors.h"
#include "debug.h"

using std::string;

Expand All @@ -11,7 +13,8 @@ ConfigFile::ConfigFile(string filename, string delimiter, string comment, string
std::ifstream in(filename.c_str());

if (!in)
throw file_not_found(filename);
eprintf("file not found: %s", filename.c_str());
//throw file_not_found(filename);

in >> (*this);
}
Expand Down
5 changes: 3 additions & 2 deletions ConfigFile/src/ConfigFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#include <iostream>
#include <fstream>
#include <sstream>
#include "errors.h" // for eprintf

using std::string;

Expand Down Expand Up @@ -165,7 +166,6 @@ template <> inline bool ConfigFile::string_as_T < bool > (const string & s) {
*p = toupper(*p); // make string all caps
if (sup == string("FALSE") || sup == string("F") || sup == string("NO") || sup == string("N") || sup == string("0") || sup == string("NONE")) {
b = false;
cout << "siamo qua " << endl;
}
return b;
}
Expand All @@ -175,7 +175,8 @@ template < class T > T ConfigFile::read(const string & key) const {
// Read the value corresponding to key
mapci p = myContents.find(key);
if (p == myContents.end())
throw key_not_found(key);
eprintf("key not found: %s", key.c_str());
//throw key_not_found(key);
return string_as_T < T > (p->second);
}

Expand Down
Loading