Skip to content

Commit f637f4e

Browse files
authored
fix #32, fix ex5 and ex12
1 parent fcba590 commit f637f4e

7 files changed

Lines changed: 9 additions & 40 deletions

File tree

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,7 @@ add_executable(ex11 ex11.c)
6464
set_target_properties(ex11 PROPERTIES ENABLE_EXPORTS TRUE)
6565
target_link_libraries(ex11 m MPI::MPI_C paraconf::paraconf PDI::pdi)
6666

67+
add_executable(ex12 ex12.c)
68+
target_link_libraries(ex12 m MPI::MPI_C paraconf::paraconf PDI::pdi)
69+
6770
add_subdirectory(ex_deisa/)

ex12.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void close_file(void)
7777
printf("Call close_file.\n");
7878

7979
if(pFile2 == NULL){
80-
fprintf(stderr,"\n error: The file should_output is not open. Call open_file before\n \n");
80+
fprintf(stderr,"\n error: The file should_output is not open. You must call open_file before.\n \n");
8181
exit(1);
8282
}
8383
fclose(pFile2);
@@ -226,7 +226,7 @@ int main( int argc, char* argv[] )
226226
double(*next)[dsize[1]] = malloc(sizeof(double)*dsize[1]*dsize[0]);
227227

228228
// initialize the value of switch for each iterations
229-
int switch_iter_values[10] = {20, 35, 50, 55, 60, 35, 25, 20, 15, 60 };
229+
int switch_iter_value[10] = {20, 35, 50, 55, 60, 35, 25, 20, 15, 60 };
230230

231231
// open the file should_output.dat
232232
open_file();

ex12.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,3 @@ pdi:
4646
memory_selection:
4747
size: [ '$dsize[0]-2', '$dsize[1]-2' ] # number of elements to transfer in each dimension
4848
start: [1, 1] # coordinate of the start point in memory relative to the shared data
49-
50-

ex5.h5dump

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
HDF5 "ex5-data0x0.h5" {
1+
HDF5 "ex5-data-0x0.h5" {
22
GROUP "/" {
33
GROUP "iter1" {
44
DATASET "ii" {

ex5.log

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -26,36 +26,6 @@
2626
[PDI][Trace-plugin] *** info: !!! named event: loop
2727
[PDI][Trace-plugin] *** info: <<= data stop being available in the store: main_field
2828
[PDI][Trace-plugin] *** info: <<= data stop being available in the store: ii
29-
[PDI][Trace-plugin] *** info: =>> data becoming available in the store: ii
30-
[PDI][Trace-plugin] *** info: =>> data becoming available in the store: main_field
31-
[PDI][Trace-plugin] *** info: !!! named event: loop
32-
[PDI][Trace-plugin] *** info: <<= data stop being available in the store: main_field
33-
[PDI][Trace-plugin] *** info: <<= data stop being available in the store: ii
34-
[PDI][Trace-plugin] *** info: =>> data becoming available in the store: ii
35-
[PDI][Trace-plugin] *** info: =>> data becoming available in the store: main_field
36-
[PDI][Trace-plugin] *** info: !!! named event: loop
37-
[PDI][Trace-plugin] *** info: <<= data stop being available in the store: main_field
38-
[PDI][Trace-plugin] *** info: <<= data stop being available in the store: ii
39-
[PDI][Trace-plugin] *** info: =>> data becoming available in the store: ii
40-
[PDI][Trace-plugin] *** info: =>> data becoming available in the store: main_field
41-
[PDI][Trace-plugin] *** info: !!! named event: loop
42-
[PDI][Trace-plugin] *** info: <<= data stop being available in the store: main_field
43-
[PDI][Trace-plugin] *** info: <<= data stop being available in the store: ii
44-
[PDI][Trace-plugin] *** info: =>> data becoming available in the store: ii
45-
[PDI][Trace-plugin] *** info: =>> data becoming available in the store: main_field
46-
[PDI][Trace-plugin] *** info: !!! named event: loop
47-
[PDI][Trace-plugin] *** info: <<= data stop being available in the store: main_field
48-
[PDI][Trace-plugin] *** info: <<= data stop being available in the store: ii
49-
[PDI][Trace-plugin] *** info: =>> data becoming available in the store: ii
50-
[PDI][Trace-plugin] *** info: =>> data becoming available in the store: main_field
51-
[PDI][Trace-plugin] *** info: !!! named event: loop
52-
[PDI][Trace-plugin] *** info: <<= data stop being available in the store: main_field
53-
[PDI][Trace-plugin] *** info: <<= data stop being available in the store: ii
54-
[PDI][Trace-plugin] *** info: =>> data becoming available in the store: ii
55-
[PDI][Trace-plugin] *** info: =>> data becoming available in the store: main_field
56-
[PDI][Trace-plugin] *** info: !!! named event: loop
57-
[PDI][Trace-plugin] *** info: <<= data stop being available in the store: main_field
58-
[PDI][Trace-plugin] *** info: <<= data stop being available in the store: ii
5929
[PDI][Trace-plugin] *** info: =>> data becoming available in the store: main_field
6030
[PDI][Trace-plugin] *** info: =>> data becoming available in the store: ii
6131
[PDI][Trace-plugin] *** info: <<= data stop being available in the store: ii

solutions/ex12.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pdi:
2727
#*** enable the writing of main_field when switch > 50, and disable the writing of main_field when switch < 25
2828
- set:
2929
- should_output: '$switch > 50 | $should_output=1'
30-
- set:
30+
- set:
3131
- should_output: '$should_output=1 & $switch>24'
3232
on_finalize:
3333
#*** release the variable should_output
@@ -50,5 +50,3 @@ pdi:
5050
memory_selection:
5151
size: [ '$dsize[0]-2', '$dsize[1]-2' ] # number of elements to transfer in each dimension
5252
start: [1, 1] # coordinate of the start point in memory relative to the shared data
53-
54-

solutions/ex5.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ pdi:
2323
#*** enable the output upon the event
2424
on_event: loop
2525
#*** enable the output when ii>0 and ii<3 (`&` is a logical `and` operation )
26-
when: '$ii>0 & $ii<3'
26+
when: '$ii>0 & $ii<3'
2727
write:
2828
ii: # name of the PDI data to write
2929
#*** give the dataset that you want to write into for ii
3030
# $-expressions can be used to define dataset name in file, , "/" separate groups in path
31-
dataset: 'iter${ii}/ii'
31+
dataset: 'iter${ii}/ii'
3232
main_field:
3333
#*** give the dataset that you want to write into for main_field
3434
# $-expressions can be used to define dataset name in file, , "/" separate groups in path

0 commit comments

Comments
 (0)