Skip to content

Commit 69cd317

Browse files
committed
Clean up Fortran bindings and remove unnecessary flags
Remove Clear storage Fix unlock status race condition Wait for disconnection when server is shut down Remove GetInteractionsGroupPresent Fix wait/resume command Add H5FD_DSM_NOTIFY_CONNECTED/H5FD_DSM_NOTIFY_DISCONNECTED internal notifications Clean up Fix test error detection
1 parent f50fd68 commit 69cd317

17 files changed

+159
-216
lines changed

Testing/H5FDdsmReceiver_cwrite_swrite_cread.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ int main(int argc, char *argv[])
1212
MPI_Comm comm = MPI_COMM_WORLD;
1313
receiverInit(argc, argv, dsmManager, &comm);
1414

15-
while (dsmManager->WaitForUnlock() != H5FD_DSM_FAIL) {
15+
if (dsmManager->WaitForUnlock() != H5FD_DSM_FAIL) {
1616
int array[3] = { 1, 2, 3 };
1717
hsize_t arraySize = 3;
1818

Testing/H5FDdsmTestDriver.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ int H5FDdsmTestDriver::OutputStringHasError(const char* pname, string& output)
288288
"mpirun can *only* be used with MPI programs",
289289
"due to signal",
290290
"failure",
291-
"bnormal termination",
291+
"abnormal termination",
292292
"failed",
293293
"FAILED",
294294
"Failed",

fortran/H5FDdsmSteeringff.f90

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ MODULE H5FDDSM_STEERING
6262
! Purpose: Initialize the steering interface
6363
!
6464
! Inputs:
65-
! comm - Communicator used by the IO nodes
65+
! comm - Communicator used by the IO nodes
6666
! Outputs:
67-
! hdferr: - error code
68-
! Success: 0
69-
! Failure: -1
67+
! hdferr: - error code
68+
! Success: 0
69+
! Failure: -1
7070
! Optional parameters:
7171
! NONE
7272
!

fortran/H5FDdsmf.c

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,14 @@ int_f nh5fd_dsm_init_flags_c(int_f* h5fd_dsm_flags)
3737
{
3838
int ret_value = -1;
3939

40-
h5fd_dsm_flags[0] = (int_f)H5FD_DSM_UNLOCK_ON_CLOSE;
41-
h5fd_dsm_flags[1] = (int_f)H5FD_DSM_UNLOCK_MANUAL;
42-
h5fd_dsm_flags[2] = (int_f)H5FD_DSM_LOCK_SYNCHRONOUS;
43-
h5fd_dsm_flags[3] = (int_f)H5FD_DSM_LOCK_ASYNCHRONOUS;
44-
h5fd_dsm_flags[4] = (int_f)H5FD_DSM_MODE_SERIAL;
45-
h5fd_dsm_flags[5] = (int_f)H5FD_DSM_MODE_PARALLEL;
46-
h5fd_dsm_flags[6] = (int_f)H5FD_DSM_NOTIFY_NONE;
47-
h5fd_dsm_flags[7] = (int_f)H5FD_DSM_NOTIFY_WAIT;
48-
h5fd_dsm_flags[8] = (int_f)H5FD_DSM_NOTIFY_DATA;
49-
h5fd_dsm_flags[9] = (int_f)H5FD_DSM_NOTIFY_INFORMATION;
50-
h5fd_dsm_flags[10] = (int_f)H5FD_DSM_NOTIFY_USER;
40+
h5fd_dsm_flags[0] = (int_f)H5FD_DSM_LOCK_SYNCHRONOUS;
41+
h5fd_dsm_flags[1] = (int_f)H5FD_DSM_LOCK_ASYNCHRONOUS;
42+
h5fd_dsm_flags[2] = (int_f)H5FD_DSM_MODE_SERIAL;
43+
h5fd_dsm_flags[3] = (int_f)H5FD_DSM_MODE_PARALLEL;
44+
h5fd_dsm_flags[4] = (int_f)H5FD_DSM_NOTIFY_NONE;
45+
h5fd_dsm_flags[5] = (int_f)H5FD_DSM_NOTIFY_DATA;
46+
h5fd_dsm_flags[6] = (int_f)H5FD_DSM_NOTIFY_INFORMATION;
47+
h5fd_dsm_flags[7] = (int_f)H5FD_DSM_NOTIFY_USER;
5148

5249
ret_value = 0;
5350
return ret_value;
@@ -105,8 +102,10 @@ int_f nh5pget_fapl_dsm_c(hid_t_f *prp_id, int_f* comm)
105102
* Name: h5fd_dsm_set_options_c
106103
* Purpose: Call H5FD_dsm_set_options to set specific option to the DSM
107104
* Inputs: options - specific options are:
108-
* - H5FD_DSM_UNLOCK_MANUAL
109-
* - H5FD_DSM_NOTIFY_MANUAL
105+
* - H5FD_DSM_LOCK_SYNCHRONOUS_F
106+
* - H5FD_DSM_LOCK_ASYNCHRONOUS_F
107+
* - H5FD_DSM_MODE_SERIAL_F
108+
* - H5FD_DSM_MODE_PARALLEL_F
110109
* Returns: 0 on success, -1 on failure
111110
*---------------------------------------------------------------------------*/
112111
int_f nh5fd_dsm_set_options_c(int_f* options)
@@ -147,14 +146,11 @@ int_f nh5fd_dsm_lock_c()
147146
* Name: h5fd_dsm_unlock_c
148147
* Purpose: Call H5FD_dsm_unlock to manually unlock the dsm, when unlocking
149148
* you should pass a flag to signify the reason such as new data etc.
150-
* Inputs: options - unlockflags are:
151-
* - H5FD_DSM_NEW_DATA _F
152-
* - H5FD_DSM_NEW_INFORMATION _F
153-
* - H5FD_DSM_NOTIFY_NONE _F
154-
* - H5FD_DSM_NOTIFY_WAIT _F
155-
* - H5FD_DSM_NOTIFY_DATA _F
156-
* - H5FD_DSM_NOTIFY_INFORMATION _F
157-
* - H5FD_DSM_NOTIFY_USER _F
149+
* Inputs: options - unlock flags are:
150+
* - H5FD_DSM_NOTIFY_NONE_F
151+
* - H5FD_DSM_NOTIFY_DATA_F
152+
* - H5FD_DSM_NOTIFY_INFORMATION_F
153+
* - H5FD_DSM_NOTIFY_USER_F
158154
* Returns: 0 on success, -1 on failure
159155
*---------------------------------------------------------------------------*/
160156
int_f nh5fd_dsm_unlock_c(int_f* unlockflag)

fortran/H5FDdsmf90global.f90

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,35 +27,29 @@ MODULE H5FD_DSM_GLOBAL
2727
!
2828
! H5FD DSM flags declaration
2929
!
30-
INTEGER, PARAMETER :: H5FD_DSM_FLAGS_LEN = 11
30+
INTEGER, PARAMETER :: H5FD_DSM_FLAGS_LEN = 8
3131
INTEGER H5FD_dsm_flags(H5FD_DSM_FLAGS_LEN)
3232
!DEC$if defined(BUILD_H5FDdsm_DLL)
3333
!DEC$ATTRIBUTES DLLEXPORT :: /H5FD_DSM_FLAGS/
3434
!DEC$endif
3535
COMMON /H5FD_DSM_FLAGS/ H5FD_dsm_flags
3636

37-
INTEGER :: H5FD_DSM_UNLOCK_ON_CLOSE_F
38-
INTEGER :: H5FD_DSM_UNLOCK_MANUAL_F
3937
INTEGER :: H5FD_DSM_LOCK_SYNCHRONOUS_F
4038
INTEGER :: H5FD_DSM_LOCK_ASYNCHRONOUS_F
4139
INTEGER :: H5FD_DSM_MODE_SERIAL_F
4240
INTEGER :: H5FD_DSM_MODE_PARALLEL_F
4341
INTEGER :: H5FD_DSM_NOTIFY_NONE_F
44-
INTEGER :: H5FD_DSM_NOTIFY_WAIT_F
4542
INTEGER :: H5FD_DSM_NOTIFY_DATA_F
4643
INTEGER :: H5FD_DSM_NOTIFY_INFORMATION_F
4744
INTEGER :: H5FD_DSM_NOTIFY_USER_F
4845

49-
EQUIVALENCE(H5FD_dsm_flags(1), H5FD_DSM_UNLOCK_ON_CLOSE_F)
50-
EQUIVALENCE(H5FD_dsm_flags(2), H5FD_DSM_UNLOCK_MANUAL_F)
51-
EQUIVALENCE(H5FD_dsm_flags(3), H5FD_DSM_LOCK_SYNCHRONOUS_F)
52-
EQUIVALENCE(H5FD_dsm_flags(4), H5FD_DSM_LOCK_ASYNCHRONOUS_F)
53-
EQUIVALENCE(H5FD_dsm_flags(5), H5FD_DSM_MODE_SERIAL_F)
54-
EQUIVALENCE(H5FD_dsm_flags(6), H5FD_DSM_MODE_PARALLEL_F)
55-
EQUIVALENCE(H5FD_dsm_flags(7), H5FD_DSM_NOTIFY_NONE_F)
56-
EQUIVALENCE(H5FD_dsm_flags(8), H5FD_DSM_NOTIFY_WAIT_F)
57-
EQUIVALENCE(H5FD_dsm_flags(9), H5FD_DSM_NOTIFY_DATA_F)
58-
EQUIVALENCE(H5FD_dsm_flags(10), H5FD_DSM_NOTIFY_INFORMATION_F)
59-
EQUIVALENCE(H5FD_dsm_flags(11), H5FD_DSM_NOTIFY_USER_F)
46+
EQUIVALENCE(H5FD_dsm_flags(1), H5FD_DSM_LOCK_SYNCHRONOUS_F)
47+
EQUIVALENCE(H5FD_dsm_flags(2), H5FD_DSM_LOCK_ASYNCHRONOUS_F)
48+
EQUIVALENCE(H5FD_dsm_flags(3), H5FD_DSM_MODE_SERIAL_F)
49+
EQUIVALENCE(H5FD_dsm_flags(4), H5FD_DSM_MODE_PARALLEL_F)
50+
EQUIVALENCE(H5FD_dsm_flags(5), H5FD_DSM_NOTIFY_NONE_F)
51+
EQUIVALENCE(H5FD_dsm_flags(6), H5FD_DSM_NOTIFY_DATA_F)
52+
EQUIVALENCE(H5FD_dsm_flags(7), H5FD_DSM_NOTIFY_INFORMATION_F)
53+
EQUIVALENCE(H5FD_dsm_flags(8), H5FD_DSM_NOTIFY_USER_F)
6054

6155
END MODULE H5FD_DSM_GLOBAL

fortran/H5FDdsmff.f90

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ MODULE H5FDDSM
3737
! Purpose: Set the File access property for DSM VFD usage
3838
!
3939
! Inputs:
40-
! prp_id - file access property list identifier
41-
! comm - Communicator used by the IO nodes
40+
! prp_id - file access property list identifier
41+
! comm - Communicator used by the IO nodes
4242
! Outputs:
43-
! hdferr: - error code
43+
! hdferr: - error code
4444
! Success: 0
4545
! Failure: -1
4646
! Optional parameters:
@@ -76,10 +76,10 @@ END SUBROUTINE h5pset_fapl_dsm_f
7676
! Purpose: Returns MPI communicator information
7777
!
7878
! Inputs:
79-
! prp_id - file access property list identifier
79+
! prp_id - file access property list identifier
8080
! Outputs:
81-
! comm - Communicator used by the IO nodes
82-
! hdferr: - error code
81+
! comm - Communicator used by the IO nodes
82+
! hdferr: - error code
8383
! Success: 0
8484
! Failure: -1
8585
! Optional parameters:
@@ -116,12 +116,10 @@ END SUBROUTINE h5pget_fapl_dsm_f
116116
!
117117
! Inputs:
118118
! options - options are:
119-
! H5FD_DSM_UNLOCK_ON_CLOSE
120-
! H5FD_DSM_UNLOCK_MANUAL
121-
! H5FD_DSM_LOCK_SYNCHRONOUS
122-
! H5FD_DSM_LOCK_ASYNCHRONOUS
123-
! H5FD_DSM_MODE_SERIAL
124-
! H5FD_DSM_MODE_PARALLEL
119+
! H5FD_DSM_LOCK_SYNCHRONOUS_F
120+
! H5FD_DSM_LOCK_ASYNCHRONOUS_F
121+
! H5FD_DSM_MODE_SERIAL_F
122+
! H5FD_DSM_MODE_PARALLEL_F
125123
! Outputs:
126124
! hdferr: - error code
127125
! Success: 0
@@ -199,14 +197,13 @@ END SUBROUTINE h5fd_dsm_lock_f
199197
! Purpose: unlock the dsm (collective)
200198
!
201199
! Inputs:
202-
! unlockflag - unlockflags are:
203-
! H5FD_DSM_NOTIFY_NONE _F
204-
! H5FD_DSM_NOTIFY_WAIT _F
205-
! H5FD_DSM_NOTIFY_DATA _F (this is the default)
206-
! H5FD_DSM_NOTIFY_INFORMATION _F
207-
! H5FD_DSM_NOTIFY_USER _F (add extra using USER+1, USER+2, ...)
200+
! unlockflag - unlock flags are:
201+
! H5FD_DSM_NOTIFY_NONE_F
202+
! H5FD_DSM_NOTIFY_DATA_F (this is the default)
203+
! H5FD_DSM_NOTIFY_INFORMATION_F
204+
! H5FD_DSM_NOTIFY_USER_F (add extra using USER+1, USER+2, ...)
208205
! Outputs:
209-
! hdferr: - error code
206+
! hdferr: - error code
210207
! Success: 0
211208
! Failure: -1
212209
! Optional parameters:

src/H5FDdsm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ RETURNS
362362
DESCRIPTION
363363
Collective call to manually lock the DSM for exclusive access.
364364
The DSM is always locked when being accessed, but usually only between
365-
an open/close pair. Multiple open/close cals may be nested inside
365+
an open/close pair. Multiple open/close calls may be nested inside
366366
a lock/unlock pair if manual control is desired.
367367
368368
--------------------------------------------------------------------------*/
@@ -398,7 +398,7 @@ RETURNS
398398
DESCRIPTION
399399
Collective call to manually lock the DSM for exclusive access.
400400
The DSM is always locked when being accessed, but usually only between
401-
an open/close pair. Multiple open/close cals may be nested inside
401+
an open/close pair. Multiple open/close calls may be nested inside
402402
a lock/unlock pair if manual control is desired.
403403
404404
--------------------------------------------------------------------------*/

src/H5FDdsm.h

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,14 @@
8383

8484
/*
8585
* Specific DSM operating modes:
86-
* - H5FD_DSM_UNLOCK_MANUAL prevents the DSM to automatically release the file on a close
87-
* - H5FD_DSM_NOTIFY_MANUAL prevents the DSM server to be automatically notified on a close
86+
* - H5FD_DSM_LOCK_SYNCHRONOUS enables client and server to operate
87+
* in a "ping-pong" mode (default)
88+
* - H5FD_DSM_LOCK_ASYNCHRONOUS enables client and server to operate
89+
* without having to wait for each other
8890
* - H5FD_DSM_MODE_SERIAL enables the driver to be used serially
8991
* - H5FD_DSM_MODE_PARALELL enables the driver to be used in parallel (default)
9092
* this should only be used when H5FD_DSM_MODE_SERIAL has been previously called
9193
*/
92-
#define H5FD_DSM_UNLOCK_ON_CLOSE 0x0001
93-
#define H5FD_DSM_UNLOCK_MANUAL 0x0002
9494
#define H5FD_DSM_LOCK_SYNCHRONOUS 0x0004
9595
#define H5FD_DSM_LOCK_ASYNCHRONOUS 0x0008
9696
#define H5FD_DSM_MODE_SERIAL 0x0010
@@ -103,9 +103,13 @@
103103
* - H5FD_DSM_NOTIFY_INFORMATION can be used to signal the presence of new information
104104
*/
105105
#define H5FD_DSM_NOTIFY_NONE 0x0000
106-
#define H5FD_DSM_NOTIFY_WAIT 0x0001
107-
#define H5FD_DSM_NOTIFY_DATA 0x0002 /* this is the default */
108-
#define H5FD_DSM_NOTIFY_INFORMATION 0x0003
106+
#define H5FD_DSM_NOTIFY_DATA 0x0001 /* this is the default */
107+
#define H5FD_DSM_NOTIFY_INFORMATION 0x0002
108+
/* Internal notifications */
109+
#define H5FD_DSM_NOTIFY_WAIT 0x0003
110+
#define H5FD_DSM_NOTIFY_CONNECTED 0x0004
111+
#define H5FD_DSM_NOTIFY_DISCONNECTED 0x0005
112+
/* User notifications */
109113
#define H5FD_DSM_NOTIFY_USER 0x0010 /* user +1, +2 ... etc etc */
110114

111115

src/H5FDdsmBuffer.cxx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -154,20 +154,6 @@ H5FDdsmBuffer::SetStorage(H5FDdsmStorage *aStorage)
154154
return(H5FD_DSM_SUCCESS);
155155
}
156156

157-
//----------------------------------------------------------------------------
158-
H5FDdsmInt32
159-
H5FDdsmBuffer::ClearStorage()
160-
{
161-
if (this->Storage) {
162-
H5FDdsmDebug("Resetting storage");
163-
H5FDdsmDebug("start address: " << this->StartAddress);
164-
H5FDdsmDebug("end address: " << this->EndAddress);
165-
this->SetLength(this->Length);
166-
this->DataPointer = (H5FDdsmByte *)this->Storage->GetDataPointer();
167-
}
168-
return(H5FD_DSM_SUCCESS);
169-
}
170-
171157
//----------------------------------------------------------------------------
172158
H5FDdsmInt32
173159
H5FDdsmBuffer::ConfigureUniform(H5FDdsmComm *aComm, H5FDdsmUInt64 aLength,

src/H5FDdsmBuffer.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,21 +133,20 @@ class H5FDdsm_EXPORT H5FDdsmBuffer : public H5FDdsmObject {
133133
// Storage
134134
H5FDdsmGetValueMacro(Storage, H5FDdsmStorage *);
135135
H5FDdsmInt32 SetStorage(H5FDdsmStorage *Storage);
136-
H5FDdsmInt32 ClearStorage();
137136

138137
// Comm
139138
H5FDdsmGetValueMacro(Comm, H5FDdsmComm *);
140139
H5FDdsmSetValueMacro(Comm, H5FDdsmComm *);
141140

142141
// Configure the system. Set the Comm and ServerIds
143142
H5FDdsmInt32 ConfigureUniform(H5FDdsmComm *Comm, H5FDdsmUInt64 Length,
144-
H5FDdsmInt32 StartId=-1, H5FDdsmInt32 EndId=-1,
145-
H5FDdsmUInt64 aBlockLength=0, H5FDdsmBoolean random=H5FD_DSM_FALSE);
143+
H5FDdsmInt32 StartId = -1, H5FDdsmInt32 EndId = -1,
144+
H5FDdsmUInt64 aBlockLength = 0, H5FDdsmBoolean random = H5FD_DSM_FALSE);
146145

147146
H5FDdsmInt32 SendCommandHeader(H5FDdsmInt32 opcode, H5FDdsmInt32 dest,
148147
H5FDdsmAddr address, H5FDdsmInt32 length, H5FDdsmInt32 comm);
149148
H5FDdsmInt32 ReceiveCommandHeader(H5FDdsmInt32 *opcode, H5FDdsmInt32 *source,
150-
H5FDdsmAddr *address, H5FDdsmInt32 *length, H5FDdsmInt32 comm, H5FDdsmInt32 remoteSource=-1);
149+
H5FDdsmAddr *address, H5FDdsmInt32 *length, H5FDdsmInt32 comm, H5FDdsmInt32 remoteSource = -1);
151150
H5FDdsmInt32 BroadcastComm(H5FDdsmInt32 *comm, H5FDdsmInt32 root);
152151

153152
// Send/Recv Methods for point-to-point comm
@@ -169,7 +168,7 @@ class H5FDdsm_EXPORT H5FDdsmBuffer : public H5FDdsmObject {
169168
H5FDdsmInt32 ReceiveInfo();
170169

171170
protected:
172-
H5FDdsmInt32 SetLength(H5FDdsmUInt64 length, H5FDdsmBoolean allowAllocate=H5FD_DSM_TRUE);
171+
H5FDdsmInt32 SetLength(H5FDdsmUInt64 length, H5FDdsmBoolean allowAllocate = H5FD_DSM_TRUE);
173172

174173
H5FDdsmBoolean IsServer;
175174

0 commit comments

Comments
 (0)