machines.sh 3.04 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#This file contains the defaults for compiling FLEUR on known machines

#please add further definitions here and also add code below!
read -r -d '' known_machines << EOM
   IFF         -- cluster @ PGI of FZJ
   JURECA      -- @JSC
   JUQUEEN     -- @JSC
   CLAIX       -- @RWTH
   MARCONI     -- @CINECA 
EOM


function configure_machine(){
    
    if [ "$machine" = "JURECA" ] 
    then
	echo "JURECA configuration used"
18
	if module list 2>&1 |grep -q -i intel
19 20
	then
	    echo "Intel toolchain used"
21
	    if module list 2>&1| grep -q Python &&
22
	       module list 2>&1| grep -q ELPA
23
               #module list 2>&1| grep -q HDF5 
24
	    then
25
		echo "All required modules load loaded"
26
	    else
27
		echo "You have to load the required modules"
28
		echo "See and/or source $DIR/cmake/machines/JURECA/intelsource.sh"
29 30
		exit
	    fi
31
	    cp $DIR/cmake/machines/JURECA/JURECA.cmake config.cmake
32 33 34
	elif module list 2>&1 |grep -q PGI
	then
	    echo "PGI toolchain used"
35 36 37 38 39 40
	    if module list 2>&1| grep -q MVAPICH2 &&
	       [ -n "${MAGMA_ROOT}" ] &&
	       [ -n "${XML2_ROOT}" ] 
            then
		echo "All required modules loaded, all variables set"
	    else
41
		echo "Not all modules are loaded"
42
		echo "See and/or source $DIR/cmake/machines/JURECA/pgisource.sh"
43 44 45
		echo "And set the variables XML2_ROOT and MAGMA_ROOT"
		exit
	    fi
46
	    cp $DIR/cmake/machines/JURECA/JURECAGPU.cmake config.cmake
47 48
	else
	    echo "You have to load the correct modules for compiling"
49
	    echo " Look for files to source in $DIR/cmake/machines/JURECA"
50 51 52 53 54 55
	    exit
	fi
    # JUQUEEN
    elif [ "$machine" = "JUQUEEN" ]
    then 
   	echo "JUQUEEN configuration used"
56 57 58 59 60 61
	if module list 2>&1| grep -q hdf5 &&
           module list 2>&1| grep -q scalapack
        then
           echo "All required modules load loaded"
	else
	   echo "You have to load the required modules"
Daniel  Wortmann's avatar
Daniel Wortmann committed
62
	   echo "'source $DIR/cmake/machines/JUQUEEN/xlfsource.sh' should help"
63 64
	   exit
	fi
65
        cp $DIR/cmake/machines/JUQUEEN/JUQUEEN.cmake config.cmake
66 67 68 69 70
	
    #IFF linux cluster
    elif [ "$machine" = "IFF" ]
    then
	echo "IFF cluster configuration used"
71
	cp $DIR/cmake/machines/IFF.cmake config.cmake
72

73 74 75 76 77 78 79 80 81
    #RWTH cluster
    elif [ "$machine" = "CLAIX" ]
    then
	echo "CLAIX@RWTH configuration used"
	if ! module list 2>&1| grep -q intelmpi
	then
	    echo "Please use intelmpi, e.g. do a module switch openmpi intelmpi"
	    exit
	fi
82
	cp $DIR/cmake/machines/CLAIX.cmake config.cmake
83
module load LIBRARIES
84 85 86 87 88 89 90
    elif [ "$machine" = "MARCONI" ]
    then
	if ! module list 2>&1| grep -q " intel\/" || ! module list 2>&1| grep -q " intelmpi" ||! module list 2>&1| grep -q cmake
	then
	    echo "Load the modules needed to compile: intel,intelmpi,cmake"
	    exit
	fi
91
	cp $DIR/cmake/machines/MARCONI.cmake config.cmake
92 93
    elif [ "$machine" = "AUTO" ] 
    then
94 95 96 97 98 99 100 101
        if [ -r ../config.cmake ] 
        then
           echo "Using AUTO-mode with user provided config.cmake"
           cp ../config.cmake .
        else
	   echo "No machine specific settings used"
	   echo "GOOD LUCK!"
        fi
102 103 104 105 106 107
    else
	echo "No valid machine configuration specified"
	exit
    fi
}