| dcca6d9d | 03-Dec-2013 |
Jed Brown <jedbrown@mcs.anl.gov> |
PetscMalloc[2-7]: remove type arguments, infer from pointer type
This change can be performed almost entirely by this script:
git grep -l PetscMalloc[2-7] $1 | xargs perl -pi \ -e ' s@PetscMalloc
PetscMalloc[2-7]: remove type arguments, infer from pointer type
This change can be performed almost entirely by this script:
git grep -l PetscMalloc[2-7] $1 | xargs perl -pi \ -e ' s@PetscMalloc2\(([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+)\)@PetscMalloc2($1,$3,$4,$6)@; s@PetscMalloc3\(([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+)\)@PetscMalloc3($1,$3,$4,$6,$7,$9)@; s@PetscMalloc4\(([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+)\)@PetscMalloc4($1,$3,$4,$6,$7,$9,$10,$12)@; s@PetscMalloc5\(([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+)\)@PetscMalloc5($1,$3,$4,$6,$7,$9,$10,$12,$13,$15)@; s@PetscMalloc6\(([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+)\)@PetscMalloc6($1,$3,$4,$6,$7,$9,$10,$12,$13,$15,$16,$18)@; s@PetscMalloc7\(([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+),([^,;()]+)\)@PetscMalloc7($1,$3,$4,$6,$7,$9,$10,$12,$13,$15,$16,$18,$19,$21)@; '
show more ...
|
| a2f94806 | 12-Sep-2013 |
Jed Brown <jedbrown@mcs.anl.gov> |
Sys: add PetscFunctionBeginHot to switch to cheaper pointer checks
Some logging and debugging operations are expensive. In particular, applications can see order of magnitude slowdowns when PetscCh
Sys: add PetscFunctionBeginHot to switch to cheaper pointer checks
Some logging and debugging operations are expensive. In particular, applications can see order of magnitude slowdowns when PetscCheckPointer configures a special signal handler (debug builds only). Additionally, high-frequency events like MAT_SetValues are disabled by default because it can be expensive to profile.
My marking "hot" regions, we can turn off the expensive operations by default, but still have the ability to enable them at run-time. This commit adds PetscFunctionBeginHot, with logic in PetscCheckPointer to skip the check while inside a "hot" function.
Reported-by: Dave May <dave.mayhem23@gmail.com>
show more ...
|