<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Proc NLMIXED nthreads insufficient memory in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Proc-NLMIXED-nthreads-insufficient-memory/m-p/549812#M8723</link>
    <description>&lt;P&gt;One of my quant users is getting this message on a Linux 6/SAS 9.4 (TS1M3) Proc NLMIXED job:&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc nlmixed data=testda_ft maxiter=800 maxfunc=8000 nthreads=24;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and she gets this&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; "WARNING:&amp;nbsp; The NTHREADS= option is ignored due to insufficient memory."&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;She ran it from a Putty command line with this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;/usr/local/SAS/SASFoundation/9.4/sas -work /lppra00a0133/temp/saswork -noterminal scoring_GN30.sas &amp;amp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It loops month by month through the data and I asked her to run 1 month with MPRINT and FULLSTIMER turned on.&lt;/P&gt;&lt;P&gt;Log is attached.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*tuning for one category product */
%macro mbspred(product_name, inputsasdb
			, month_reset_min, month_reset_max
			, resetperi_min, resetperi_max
			, orig_term_min, orig_term_max
			, wala_min, wala_max
			, obsdt_bgn, obsdt_end
			, vintage_begin, vintage_end
			, agency_type, product_type, coll_type
			, exclude_mon
			, Parm_inputda_dir, tunParmInFile
			, nlinout_db
			, output_dir
			, nlin_graph_nm, tunParmOutFile, tunSumOutFile
			, model_num, nlin_sum
			);
	%dafilter_ARM( &amp;amp;inputsasdb.,outab=testda_ft
		,mth2reset_min=&amp;amp;month_reset_min. ,  mth2reset_max=&amp;amp;month_reset_max.
		,resetperi_min=&amp;amp;resetperi_min. ,      resetperi_max=&amp;amp;resetperi_max.
		,orig_term_min=&amp;amp;orig_term_min. ,      orig_term_max=&amp;amp;orig_term_max.
		,wala_min=&amp;amp;wala_min. ,           wala_max=&amp;amp;wala_max.
		,obsdt_bgn=&amp;amp;obsdt_bgn.,          obsdt_end=&amp;amp;obsdt_end.
		,vintage_bgn=&amp;amp;vintage_begin. ,     vintage_end=&amp;amp;vintage_end.
		,agency_typ=&amp;amp;agency_type.
		,product_typ=&amp;amp;product_type.
		,coll_typ=&amp;amp;coll_type.
		,exclude_mon=&amp;amp;exclude_mon.
		);

	/*read parameters initial values */
	proc import datafile="&amp;amp;Parm_inputda_dir./&amp;amp;tunParmInFile." out=parmset DBMS=csv REPLACE;
		GETNAMES=YES;
		guessingrows=100;
	RUN;

	data parmset;
		set parmset;
		product="&amp;amp;product_name.";
		Agency=compress("&amp;amp;agency_type.","()'");
		date_begin="&amp;amp;obsdt_bgn."d;
		date_end="&amp;amp;obsdt_end."d;
		run_date=Today();
		run_by="&amp;amp;sysuserid.";
		format date_begin mmddyy10.
			date_end mmddyy10.
			run_date mmddyy10.
		;
	run;

	/*performe nlin tuning */
	%let year_end=%substr(&amp;amp;obsdt_end.,3,7);

	%nlin_ssn(&amp;amp;model_num.,testda_ft,&amp;amp;nlinout_db.,&amp;amp;nlin_sum., parmset, outest_param,"&amp;amp;nlin_graph_nm.","&amp;amp;output_dir.",&amp;amp;product_name.,&amp;amp;obsdt_bgn.,&amp;amp;obsdt_end. );

	proc export data=nlin_parms dbms=csv outfile="&amp;amp;output_dir./&amp;amp;tunParmOutFile." replace;
	run;

%mend;

/*******************************************************************************************************************************************************************/
/*******************************************************************************************************************************************************************/
%macro ProdMBSpred(obsdate_b, obsdate_e, parm_dir, output_dir, inputdb,macroset_csvFile);

	proc import datafile="&amp;amp;parm_dir./&amp;amp;macroset_csvFile." out=macroset DBMS=csv REPLACE;
		GETNAMES=YES;
	RUN;

	data macroset1;
		set macroset;
		macro_ind=_n_;
	run;

	data _null_;
		set macroset1 end=last;

		if last then
			call symput('N', put (macro_ind,3.));
	run;

	%do i=1 %to &amp;amp;N.;

		proc sql noprint;
			select
				strip(macroVar_name), macroVar_value
			into : this_macro_name , : this_macro_value
				from macroset1 where macro_ind=&amp;amp;i;
		quit;

		data _null_;
			call symput(strip("&amp;amp;this_macro_name."),strip("&amp;amp;this_macro_value."));
		run;

	%end;

	%let year_end=%substr(&amp;amp;obsdate_e.,3,7);

	/*add some prefix to some macro variables */
	%let TunParm_inFile=%cmpres(&amp;amp;TunParmInFile.);
	%let TunParm_outFile=%cmpres(&amp;amp;year_end._&amp;amp;product_nm._&amp;amp;TunParmoutFile.);
	%let nlinout_dtbase=%cmpres(&amp;amp;nlinout_db._&amp;amp;product_nm._&amp;amp;year_end.);
	%let nlinsum_dtbase=%cmpres(&amp;amp;nlin_sum._&amp;amp;product_nm._&amp;amp;year_end.);
	%let TunSum_outFile=%cmpres(&amp;amp;year_end._&amp;amp;product_nm._&amp;amp;tunSumOutFile.);
	%let Nlingraph_nm=%cmpres(&amp;amp;year_end._&amp;amp;product_nm._&amp;amp;nlin_graph_nm.);
	%put &amp;amp;product_nm.&amp;gt;&amp;gt;&amp;gt; &amp;amp;nlinsum_dtbase.&amp;gt;&amp;gt;&amp;gt;&amp;amp;tunParm_outFile. &amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;amp;nlinout_dtbase. &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;amp;TunSum_outFile. &amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;amp;Nlingraph_nm.;

	%mbspred(product_name=&amp;amp;product_nm.,             inputsasdb= &amp;amp;inputdb.
		,month_reset_min=&amp;amp;month_reset_min. , month_reset_max=&amp;amp;month_reset_max.
		,resetperi_min=&amp;amp;firstResetAge_min. , resetperi_max=&amp;amp;firstResetAge_max.
		,orig_term_min=&amp;amp;orig_term_min. ,     orig_term_max=&amp;amp;orig_term_max.
		,wala_min=&amp;amp;wala_min. ,               wala_max=&amp;amp;wala_max.
		,obsdt_bgn=&amp;amp;obsdate_b.,          obsdt_end=&amp;amp;obsdate_e.
		,vintage_begin=&amp;amp;vintage_begin. ,     vintage_end=&amp;amp;vintage_end.
		,agency_type=&amp;amp;agency_type.,          product_type=&amp;amp;product_type.,        coll_type=&amp;amp;coll_type.
		,exclude_mon=&amp;amp;exclude_month.
		,Parm_inputda_dir=&amp;amp;parm_dir.,            tunParmInFile=&amp;amp;tunParm_InFile.
		,nlinout_db=&amp;amp;nlinout_dtbase.
		,output_dir=&amp;amp;output_dir.
		,nlin_graph_nm=&amp;amp;nlingraph_nm.,      tunParmOutFile=&amp;amp;tunParm_OutFile.,      tunSumOutFile=&amp;amp;tunSum_OutFile.
		,model_num=&amp;amp;ModelNum., nlin_sum=&amp;amp;nlinsum_dtbase.
		);

	proc datasets lib=work;
		delete macroset macroset1;
	run;

%mend;

/*******************************************************************************************************************************************************************/
&lt;BR /&gt;**** DRIVER PGM BELOW ****;

/*********************************************************************************************************************************/
/*******                *******/
/******* Description: This program use csv files from BRI then conduct optimization tuning and output the result to excel file  *******/
/*******                                        *******/
/*******                                        *******/
/*******  Change log: first version 4/18/2017 Huibin Cheng                                      *******/
/*******                                        *******/
/*********     second version 06/11/2018 by Haisu Ma      ****************/
/**/
;;;;

%let codedir=/lppra00a0133/data/dev/haisu/ginnie_plpm/run18;
%let inputda_dir=/lppra00a0133/data/dev/haisu/ginnie_plpm;
%let parm_dir=/lppra00a0133/data/dev/haisu/ginnie_plpm/run18;
%let outputda_dir=/lppra00a0133/data/dev/haisu/ginnie_plpm/run18;
libname sasdb "&amp;amp;inputda_dir.";
libname outdb "&amp;amp;outputda_dir.";

%include "&amp;amp;codedir./Macro_hm_bspline_GN30_server_poisson.sas";
%let date_begin=31JAN2012;
%let date_end=31JAN2019;
%let fix30_inputsasdb=sasdb.est_gnma30;
%let fix30GNSetCsv=PLPM_GN30_Setting.csv;

/*for model 1, no seasing, only tune refinance  */
%macro full_run(n_runs,obs_begin,obs_end);
	%do run = 1 %to &amp;amp;n_runs.;
		%put running cycle &amp;amp;run.;
		%let obs_b=%sysfunc(intnx(month,"&amp;amp;obs_begin."D,%eval((&amp;amp;run.-1)*3),e),date9.);
		%let obs_e=%sysfunc(intnx(month,"&amp;amp;obs_end."D,%eval((&amp;amp;run.-1)*3),e),date9.);
		%put &amp;amp;obs_b. &amp;amp;obs_e.;

		%ProdMBSpred(obsdate_b=&amp;amp;obs_b., obsdate_e=&amp;amp;obs_e., parm_dir=&amp;amp;parm_dir.,output_dir=&amp;amp;outputda_dir., inputdb=&amp;amp;fix30_inputsasdb.,macroset_csvFile=&amp;amp;fix30GNSetCsv.);
	%end;
%mend;

%full_run(1,&amp;amp;date_begin.,&amp;amp;date_end.);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Apr 2019 21:47:28 GMT</pubDate>
    <dc:creator>DougZ</dc:creator>
    <dc:date>2019-04-09T21:47:28Z</dc:date>
    <item>
      <title>Proc NLMIXED nthreads insufficient memory</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-NLMIXED-nthreads-insufficient-memory/m-p/549812#M8723</link>
      <description>&lt;P&gt;One of my quant users is getting this message on a Linux 6/SAS 9.4 (TS1M3) Proc NLMIXED job:&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc nlmixed data=testda_ft maxiter=800 maxfunc=8000 nthreads=24;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and she gets this&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; "WARNING:&amp;nbsp; The NTHREADS= option is ignored due to insufficient memory."&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;She ran it from a Putty command line with this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;/usr/local/SAS/SASFoundation/9.4/sas -work /lppra00a0133/temp/saswork -noterminal scoring_GN30.sas &amp;amp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It loops month by month through the data and I asked her to run 1 month with MPRINT and FULLSTIMER turned on.&lt;/P&gt;&lt;P&gt;Log is attached.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*tuning for one category product */
%macro mbspred(product_name, inputsasdb
			, month_reset_min, month_reset_max
			, resetperi_min, resetperi_max
			, orig_term_min, orig_term_max
			, wala_min, wala_max
			, obsdt_bgn, obsdt_end
			, vintage_begin, vintage_end
			, agency_type, product_type, coll_type
			, exclude_mon
			, Parm_inputda_dir, tunParmInFile
			, nlinout_db
			, output_dir
			, nlin_graph_nm, tunParmOutFile, tunSumOutFile
			, model_num, nlin_sum
			);
	%dafilter_ARM( &amp;amp;inputsasdb.,outab=testda_ft
		,mth2reset_min=&amp;amp;month_reset_min. ,  mth2reset_max=&amp;amp;month_reset_max.
		,resetperi_min=&amp;amp;resetperi_min. ,      resetperi_max=&amp;amp;resetperi_max.
		,orig_term_min=&amp;amp;orig_term_min. ,      orig_term_max=&amp;amp;orig_term_max.
		,wala_min=&amp;amp;wala_min. ,           wala_max=&amp;amp;wala_max.
		,obsdt_bgn=&amp;amp;obsdt_bgn.,          obsdt_end=&amp;amp;obsdt_end.
		,vintage_bgn=&amp;amp;vintage_begin. ,     vintage_end=&amp;amp;vintage_end.
		,agency_typ=&amp;amp;agency_type.
		,product_typ=&amp;amp;product_type.
		,coll_typ=&amp;amp;coll_type.
		,exclude_mon=&amp;amp;exclude_mon.
		);

	/*read parameters initial values */
	proc import datafile="&amp;amp;Parm_inputda_dir./&amp;amp;tunParmInFile." out=parmset DBMS=csv REPLACE;
		GETNAMES=YES;
		guessingrows=100;
	RUN;

	data parmset;
		set parmset;
		product="&amp;amp;product_name.";
		Agency=compress("&amp;amp;agency_type.","()'");
		date_begin="&amp;amp;obsdt_bgn."d;
		date_end="&amp;amp;obsdt_end."d;
		run_date=Today();
		run_by="&amp;amp;sysuserid.";
		format date_begin mmddyy10.
			date_end mmddyy10.
			run_date mmddyy10.
		;
	run;

	/*performe nlin tuning */
	%let year_end=%substr(&amp;amp;obsdt_end.,3,7);

	%nlin_ssn(&amp;amp;model_num.,testda_ft,&amp;amp;nlinout_db.,&amp;amp;nlin_sum., parmset, outest_param,"&amp;amp;nlin_graph_nm.","&amp;amp;output_dir.",&amp;amp;product_name.,&amp;amp;obsdt_bgn.,&amp;amp;obsdt_end. );

	proc export data=nlin_parms dbms=csv outfile="&amp;amp;output_dir./&amp;amp;tunParmOutFile." replace;
	run;

%mend;

/*******************************************************************************************************************************************************************/
/*******************************************************************************************************************************************************************/
%macro ProdMBSpred(obsdate_b, obsdate_e, parm_dir, output_dir, inputdb,macroset_csvFile);

	proc import datafile="&amp;amp;parm_dir./&amp;amp;macroset_csvFile." out=macroset DBMS=csv REPLACE;
		GETNAMES=YES;
	RUN;

	data macroset1;
		set macroset;
		macro_ind=_n_;
	run;

	data _null_;
		set macroset1 end=last;

		if last then
			call symput('N', put (macro_ind,3.));
	run;

	%do i=1 %to &amp;amp;N.;

		proc sql noprint;
			select
				strip(macroVar_name), macroVar_value
			into : this_macro_name , : this_macro_value
				from macroset1 where macro_ind=&amp;amp;i;
		quit;

		data _null_;
			call symput(strip("&amp;amp;this_macro_name."),strip("&amp;amp;this_macro_value."));
		run;

	%end;

	%let year_end=%substr(&amp;amp;obsdate_e.,3,7);

	/*add some prefix to some macro variables */
	%let TunParm_inFile=%cmpres(&amp;amp;TunParmInFile.);
	%let TunParm_outFile=%cmpres(&amp;amp;year_end._&amp;amp;product_nm._&amp;amp;TunParmoutFile.);
	%let nlinout_dtbase=%cmpres(&amp;amp;nlinout_db._&amp;amp;product_nm._&amp;amp;year_end.);
	%let nlinsum_dtbase=%cmpres(&amp;amp;nlin_sum._&amp;amp;product_nm._&amp;amp;year_end.);
	%let TunSum_outFile=%cmpres(&amp;amp;year_end._&amp;amp;product_nm._&amp;amp;tunSumOutFile.);
	%let Nlingraph_nm=%cmpres(&amp;amp;year_end._&amp;amp;product_nm._&amp;amp;nlin_graph_nm.);
	%put &amp;amp;product_nm.&amp;gt;&amp;gt;&amp;gt; &amp;amp;nlinsum_dtbase.&amp;gt;&amp;gt;&amp;gt;&amp;amp;tunParm_outFile. &amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;amp;nlinout_dtbase. &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;amp;TunSum_outFile. &amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;amp;Nlingraph_nm.;

	%mbspred(product_name=&amp;amp;product_nm.,             inputsasdb= &amp;amp;inputdb.
		,month_reset_min=&amp;amp;month_reset_min. , month_reset_max=&amp;amp;month_reset_max.
		,resetperi_min=&amp;amp;firstResetAge_min. , resetperi_max=&amp;amp;firstResetAge_max.
		,orig_term_min=&amp;amp;orig_term_min. ,     orig_term_max=&amp;amp;orig_term_max.
		,wala_min=&amp;amp;wala_min. ,               wala_max=&amp;amp;wala_max.
		,obsdt_bgn=&amp;amp;obsdate_b.,          obsdt_end=&amp;amp;obsdate_e.
		,vintage_begin=&amp;amp;vintage_begin. ,     vintage_end=&amp;amp;vintage_end.
		,agency_type=&amp;amp;agency_type.,          product_type=&amp;amp;product_type.,        coll_type=&amp;amp;coll_type.
		,exclude_mon=&amp;amp;exclude_month.
		,Parm_inputda_dir=&amp;amp;parm_dir.,            tunParmInFile=&amp;amp;tunParm_InFile.
		,nlinout_db=&amp;amp;nlinout_dtbase.
		,output_dir=&amp;amp;output_dir.
		,nlin_graph_nm=&amp;amp;nlingraph_nm.,      tunParmOutFile=&amp;amp;tunParm_OutFile.,      tunSumOutFile=&amp;amp;tunSum_OutFile.
		,model_num=&amp;amp;ModelNum., nlin_sum=&amp;amp;nlinsum_dtbase.
		);

	proc datasets lib=work;
		delete macroset macroset1;
	run;

%mend;

/*******************************************************************************************************************************************************************/
&lt;BR /&gt;**** DRIVER PGM BELOW ****;

/*********************************************************************************************************************************/
/*******                *******/
/******* Description: This program use csv files from BRI then conduct optimization tuning and output the result to excel file  *******/
/*******                                        *******/
/*******                                        *******/
/*******  Change log: first version 4/18/2017 Huibin Cheng                                      *******/
/*******                                        *******/
/*********     second version 06/11/2018 by Haisu Ma      ****************/
/**/
;;;;

%let codedir=/lppra00a0133/data/dev/haisu/ginnie_plpm/run18;
%let inputda_dir=/lppra00a0133/data/dev/haisu/ginnie_plpm;
%let parm_dir=/lppra00a0133/data/dev/haisu/ginnie_plpm/run18;
%let outputda_dir=/lppra00a0133/data/dev/haisu/ginnie_plpm/run18;
libname sasdb "&amp;amp;inputda_dir.";
libname outdb "&amp;amp;outputda_dir.";

%include "&amp;amp;codedir./Macro_hm_bspline_GN30_server_poisson.sas";
%let date_begin=31JAN2012;
%let date_end=31JAN2019;
%let fix30_inputsasdb=sasdb.est_gnma30;
%let fix30GNSetCsv=PLPM_GN30_Setting.csv;

/*for model 1, no seasing, only tune refinance  */
%macro full_run(n_runs,obs_begin,obs_end);
	%do run = 1 %to &amp;amp;n_runs.;
		%put running cycle &amp;amp;run.;
		%let obs_b=%sysfunc(intnx(month,"&amp;amp;obs_begin."D,%eval((&amp;amp;run.-1)*3),e),date9.);
		%let obs_e=%sysfunc(intnx(month,"&amp;amp;obs_end."D,%eval((&amp;amp;run.-1)*3),e),date9.);
		%put &amp;amp;obs_b. &amp;amp;obs_e.;

		%ProdMBSpred(obsdate_b=&amp;amp;obs_b., obsdate_e=&amp;amp;obs_e., parm_dir=&amp;amp;parm_dir.,output_dir=&amp;amp;outputda_dir., inputdb=&amp;amp;fix30_inputsasdb.,macroset_csvFile=&amp;amp;fix30GNSetCsv.);
	%end;
%mend;

%full_run(1,&amp;amp;date_begin.,&amp;amp;date_end.);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2019 21:47:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-NLMIXED-nthreads-insufficient-memory/m-p/549812#M8723</guid>
      <dc:creator>DougZ</dc:creator>
      <dc:date>2019-04-09T21:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: Proc NLMIXED nthreads insufficient memory</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-NLMIXED-nthreads-insufficient-memory/m-p/549813#M8724</link>
      <description>&lt;P&gt;One correction to my post: I mis-pasted the Linux command line SAS call;&amp;nbsp; it should read,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; /usr/local/SAS/SASFoundation/9.4/sas -work /lppra00a0133/temp/saswork -noterminal -memsize=max &lt;STRONG&gt;Est_Bspline_GN30_server.sas&lt;/STRONG&gt; &amp;amp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2019 21:50:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-NLMIXED-nthreads-insufficient-memory/m-p/549813#M8724</guid>
      <dc:creator>DougZ</dc:creator>
      <dc:date>2019-04-09T21:50:10Z</dc:date>
    </item>
  </channel>
</rss>

