Skip to content

Commit

Permalink
cleanup and mark v3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
barnex committed Sep 24, 2013
1 parent 492551d commit c7c2113
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 16 deletions.
16 changes: 8 additions & 8 deletions engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"runtime"
)

const VERSION = "mumax3.0.11 α "
const VERSION = "mumax3.1.0"

var UNAME = VERSION + runtime.GOOS + "_" + runtime.GOARCH + " " + runtime.Version() + "(" + runtime.Compiler + ")"

Expand Down Expand Up @@ -115,13 +115,13 @@ func Close() {
Table.flush()

// debug. TODO: rm
for n, p := range params {
if u, ok := p.(interface {
nUpload() int
}); ok {
log.Println(n, "\t:\t", u.nUpload(), "uploads")
}
}
// for n, p := range params {
// if u, ok := p.(interface {
// nUpload() int
// }); ok {
// log.Println(n, "\t:\t", u.nUpload(), "uploads")
// }
// }
}

//func sanitycheck() {
Expand Down
5 changes: 2 additions & 3 deletions engine/exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"github.com/mumax/3/cuda"
"github.com/mumax/3/data"
"github.com/mumax/3/util"
"log"
"math"
"unsafe"
)
Expand Down Expand Up @@ -140,14 +139,14 @@ func (p *exchParam) upload() {
if p.gpu == nil {
p.gpu = cuda.SymmLUT(cuda.MemAlloc(int64(len(p.lut)) * cu.SIZEOF_FLOAT32))
}
log.Println("upload lex2:\n", p)
//log.Println("upload lex2:\n", p)
cu.MemcpyHtoD(cu.DevicePtr(p.gpu), unsafe.Pointer(&p.lut[0]), cu.SIZEOF_FLOAT32*int64(len(p.lut)))
p.gpu_ok = true
}

func (p *exchParam) SetInterRegion(r1, r2 int, val float64) {
v := float32(val)
log.Println("lex2.setinterregion", r1, r2, val)
//log.Println("lex2.setinterregion", r1, r2, val)
p.lut[symmidx(r1, r2)] = v

if r1 == r2 {
Expand Down
3 changes: 1 addition & 2 deletions engine/scalarparam.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package engine

import (
"github.com/mumax/3/script"
"log"
"reflect"
)

Expand All @@ -25,7 +24,7 @@ func (p *ScalarParam) GetRegion(region int) float64 {
}

func (p *ScalarParam) SetValue(v interface{}) {
log.Println(p.Name(), ".SetValue", v)
//log.Println(p.Name(), ".SetValue", v)
f := v.(script.ScalarFunction)
if f.Const() {
p.setUniform([]float64{f.Float()})
Expand Down
5 changes: 2 additions & 3 deletions engine/vectorparam.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package engine

import (
"github.com/mumax/3/script"
"log"
"reflect"
)

Expand All @@ -28,10 +27,10 @@ func (p *VectorParam) GetRegion(region int) [3]float64 {
func (p *VectorParam) SetValue(v interface{}) {
f := v.(script.VectorFunction)
if f.Const() {
log.Println(p.Name(), "is constant")
//log.Println(p.Name(), "is constant")
p.setUniform(slice(f.Float3()))
} else {
log.Println(p.Name(), "not constant")
//log.Println(p.Name(), "not constant")
p.setFunc(0, NREGION, func() []float64 {
return slice(f.Float3())
})
Expand Down

0 comments on commit c7c2113

Please sign in to comment.