From 6dc5f12914b7e0ae708cff347030ec96ca44cc60 Mon Sep 17 00:00:00 2001 From: rlar Date: Sun, 1 Jun 2014 18:49:08 +0200 Subject: [PATCH] USE_OMP, dont miss error return codes when a DEVLoadOMP() invocation fails --- src/spicelib/devices/bsim3/b3ld.c | 9 +++++---- src/spicelib/devices/bsim4/b4ld.c | 9 +++++---- src/spicelib/devices/bsim4v6/b4v6ld.c | 9 +++++---- src/spicelib/devices/bsim4v7/b4v7ld.c | 9 +++++---- src/spicelib/devices/bsimsoi/b4soild.c | 9 +++++---- src/spicelib/devices/hisim2/hsm2ld.c | 9 +++++---- 6 files changed, 30 insertions(+), 24 deletions(-) diff --git a/src/spicelib/devices/bsim3/b3ld.c b/src/spicelib/devices/bsim3/b3ld.c index 8d352d607..5520c9052 100644 --- a/src/spicelib/devices/bsim3/b3ld.c +++ b/src/spicelib/devices/bsim3/b3ld.c @@ -47,14 +47,15 @@ CKTcircuit *ckt) int idx; BSIM3model *model = (BSIM3model*)inModel; int good = 0; - BSIM3instance *here; BSIM3instance **InstArray; InstArray = model->BSIM3InstanceArray; -#pragma omp parallel for private(here) +#pragma omp parallel for for (idx = 0; idx < model->BSIM3InstCount; idx++) { - here = InstArray[idx]; - good = BSIM3LoadOMP(here, ckt); + BSIM3instance *here = InstArray[idx]; + int local_good = BSIM3LoadOMP(here, ckt); + if (local_good) + good = local_good; } BSIM3LoadRhsMat(inModel, ckt); diff --git a/src/spicelib/devices/bsim4/b4ld.c b/src/spicelib/devices/bsim4/b4ld.c index c5b48b897..67f27b7e9 100644 --- a/src/spicelib/devices/bsim4/b4ld.c +++ b/src/spicelib/devices/bsim4/b4ld.c @@ -77,14 +77,15 @@ CKTcircuit *ckt) int idx; BSIM4model *model = (BSIM4model*)inModel; int good = 0; - BSIM4instance *here; BSIM4instance **InstArray; InstArray = model->BSIM4InstanceArray; -#pragma omp parallel for private(here) +#pragma omp parallel for for (idx = 0; idx < model->BSIM4InstCount; idx++) { - here = InstArray[idx]; - good = BSIM4LoadOMP(here, ckt); + BSIM4instance *here = InstArray[idx]; + int local_good = BSIM4LoadOMP(here, ckt); + if (local_good) + good = local_good; } BSIM4LoadRhsMat(inModel, ckt); diff --git a/src/spicelib/devices/bsim4v6/b4v6ld.c b/src/spicelib/devices/bsim4v6/b4v6ld.c index d76c64fcc..78cf7acc4 100644 --- a/src/spicelib/devices/bsim4v6/b4v6ld.c +++ b/src/spicelib/devices/bsim4v6/b4v6ld.c @@ -77,14 +77,15 @@ CKTcircuit *ckt) int idx; BSIM4v6model *model = (BSIM4v6model*)inModel; int good = 0; - BSIM4v6instance *here; BSIM4v6instance **InstArray; InstArray = model->BSIM4v6InstanceArray; -#pragma omp parallel for private(here) +#pragma omp parallel for for (idx = 0; idx < model->BSIM4v6InstCount; idx++) { - here = InstArray[idx]; - good = BSIM4v6LoadOMP(here, ckt); + BSIM4v6instance *here = InstArray[idx]; + int local_good = BSIM4v6LoadOMP(here, ckt); + if (local_good) + good = local_good; } BSIM4v6LoadRhsMat(inModel, ckt); diff --git a/src/spicelib/devices/bsim4v7/b4v7ld.c b/src/spicelib/devices/bsim4v7/b4v7ld.c index 5fc05e273..fa6b28ea1 100644 --- a/src/spicelib/devices/bsim4v7/b4v7ld.c +++ b/src/spicelib/devices/bsim4v7/b4v7ld.c @@ -75,14 +75,15 @@ CKTcircuit *ckt) int idx; BSIM4v7model *model = (BSIM4v7model*)inModel; int good = 0; - BSIM4v7instance *here; BSIM4v7instance **InstArray; InstArray = model->BSIM4v7InstanceArray; -#pragma omp parallel for private(here) +#pragma omp parallel for for (idx = 0; idx < model->BSIM4v7InstCount; idx++) { - here = InstArray[idx]; - good = BSIM4v7LoadOMP(here, ckt); + BSIM4v7instance *here = InstArray[idx]; + int local_good = BSIM4v7LoadOMP(here, ckt); + if (local_good) + good = local_good; } BSIM4v7LoadRhsMat(inModel, ckt); diff --git a/src/spicelib/devices/bsimsoi/b4soild.c b/src/spicelib/devices/bsimsoi/b4soild.c index d3a45b15b..6a74a04ce 100644 --- a/src/spicelib/devices/bsimsoi/b4soild.c +++ b/src/spicelib/devices/bsimsoi/b4soild.c @@ -110,14 +110,15 @@ B4SOIload( int idx; B4SOImodel *model = (B4SOImodel*)inModel; int good = 0; - B4SOIinstance *here; B4SOIinstance **InstArray; InstArray = model->B4SOIInstanceArray; -#pragma omp parallel for private(here) +#pragma omp parallel for for (idx = 0; idx < model->B4SOIInstCount; idx++) { - here = InstArray[idx]; - good = B4SOILoadOMP(here, ckt); + B4SOIinstance *here = InstArray[idx]; + int local_good = B4SOILoadOMP(here, ckt); + if (local_good) + good = local_good; } B4SOILoadRhsMat(inModel, ckt); diff --git a/src/spicelib/devices/hisim2/hsm2ld.c b/src/spicelib/devices/hisim2/hsm2ld.c index aeef1fdc8..e830dc3ac 100644 --- a/src/spicelib/devices/hisim2/hsm2ld.c +++ b/src/spicelib/devices/hisim2/hsm2ld.c @@ -190,14 +190,15 @@ int HSM2load( int idx; HSM2model *model = (HSM2model*)inModel; int good = 0; - HSM2instance *here; HSM2instance **InstArray; InstArray = model->HSM2InstanceArray; -#pragma omp parallel for private(here) +#pragma omp parallel for for (idx = 0; idx < model->HSM2InstCount; idx++) { - here = InstArray[idx]; - good = HSM2LoadOMP(here, ckt); + HSM2instance *here = InstArray[idx]; + int local_good = HSM2LoadOMP(here, ckt); + if (local_good) + good = local_good; } HSM2LoadRhsMat(inModel, ckt);