Skip to content

Commit 8913577

Browse files
committed
Updated local environment
1 parent 92c7233 commit 8913577

File tree

8 files changed

+55
-17
lines changed

8 files changed

+55
-17
lines changed

0_version_openmp/environment_local.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
export CC=gcc
3+
export FWIDIR=$PWD/..

2_version_mpi/CMakeLists.txt

+29-15
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,18 @@ project(FWI C)
77
#--------------------------------------
88
find_package(MPI REQUIRED QUIET)
99

10-
message(STATUS "--------------------------------------")
11-
message(STATUS "----[MPI ENABLED] setting: ")
12-
message(STATUS "---- MPI_C_COMPILER: ${MPI_C_COMPILER}")
13-
message(STATUS "---- MPI_C_COMPILE_FLAGS: ${MPI_C_COMPILE_FLAGS}")
14-
message(STATUS "---- MPI_C_INCLUDE_PATH: ${MPI_C_INCLUDE_PATH}")
15-
message(STATUS "---- MPI_C_LINK_FLAGS: ${MPI_C_LINK_FLAGS}")
16-
message(STATUS "---- MPI_C_LIBRARIES: ${MPI_C_LIBRARIES}")
17-
message(STATUS "--------------------------------------")
10+
message(STATUS "-------------------------------------------------")
11+
message(STATUS "---- MPI setting: ")
12+
message(STATUS "---- MPI_C_COMPILER: ${MPI_C_COMPILER} ")
13+
message(STATUS "---- MPI_C_COMPILE_FLAGS: ${MPI_C_COMPILE_FLAGS} ")
14+
message(STATUS "---- MPI_C_INCLUDE_PATH: ${MPI_C_INCLUDE_PATH} ")
15+
message(STATUS "---- MPI_C_LINK_FLAGS: ${MPI_C_LINK_FLAGS} ")
16+
message(STATUS "---- MPI_C_LIBRARIES: ${MPI_C_LIBRARIES} ")
17+
message(STATUS "-------------------------------------------------")
1818

1919
include_directories(${MPI_C_INCLUDE_PATH})
2020
add_definitions("-DDISTRIBUTED_MEMORY_IMPLEMENTATION")
2121

22-
2322
#--------------------------------------
2423
# Configure high-level compiler flags
2524
#--------------------------------------
@@ -35,13 +34,16 @@ else()
3534
message (FATAL_ERROR "Invalid architecture descriptor!")
3635
endif()
3736

37+
message(STATUS "Compiler Id ${CMAKE_C_COMPILER_ID}")
3838

39-
#--------------------------------------
40-
# Common compilation flags, if any.
41-
#--------------------------------------
42-
set (CMAKE_C_FLAGS "-std=c99 -qopenmp -fma -align -finline-functions")
43-
# set (CMAKE_C_FLAGS "-g -Wall -std=c99 -qopenmp")
44-
39+
#---------------------------------------------------
40+
# Configure compiler flags for Intel/GCC compilers
41+
#--------------------------------------------------
42+
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Intel")
43+
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -qopenmp -fma -align -finline-functions")
44+
else()
45+
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -fopenmp")
46+
endif()
4547

4648
#--------------------------------------
4749
# Configure release
@@ -51,6 +53,8 @@ set (debug "Debug mode enabled" OFF)
5153
if (debug)
5254
message(STATUS "Debug mode enabled")
5355
add_definitions ("-DDEBUG")
56+
else()
57+
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wunused-result")
5458
endif()
5559

5660

@@ -91,6 +95,16 @@ else()
9195
message(STATUS "GPFS system will be used for local I/O")
9296
endif()
9397

98+
#--------------------------------------
99+
# Use NMVe local storage
100+
#--------------------------------------
101+
message(STATUS "----------------------------------------")
102+
message(STATUS "CMAKE_C_COMPILER: ${CMAKE_C_COMPILER}")
103+
message(STATUS "CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}")
104+
message(STATUS "CMAKE_C_INCLUDE_PATH: ${CMAKE_C_INCLUDE_PATH}")
105+
message(STATUS "CMAKE_C_LIBRARIES: ${CMAKE_C_LIBRARIES}")
106+
message(STATUS "----------------------------------------")
107+
94108

95109
#--------------------------------------
96110
# Create fwi binary

2_version_mpi/environment_local.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
export CC=mpiicc
3+
export FWIDIR=$PWD/..

InputModels/README.md

Whitespace-only changes.

run_example.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ color_reset=`tput sgr0`
1717
# compile the schedule and model generator utilities
1818
echo "${color_green}------------- Compiling scheduler and model generator binaries${color_reset}"
1919
cd utils
20-
source environment.sh
20+
source environment_$2.sh
21+
mkdir -p build
2122
cd build
2223
rm -rf *
2324
cmake -DCMAKE_C_COMPILER=gcc -Ddebug=OPTION_DEBUG_VALUE -Dperform-io=OPTION_IO_VALUE -Duse-nmve=OPTION_NMVE_VALUE ..
@@ -36,6 +37,7 @@ echo "${color_reset}"
3637
echo "${color_green}------------- Compiling $1 FWI version code${color_reset}"
3738
cd ../$1
3839
source environment_$2.sh
40+
mkdir -p build
3941
cd build
4042
rm -rf *
4143
cmake -Darchitecture=generic -Ddebug=OPTION_DEBUG_VALUE -Dperform-io=OPTION_IO_VALUE -Duse-nmve=OPTION_NMVE_VALUE -Dcollect-stats=OPTION_STATS_VALUE ..

utils/CMakeLists.txt

+14-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,18 @@ project(FWI C)
55
#--------------------------------------
66
# Common compilation flags, if any.
77
#--------------------------------------
8-
set (CMAKE_C_FLAGS "-g -std=c99 -O2")
8+
9+
message(STATUS "Compiler Id ${CMAKE_C_COMPILER_ID}")
10+
11+
#---------------------------------------------------
12+
# Configure compiler flags for Intel/GCC compilers
13+
#--------------------------------------------------
14+
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Intel")
15+
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -qopenmp -fma -align -finline-functions")
16+
else()
17+
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -fopenmp")
18+
endif()
19+
920
add_definitions ("-DSHARED_MEMORY_IMPLEMENTATION")
1021

1122
#--------------------------------------
@@ -16,6 +27,8 @@ set (debug "Debug mode enabled" OFF)
1627
if (debug)
1728
message(STATUS "Debug mode enabled")
1829
add_definitions ("-DDEBUG")
30+
else()
31+
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wunused-result")
1932
endif()
2033

2134
#--------------------------------------

utils/environment_local.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin
2+
export CC=gcc
3+
export FWIDIR=$PWD/..
File renamed without changes.

0 commit comments

Comments
 (0)