From wilde at mcs.anl.gov Tue Dec 11 07:17:37 2007 From: wilde at mcs.anl.gov (Michael Wilde) Date: Tue, 11 Dec 2007 07:17:37 -0600 Subject: [Swift-user] readdata able to read array fields? Message-ID: <475E8DF1.3050200@mcs.anl.gov> This question is for the LQCD application. Can readdata() read structure fields that are arrays? I want to read the parameter file below into a struct and have fields like, eg, confList[], wsrc[] and kappaQ[] be arrays. The param file looks like: confList=503210,503216 wsrc=d,1S,2S ensemble=l612f21b6600m0290m0484 kappaQ=0.122,0.086 cSW=1.72 mass=0.005,0.006,0.007 dimX=6 dimY=6 dimZ=6 dimT=12 dimArg=6,6,6,12 beta=6.76 u0=0.836 uFileSize=746532 workdir=/home/piccoli/2ptHL/workdir coresPerNode=4 nodesHQ=2 nodesLQ=2 nodes2PT=1 tsrc=0 cloverResidue2=100 cloverResidue=3e-10 sea=2:0.005,1:0.05 precision=3e-9 iterations=7800 steps=3,6,9,12 I want to read this into: type param { int confList[]; string wsrc[]; string ensemble; float kappaQ[]; etc... } Its OK if I need to coerce it into a different format. The data format of the ext mapper would be acceptable. For now I can defer the maping of filename strings to files until just before I use them. From benc at hawaga.org.uk Tue Dec 11 18:57:38 2007 From: benc at hawaga.org.uk (Ben Clifford) Date: Wed, 12 Dec 2007 00:57:38 +0000 (GMT) Subject: [Swift-user] readdata able to read array fields? In-Reply-To: <475E8DF1.3050200@mcs.anl.gov> References: <475E8DF1.3050200@mcs.anl.gov> Message-ID: On Tue, 11 Dec 2007, Michael Wilde wrote: > Can readdata() read structure fields that are arrays? >From the documentation in the user guide for readData which came from something Mihael posted when he wrote readData, I think no - you can do arrays of structs but not structs of arrays. --