n Name: Accordion Block Migration CLI * Description: WP-CLI command to migrate snl-blocks/snl-accordion to snl/accordion-wrapper * Version: 1.2.1 */ if ( ! defined( 'WP_CLI' ) || ! WP_CLI ) { return; } /** * Migrate accordion blocks from old structure to new TUI4 structure */ class Accordion_Block_Migration_Command { /** * Migrates accordion blocks from snl-blocks/snl-accordion to snl/accordion-wrapper * * ## OPTIONS * * [--dry-run] * : Run the migration without making any changes (preview only) * * [--post-type=] * : Limit migration to specific post type (default: page,post) * * [--blog-id=] * : Specific blog ID to migrate (use 'all' for all sites, defaults to main site) * * [--batch-size=] * : Number of posts to process per batch (default: 50) * * [--start-batch=] * : Resume from a specific batch number (default: 1) * * [--show-urls] * : Display the URL of each page as it's migrated, including skipped posts * * [--post-id=] * : Test migration on a specific post ID only * * [--debug] * : Output raw block attributes for debugging attribute mapping * * ## EXAMPLES * * # Preview changes without applying them * wp accordion-migrate run --dry-run * * # Test on a specific post * wp accordion-migrate run --post-id=123 --dry-run * * # Debug attribute keys on a specific post * wp accordion-migrate run --post-id=123 --dry-run --debug * * # Run the actual migration * wp accordion-migrate run * * # Migrate specific blog * wp accordion-migrate run --blog-id=2 * * # Migrate all sites in network * wp accordion-migrate run --blog-id=all * * # Use smaller batch size * wp accordion-migrate run --batch-size=25 * * # Resume from batch 3 * wp accordion-migrate run --start-batch=3 * * @when after_wp_load */ public function run( $args, $assoc_args ) { $dry_run = isset( $assoc_args['dry-run'] ); $debug = isset( $assoc_args['debug'] ); $post_types = isset( $assoc_args['post-type'] ) ? explode( ',', $assoc_args['post-type'] ) : array( 'page', 'post' ); $batch_size = isset( $assoc_args['batch-size'] ) ? absint( $assoc_args['batch-size'] ) : 50; $start_batch = isset( $assoc_args['start-batch'] ) ? absint( $assoc_args['start-batch'] ) : 1; $show_urls = isset( $assoc_args['show-urls'] ); $single_post_id = isset( $assoc_args['post-id'] ) ? absint( $assoc_args['post-id'] ) : null; // Handle multisite $blog_id = isset( $assoc_args['blog-id'] ) ? $assoc_args['blog-id'] : null; if ( is_multisite() && $blog_id === 'all' ) { if ( $single_post_id ) { WP_CLI::error( 'Cannot use --post-id with --blog-id=all' ); } $this->run_for_all_sites( $post_types, $batch_size, $start_batch, $dry_run, $show_urls, $debug ); return; } // Determine which site to run on $target_blog_id = $this->get_target_blog_id( $blog_id ); if ( is_multisite() ) { switch_to_blog( $target_blog_id ); WP_CLI::log( "Switched to blog ID: {$target_blog_id}" ); } if ( $dry_run ) { WP_CLI::warning( 'DRY RUN MODE - No changes will be made' ); } WP_CLI::log( 'Starting accordion block migration...' ); WP_CLI::log( 'From: snl-blocks/snl-accordion → To: snl/accordion-wrapper' ); WP_CLI::log( 'Post types: ' . implode( ', ', $post_types ) ); if ( $single_post_id ) { WP_CLI::log( "Testing on single post ID: {$single_post_id}" ); } else { WP_CLI::log( "Batch size: {$batch_size}" ); if ( $start_batch > 1 ) { WP_CLI::warning( "Resuming from batch: {$start_batch}" ); } } WP_CLI::log( '' ); $stats = array( 'total_processed' => 0, 'updated' => 0, 'skipped' => 0, 'errors' => 0, 'blocks_migrated' => 0, ); if ( $single_post_id ) { $this->migrate_single_post( $single_post_id, $dry_run, $show_urls, $debug, $stats ); } else { $this->migrate_all_posts( $post_types, $batch_size, $start_batch, $dry_run, $show_urls, $debug, $stats ); } // Display summary $this->print_summary( $stats, $dry_run, is_multisite() ? $target_blog_id : null ); // Restore original blog in multisite if ( is_multisite() ) { restore_current_blog(); } } // ------------------------------------------------------------------------- // Single post migration (for testing) // ------------------------------------------------------------------------- /** * Migrate a single post (for testing) */ private function migrate_single_post( $post_id, $dry_run, $show_urls, $debug, &$stats ) { $post = get_post( $post_id ); if ( ! $post ) { WP_CLI::error( "Post ID {$post_id} not found." ); return; } WP_CLI::log( "Post: {$post->post_title} (ID: {$post_id})" ); WP_CLI::log( "URL: " . get_permalink( $post_id ) ); WP_CLI::log( "Status: {$post->post_status}" ); WP_CLI::log( '' ); $result = $this->process_post( $post, $dry_run, $show_urls, $debug ); if ( $result['updated'] ) { $stats['total_processed']++; $stats['updated']++; $stats['blocks_migrated'] += $result['blocks_migrated']; WP_CLI::log( "Result: " . ( $dry_run ? 'DRY RUN' : 'UPDATED' ) ); WP_CLI::log( "Accordion blocks migrated: {$result['blocks_migrated']}" ); WP_CLI::log( "URL: " . get_permalink( $post_id ) ); WP_CLI::log( '' ); WP_CLI::log( 'BEFORE:' ); WP_CLI::log( '-------' ); WP_CLI::log( $result['content_before'] ); WP_CLI::log( '' ); WP_CLI::log( 'AFTER:' ); WP_CLI::log( '------' ); WP_CLI::log( $result['content_after'] ); } else { $stats['total_processed']++; $stats['skipped']++; WP_CLI::log( 'No accordion blocks found in this post.' ); } } // ------------------------------------------------------------------------- // Batch migration // ------------------------------------------------------------------------- /** * Migrate all posts in batches */ private function migrate_all_posts( $post_types, $batch_size, $start_batch, $dry_run, $show_urls, $debug, &$stats ) { $total_count = $this->get_posts_with_accordion_count( $post_types ); if ( $total_count === 0 ) { WP_CLI::log( "No posts found with accordion blocks." ); return; } $total_batches = ceil( $total_count / $batch_size ); WP_CLI::log( "Found approximately {$total_count} post(s) with accordion blocks" ); WP_CLI::log( "Processing in {$total_batches} batch(es) of {$batch_size}" ); WP_CLI::log( '' ); for ( $current_batch = $start_batch; $current_batch <= $total_batches; $current_batch++ ) { $offset = ( $current_batch - 1 ) * $batch_size; WP_CLI::log( "→ Batch {$current_batch} of {$total_batches} (offset: {$offset})" ); $posts = get_posts( array( 'post_type' => $post_types, 'post_status' => 'publish', 'posts_per_page' => $batch_size, 'offset' => $offset, 'orderby' => 'ID', 'order' => 'ASC', ) ); $batch_count = count( $posts ); if ( $batch_count === 0 ) { WP_CLI::log( " No posts in this batch (migration complete)" ); break; } $progress = \WP_CLI\Utils\make_progress_bar( " Processing {$batch_count} posts", $batch_count ); foreach ( $posts as $post ) { $result = $this->process_post( $post, $dry_run, $show_urls, $debug ); if ( $result['updated'] ) { $stats['total_processed']++; $stats['updated']++; $stats['blocks_migrated'] += $result['blocks_migrated']; WP_CLI::log( " ✓ [" . ( $dry_run ? 'DRY RUN' : 'UPDATED' ) . "] (Post {$post->ID}) " . get_permalink( $post->ID ) . " — {$result['blocks_migrated']} block(s) migrated" ); } else { $stats['total_processed']++; $stats['skipped']++; if ( $show_urls ) { WP_CLI::log( " - [SKIP] (Post {$post->ID}) " . get_permalink( $post->ID ) . " — no accordion blocks" ); } } $progress->tick(); } $progress->finish(); // Give the database a breather between batches if ( $current_batch < $total_batches ) { sleep( 1 ); } } WP_CLI::log( '' ); } // ------------------------------------------------------------------------- // Core processing // ------------------------------------------------------------------------- /** * Process a single post — parse, check, transform, and optionally save */ private function process_post( $post, $dry_run, $show_urls, $debug ) { $result = array( 'updated' => false, 'has_blocks' => false, 'blocks_migrated' => 0, 'content_before' => '', 'content_after' => '', ); if ( ! has_blocks( $post->post_content ) ) { return $result; } $result['has_blocks'] = true; $blocks = parse_blocks( $post->post_content ); if ( ! $this->has_accordion_blocks( $blocks ) ) { return $result; } $result['content_before'] = $post->post_content; // Transform $transformed_blocks = $this->transform_blocks( $blocks, $result, $debug ); if ( $result['blocks_migrated'] === 0 ) { return $result; } $new_content = serialize_blocks( $transformed_blocks ); $result['content_after'] = $new_content; $result['updated'] = true; if ( ! $dry_run ) { global $wpdb; // Use direct DB update to bypass wp_update_post() validation // which can fail with "Invalid page template" when the theme // isn't fully loaded in CLI context or templates have changed. $db_result = $wpdb->update( $wpdb->posts, array( 'post_content' => $new_content ), array( 'ID' => $post->ID ), array( '%s' ), array( '%d' ) ); if ( $db_result === false ) { WP_CLI::warning( "Failed to update post ID {$post->ID}: " . $wpdb->last_error ); $result['updated'] = false; } else { // Clear the post cache so subsequent reads reflect the change clean_post_cache( $post->ID ); } } return $result; } // ------------------------------------------------------------------------- // Block traversal & transformation // ------------------------------------------------------------------------- /** * Recursively check whether the block tree contains any old accordion blocks */ private function has_accordion_blocks( $blocks ) { foreach ( $blocks as $block ) { if ( $block['blockName'] === 'snl-blocks/snl-accordion' ) { return true; } if ( ! empty( $block['innerBlocks'] ) && $this->has_accordion_blocks( $block['innerBlocks'] ) ) { return true; } } return false; } /** * Walk the block tree; replace every old accordion with the new wrapper */ private function transform_blocks( $blocks, &$result, $debug ) { $transformed = array(); foreach ( $blocks as $block ) { if ( $block['blockName'] === 'snl-blocks/snl-accordion' ) { $transformed[] = $this->transform_accordion_block( $block, $debug ); $result['blocks_migrated']++; } else { if ( ! empty( $block['innerBlocks'] ) ) { $block['innerBlocks'] = $this->transform_blocks( $block['innerBlocks'], $result, $debug ); } $transformed[] = $block; } } return $transformed; } /** * Transform one old snl-blocks/snl-accordion into snl/accordion-wrapper * containing snl/accordion children. */ private function transform_accordion_block( $old_block, $debug ) { $old_attrs = $old_block['attrs'] ?? array(); $old_inner_blocks = $old_block['innerBlocks'] ?? array(); // --- generate IDs (8-char hex, matching the block's own format) -------- $wrapper_id = 'accordion-' . substr( md5( uniqid( '', true ) ), 0, 8 ); // --- resolve old attributes ---------------------------------------------- $show_toggle_links = isset( $old_attrs['showToggled'] ) ? (bool) $old_attrs['showToggled'] : true; $allow_multiple = isset( $old_attrs['allowMultiple'] ) ? (bool) $old_attrs['allowMultiple'] : false; $render_toggle = $show_toggle_links; // --- wrapper attrs (only non-default values serialized into comment) ----- $wrapper_attrs = array( 'wrapperId' => $wrapper_id ); if ( ! $show_toggle_links ) { $wrapper_attrs['showToggleLinks'] = false; } if ( $allow_multiple ) { $wrapper_attrs['allowMultipleOpen'] = true; } // --- build each accordion item -------------------------------------------- $accordion_items = array(); $item_index = 0; foreach ( $old_inner_blocks as $card_block ) { if ( $card_block['blockName'] !== 'snl-blocks/snl-accordion-card' ) { continue; } $card_attrs = $card_block['attrs'] ?? array(); $card_inner_blocks = $card_block['innerBlocks'] ?? array(); $card_inner_content = $card_block['innerContent'] ?? array(); // ------------------------------------------------------------------ // Debug output // ------------------------------------------------------------------ if ( $debug ) { WP_CLI::log( " [DEBUG] Card attrs keys : " . implode( ', ', array_keys( $card_attrs ) ) ); WP_CLI::log( " [DEBUG] Card attrs : " . json_encode( $card_attrs ) ); WP_CLI::log( " [DEBUG] innerContent cnt: " . count( $card_inner_content ) ); WP_CLI::log( " [DEBUG] innerBlocks cnt : " . count( $card_inner_blocks ) ); WP_CLI::log( '' ); } // ------------------------------------------------------------------ // Resolve card attributes // ------------------------------------------------------------------ $title = ''; foreach ( array( 'title', 'cardTitle', 'heading', 'label', 'name' ) as $key ) { if ( ! empty( $card_attrs[ $key ] ) ) { $title = $card_attrs[ $key ]; break; } } $subtitle = $card_attrs['subtitle'] ?? ''; $item_id = 'accordion-item-' . substr( md5( uniqid( '', true ) ), 0, 8 ); // ------------------------------------------------------------------ // Item attrs // ------------------------------------------------------------------ $item_attrs = array( 'accordionId' => $wrapper_id, 'itemId' => $item_id, ); if ( $title !== '' ) { $item_attrs['title'] = $title; } if ( $subtitle !== '' ) { $item_attrs['subtitle'] = $subtitle; } if ( $allow_multiple ) { $item_attrs['allowMultipleOpen'] = true; } // ------------------------------------------------------------------ // Assemble the item block // ------------------------------------------------------------------ $accordion_items[] = array( 'blockName' => 'snl/accordion', 'attrs' => $item_attrs, 'innerBlocks' => $card_inner_blocks, 'innerHTML' => '', 'innerContent' => $card_inner_content, ); $item_index++; } // --- build wrapper innerHTML / innerContent ------------------------------ $html_wrapper_open = '
'; if ( $render_toggle ) { $html_wrapper_open .= ''; } $html_wrapper_close = '
'; $wrapper_inner_content = array(); $wrapper_inner_content[] = "\n" . $html_wrapper_open; foreach ( $accordion_items as $i => $item ) { $wrapper_inner_content[] = null; if ( $i < count( $accordion_items ) - 1 ) { $wrapper_inner_content[] = "\n"; } } $wrapper_inner_content[] = $html_wrapper_close . "\n"; // --- assemble wrapper block ---------------------------------------------- return array( 'blockName' => 'snl/accordion-wrapper', 'attrs' => $wrapper_attrs, 'innerBlocks' => $accordion_items, 'innerHTML' => '', 'innerContent' => $wrapper_inner_content, ); } // ------------------------------------------------------------------------- // Multisite helpers // ------------------------------------------------------------------------- /** * Run migration across every site in the network */ private function run_for_all_sites( $post_types, $batch_size, $start_batch, $dry_run, $show_urls, $debug ) { if ( ! is_multisite() ) { WP_CLI::error( 'This is not a multisite installation.' ); } $sites = get_sites( array( 'number' => 0 ) ); $total_sites = count( $sites ); WP_CLI::log( "Processing {$total_sites} sites in the network..." ); WP_CLI::log( '' ); $global_stats = array( 'sites_processed' => 0, 'sites_with_changes' => 0, 'total_posts_updated' => 0, 'total_blocks_migrated' => 0, 'total_errors' => 0, ); foreach ( $sites as $site ) { switch_to_blog( $site->blog_id ); WP_CLI::log( "========================================" ); WP_CLI::log( "Site: {$site->blogname} (ID: {$site->blog_id})" ); WP_CLI::log( "URL: {$site->siteurl}" ); WP_CLI::log( "========================================" ); $stats = array( 'total_processed' => 0, 'updated' => 0, 'skipped' => 0, 'errors' => 0, 'blocks_migrated' => 0, ); $this->migrate_all_posts( $post_types, $batch_size, $start_batch, $dry_run, $show_urls, $debug, $stats ); // Tally $global_stats['sites_processed']++; if ( $stats['updated'] > 0 ) { $global_stats['sites_with_changes']++; $global_stats['total_posts_updated'] += $stats['updated']; $global_stats['total_blocks_migrated'] += $stats['blocks_migrated']; } $global_stats['total_errors'] += $stats['errors']; WP_CLI::log( "Site summary: {$stats['updated']} posts updated, {$stats['blocks_migrated']} blocks migrated" ); WP_CLI::log( '' ); restore_current_blog(); } // Network-wide summary WP_CLI::log( '========================================' ); WP_CLI::log( 'NETWORK-WIDE SUMMARY' ); WP_CLI::log( '========================================' ); WP_CLI::success( "Sites processed: {$global_stats['sites_processed']}" ); WP_CLI::success( "Sites with changes: {$global_stats['sites_with_changes']}" ); WP_CLI::success( "Total posts updated: {$global_stats['total_posts_updated']}" ); WP_CLI::success( "Total blocks migrated: {$global_stats['total_blocks_migrated']}" ); if ( $global_stats['total_errors'] > 0 ) { WP_CLI::error( "Total errors: {$global_stats['total_errors']}", false ); } if ( $dry_run ) { WP_CLI::warning( 'This was a DRY RUN. Run without --dry-run to apply changes.' ); } } /** * Resolve --blog-id to an integer, verifying the blog exists */ private function get_target_blog_id( $blog_id ) { if ( ! is_multisite() ) { return get_current_blog_id(); } if ( $blog_id !== null && $blog_id !== 'all' ) { $target_id = absint( $blog_id ); $blog = get_blog_details( $target_id ); if ( ! $blog ) { WP_CLI::error( "Blog ID {$target_id} does not exist." ); } return $target_id; } return get_main_site_id(); } // ------------------------------------------------------------------------- // Counting / listing helpers // ------------------------------------------------------------------------- /** * Count posts that contain the old accordion block comment delimiter. */ private function get_posts_with_accordion_count( $post_types ) { $post_ids = get_posts( array( 'post_type' => $post_types, 'post_status' => 'publish', 'posts_per_page' => -1, 'fields' => 'ids', ) ); $count = 0; foreach ( $post_ids as $post_id ) { $content = get_post_field( 'post_content', $post_id ); if ( strpos( $content, 'wp:snl-blocks/snl-accordion' ) !== false ) { $count++; } } return $count; } /** * Recursively count old accordion blocks in a parsed block tree */ private function count_accordion_blocks( $blocks ) { $count = 0; foreach ( $blocks as $block ) { if ( $block['blockName'] === 'snl-blocks/snl-accordion' ) { $count++; } if ( ! empty( $block['innerBlocks'] ) ) { $count += $this->count_accordion_blocks( $block['innerBlocks'] ); } } return $count; } // ------------------------------------------------------------------------- // List sub-command // ------------------------------------------------------------------------- /** * List all posts that still contain old accordion blocks * * ## OPTIONS * * [--blog-id=] * : Specific blog ID to list (use 'all' for all sites) * * [--format=] * : Render output in a particular format. * --- * default: table * options: * - table * - csv * - json * --- * * ## EXAMPLES * * wp accordion-migrate list * wp accordion-migrate list --format=csv * wp accordion-migrate list --blog-id=all * * @when after_wp_load */ public function list( $args, $assoc_args ) { $blog_id = isset( $assoc_args['blog-id'] ) ? $assoc_args['blog-id'] : null; if ( is_multisite() && $blog_id === 'all' ) { $this->list_all_sites( $assoc_args ); return; } $target_blog_id = $this->get_target_blog_id( $blog_id ); if ( is_multisite() ) { switch_to_blog( $target_blog_id ); WP_CLI::log( "Listing for blog ID: {$target_blog_id}" ); WP_CLI::log( '' ); } $results = $this->get_posts_with_accordion_blocks( $target_blog_id ); if ( is_multisite() ) { restore_current_blog(); } if ( empty( $results ) ) { WP_CLI::success( 'No posts found with old accordion blocks!' ); return; } $format = isset( $assoc_args['format'] ) ? $assoc_args['format'] : 'table'; $fields = is_multisite() && $blog_id !== null ? array( 'Blog_ID', 'ID', 'Title', 'Type', 'Block_Count', 'URL' ) : array( 'ID', 'Title', 'Type', 'Block_Count', 'URL' ); \WP_CLI\Utils\format_items( $format, $results, $fields ); } /** * Gather post rows for the list sub-command (single site) */ private function get_posts_with_accordion_blocks( $blog_id = null ) { $posts = get_posts( array( 'post_type' => array( 'page', 'post' ), 'post_status' => 'publish', 'posts_per_page' => -1, ) ); $results = array(); foreach ( $posts as $post ) { if ( ! has_blocks( $post->post_content ) ) { continue; } $blocks = parse_blocks( $post->post_content ); $block_count = $this->count_accordion_blocks( $blocks ); if ( $block_count > 0 ) { $row = array( 'ID' => $post->ID, 'Title' => $post->post_title, 'Type' => $post->post_type, 'Block_Count' => $block_count, 'URL' => get_permalink( $post->ID ), ); if ( is_multisite() && $blog_id !== null ) { $row['Blog_ID'] = $blog_id; } $results[] = $row; } } return $results; } /** * List sub-command: network-wide variant */ private function list_all_sites( $assoc_args ) { if ( ! is_multisite() ) { WP_CLI::error( 'This is not a multisite installation.' ); } $sites = get_sites( array( 'number' => 0 ) ); $all_results = array(); foreach ( $sites as $site ) { switch_to_blog( $site->blog_id ); $site_results = $this->get_posts_with_accordion_blocks( $site->blog_id ); foreach ( $site_results as &$row ) { $row['Blog_Name'] = $site->blogname; } unset( $row ); $all_results = array_merge( $all_results, $site_results ); restore_current_blog(); } if ( empty( $all_results ) ) { WP_CLI::success( 'No posts found with old accordion blocks across all sites!' ); return; } $format = isset( $assoc_args['format'] ) ? $assoc_args['format'] : 'table'; \WP_CLI\Utils\format_items( $format, $all_results, array( 'Blog_ID', 'Blog_Name', 'ID', 'Title', 'Type', 'Block_Count', 'URL' ) ); } // ------------------------------------------------------------------------- // Shared output helpers // ------------------------------------------------------------------------- /** * Print the per-site (or single-site) migration summary */ private function print_summary( $stats, $dry_run, $blog_id = null ) { WP_CLI::log( '' ); WP_CLI::log( '========================================' ); WP_CLI::log( 'MIGRATION SUMMARY' ); if ( $blog_id !== null ) { WP_CLI::log( "Blog ID: {$blog_id}" ); } WP_CLI::log( '========================================' ); WP_CLI::success( "Posts processed: {$stats['total_processed']}" ); WP_CLI::success( "Posts updated: {$stats['updated']}" ); WP_CLI::success( "Accordion blocks migrated: {$stats['blocks_migrated']}" ); if ( $stats['skipped'] > 0 ) { WP_CLI::log( "Posts skipped (no accordion blocks): {$stats['skipped']}" ); } if ( $stats['errors'] > 0 ) { WP_CLI::error( "Errors: {$stats['errors']}", false ); } if ( $dry_run ) { WP_CLI::warning( 'This was a DRY RUN. Run without --dry-run to apply changes.' ); } } } WP_CLI::add_command( 'accordion-migrate', 'Accordion_Block_Migration_Command' ); Publications Search – Center for Computing Research (CCR)

Publications

Results 5076–5100 of 9,998

Search results

Jump to search filters

Parallel scaling analysis for explicit solid dynamics in ALEGRA

Niederhaus, John H.J.; Drake, Richard R.; Luchini, Christopher B.

Weak scaling studies were performed for the explicit solid dynamics component of the ALEGRA code on two Cray supercomputer platforms during the period 2012-2015, involving a production-oriented hypervelocity impact problem. Results from these studies are presented, with analysis of the performance, scaling, and throughput of the code on these machines. The analysis demonstrates logarithmic scaling of the average CPU time per cycle up to core counts on the order of 10,000. At higher core counts, variable performance is observed, with significant upward excursions in compute time from the logarithmic trend. However, for core counts less than 10,000, the results show a 3 × improvement in simulation throughput, and a 2 × improvement in logarithmic scaling. This improvement is linked to improved memory performance on the Cray platforms, and to significant improvements made over this period to the data layout used by ALEGRA.

More Details

Time series discord detection in medical data using a parallel relational database

Proceedings - 2015 IEEE International Conference on Bioinformatics and Biomedicine, BIBM 2015

Woodbridge, Diane M.; Wilson, Andrew T.; Foulk, James W.; Goldstein, Richard H.

Recent advances in sensor technology have made continuous real-time health monitoring available in both hospital and non-hospital settings. Since data collected from high frequency medical sensors includes a huge amount of data, storing and processing continuous medical data is an emerging big data area. Especially detecting anomaly in real time is important for patients' emergency detection and prevention. A time series discord indicates a subsequence that has the maximum difference to the rest of the time series subsequences, meaning that it has abnormal or unusual data trends. In this study, we implemented two versions of time series discord detection algorithms on a high performance parallel database management system (DBMS) and applied them to 240 Hz waveform data collected from 9,723 patients. The initial brute force version of the discord detection algorithm takes each possible subsequence and calculates a distance to the nearest non-self match to find the biggest discords in time series. For the heuristic version of the algorithm, a combination of an array and a trie structure was applied to order time series data for enhancing time efficiency. The study results showed efficient data loading, decoding and discord searches in a large amount of data, benefiting from the time series discord detection algorithm and the architectural characteristics of the parallel DBMS including data compression, data pipe-lining, and task scheduling.

More Details

Peridynamic Multiscale Finite Element Methods

Costa, Timothy; Bond, Stephen D.; Littlewood, David J.; Moore, Stan G.

The problem of computing quantum-accurate design-scale solutions to mechanics problems is rich with applications and serves as the background to modern multiscale science research. The prob- lem can be broken into component problems comprised of communicating across adjacent scales, which when strung together create a pipeline for information to travel from quantum scales to design scales. Traditionally, this involves connections between a) quantum electronic structure calculations and molecular dynamics and between b) molecular dynamics and local partial differ- ential equation models at the design scale. The second step, b), is particularly challenging since the appropriate scales of molecular dynamic and local partial differential equation models do not overlap. The peridynamic model for continuum mechanics provides an advantage in this endeavor, as the basic equations of peridynamics are valid at a wide range of scales limiting from the classical partial differential equation models valid at the design scale to the scale of molecular dynamics. In this work we focus on the development of multiscale finite element methods for the peridynamic model, in an effort to create a mathematically consistent channel for microscale information to travel from the upper limits of the molecular dynamics scale to the design scale. In particular, we first develop a Nonlocal Multiscale Finite Element Method which solves the peridynamic model at multiple scales to include microscale information at the coarse-scale. We then consider a method that solves a fine-scale peridynamic model to build element-support basis functions for a coarse- scale local partial differential equation model, called the Mixed Locality Multiscale Finite Element Method. Given decades of research and development into finite element codes for the local partial differential equation models of continuum mechanics there is a strong desire to couple local and nonlocal models to leverage the speed and state of the art of local models with the flexibility and accuracy of the nonlocal peridynamic model. In the mixed locality method this coupling occurs across scales, so that the nonlocal model can be used to communicate material heterogeneity at scales inappropriate to local partial differential equation models. Additionally, the computational burden of the weak form of the peridynamic model is reduced dramatically by only requiring that the model be solved on local patches of the simulation domain which may be computed in parallel, taking advantage of the heterogeneous nature of next generation computing platforms. Addition- ally, we present a novel Galerkin framework, the 'Ambulant Galerkin Method', which represents a first step towards a unified mathematical analysis of local and nonlocal multiscale finite element methods, and whose future extension will allow the analysis of multiscale finite element methods that mix models across scales under certain assumptions of the consistency of those models.

More Details

Optimizing the Performance of Reactive Molecular Dynamics Simulations for Multi-core Architectures

IEEE Transactions on Parallel and Distributed Systems

Shan, Tzu-Ray; Aktulga, Hasan M.; Knight, Chris; Coffman, Paul; Jiang, Wei

Hybrid parallelism allows high performance computing applications to better leverage the increasing on-node parallelism of modern supercomputers. In this paper, we present a hybrid parallel implementation of the widely used LAMMPS/ReaxC package, where the construction of bonded and nonbonded lists and evaluation of complex ReaxFF interactions are implemented efficiently using OpenMP parallelism. Additionally, the performance of the QEq charge equilibration scheme is examined and a dual-solver is implemented. We present the performance of the resulting ReaxC-OMP package on a state-of-the-art multi-core architecture Mira, an IBM BlueGene/Q supercomputer. For system sizes ranging from 32 thousand to 16.6 million particles, speedups in the range of 1.5-4.5x are observed using the new ReaxC-OMP software. Sustained performance improvements have been observed for up to 262,144 cores (1,048,576 processes) of Mira with a weak scaling efficiency of 91.5% in larger simulations containing 16.6 million particles.

More Details
Results 5076–5100 of 9,998
Results 5076–5100 of 9,998