- Timestamp:
- 05/20/19 13:14:51 (5 years ago)
- Location:
- XIOS/dev/dev_trunk_omp
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_trunk_omp/arch/arch-X64_ADA_ep.fcm
r1646 r1665 2 2 ################### Projet XIOS ################### 3 3 ################################################################################ 4 5 %CCOMPILER mpiicc -std=c++11 -D_usingEP -qopenmp -D_intelmpi4 5 %CCOMPILER mpiicc -std=c++11 -qopenmp 6 6 %FCOMPILER mpiifort -qopenmp 7 7 %LINKER mpiifort -nofor-main -qopenmp -
XIOS/dev/dev_trunk_omp/arch/arch-X64_ADA_mpi.fcm
r1646 r1665 3 3 ################################################################################ 4 4 5 %CCOMPILER mpiicc -std=c++11 - D_usingMPI -qopenmp -D_intelmpi5 %CCOMPILER mpiicc -std=c++11 -qopenmp 6 6 %FCOMPILER mpiifort -qopenmp 7 7 %LINKER mpiifort -nofor-main -qopenmp -
XIOS/dev/dev_trunk_omp/bld.cfg
r1661 r1665 54 54 bld::target test_complete.exe 55 55 bld::target test_complete_omp.exe 56 #bld::target test_client.exe56 bld::target test_client.exe 57 57 bld::target test_omp.exe 58 58 #bld::target test_omp2.exe -
XIOS/dev/dev_trunk_omp/extern/remap/src/mpi_routing.cpp
r1661 r1665 155 155 #ifdef _usingEP 156 156 MPI_Irecv(&sourceRank[i], 1, MPI_INT, -2, 0, communicator, &request[indexRequest++]); 157 #endif 158 159 #ifdef _usingMPI 157 #else 160 158 MPI_Irecv(&sourceRank[i], 1, MPI_INT, MPI_ANY_SOURCE, 0, communicator, &request[indexRequest++]); 161 159 #endif … … 179 177 #ifdef _usingEP 180 178 MPI_Irecv(&sourceRank[i], 1, MPI_INT, -2, 0, communicator, &request[indexRequest]); 181 #endif 182 #ifdef _usingMPI 183 MPI_Irecv(&sourceRank[i], 1, MPI_INT, MPI_ANY_SOURCE, 0, communicator, &request[indexRequest]); 179 #else 180 MPI_Irecv(&sourceRank[i], 1, MPI_INT, MPI_ANY_SOURCE, 0, communicator, &request[indexRequest]); 184 181 #endif 185 182 indexRequest++; -
XIOS/dev/dev_trunk_omp/make_xios
r1510 r1665 18 18 arch_defined="FALSE" 19 19 arch_path_defined="FALSE" 20 20 use_ep="FALSE" 21 21 # Traitement de la ligne de commande 22 22 while (($# > 0)) … … 34 34 echo " [--full] : to generate dependencies and recompile from scratch" 35 35 echo " [--use_oasis 'oasis3' 'oasis3_mct' : default oasis3_mct] : to use Oasis coupler" 36 echo " [--build_path : absolute path to the build directory"37 echo " [--build_dir : name of the build directory"38 echo " [--build_suffixed : generate automatically suffixed name of the build directory (e.g. config_X64_CURIE_prod)"39 echo " [--use_extern_boost : to use external boost library"40 echo " [--use_extern_blitz : to use external blitz library"36 echo " [--build_path : absolute path to the build directory" 37 echo " [--build_dir : name of the build directory" 38 echo " [--build_suffixed : generate automatically suffixed name of the build directory (e.g. config_X64_CURIE_prod)" 39 echo " [--use_extern_boost : to use external boost library" 40 echo " [--use_extern_blitz : to use external blitz library" 41 41 echo " [--doc] : to generate Doxygen documentation (not available yet)" 42 42 echo " [--job ntasks] : to use parallel compilation with ntasks" 43 43 echo " [--netcdf_lib 'netcdf4_par'/'netcdf4_seq'/'netcdf4_internal' : default netcdf4_par] : choice of netcdf library" 44 44 echo " [--memtrack] : tracking memory leak - developper only" 45 echo " [--omp] : enable multithread XIOS using mpi_endpoint (EP) : default no EP" 45 46 echo "Example : ./make_xios --prod --arch PW6_VARGAS" 46 47 echo "Example : ./make_xios --avail" … … 63 64 "--netcdf_lib") netcdf_lib=$2 ; shift ; shift ;; 64 65 "--memtrack") use_memtrack="true" memtrack=$2 ; shift ; shift ;; 66 "--omp") use_ep="true" ; shift ;; 65 67 *) code="$1" ; shift ;; 66 68 esac … … 153 155 fi 154 156 157 158 159 155 160 # Vérification de la présence d'un mode de compilation. 161 162 if [[ "$use_ep" == "true" ]]; then 163 164 if [[ "$compil_mode" == "prod" ]] 165 then 166 COMPIL_CFLAGS="%PROD_CFLAGS -D_usingEP -D_intelmpi" 167 COMPIL_FFLAGS="%PROD_FFLAGS -D_usingEP -D_intelmpi" 168 elif [[ "$compil_mode" == "dev" ]] 169 then 170 COMPIL_CFLAGS="%DEV_CFLAGS -D_usingEP -D_intelmpi" 171 COMPIL_FFLAGS="%DEV_FFLAGS -D_usingEP -D_intelmpi" 172 elif [[ "$compil_mode" == "debug" ]] 173 then 174 COMPIL_CFLAGS="%DEBUG_CFLAGS -D_usingEP -D_intelmpi" 175 COMPIL_FFLAGS="%DEBUG_FFLAGS -D_usingEP -D_intelmpi" 176 fi 177 178 else 156 179 157 180 if [[ "$compil_mode" == "prod" ]] … … 169 192 fi 170 193 194 fi 171 195 rm -r $PWD/extern/netcdf4 172 196 -
XIOS/dev/dev_trunk_omp/src/context_client.cpp
r1646 r1665 363 363 #ifdef _usingEP 364 364 MPI_Allreduce(&minBufferSizeEventSizeRatio, &minBufferSizeEventSizeRatio, 1, MPI_DOUBLE, MPI_MIN, intraComm); 365 #el if _usingMPI365 #else 366 366 MPI_Allreduce(MPI_IN_PLACE, &minBufferSizeEventSizeRatio, 1, MPI_DOUBLE, MPI_MIN, intraComm); 367 367 #endif -
XIOS/dev/dev_trunk_omp/src/context_server.cpp
r1646 r1665 88 88 if (flag==true) 89 89 { 90 #ifdef _usingMPI 90 91 #ifdef _usingEP 92 rank=status.ep_src ; 93 #else 91 94 rank=status.MPI_SOURCE ; 92 #elif _usingEP93 rank=status.ep_src ;94 95 #endif 95 96 okLoop = true; … … 118 119 char * addr; 119 120 map<int,CServerBuffer*>::iterator it; 120 #ifdef _usingMPI 121 122 #ifdef _usingEP 123 int rank=status.ep_src; 124 #else 121 125 int rank=status.MPI_SOURCE ; 122 #elif _usingEP123 int rank=status.ep_src;124 126 #endif 125 127 -
XIOS/dev/dev_trunk_omp/src/cxios.cpp
r1661 r1665 102 102 checkEventSync = getin<bool>("check_event_sync", checkEventSync); 103 103 104 #ifdef _usingMPI 105 globalComm=MPI_COMM_WORLD ; 106 #elif _usingEP 104 105 #ifdef _usingEP 107 106 int num_ep; 108 107 … … 120 119 #pragma omp barrier 121 120 CXios::globalComm = passage[omp_get_thread_num()]; 121 122 #else 123 globalComm=MPI_COMM_WORLD ; 124 122 125 #endif 123 126 } -
XIOS/dev/dev_trunk_omp/src/interface/c/icdata.cpp
r1646 r1665 67 67 int initialized; 68 68 MPI_Initialized(&initialized); 69 #ifdef _usingMPI 70 if (initialized) local_comm=MPI_Comm_f2c(*f_local_comm); 71 else local_comm=MPI_COMM_NULL; 72 #elif _usingEP 69 70 #ifdef _usingEP 73 71 ep_lib::fc_comm_map.clear(); 74 72 if (initialized) local_comm=EP_Comm_f2c((f_local_comm)); 75 73 else local_comm=MPI_COMM_NULL; 74 #else 75 if (initialized) local_comm=MPI_Comm_f2c(*f_local_comm); 76 else local_comm=MPI_COMM_NULL; 76 77 #endif 77 78 … … 79 80 80 81 CXios::initClientSide(str, local_comm, return_comm); 81 #ifdef _usingMPI 82 83 #ifdef _usingEP 84 *f_return_comm=*static_cast<MPI_Fint*>(EP_Comm_c2f(return_comm)); 85 #else 82 86 *f_return_comm=MPI_Comm_c2f(return_comm); 83 #elif _usingEP84 *f_return_comm=*static_cast<MPI_Fint*>(EP_Comm_c2f(return_comm));85 87 #endif 86 88 CTimer::get("XIOS init").suspend(); … … 98 100 CTimer::get("XIOS").resume(); 99 101 CTimer::get("XIOS init context").resume(); 100 #ifdef _usingMPI 102 103 #ifdef _usingEP 104 comm = EP_Comm_f2c(f_comm); 105 #else 101 106 comm=MPI_Comm_f2c(*f_comm); 102 #elif _usingEP103 comm = EP_Comm_f2c(f_comm);104 107 #endif 105 108 CClient::registerContext(str, comm); -
XIOS/dev/dev_trunk_omp/src/io/inetcdf4.cpp
r1646 r1665 25 25 #ifdef _usingEP 26 26 CNetCdfInterface::openPar(filename, NC_NOWRITE | NC_MPIIO, to_mpi_comm((*comm)->mpi_comm), to_mpi_info(MPI_INFO_NULL), this->ncidp); 27 #el if _usingMPI27 #else 28 28 CNetCdfInterface::openPar(filename, NC_NOWRITE | NC_MPIIO, *comm, MPI_INFO_NULL, this->ncidp); 29 29 #endif -
XIOS/dev/dev_trunk_omp/src/io/netCdfInterface.cpp
r1661 r1665 58 58 #ifdef _usingEP 59 59 int status = xios::nc_create_par(fileName.c_str(), cMode, comm, to_mpi_info(MPI_INFO_NULL), &ncId); 60 #el if _usingMPI60 #else 61 61 int status = xios::nc_create_par(fileName.c_str(), cMode, comm, MPI_INFO_NULL, &ncId); 62 62 #endif … … 122 122 #ifdef _usingEP 123 123 int status = xios::nc_open_par(fileName.c_str(), oMode, comm, to_mpi_info(MPI_INFO_NULL), &ncId); 124 #el if _usingMPI124 #else 125 125 int status = xios::nc_open_par(fileName.c_str(), oMode, comm, MPI_INFO_NULL, &ncId); 126 126 #endif -
XIOS/dev/dev_trunk_omp/src/io/onetcdf4.cpp
r1646 r1665 60 60 #ifdef _usingEP 61 61 CNetCdfInterface::createPar(filename, mode, to_mpi_comm((*comm)->mpi_comm), to_mpi_info(MPI_INFO_NULL), this->ncidp); 62 #el if _usingMPI62 #else 63 63 CNetCdfInterface::createPar(filename, mode, *comm, MPI_INFO_NULL, this->ncidp); 64 64 #endif … … 76 76 #ifdef _usingEP 77 77 CNetCdfInterface::openPar(filename, mode, to_mpi_comm((*comm)->mpi_comm), to_mpi_info(MPI_INFO_NULL), this->ncidp); 78 #el if _usingMPI78 #else 79 79 CNetCdfInterface::openPar(filename, mode, *comm, MPI_INFO_NULL, this->ncidp); 80 80 #endif -
XIOS/dev/dev_trunk_omp/src/mpi.hpp
r1661 r1665 14 14 #include "ep_lib.hpp" 15 15 #include "ep_declaration.hpp" 16 #el if _usingMPI16 #else 17 17 #include <mpi.h> 18 18 #define ep_lib -
XIOS/dev/dev_trunk_omp/src/mpi_std.hpp
r1650 r1665 17 17 #include "ep_lib.hpp" 18 18 #include "ep_declaration.hpp" 19 #el if _usingMPI19 #else 20 20 #include <mpi.h> 21 21 #define ep_lib -
XIOS/dev/dev_trunk_omp/src/node/field.cpp
r1646 r1665 536 536 #ifdef _usingEP 537 537 MPI_Allreduce(&nstepMax, &nstepMax, 1, MPI_INT, MPI_MAX, context->server->intraComm); 538 #el if _usingMPI538 #else 539 539 MPI_Allreduce(MPI_IN_PLACE, &nstepMax, 1, MPI_INT, MPI_MAX, context->server->intraComm); 540 540 #endif -
XIOS/dev/dev_trunk_omp/src/node/file.cpp
r1661 r1665 728 728 isOpen = false; 729 729 } 730 #ifdef _usingMPI 730 #ifdef _usingEP 731 //if (fileComm != MPI_COMM_NULL) MPI_Comm_free(&fileComm); 732 #else 731 733 if (fileComm != MPI_COMM_NULL) MPI_Comm_free(&fileComm); 732 734 #endif -
XIOS/dev/dev_trunk_omp/src/server.cpp
r1661 r1665 666 666 if (flag==true) 667 667 { 668 #ifdef _usingMPI 668 669 #ifdef _usingEP 670 rank=status.ep_src; 671 #else 669 672 rank=status.MPI_SOURCE ; 670 #elif _usingEP671 rank=status.ep_src;672 673 #endif 673 674 MPI_Get_count(&status,MPI_CHAR,&count) ; … … 684 685 if (flag==true) 685 686 { 686 #ifdef _usingMPI 687 688 #ifdef _usingEP 689 rank=status.ep_src; 690 #else 687 691 rank=status.MPI_SOURCE ; 688 #elif _usingEP689 rank=status.ep_src;690 692 #endif 691 693 MPI_Get_count(&status,MPI_CHAR,&count) ; -
XIOS/dev/dev_trunk_omp/src/test/test_complete_omp.f90
r1661 r1665 31 31 INTEGER :: i,j,l,ts,n, nb_pt, provided 32 32 33 integer :: num_args, ix, nb_servers 34 character(len=12), dimension(:), allocatable :: args 35 36 num_args = command_argument_count() 37 if(num_args<1) then 38 print*, "please give the number of servers as argument." 39 call abort 40 endif 41 42 allocate(args(num_args)) ! I've omitted checking the return status of the allocation 43 44 do ix = 1, num_args 45 call get_command_argument(ix,args(ix)) 46 ! now parse the argument as you wish 47 end do 48 49 READ(args(1),*) nb_servers 50 33 51 !!! MPI Initialization 34 52 … … 45 63 CALL MPI_COMM_RANK(MPI_COMM_WORLD,rank,ierr) 46 64 CALL MPI_COMM_SIZE(MPI_COMM_WORLD,size,ierr) 47 if(rank < size- 4) then65 if(rank < size-nb_servers) then 48 66 49 67 !$omp parallel default(firstprivate) -
XIOS/dev/dev_trunk_omp/src/test/test_omp.f90
r1646 r1665 33 33 INTEGER :: i,j,l,ts,n, provided 34 34 35 integer :: num_args, ix, nb_servers 36 character(len=12), dimension(:), allocatable :: args 37 38 num_args = command_argument_count() 39 if(num_args<1) then 40 print*, "please give the number of servers as input argument." 41 call abort 42 endif 43 44 allocate(args(num_args)) ! I've omitted checking the return status of the allocation 45 46 do ix = 1, num_args 47 call get_command_argument(ix,args(ix)) 48 ! now parse the argument as you wish 49 end do 50 51 READ(args(1),*) nb_servers 52 35 53 !!! MPI Initialization 36 54 … … 45 63 CALL MPI_COMM_RANK(MPI_COMM_WORLD,rank,ierr) 46 64 CALL MPI_COMM_SIZE(MPI_COMM_WORLD,size,ierr) 47 if(rank < size- 4) then65 if(rank < size-nb_servers) then 48 66 49 67 !$omp parallel default(firstprivate) -
XIOS/dev/dev_trunk_omp/src/test/test_remap_omp.f90
r1608 r1665 41 41 DOUBLE PRECISION, PARAMETER :: missing_value = 100000 42 42 INTEGER :: provided 43 44 integer :: num_args, ix, nb_servers 45 character(len=12), dimension(:), allocatable :: args 46 47 num_args = command_argument_count() 48 if(num_args<1) then 49 print*, "please give the number of servers as argument." 50 call abort 51 endif 52 53 allocate(args(num_args)) ! I've omitted checking the return status of the allocation 54 55 do ix = 1, num_args 56 call get_command_argument(ix,args(ix)) 57 ! now parse the argument as you wish 58 end do 59 60 READ(args(1),*) nb_servers 43 61 44 62 CALL MPI_INIT_THREAD(3, provided, ierr) … … 51 69 CALL MPI_COMM_RANK(MPI_COMM_WORLD,rank,ierr) 52 70 CALL MPI_COMM_SIZE(MPI_COMM_WORLD,size,ierr) 53 if(rank < size- 2) then71 if(rank < size-nb_servers) then 54 72 55 73 !$omp parallel default(firstprivate) -
XIOS/dev/dev_trunk_omp/src/transformation/domain_algorithm_interpolate.cpp
r1661 r1665 705 705 int countBuff = 0; 706 706 ep_lib::MPI_Get_count(&recvStatus, MPI_INT, &countBuff); 707 #ifdef _usingMPI 707 708 #ifdef _usingEP 709 clientSrcRank = recvStatus.ep_src; 710 #else 708 711 clientSrcRank = recvStatus.MPI_SOURCE; 709 #elif _usingEP710 clientSrcRank = recvStatus.ep_src;711 712 #endif 712 713 … … 864 865 #ifdef _usingEP 865 866 int my_rank_loc = client->intraComm->ep_comm_ptr->size_rank_info[1].first; 866 #el if _usingMPI867 #else 867 868 int my_rank_loc = 0; 868 869 #endif
Note: See TracChangeset
for help on using the changeset viewer.