#!/bin/tcsh #HERE IS HOW TO COMPILE: #./make_cmd sooner #or #./make_cmd lonestar #(depending on the machine) set cluster_name = "${1}" echo 'cluster_name = '$cluster_name set compile_for_tau_profiling = "${2}" echo 'tau_profiling = '$compile_for_tau_profiling if (${compile_for_tau_profiling} == "tau") then module load tau echo 'FINISHED LOADING Tau Module' setenv TAU_OPTIONS "-optVerbose -optPreProcess -optComInst" setenv TAU_MAKEFILE "$TACC_TAU_LIB/Makefile.tau-multiplecounters-icpc-mpi-papi-pdt" setenv COUNTER1 "GET_TIME_OF_DAY" echo 'COUNTER1 = $COUNTER1' # setenv COUNTER1 "PAPI_TOT_CYC #(total cycle)" setenv COUNTER2 "PAPI_FP_INS" # setenv COUNTER2 "PAPI_FP_OPS" echo 'COUNTER2 = $COUNTER2' # setenv COUNTER3 "PAPI_L1_TCM" setenv COUNTER3 "PAPI_L2_TCM" echo 'COUNTER3 = $COUNTER3' echo 'FINISHED setting Tau Environment Variables ' endif #${compile_for_tau_profiling} == "tau" #CLEAR COMPILER VARIABLES, JUST IN CASE setenv F90 "" setenv CC "" setenv MPCC "" setenv MPI_COMPILER "intel" #setenv MPI_COMPILER "pgi" #setenv MPI_COMPILER "nag" setenv MPI_INTERCONNECT "ib" #setenv MPI_INTERCONNECT "p4" #setenv MPI_VENDOR "openmpi" dos2unix lsf_chain.tcsh chmod 755 lsf_chain.tcsh mkdir debug mkdir backup mkdir results mkdir results_LST mkdir results_LBM mkdir results_LBM/stresses chmod 755 lsf* *cmd mpicc -c timer.c if ((${MPI_COMPILER} == "intel") || (${MPI_COMPILER} == "intel9")) then if( ${cluster_name} == "sooner" ) then #make OPTFLAGS="-O3 -march=core2 -mtune=core2 -shared-intel" # Intel on sooner make OPTFLAGS="-warn interface -O3 -fpe0 -traceback -C -march=core2 -mtune=core2 -shared-intel" # Intel debug on sooner #make OPTFLAGS="-O3 -march=core2 -mtune=core2 -shared-intel" # Intel debug on sooner else if ( ${cluster_name} == "lonestar" ) then if (${compile_for_tau_profiling} == "tau") then #define Tau compilers setenv F90 "tau_f90.sh" setenv CC "tau_cc.sh" setenv MPCC "tau_cc.sh" make OPTFLAGS="-I. -g -O2 -xT" # Intel tau profiling on lonestar else #${compile_for_tau_profiling} != "tau" #make OPTFLAGS="-O3 -xT -shared-intel" # Intel no debug on lonestar make OPTFLAGS="-warn interface -C -fpe0 -traceback -xT -shared-intel" # Intel debug on lonestar endif #${compile_for_tau_profiling} == "tau" else if ( ${cluster_name} == "ranger" ) then module swap pgi intel make OPTFLAGS="-O3 -xW -shared-intel" # Intel no debug on lonestar #make OPTFLAGS="-warn interface -C -fpe0 -traceback -xW -shared-intel -fp-stack-check" # Intel debug on ranger #make OPTFLAGS="-fast -tp barcelona-64 -mp" # PGI no debug on ranger #make OPTFLAGS="-fast -tp barcelona-64 -mp -g -gopt -Mbounds -Mchkptr -Mchkfpstk -Mchkstk" # PGI debug on ranger else if ( ${cluster_name} == "stampede" ) then #make OPTFLAGS="-O3 -shared-intel" #Intel no debug on stampede make OPTFLAGS="-warn interface -C -fpe0 -traceback -shared-intel -fp-stack-check" #Intel debug on stampede else echo 'cluster_name NOT RECOGNIZED. NOTHING TO DO... EXITING' exit 1 endif #${cluster_name} ==... else if (${MPI_COMPILER} == "pgi") then #make OPTFLAGS="-fastsse -tp=core2-64" # PGI on sooner make OPTFLAGS="-g -gopt -Mbounds -Mchkptr -Mchkfpstk -Mchkstk -fastsse -tp=core2-64" # PGI debug on sooner else if ((${MPI_COMPILER} == "gcc") || (${MPI_COMPILER} == "gnu")) then make OPTFLAGS="-O -ffixed-line-length-none -ffree-form " # GNU else if (${MPI_COMPILER} == "nag") then make OPTFLAGS="-O -free -dusty" # GNU endif # (${MPI_COMPILER == "nag")