mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-03-25 17:00:45 +08:00
[svn-r5386] Purpose:
Bug Fix Description: Currently, only process 0 is writing attribute data to a file. This is incorrect, because the raw data for attributes is cached in memory until the object header is written and other processes are not able to read the correct attribute information. Solution: Have all processes participate in writing the attribute data. Platforms tested: IRIX64 6.5 (modi4)
This commit is contained in:
parent
fcdc05f307
commit
1696277a6c
@ -390,8 +390,7 @@ void write_attribute(hid_t obj_id, int this_type, int num)
|
||||
sprintf(attr_name, "Group Attribute %d", num);
|
||||
sid = H5Screate(H5S_SCALAR);
|
||||
aid = H5Acreate(obj_id, attr_name, H5T_NATIVE_INT, sid, H5P_DEFAULT);
|
||||
if(MAINPROCESS)
|
||||
H5Awrite(aid, H5T_NATIVE_INT, &num);
|
||||
H5Awrite(aid, H5T_NATIVE_INT, &num);
|
||||
H5Aclose(aid);
|
||||
H5Sclose(sid);
|
||||
}
|
||||
@ -401,8 +400,7 @@ void write_attribute(hid_t obj_id, int this_type, int num)
|
||||
attr_data[i] = i;
|
||||
sid = H5Screate_simple(dspace_rank, dspace_dims, NULL);
|
||||
aid = H5Acreate(obj_id, attr_name, H5T_NATIVE_INT, sid, H5P_DEFAULT);
|
||||
if(MAINPROCESS)
|
||||
H5Awrite(aid, H5T_NATIVE_INT, attr_data);
|
||||
H5Awrite(aid, H5T_NATIVE_INT, attr_data);
|
||||
H5Aclose(aid);
|
||||
H5Sclose(sid);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user