[Swift-devel] Problem with @extractint?

Michael Wilde wilde at mcs.anl.gov
Mon Oct 8 14:08:16 CDT 2007


Updated t26hangs.swift to elim duplicate declare of file.
Still hangs; source and kml are:

$ cat t26hangs.swift
type file;

int i;

(file r1 ) set1 ( ) {
   app { set1 @r1 ; }
}

file f <"varf.value">;
f = set1();
print("f=", at extractint(f));

i=@extractint(f); // Program works when you comment out this line,
                   // hangs otherwise
print("i=",i);

$ cat t26hangs.kml
<project>
   <import file="sys.xml"/>
   <import file="scheduler.xml"/>
   <import file="rlog.xml"/>
   <import file="vdl.k"/>
   <types>
     <xs:schema 
targetNamespace="http://ci.uchicago.edu/swift/2007/07/swiftscript" 
xmlns="http://ci.uchicago.edu/swift/2007/07/swiftscript" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xs="http://www.w3.org/2001/XMLSchema">
       <xs:simpleType name="file">
         <xs:restriction base="xs:string"/>
       </xs:simpleType>
     </xs:schema>
   </types>
   <element name="set1" arguments="r1">
     <vdl:typecheck argname="r1" var="{r1}" type="file"/>
     <vdl:execute>
       <vdl:tr>set1</vdl:tr>
       <vdl:stageout var="{r1}"/>
       <vdl:arguments>
         <swiftscript:filename>
             <variable>r1</variable>
         </swiftscript:filename>
       </vdl:arguments>

     </vdl:execute>
     <vdl:closedataset var="{r1}"/>
   </element>

   <set name="i">
     <vdl:new type="int" dbgname="i">
       <vdl:mapping descriptor="concurrent_mapper">
         <vdl:parameter 
name="prefix">i-b13c9714-8b61-4989-8be1-3bcbb154181f</vdl:parameter>
       </vdl:mapping>
     </vdl:new>
   </set>
   <set name="f">
     <vdl:new type="file" dbgname="f">
       <vdl:mapping descriptor="single_file_mapper">
         <vdl:parameter name="file" value="varf.value"/>
         <vdl:parameter name="input">false</vdl:parameter>
       </vdl:mapping>
     </vdl:new>
   </set>
      <vdl:setfieldvalue>
        <argument name="var">
          <variable>i</variable>
        </argument>
        <argument name="value">
   <!-- TODO this should be removed and the equivalent code put in the
   java implementation of setfieldvalue itself -->
   <getfieldvalue>
          <swiftscript:extractint>
              <variable>f</variable>
          </swiftscript:extractint>
   </getfieldvalue>
        </argument>
      </vdl:setfieldvalue>
   <restartLog>
         <vdl:pre/>
         <vdl:mains>
                 <vdl:mainp>
                     <parallel>
                       <set1>
                         <parallel>
                           <variable>f</variable>
                         </parallel>
                       </set1>
                       <print>
                         <parallel>
                           <vdl:new type="string" value="f=" />
                           <swiftscript:extractint>
                               <variable>f</variable>
                           </swiftscript:extractint>
                         </parallel>
                       </print>
                       <print>
                         <parallel>
                           <vdl:new type="string" value="i=" />
                           <variable>i</variable>
                         </parallel>
                       </print>
                     </parallel>
                 </vdl:mainp>
         </vdl:mains>
         <vdl:post/>
   </restartLog>
</project>
$


On 10/8/07 1:40 PM, Michael Wilde wrote:
> Attached, with source out kml and logs for both working and hanging cases.
> 
> 
> 
> On 10/8/07 12:45 PM, Mihael Hategan wrote:
>> Send the .kml file.
>>
>> On Mon, 2007-10-08 at 12:41 -0500, Michael Wilde wrote:
>>> It seems that if I extractint from a file that is static it works 
>>> fine, but if I extract from a file that I just derived and assign to 
>>> an int, it hangs.
>>>
>>> seems like swift is (or I am) getting confused in the data flow 
>>> dependencies when the value of extractint is assigned.
>>>
>>> On 10/8/07 9:25 AM, Michael Wilde wrote:
>>>> @extractint is behaving unpredictably for me.
>>>>
>>>> In the following script:
>>>> -- 
>>>> type file;
>>>>
>>>> int i;
>>>> file f;
>>>>
>>>> (file r1 ) set1 ( ) {
>>>>   app { set1 @r1 ; }
>>>> }
>>>>
>>>> file f <"varf.value">;
>>>> f = set1();
>>>> print("f=", at extractint(f));  // this print works when the next assign
>>>>                              // stmt is commented out
>>>>
>>>> // i=@extractint(f); // Program works when you comment out this line,
>>>>                   // hangs otherwise
>>>> //print("i=",i);
>>>>
>>>> -- 
>>>> it works if i dont try to assign the value of @extractint to an int 
>>>> but hangs otherwise.
>>>>
>>>> set1 is:
>>>> echo 77777 >$1
>>>>
>>>>
>>>> Ive tried various other patterns, and some seem to work; I dont know 
>>>> if I missed a data flow issue here or if @extractint has a problem.
>>>>
>>>> Any advice while I continue to debug this?
>>>>
>>>> _______________________________________________
>>>> Swift-devel mailing list
>>>> Swift-devel at ci.uchicago.edu
>>>> http://mail.ci.uchicago.edu/mailman/listinfo/swift-devel
>>>>
>>>>
>>> _______________________________________________
>>> Swift-devel mailing list
>>> Swift-devel at ci.uchicago.edu
>>> http://mail.ci.uchicago.edu/mailman/listinfo/swift-devel
>>>
>>
>>
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Swift-devel mailing list
> Swift-devel at ci.uchicago.edu
> http://mail.ci.uchicago.edu/mailman/listinfo/swift-devel



More information about the Swift-devel mailing list