Skip to main content
Ctrl+K
This is not yet fully debugged - report any issues!
Training Manual For Reproducibility Verification - Home
  • Introduction

Overview

  • Background

Preliminary Tasks

  • Pre-requisites
    • Pre-training tasks
    • Toolkit

Basics

  • Basic Concepts
  • Reproducible practices
  • The README template
  • Data citations and data availability statements
  • Generic data workflow
  • Assessing computational reproducibility
  • A guided walk through the Replication Report

AEA-specific Jira Workflow

  • AEA Jira workflow
    • Assigned
    • Creating a repository and running pipeline
    • In Progress
    • Preparing Part A - Preliminary Report
    • Preparing to Run Code (Part B)
    • Running Code (Part B)
    • Writing Report
    • Report completed
  • AEA: Revision reports after author resubmission
  • AEA-related meetings

Advanced AEA-related tasks

  • Checking Unassigned Jira Tickets
  • AEA: Reviewing and (Pre-) Approving Reports
    • Original Replication Report
    • Revision Report
    • Choosing a Recommendation
  • AEA: Submitting information back to the Editorial Office and to authors
    • Basic setup
    • Submitting to the JMS ScholarOne
    • Deleting restricted data
    • Submitting deposit-related information via openICPSR
  • AEA: Interfacing with repositories
    • AEA: Monitoring Pending openICPSR Changes
    • AEA: Publishing a deposit
    • Adding the article DOI to the openICPSR deposit metadata
  • AEA: Instructions for Papers and Proceedings checks

Running code

  • Guidelines for running code
  • Stata-related procedures
    • Using config.do in STATA
    • Running Code in Stata
    • Using scan_packages.do
    • Stata on Linux
    • Debugging Stata
  • R-related procedures
    • Using config.R in R
    • Running Code in R
    • Running R on Linux systems
    • Running R from other software
    • Debugging R
  • MATLAB-related procedures
    • Adding config.m to MATLAB and path names
    • Running MATLAB without the desktop GUI and with log file
    • Running Dynare from MATLAB
    • Debugging MATLAB-related problems
  • Python-related procedures
  • Julia-related procedures
  • Docker-related procedures
    • Docker on Windows
  • Mathematica-related procedures
  • Rare software
    • Ox-related procedures
    • Mosek

Sundry other guidance

  • External reproducibility checks

Appendix

  • Glossary
  • Setup Checklist
  • Privacy
  • Communication
  • Identifying differences between original manuscript and reproduction
    • Using screenshot and annotation tools on Windows
    • Using screenshot and annotation tools on macOS
    • Include Screenshots in the Report
  • Downloading Data
    • Using pre-publication openICPSR Projects
    • Alternate sources of data
    • Accessing privately provided data
    • Globus Transfers
    • Updating Replication Materials after Revisions
  • Access to Computers
    • Connecting to remote Windows servers
    • Connecting to remote Linux servers
    • Reproducibility Checks in Codeocean
    • Conducting reproducibility checks on WholeTale
    • Computing using Github Codespaces
    • Setting up your Bash environment
    • Additional setup instructions
  • Authentication-related issues
    • Bitbucket Authentication
    • openICPSR Authentication
  • Various helpful scripts
  • Automation Explainer
    • Bitbucket Pipeline Overview
    • Bitbucket Pipelines Configuration
  • Various templates for correspondence by AEA Data Editor team members
    • Preparing a Legacy Deposit for Updates by Authors
    • IPUMS Beta API request
    • Requesting Restricted-Access Data from Authors
    • Request for External Reproducibility Check (general)
    • Clarification regarding privately-provided restricted access files
  • Technical issues
  • Code of Conduct
  • Videoconferencing Rules and Etiquette
  • References
  • Older versions
  • Repository
  • Suggest edit
  • Open issue
  • .md

Debugging MATLAB-related problems

Contents

  • The .m program is using a software extension to MATLAB called “Dynare”
  • Mention of MEX programs, what do I do?
  • MATLAB complains about a missing Toolbox
  • MATLAB uses too much memory or too many CPU cores (parpool)

Debugging MATLAB-related problems#

The .m program is using a software extension to MATLAB called “Dynare”#

See Using Dynare in MATLAB.

Mention of MEX programs, what do I do?#

(or: MEX files provided for Linux/MacOS, but you need to run on Windows)

  • There should be .cpp files provided - if not, they should be requested from the author

  • From within Matlab, run mex name_of_file.cpp (though this should also be provided by the author).

MATLAB complains about a missing Toolbox#

Check that the Path includes said Toolbox, see https://it.mathworks.com/help/matlab/ref/pathtool.html. It may also be that we are not licensed to use that Toolbox. Make a note of the error in the replication report.

MATLAB uses too much memory or too many CPU cores (parpool)#

When running MATLAB on BioHPC (or other clusters), you will sometimes find that authors have hard-coded the number of CPU cores to use, or might ignore the amount of memory needed.

Code might look like this:

%% Parallelizing code

c = parcluster;
c.NumWorkers =30;
parpool(30)

The following code might be helpful in making this somewhat easier to debug:

%% Parallelizing code dynamically

% 1. Get the CPU count from SLURM environment
% SLURM_CPUS_PER_TASK is set when you use --cpus-per-task
num_cpus = str2double(getenv('SLURM_CPUS_PER_TASK'));

% 2. Fallback: If running locally or variable isn't set, default to 1 or a safe number
if isnan(num_cpus)
    num_cpus = 1; 
    fprintf('SLURM variable not found. Defaulting to 1 worker.\n');
else
    fprintf('Detected %d CPUs assigned by SLURM.\n', num_cpus);
end

% 3. Initialize the pool
c = parcluster;
c.NumWorkers = num_cpus;
parpool(c, num_cpus);

previous

Running Dynare from MATLAB

next

Python-related procedures

Contents
  • The .m program is using a software extension to MATLAB called “Dynare”
  • Mention of MEX programs, what do I do?
  • MATLAB complains about a missing Toolbox
  • MATLAB uses too much memory or too many CPU cores (parpool)

By Lars Vilhuber, Dane Clunk, Michael Darisse, Sofia Encarnación, David Graham, Julia Hewitt, ilanith Nizard, Leonel Borja Plaza, Takshil Sachdev, Hyuk Son, Linda Wang, David Wasser, Meredith Welch

© Copyright 2018-2025.