Scientific computing sometimes involves computation on sensitive data.
Depending on the data and the execution environment, the HPC (high-performance
computing) user or data provider may require confidentiality and/or integrity
guarantees. To study the applicability of hardware-based trusted execution
environments (TEEs) to enable secure scientific computing, we deeply analyze
the performance impact of AMD SEV and Intel SGX for diverse HPC benchmarks
including traditional scientific computing, machine learning, graph analytics,
and emerging scientific computing workloads. We observe three main findings: 1)
SEV requires careful memory placement on large scale NUMA machines
(1$\times$$-$3.4$\times$ slowdown without and 1$\times$$-$1.15$\times$ slowdown
with NUMA aware placement), 2) virtualization$-$a prerequisite for
SEV$-$results in performance degradation for workloads with irregular memory
accesses and large working sets (1$\times$$-$4$\times$ slowdown compared to
native execution for graph applications) and 3) SGX is inappropriate for HPC
given its limited secure memory size and inflexible programming model
(1.2$\times$$-$126$\times$ slowdown over unsecure execution). Finally, we
discuss forthcoming new TEE designs and their potential impact on scientific
computing.