Changeset 1544
- Timestamp:
- 06/14/18 13:42:14 (6 years ago)
- Location:
- XIOS/dev/branch_openmp
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_openmp/bld.cfg
r1538 r1544 46 46 #bld::target test_unstruct_omp.exe 47 47 #bld::target test_netcdf_omp.exe 48 #bld::target test_client.exe48 bld::target test_client.exe 49 49 #bld::target test_complete.exe 50 50 #bld::target test_remap.exe -
XIOS/dev/branch_openmp/inputs/iodef.xml
r1468 r1544 8 8 <field_definition level="1" enabled=".FALSE."> 9 9 <field id="field_A" operation="average" freq_op="3600s" grid_ref="grid_A"/> 10 <field id="field_Axis" operation="average" freq_op="3600s" axis_ref="axis_A"/> 11 <field id="field_Domain" operation="average" freq_op="3600s" domain_ref="domain_A"/> 10 12 <field id="field_A_zoom" operation="average" freq_op="3600s" field_ref="field_A" grid_ref="grid_A_zoom"/> 13 <field id="field_Scalar" operation="average" freq_op="3600s" grid_ref="grid_Scalar"/> 11 14 </field_definition> 12 15 13 16 14 <file_definition type="one_file" par_access="collective" output_freq="6h" output_level="10" enabled=".TRUE."> 15 <file id="output" name="output"> 16 <field field_ref="field_A_zoom" name="field_A" /> 17 <file_definition type="one_file" par_access="collective" output_freq="1h" output_level="10" enabled=".TRUE."> 18 <file id="output" name="output" enabled=".TRUE."> 19 <field field_ref="field_A" name="field_A" /> 20 <field field_ref="field_A_zoom" name="field_B" /> 21 </file> 22 <file id="output1" name="output1" enabled=".TRUE."> 23 <field field_ref="field_A" name="field_A" /> 24 </file> 25 <file id="output2" name="output2" enabled=".TRUE."> 26 <field field_ref="field_Scalar" name="field_A" /> 17 27 </file> 18 28 </file_definition> … … 22 32 <axis id="axis_A"/> 23 33 <axis id="axis_A_zoom" axis_ref="axis_A"> 24 <zoom_axis begin="1" n="2" /> 34 <!--<zoom_axis begin="1" n="2" /> --> 35 <zoom_axis index="(0,1)[0 2]" /> 25 36 </axis> 26 37 </axis_definition> … … 39 50 <axis axis_ref="axis_A_zoom" /> 40 51 </grid> 52 <grid id="grid_Scalar"> 53 <scalar id="scalar_A" /> 54 </grid> 41 55 </grid_definition> 42 56 </context> 43 57 44 <context id="toto" >45 </context>46 47 <context id="titi">48 </context>49 50 <context id="tata">51 </context>52 58 53 59 <context id="xios"> 54 60 <variable_definition> 61 <variable_group id="server" > 62 <variable id="using_server2" type="bool">true</variable> 63 <variable id="ratio_server2" type="int">50</variable> 64 </variable_group> 65 55 66 <variable_group id="buffer"> 56 67 <variable id="optimal_buffer_size" type="string">performance</variable> 57 <variable id="buffer_size_factor" type="double">1 .0</variable>68 <variable id="buffer_size_factor" type="double">10.0</variable> 58 69 </variable_group> 59 70 60 71 <variable_group id="parameters" > 61 <variable id="using_server2" type="bool">true</variable> 62 <variable id="ratio_server2" type="int">50</variable> 72 <variable id="using_server" type="bool">false</variable> 63 73 <variable id="info_level" type="int">50</variable> 64 74 <variable id="print_file" type="bool">true</variable> -
XIOS/dev/branch_openmp/src/io/nc4_data_input.cpp
r1491 r1544 193 193 */ 194 194 195 //if (!SuperClassWriter::isRectilinear(fieldId)) 196 if (true) 197 { 198 for (std::list<StdString>::const_iterator it = dimList.begin(); it != dimList.end(); ++it) 195 for (std::list<StdString>::const_iterator it = dimList.begin(); it != dimList.end(); ++it) 199 196 listDimSize.push_front(*dimSizeMap.find(*it)); 200 }201 else202 {203 std::list<StdString> coords = SuperClassWriter::getCoordinatesIdList(fieldId);204 std::list<StdString>::const_iterator itCoord = coords.begin();205 for (; itCoord != coords.end(); itCoord++)206 {207 const StdString& coord = *itCoord;208 if (SuperClassWriter::hasVariable(coord) && !SuperClassWriter::isTemporal(coord))209 {210 std::map<StdString, StdSize> dimsTmp = SuperClassWriter::getDimensions(&coord);211 StdString dimNameTmp = dimsTmp.begin()->first;212 StdSize dimSizeTmp = dimsTmp.begin()->second;213 listDimSize.push_front(make_pair(coord, dimSizeTmp));214 dimSizeMap.erase(dimNameTmp);215 dimList.remove(dimNameTmp);216 }217 }218 for (std::list<StdString>::const_iterator it = dimList.begin(); it != dimList.end(); ++it)219 listDimSize.push_front(*dimSizeMap.find(*it));220 }221 197 222 198 // Now process domain and axis -
XIOS/dev/branch_openmp/src/io/netCdfInterface_impl.hpp
r1334 r1544 86 86 { 87 87 int status; 88 #pragma omp critical (_netcdf)89 88 status = ncGetVaraType(ncid, varId, start, count, data); 90 89 if (NC_NOERR != status) -
XIOS/dev/branch_openmp/src/object_factory.hpp
r1460 r1544 39 39 template <typename U> 40 40 static const std::vector<boost::shared_ptr<U> > & 41 GetObjectVector(const StdString & context = CObjectFactory::GetCurrentContextId()); 41 GetObjectVector(const StdString & context); 42 //GetObjectVector(const StdString & context = CObjectFactory::GetCurrentContextId()); 42 43 43 44 /// Tests /// -
XIOS/dev/branch_openmp/src/object_template_impl.hpp
r1460 r1544 430 430 const vector<T*> CObjectTemplate<T>::getAll() 431 431 { 432 const vector< boost::shared_ptr<T> >& shared_vect= CObjectFactory::GetObjectVector<T>(); 432 int tmp_rank; 433 MPI_Comm_rank(MPI_COMM_WORLD, &tmp_rank); 434 if(tmp_rank==7) printf("getCurrentContextid() = %s\n", CObjectFactory::GetCurrentContextId()); 435 const vector< boost::shared_ptr<T> >& shared_vect= CObjectFactory::GetObjectVector<T>(CObjectFactory::GetCurrentContextId()); 433 436 vector<T*> vect; 434 437 -
XIOS/dev/branch_openmp/src/test/test_client.f90
r1460 r1544 37 37 38 38 CALL init_wait 39 40 CALL MPI_COMM_RANK(MPI_COMM_WORLD,rank,ierr) 41 CALL MPI_COMM_SIZE(MPI_COMM_WORLD,size,ierr) 42 if(rank < size-2) then 39 43 40 44 !!! XIOS Initialization (get the local communicator) … … 139 143 CALL xios_send_field("field_Domain",field_domain) 140 144 CALL xios_send_field("field_Scalar",scalar) 141 CALL wait_us(5000) ;145 CALL wait_us(5000) 142 146 ENDDO 143 147 144 148 CALL xios_context_finalize() 149 CALL xios_finalize() 145 150 146 DEALLOCATE(lon, lat, field_A, lonvalue )151 DEALLOCATE(lon, lat, field_A, lonvalue, axisValue, field_domain) 147 152 148 153 CALL MPI_COMM_FREE(comm, ierr) 149 154 150 CALL xios_finalize() 155 else !!server 156 157 CALL xios_init_server 158 print *, "Server : xios_finalize " 159 160 endif 161 151 162 152 163 CALL MPI_FINALIZE(ierr) -
XIOS/dev/branch_openmp/src/test/test_complete_omp.f90
r1520 r1544 47 47 if(rank < size-2) then 48 48 49 !$omp parallel default(private) 49 !$omp parallel default(firstprivate) 50 !!firstprivate(dtime) 50 51 51 52 !!! XIOS Initialization (get the local communicator) … … 248 249 !#################################################################################### 249 250 250 !DO ts=1,24*2251 DO ts=1,24251 DO ts=1,24*10 252 !DO ts=1,24 252 253 253 254 CALL xios_get_handle("atmosphere",ctx_hdl) -
XIOS/dev/branch_openmp/src/test/test_omp.f90
r1196 r1544 21 21 INTEGER,PARAMETER :: nj_glo=100 22 22 INTEGER,PARAMETER :: llm=5 23 DOUBLE PRECISION :: lval(llm)=1 23 DOUBLE PRECISION :: lval(llm)=1, scalar = 5 24 24 TYPE(xios_field) :: field_hdl 25 25 TYPE(xios_fieldgroup) :: fieldgroup_hdl … … 29 29 DOUBLE PRECISION,DIMENSION(ni_glo,nj_glo) :: lon_glo,lat_glo 30 30 DOUBLE PRECISION :: field_A_glo(ni_glo,nj_glo,llm) 31 DOUBLE PRECISION,ALLOCATABLE :: lon(:,:),lat(:,:),field_A(:,:,:), lonvalue(:,:) ;31 DOUBLE PRECISION,ALLOCATABLE :: lon(:,:),lat(:,:),field_A(:,:,:), lonvalue(:,:), axisValue(:), field_domain(:,:) 32 32 INTEGER :: ni,ibegin,iend,nj,jbegin,jend 33 33 INTEGER :: i,j,l,ts,n, provided … … 62 62 lat_glo(i,j)=1000+(i-1)+(j-1)*ni_glo 63 63 DO l=1,llm 64 field_A_glo(i,j,l)=(i-1)+(j-1)*ni_glo +10000*l64 field_A_glo(i,j,l)=(i-1)+(j-1)*ni_glo*100+10000*l 65 65 ENDDO 66 66 ENDDO … … 78 78 iend=ibegin+ni-1 ; jend=jbegin+nj-1 79 79 80 ALLOCATE(lon(ni,nj),lat(ni,nj),field_A(0:ni+1,-1:nj+2,llm),lonvalue(ni,nj)) 80 !ALLOCATE(lon(ni,nj),lat(ni,nj),field_A(0:ni+1,-1:nj+2,llm),lonvalue(ni,nj)) 81 !lon(:,:)=lon_glo(ibegin+1:iend+1,jbegin+1:jend+1) 82 !lat(:,:)=lat_glo(ibegin+1:iend+1,jbegin+1:jend+1) 83 !field_A(1:ni,1:nj,:)=field_A_glo(ibegin+1:iend+1,jbegin+1:jend+1,:) 84 85 ALLOCATE(lon(ni,nj),lat(ni,nj),field_A(0:ni+1,-1:nj+2,llm),lonvalue(ni,nj), axisValue(nj_glo), field_domain(0:ni+1,-1:nj+2)) 81 86 lon(:,:)=lon_glo(ibegin+1:iend+1,jbegin+1:jend+1) 82 87 lat(:,:)=lat_glo(ibegin+1:iend+1,jbegin+1:jend+1) 83 88 field_A(1:ni,1:nj,:)=field_A_glo(ibegin+1:iend+1,jbegin+1:jend+1,:) 89 field_domain(1:ni,1:nj) = field_A_glo(ibegin+1:iend+1,jbegin+1:jend+1,1) 90 axisValue(1:nj_glo)=field_A_glo(1,1:nj_glo,1); 91 84 92 85 !print*, "xios init OK", rank, size86 93 87 94 CALL xios_context_initialize("test",comm) 88 89 !print*, "xios_context_initialize OK", rank, size90 91 95 CALL xios_get_handle("test",ctx_hdl) 92 96 CALL xios_set_current_context(ctx_hdl) 93 97 94 95 98 CALL xios_get_calendar_type(calendar_type) 96 !print*, "xios_get_calendar_type OK", rank, size99 PRINT *, "calendar_type = ", calendar_type 97 100 98 101 CALL xios_set_axis_attr("axis_A",n_glo=llm ,value=lval) ; … … 103 106 !print*, "test block OK", rank, size 104 107 105 CALL xios_get_handle("field_definition",fieldgroup_hdl)106 CALL xios_add_child(fieldgroup_hdl,field_hdl,"field_B")107 CALL xios_set_attr(field_hdl,field_ref="field_A",name="field_B")108 !CALL xios_get_handle("field_definition",fieldgroup_hdl) 109 !CALL xios_add_child(fieldgroup_hdl,field_hdl,"field_B") 110 !CALL xios_set_attr(field_hdl,field_ref="field_A",name="field_B") 108 111 109 CALL xios_get_handle("output",file_hdl)110 CALL xios_add_child(file_hdl,field_hdl)111 CALL xios_set_attr(field_hdl,field_ref="field_A_zoom",name="field_C")112 !CALL xios_get_handle("output",file_hdl) 113 !CALL xios_add_child(file_hdl,field_hdl) 114 !CALL xios_set_attr(field_hdl,field_ref="field_A_zoom",name="field_C") 112 115 113 116 dtime%second = 3600 … … 118 121 ! calendar operations can be used before the context definition is closed 119 122 CALL xios_get_time_origin(date) 120 !PRINT *, "--> year length = ", xios_get_year_length_in_seconds(date%year)121 !PRINT *, "--> day length = ", xios_get_day_length_in_seconds()123 PRINT *, "--> year length = ", xios_get_year_length_in_seconds(date%year) 124 PRINT *, "--> day length = ", xios_get_day_length_in_seconds() 122 125 CALL xios_date_convert_to_string(date, date_str) 123 !PRINT *, "time_origin = ", date_str124 !PRINT *, "xios_date_get_second_of_year(time_origin) = ", xios_date_get_second_of_year(date)125 !PRINT *, "xios_date_get_day_of_year(time_origin) = ", xios_date_get_day_of_year(date)126 !PRINT *, "xios_date_get_fraction_of_year(time_origin) = ", xios_date_get_fraction_of_year(date)127 !PRINT *, "xios_date_get_second_of_day(time_origin) = ", xios_date_get_second_of_day(date)128 !PRINT *, "xios_date_get_fraction_of_day(time_origin) = ", xios_date_get_fraction_of_day(date)126 PRINT *, "time_origin = ", date_str 127 PRINT *, "xios_date_get_second_of_year(time_origin) = ", xios_date_get_second_of_year(date) 128 PRINT *, "xios_date_get_day_of_year(time_origin) = ", xios_date_get_day_of_year(date) 129 PRINT *, "xios_date_get_fraction_of_year(time_origin) = ", xios_date_get_fraction_of_year(date) 130 PRINT *, "xios_date_get_second_of_day(time_origin) = ", xios_date_get_second_of_day(date) 131 PRINT *, "xios_date_get_fraction_of_day(time_origin) = ", xios_date_get_fraction_of_day(date) 129 132 dtime%timestep = 1 130 133 dtime = 0.5 * dtime 131 134 CALL xios_duration_convert_to_string(dtime, dtime_str) 132 !PRINT *, "duration = ", dtime_str135 PRINT *, "duration = ", dtime_str 133 136 date = date + 3 * (dtime + dtime) 134 137 CALL xios_date_convert_to_string(date, date_str) 135 !PRINT *, "date = time_origin + 3 * (duration + duration) = ", date_str136 !PRINT *, "xios_date_convert_to_seconds(date) = ", xios_date_convert_to_seconds(date)137 !PRINT *, "xios_date_convert_to_seconds(date - 2.5h) = ", xios_date_convert_to_seconds(date - 2.5 * xios_hour)138 PRINT *, "date = time_origin + 3 * (duration + duration) = ", date_str 139 PRINT *, "xios_date_convert_to_seconds(date) = ", xios_date_convert_to_seconds(date) 140 PRINT *, "xios_date_convert_to_seconds(date - 2.5h) = ", xios_date_convert_to_seconds(date - 2.5 * xios_hour) 138 141 139 142 ni=0 ; lonvalue(:,:)=0; 140 143 CALL xios_get_domain_attr("domain_A",ni=ni,lonvalue_2D=lonvalue) 141 !print *,"ni",ni142 !print *,"lonvalue",lonvalue;144 print *,"ni",ni 145 print *,"lonvalue",lonvalue; 143 146 144 147 CALL xios_is_defined_field_attr("field_A",enabled=ok) 145 !PRINT *,"field_A : attribute enabled is defined ? ",ok 146 148 PRINT *,"field_A : attribute enabled is defined ? ",ok 147 149 CALL xios_close_context_definition() 148 !print*, "xios_close_context_definition OK"149 150 150 151 PRINT*,"field field_A is active ? ",xios_field_is_active("field_A") 151 152 152 DO ts=1, 6153 DO ts=1,4 153 154 CALL xios_update_calendar(ts) 154 155 CALL xios_send_field("field_A",field_A) 156 CALL xios_send_field("field_Axis",axisValue) 157 ! CALL xios_send_field("field_Axis",lval) 158 CALL xios_send_field("field_Domain",field_domain) 159 CALL xios_send_field("field_Scalar",scalar) 155 160 CALL wait_us(5000) 156 161 ENDDO … … 162 167 print*, "xios finalize OK", rank, size 163 168 164 DEALLOCATE(lon, lat, field_A, lonvalue )169 DEALLOCATE(lon, lat, field_A, lonvalue, axisValue, field_domain) 165 170 !$omp master 166 171 !call MPI_Barrier(comm) … … 168 173 !$omp end master 169 174 170 !$omp barrier 171 172 !print*, "MPI_COMM_FREE OK", rank, size 175 !$omp barrier 173 176 174 177 -
XIOS/dev/branch_openmp/src/test/test_remap_omp.f90
r1491 r1544 272 272 273 273 !$omp end parallel 274 274 275 else 275 276
Note: See TracChangeset
for help on using the changeset viewer.