You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Version(s) Affected
Server Version : stable 7-142-81
Client #1 Version : 6.1-84 & stable-7-142-81
Client #2 Version : stable 7-142-81
Platform(s)
Server : Rocky Linux 8.5
Client #1: CentOS 5.11 (2.6.18-348.el5)
Client #2 : Rocky Linux 8.5
Installation Method(s)
compiled from source, kits downloaded from GitHub Release
Describe the bug
We recently upgraded our systems to the latest MDSplus, so now we have two versions of MDSplus systems.
In Version 6.1.84, we started saving Segment data from 2018. As shown below, we saved data using only 'BeginSegment'. At this time, there was no problem reading and writing data.
########################(This is the segment method I used in version 6.1.84.)#######
for(segIdx = 0, count = 1; segIdx < segmentCnt; segIdx++) {
printf("Building segment %d / %d \n", segIdx, dataCount);
for(i = 0; i < dataCount; i++) {
buf[i] = count++;
}
segIdxS = (double) segIdx*dataCount*delta;
segIdxE = (double) (((segIdx+1)*dataCount)-1)*delta;
startTime = descr (&dtype_Double, &segIdxS, &null);
endTime = descr (&dtype_Double, &segIdxE, &null);
timeRate = descr (&dtype_Double, &delta , &null);
valueDesc = descr (&dtype_Double, buf , &dataCount, &null);
valueAllDesc = descr (&dtype_Double, bufAll , &dataCountAll, &null);
statDesc = descr (&dtype_long , &tstat , &null);
sprintf (tdiSegbuf, "BeginSegment(%s,$1,$2,MAKE_DIM(*,MAKE_RANGE($1,$2,$3)),$4,%d)", TAG_NAME, -1);
status = MdsValue (tdiSegbuf, &startTime, &endTime, &timeRate, &valueDesc, &statDesc, &null, &len);
// in 6-1-84 ver, we just use only beginSegment function for segment archive data.
// There is no issue about return data of segment data, but new version of mdsplus can't return last segment data.
if ( !((status) & 1) ) {
printf("Error: during BeginSegment archive \n");
}
}
##########################
When I changed the MDSplus version (7-132-0 & 7-142-81) to the latest version, I saved the data as segments, but I couldn't read the last segment data block when saving it using the same method as before, only using BeginSegment.
So in the latest version, the last block data (7-142-81) was saved by adding putSegment, and there was no problem reading the data in the latest version.
*****************************(This is the segment method I used in version 7.142.81.)
for(segIdx = 0, count = 1; segIdx < segmentCnt; segIdx++) {
printf("Building segment %d / %d \n", segIdx, dataCount);
for(i = 0; i < dataCount; i++) {
buf[i] = count++;
}
segIdxS = (double) segIdx*dataCount*delta;
segIdxE = (double) (((segIdx+1)*dataCount)-1)*delta;
startTime = descr (&dtype_Double, &segIdxS, &null);
endTime = descr (&dtype_Double, &segIdxE, &null);
timeRate = descr (&dtype_Double, &delta , &null);
valueDesc = descr (&dtype_Double, buf , &dataCount, &null);
valueAllDesc = descr (&dtype_Double, bufAll , &dataCountAll, &null);
statDesc = descr (&dtype_long , &tstat , &null);
sprintf (tdiSegbuf, "BeginSegment(%s,$1,$2,MAKE_DIM(*,MAKE_RANGE($1,$2,$3)),$4,%d)", TAG_NAME, -1);
status = MdsValue (tdiSegbuf, &startTime, &endTime, &timeRate, &valueDesc, &statDesc, &null, &len);
// in 6-1-84 ver, we just use only beginSegment function for segment archive data.
// There is no issue about return data of segment data, but new version of mdsplus can't return last segment data.
if ( !((status) & 1) ) {
printf("Error: during BeginSegment archive \n");
}
#if 1
// 7-142-81 ver : we use this function for segment archive data from new mdsplus version
if(segIdx == (segmentCnt-1)){
printf("PutSegment last index segment re-injection same data %d / %d \n", segIdx, dataCount);
sprintf (tdiSegbuf, "PutSegment(%s,%d,$1)", TAG_NAME, -1);
// status = MdsValue (tdiSegbuf, &statDesc, &null, &len);
status = MdsValue (tdiSegbuf, &valueDesc, &statDesc, &null, &len);
if ( !((status) & 1) ) {
printf("Error: during putSegment archive \n");
}
}
#endif
}
Question
The problem is that when reading data previously saved using only BeginSegment in the latest MDSplus version (7-142-81), the last segment data block cannot be read.
Please give me advice on how I can solve this problem.
The solutions I think are as follows:
1st: Can you modify and distribute the MDSplus source code so that data saved using only BeginSegment and data saved using BeginSegment & putSegment can be read at the same time in the latest version of MDSplus?
2nd: Read the last block of previously saved data and execute putSegment to save it. (I don't know if this is a good way.)
Thank you for your help.
The text was updated successfully, but these errors were encountered:
I tested the second method and the data worked well in the new version of MDSplus environment without any problems.
So I will recover the problem data using the second method. You don't have to worry about this issue anymore.
Thanks
The last segment data block could not be read.
Affiliation
KFE - KSTAR
Version(s) Affected
Server Version : stable 7-142-81
Client #1 Version : 6.1-84 & stable-7-142-81
Client #2 Version : stable 7-142-81
Platform(s)
Server : Rocky Linux 8.5
Client #1: CentOS 5.11 (2.6.18-348.el5)
Client #2 : Rocky Linux 8.5
Installation Method(s)
compiled from source, kits downloaded from GitHub Release
Describe the bug
We recently upgraded our systems to the latest MDSplus, so now we have two versions of MDSplus systems.
In Version 6.1.84, we started saving Segment data from 2018. As shown below, we saved data using only 'BeginSegment'. At this time, there was no problem reading and writing data.
########################(This is the segment method I used in version 6.1.84.)#######
for(segIdx = 0, count = 1; segIdx < segmentCnt; segIdx++) {
printf("Building segment %d / %d \n", segIdx, dataCount);
}
##########################
When I changed the MDSplus version (7-132-0 & 7-142-81) to the latest version, I saved the data as segments, but I couldn't read the last segment data block when saving it using the same method as before, only using BeginSegment.
So in the latest version, the last block data (7-142-81) was saved by adding putSegment, and there was no problem reading the data in the latest version.
*****************************(This is the segment method I used in version 7.142.81.)
for(segIdx = 0, count = 1; segIdx < segmentCnt; segIdx++) {
printf("Building segment %d / %d \n", segIdx, dataCount);
#if 1
// 7-142-81 ver : we use this function for segment archive data from new mdsplus version
if(segIdx == (segmentCnt-1)){
printf("PutSegment last index segment re-injection same data %d / %d \n", segIdx, dataCount);
sprintf (tdiSegbuf, "PutSegment(%s,%d,$1)", TAG_NAME, -1);
// status = MdsValue (tdiSegbuf, &statDesc, &null, &len);
status = MdsValue (tdiSegbuf, &valueDesc, &statDesc, &null, &len);
if ( !((status) & 1) ) {
printf("Error: during putSegment archive \n");
}
}
#endif
}
Question
The problem is that when reading data previously saved using only BeginSegment in the latest MDSplus version (7-142-81), the last segment data block cannot be read.
Please give me advice on how I can solve this problem.
The solutions I think are as follows:
1st: Can you modify and distribute the MDSplus source code so that data saved using only BeginSegment and data saved using BeginSegment & putSegment can be read at the same time in the latest version of MDSplus?
2nd: Read the last block of previously saved data and execute putSegment to save it. (I don't know if this is a good way.)
Thank you for your help.
The text was updated successfully, but these errors were encountered: